Controller area network (bxCAN)
ï‚· CAN_OperatingModeRequest()
ï‚· CAN_Sleep()
ï‚· CAN_WakeUp()
4.2.6 CAN Bus Error management functions
This section provides functions allowing to
ï‚· Return the CANx's last error code (LEC).
ï‚· Return the CANx Receive Error Counter (REC).
ï‚· Return the LSB of the 9-bit CANx Transmit Error Counter(TEC).
If TEC is greater than 255, The CAN is in bus-off state.
If REC or TEC are greater than 96, an Error warning flag occurs.
If REC or TEC are greater than 127, an Error Passive Flag occurs.
ï‚· CAN_GetLastErrorCode()
ï‚· CAN_GetReceiveErrorCounter()
ï‚· CAN_GetLSBTransmitErrorCounter()
4.2.7 Interrupts and flags management functions
This section provides functions allowing to configure the CAN Interrupts and to get the
status and clear flags and Interrupts pending bits.
The CAN provides 14 Interrupts sources and 15 Flags:
Flags
The 15 flags can be divided on 4 groups:
ï‚· Transmit Flags:
ï€ CAN_FLAG_RQCP0.
ï€ CAN_FLAG_RQCP1.
ï€ CAN_FLAG_RQCP2: Request completed MailBoxes 0, 1 and 2 Flags Set when
when the last request (transmit or abort) has been performed.
ï‚· Receive Flags:
ï€ CAN_FLAG_FMP0.
ï€ CAN_FLAG_FMP1: FIFO 0 and 1 Message Pending Flags; Set to signal that
messages are pending in the receive FIFO. These Flags are cleared only by
hardware.
ï€ CAN_FLAG_FF0.