Controller area network (bxCAN)
ï€ CAN_IT_BOF: Bus-off Interrupt; If enabled, this interrupt source is pending when
CAN enters the bus-off state. The bus-off state is entered on TEC overflow,
greater than 255. This Flag is cleared only by hardware.
ï€ CAN_IT_LEC: Last error code Interrupt; If enabled, this interrupt source is
pending when a message has been transferred (reception or transmission) with
error and the error code is hold.
ï€ CAN_IT_ERR: Error Interrupt; If enabled, this interrupt source is pending when
an error condition is pending.
Managing the CAN controller events: The user should identify which mode will be used in
his application to manage the CAN controller events: Polling mode or Interrupt mode.
ï‚· In the Polling Mode it is advised to use the following functions:
ï€ CAN_GetFlagStatus() : to check if flags events occur.
ï€ CAN_ClearFlag() : to clear the flags events.
ï‚· In the Interrupt Mode it is advised to use the following functions:
ï€ CAN_ITConfig() : to enable or disable the interrupt source.
ï€ CAN_GetITStatus() : to check if Interrupt occurs.
ï€ CAN_ClearITPendingBit() : to clear the Interrupt pending Bit (corresponding
Flag). This function has no impact on CAN_IT_FMP0 and CAN_IT_FMP1
Interrupts pending bits since there are cleared only by hardware.
ï‚· CAN_ITConfig()
ï‚· CAN_GetFlagStatus()
ï‚· CAN_ClearFlag()
ï‚· CAN_GetITStatus()
ï‚· CAN_ClearITPendingBit()
4.2.8 Initialization and Configuration functions
4.2.8.1 CAN_DeInit
void CAN_DeInit ( CAN_TypeDef * CANx)
Deinitializes the CAN peripheral registers to their default reset
values.
ï‚· CANx : where x can be 1 to select the CAN1 peripheral.
4.2.8.2 CAN_Init
uint8_t CAN_Init ( CAN_TypeDef * CANx, CAN_InitTypeDef *
CAN_InitStruct)
Initializes the CAN peripheral according to the specified