1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/drivers/candev
2024-05-16 15:00:28 +02:00
..
main.c tests/drivers/candev: add debug output concerning errors 2024-05-16 15:00:28 +02:00
Makefile tests/candev: move to tests/drivers 2023-05-12 14:24:40 +02:00
Makefile.board.dep tests/drivers/candev: add test commands 2024-03-26 15:17:48 +01:00
Makefile.ci examples and tests: add atmega8 to relevent Makefile.ci 2023-07-11 21:22:02 +02:00
README.md tests/candev: move to tests/drivers 2023-05-12 14:24:40 +02:00
README.native.can.md tree-wide: fix typos in doc and comments 2023-10-16 12:17:48 +02:00

candev test application

About

This application is a test for using the candev abstraction directly. Use this if you want to use a single CAN driver and thus don't need the CAN-DLL layer.

The CAN_DRIVER variable is used to select the default CAN_DRIVER, supported alternatives are:

  • MCP2515 to use mcp2515 stand-alone CAN controller
  • PERIPH_CAN to use periph_can controller, usually requires a CAN transceiver as well: e.g. tja1042 or ncv7356 (except for native)

Usage

Sending

Messages can be sent over the CAN-bus through the send command. Optionally, up to 8 bytes can be passed as arguments (in decimal form). If no arguments are passed it will default to sending AB CD EF (hex).

> send <bytes>
# e.g.: send AA BB CC
> send 170 187 204
send 170 187 204

Receiving

The test-app is always listening for incoming CAN messages. They will be stored asynchronously in a buffer and can be requested by means of the receive command. Optionally, an argument n can be passed to receive n messages in a row.

> receive <n>
# e.g.:
> receive 2
Reading from Rxbuf...
id: 1 dlc: 3 Data:
0xAA 0xBB 0xCC
Reading from Rxbuf...
id: 1 dlc: 3 Data:
0xAA 0xBB 0xCC

Native Setup

Refer to README.native.can.md.