Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

CAN reception

  • With the receive complete interrupt of the CAN controller, the function CanBusRxHandler() shall be activated.
  • The handler uses the low level device driver function Read() to get the CAN frame from CAN controller.
  • The CAN frame will be copied to the internal can receive queue.
  • CANOS_PostRxFrame is called to indicated the new received frame and the handler exits.
  • Asynchronous to this actions, a task can wait for CAN frames:

  • The function is CanBusRead() pending on the receive semaphore with the configured timeout. The timeout must be set with CanBusIoCtl() CANBUS_SET_RX_TIMEOUT.
  • 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.
    • No labels