zephyr/samples/drivers/CAN
Henrik Brix Andersen a361d7caad samples: drivers: CAN: add support for twr_ke18f board
Add support for the NXP TWR-KE18F developement board to CAN sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
..
boards samples: drivers: CAN: add support for twr_ke18f board 2019-06-24 14:33:46 -05:00
src style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
Kconfig Kconfig: Remove redundant $(ZEPHYR_BASE) from 'source's 2018-10-10 11:28:27 -05:00
mcp2515-dts.overlay dts: Replace status = "ok" with status = "okay" 2019-06-14 19:51:13 -05:00
prj.conf drivers: can: stm32: Cleanup Kconfig enablement 2019-02-25 10:05:21 -06:00
prj.conf.mcp2515 drivers: can: mcp2515: Fixes for DT SPI cs 2019-04-17 16:12:30 -04:00
README.rst samples: can: move CAN sample under drivers 2018-06-11 17:11:18 -04:00
sample.yaml samples: can: move CAN sample under drivers 2018-06-11 17:11:18 -04:00

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