1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/candev
2022-07-12 15:09:58 +02:00
..
main.c tests/candev: update test application 2022-07-12 15:09:58 +02:00
Makefile tests/candev: cleanup 2022-04-20 11:55:29 +02:00
Makefile.board.dep tests/candev: adapt test application 2022-06-26 17:38:23 +02:00
Makefile.ci boards: introduce atmega328p-xplained-mini 2021-03-27 14:10:19 -03:00
README.md tests/candev/README: cleanup README 2022-04-25 12:48:10 +02:00
README.native.can.md tests/candev/README.native.can.md: add README for native can setup 2022-04-25 12:48:10 +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.