Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If a task wants to receive a CAN frame, the function CanBusRead() must be called. The following steps will be performed:


Panel
borderWidth0
titleFigure - CAN reception

Image Added


  1. With the receive complete interrupt of the CAN controller, the function CanBusRxHandler() shall be activated.
  2. The handler uses the low level device driver function Read() to get the CAN frame from CAN controller.
  3. The CAN frame will be copied to the internal can receive queue.
  4. CANOS_

...

  1. PostRxFrame is called to indicated the new received frame and the handler exits.

Asynchronous to this actions, a task can wait for CAN frames:

  1. The function is CanBusRead() pending on the receive semaphore with the configured timeout. The timeout must be set with CanBusIoCtl() CANBUS_SET_RX_TIMEOUT.
  2. If a CAN frame is received within the timeout, the content will be copied to the given. In this case the function exists normally. If a timeout is detected, the function exits with an error code.