zephyr/samples/drivers/CAN
Karsten Koenig 758c461252 drivers: can: mcp2515: fix devicetree bindings
Adding required fields to the devicetree overlay of the CAN sample as
this is often used as a reference. Also use these fields instead of the
KConfig entries.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-08-18 09:56:42 +02:00
..
src samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
Kconfig samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
mcp2515-dts.overlay drivers: can: mcp2515: fix devicetree bindings 2019-08-18 09:56:42 +02:00
prj.conf samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
README.rst samples: drivers: CAN: reworked sample code 2019-08-18 09:56:42 +02:00
sample.yaml

.. _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 tre.

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.