zephyr/samples/drivers/CAN
Kumar Gala bb6b1918b2 drivers: can: stm32: Cleanup Kconfig enablement
Follow the pattern we have for other peripherals in that if the driver
class (CAN) is enabled than enable the driver for that class
(CAN_STM32).  Also have the STM32 CAN driver depend on being on a STM32
SoC.

Remove setting of CONFIG_CAN_STM32 in any .conf files as it will get set
of CONFIG_CAN is set/enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-25 10:05:21 -06:00
..
src can: Rename can_msg and can_msg_filter structs 2019-02-22 08:07:03 -05:00
CMakeLists.txt cmake: increase minimal required version to 3.13.1 2019-01-03 11:51:29 -05:00
Kconfig Kconfig: Remove redundant $(ZEPHYR_BASE) from 'source's 2018-10-10 11:28:27 -05:00
README.rst
prj.conf drivers: can: stm32: Cleanup Kconfig enablement 2019-02-25 10:05:21 -06:00
sample.yaml

README.rst

.. _can-sample:

Controller Area Network
#######################

Overview
********

This sample demonstrates how to use the Controller Area Network (CAN) API.
Messages with standard and extended identifiers are sent over the bus, triggered
by a button event.
Messages are received using message queues and ISRs.
Reception is indicated by blink LEDs and output to the console.

Building and Running
********************

In loopback mode, the board receives its own messages. This could be used for
standalone testing.

The sample can be built and executed on boards supporting CAN.
The output ports and pins of the LEDs can be configured by Kconfig.

Sample output
=============

.. code-block:: console

   Finished init. waiting for Interrupts
   TX thread is running.
   filter id: 1
   Button pressed! Send message 1
   Button pressed 1 times
   Button pressed! Send message 0
   Button pressed 2 times
   String sent over CAN
   Button pressed! Send message 1
   Button pressed 3 times
   Button pressed! Send message 0
   Button pressed 4 times
   String sent over CAN

.. note:: The values shown above might differ.