zephyr/samples/drivers/CAN
Kumar Gala 544921cd93 samples: CAN: Tweak GPIO flags in dts for mcp2515
Remove setting GPIO_DIR_OUT in the dts overlay for mcp2515 as a
precursor to new GPIO API work.  The flag isn't used for cs-gpio,
as we hard code GPIO_DIR_OUT in the spi controller code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-11 05:15:54 -05:00
..
src samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
CMakeLists.txt
Kconfig samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
README.rst doc: fix misspellings in documentation 2019-09-06 16:13:15 +02:00
mcp2515-dts.overlay samples: CAN: Tweak GPIO flags in dts for mcp2515 2019-09-11 05:15:54 -05:00
prj.conf samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
sample.yaml samples: CAN: Add testing harness 2019-08-26 22:33:14 -04:00

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.
Messages are received using message-queues and work-queues.
Reception is indicated by blinking the LED (if present) 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 LED output pin is defined in the board's device tree.

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

.. code-block:: console

   Change LED filter ID: 0
   Finished init.
   Counter filter id: 4

   uart:~$ Counter received: 0
   Counter received: 1
   Counter received: 2
   Counter received: 3

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