zephyr/samples/drivers/CAN
Ulf Magnusson d713033d5c Kconfig: Use new preprocessor syntax for env. variables
With the new Kconfig preprocessor (described in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt), the syntax for expanding environment
variables is $(FOO) rather than $FOO.

$(FOO) is a general preprocessor variable expansion, which falls back to
environment variables if the variable isn't set (like in Make). It can
also be used in prompts, 'comment's, etc.

The old syntax will probably be supported forever in Kconfiglib for
backwards compatibility, but might as well make it consistent now that
people might start using the preprocessor more.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
..
src
CMakeLists.txt cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
Kconfig Kconfig: Use new preprocessor syntax for env. variables 2018-09-11 19:17:25 -04:00
README.rst
prj.conf
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.