CARME-M4 BSP  V1.5
stm32f4xx_can.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F4xx_CAN_H
31 #define __STM32F4xx_CAN_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f4xx.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 
50 #define IS_CAN_ALL_PERIPH(PERIPH) (((PERIPH) == CAN1) || \
51  ((PERIPH) == CAN2))
52 
56 typedef struct
57 {
58  uint16_t CAN_Prescaler;
61  uint8_t CAN_Mode;
64  uint8_t CAN_SJW;
69  uint8_t CAN_BS1;
73  uint8_t CAN_BS2;
76  FunctionalState CAN_TTCM;
79  FunctionalState CAN_ABOM;
82  FunctionalState CAN_AWUM;
85  FunctionalState CAN_NART;
88  FunctionalState CAN_RFLM;
91  FunctionalState CAN_TXFP;
94 
98 typedef struct
99 {
100  uint16_t CAN_FilterIdHigh;
104  uint16_t CAN_FilterIdLow;
123  uint8_t CAN_FilterMode;
126  uint8_t CAN_FilterScale;
129  FunctionalState CAN_FilterActivation;
132 
136 typedef struct
137 {
138  uint32_t StdId;
141  uint32_t ExtId;
144  uint8_t IDE;
148  uint8_t RTR;
152  uint8_t DLC;
156  uint8_t Data[8];
158 } CanTxMsg;
159 
163 typedef struct
164 {
165  uint32_t StdId;
168  uint32_t ExtId;
171  uint8_t IDE;
175  uint8_t RTR;
179  uint8_t DLC;
182  uint8_t Data[8];
185  uint8_t FMI;
188 } CanRxMsg;
189 
190 /* Exported constants --------------------------------------------------------*/
191 
200 #define CAN_InitStatus_Failed ((uint8_t)0x00)
201 #define CAN_InitStatus_Success ((uint8_t)0x01)
204 /* Legacy defines */
205 #define CANINITFAILED CAN_InitStatus_Failed
206 #define CANINITOK CAN_InitStatus_Success
207 
215 #define CAN_Mode_Normal ((uint8_t)0x00)
216 #define CAN_Mode_LoopBack ((uint8_t)0x01)
217 #define CAN_Mode_Silent ((uint8_t)0x02)
218 #define CAN_Mode_Silent_LoopBack ((uint8_t)0x03)
220 #define IS_CAN_MODE(MODE) (((MODE) == CAN_Mode_Normal) || \
221  ((MODE) == CAN_Mode_LoopBack)|| \
222  ((MODE) == CAN_Mode_Silent) || \
223  ((MODE) == CAN_Mode_Silent_LoopBack))
224 
233 #define CAN_OperatingMode_Initialization ((uint8_t)0x00)
234 #define CAN_OperatingMode_Normal ((uint8_t)0x01)
235 #define CAN_OperatingMode_Sleep ((uint8_t)0x02)
238 #define IS_CAN_OPERATING_MODE(MODE) (((MODE) == CAN_OperatingMode_Initialization) ||\
239  ((MODE) == CAN_OperatingMode_Normal)|| \
240  ((MODE) == CAN_OperatingMode_Sleep))
241 
250 #define CAN_ModeStatus_Failed ((uint8_t)0x00)
251 #define CAN_ModeStatus_Success ((uint8_t)!CAN_ModeStatus_Failed)
259 #define CAN_SJW_1tq ((uint8_t)0x00)
260 #define CAN_SJW_2tq ((uint8_t)0x01)
261 #define CAN_SJW_3tq ((uint8_t)0x02)
262 #define CAN_SJW_4tq ((uint8_t)0x03)
264 #define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1tq) || ((SJW) == CAN_SJW_2tq)|| \
265  ((SJW) == CAN_SJW_3tq) || ((SJW) == CAN_SJW_4tq))
266 
273 #define CAN_BS1_1tq ((uint8_t)0x00)
274 #define CAN_BS1_2tq ((uint8_t)0x01)
275 #define CAN_BS1_3tq ((uint8_t)0x02)
276 #define CAN_BS1_4tq ((uint8_t)0x03)
277 #define CAN_BS1_5tq ((uint8_t)0x04)
278 #define CAN_BS1_6tq ((uint8_t)0x05)
279 #define CAN_BS1_7tq ((uint8_t)0x06)
280 #define CAN_BS1_8tq ((uint8_t)0x07)
281 #define CAN_BS1_9tq ((uint8_t)0x08)
282 #define CAN_BS1_10tq ((uint8_t)0x09)
283 #define CAN_BS1_11tq ((uint8_t)0x0A)
284 #define CAN_BS1_12tq ((uint8_t)0x0B)
285 #define CAN_BS1_13tq ((uint8_t)0x0C)
286 #define CAN_BS1_14tq ((uint8_t)0x0D)
287 #define CAN_BS1_15tq ((uint8_t)0x0E)
288 #define CAN_BS1_16tq ((uint8_t)0x0F)
290 #define IS_CAN_BS1(BS1) ((BS1) <= CAN_BS1_16tq)
291 
298 #define CAN_BS2_1tq ((uint8_t)0x00)
299 #define CAN_BS2_2tq ((uint8_t)0x01)
300 #define CAN_BS2_3tq ((uint8_t)0x02)
301 #define CAN_BS2_4tq ((uint8_t)0x03)
302 #define CAN_BS2_5tq ((uint8_t)0x04)
303 #define CAN_BS2_6tq ((uint8_t)0x05)
304 #define CAN_BS2_7tq ((uint8_t)0x06)
305 #define CAN_BS2_8tq ((uint8_t)0x07)
307 #define IS_CAN_BS2(BS2) ((BS2) <= CAN_BS2_8tq)
308 
315 #define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1) && ((PRESCALER) <= 1024))
316 
323 #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27)
324 
331 #define CAN_FilterMode_IdMask ((uint8_t)0x00)
332 #define CAN_FilterMode_IdList ((uint8_t)0x01)
334 #define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FilterMode_IdMask) || \
335  ((MODE) == CAN_FilterMode_IdList))
336 
343 #define CAN_FilterScale_16bit ((uint8_t)0x00)
344 #define CAN_FilterScale_32bit ((uint8_t)0x01)
346 #define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FilterScale_16bit) || \
347  ((SCALE) == CAN_FilterScale_32bit))
348 
355 #define CAN_Filter_FIFO0 ((uint8_t)0x00)
356 #define CAN_Filter_FIFO1 ((uint8_t)0x01)
357 #define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FilterFIFO0) || \
358  ((FIFO) == CAN_FilterFIFO1))
359 
360 /* Legacy defines */
361 #define CAN_FilterFIFO0 CAN_Filter_FIFO0
362 #define CAN_FilterFIFO1 CAN_Filter_FIFO1
363 
370 #define IS_CAN_BANKNUMBER(BANKNUMBER) (((BANKNUMBER) >= 1) && ((BANKNUMBER) <= 27))
371 
378 #define IS_CAN_TRANSMITMAILBOX(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= ((uint8_t)0x02))
379 #define IS_CAN_STDID(STDID) ((STDID) <= ((uint32_t)0x7FF))
380 #define IS_CAN_EXTID(EXTID) ((EXTID) <= ((uint32_t)0x1FFFFFFF))
381 #define IS_CAN_DLC(DLC) ((DLC) <= ((uint8_t)0x08))
382 
389 #define CAN_Id_Standard ((uint32_t)0x00000000)
390 #define CAN_Id_Extended ((uint32_t)0x00000004)
391 #define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_Id_Standard) || \
392  ((IDTYPE) == CAN_Id_Extended))
393 
394 /* Legacy defines */
395 #define CAN_ID_STD CAN_Id_Standard
396 #define CAN_ID_EXT CAN_Id_Extended
397 
404 #define CAN_RTR_Data ((uint32_t)0x00000000)
405 #define CAN_RTR_Remote ((uint32_t)0x00000002)
406 #define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_Data) || ((RTR) == CAN_RTR_Remote))
407 
408 /* Legacy defines */
409 #define CAN_RTR_DATA CAN_RTR_Data
410 #define CAN_RTR_REMOTE CAN_RTR_Remote
411 
418 #define CAN_TxStatus_Failed ((uint8_t)0x00)
419 #define CAN_TxStatus_Ok ((uint8_t)0x01)
420 #define CAN_TxStatus_Pending ((uint8_t)0x02)
421 #define CAN_TxStatus_NoMailBox ((uint8_t)0x04)
423 /* Legacy defines */
424 #define CANTXFAILED CAN_TxStatus_Failed
425 #define CANTXOK CAN_TxStatus_Ok
426 #define CANTXPENDING CAN_TxStatus_Pending
427 #define CAN_NO_MB CAN_TxStatus_NoMailBox
428 
435 #define CAN_FIFO0 ((uint8_t)0x00)
436 #define CAN_FIFO1 ((uint8_t)0x01)
438 #define IS_CAN_FIFO(FIFO) (((FIFO) == CAN_FIFO0) || ((FIFO) == CAN_FIFO1))
439 
446 #define CAN_Sleep_Failed ((uint8_t)0x00)
447 #define CAN_Sleep_Ok ((uint8_t)0x01)
449 /* Legacy defines */
450 #define CANSLEEPFAILED CAN_Sleep_Failed
451 #define CANSLEEPOK CAN_Sleep_Ok
452 
459 #define CAN_WakeUp_Failed ((uint8_t)0x00)
460 #define CAN_WakeUp_Ok ((uint8_t)0x01)
462 /* Legacy defines */
463 #define CANWAKEUPFAILED CAN_WakeUp_Failed
464 #define CANWAKEUPOK CAN_WakeUp_Ok
465 
473 #define CAN_ErrorCode_NoErr ((uint8_t)0x00)
474 #define CAN_ErrorCode_StuffErr ((uint8_t)0x10)
475 #define CAN_ErrorCode_FormErr ((uint8_t)0x20)
476 #define CAN_ErrorCode_ACKErr ((uint8_t)0x30)
477 #define CAN_ErrorCode_BitRecessiveErr ((uint8_t)0x40)
478 #define CAN_ErrorCode_BitDominantErr ((uint8_t)0x50)
479 #define CAN_ErrorCode_CRCErr ((uint8_t)0x60)
480 #define CAN_ErrorCode_SoftwareSetErr ((uint8_t)0x70)
488 /* If the flag is 0x3XXXXXXX, it means that it can be used with CAN_GetFlagStatus()
489  and CAN_ClearFlag() functions. */
490 /* If the flag is 0x1XXXXXXX, it means that it can only be used with
491  CAN_GetFlagStatus() function. */
492 
493 /* Transmit Flags */
494 #define CAN_FLAG_RQCP0 ((uint32_t)0x38000001)
495 #define CAN_FLAG_RQCP1 ((uint32_t)0x38000100)
496 #define CAN_FLAG_RQCP2 ((uint32_t)0x38010000)
498 /* Receive Flags */
499 #define CAN_FLAG_FMP0 ((uint32_t)0x12000003)
500 #define CAN_FLAG_FF0 ((uint32_t)0x32000008)
501 #define CAN_FLAG_FOV0 ((uint32_t)0x32000010)
502 #define CAN_FLAG_FMP1 ((uint32_t)0x14000003)
503 #define CAN_FLAG_FF1 ((uint32_t)0x34000008)
504 #define CAN_FLAG_FOV1 ((uint32_t)0x34000010)
506 /* Operating Mode Flags */
507 #define CAN_FLAG_WKU ((uint32_t)0x31000008)
508 #define CAN_FLAG_SLAK ((uint32_t)0x31000012)
509 /* @note When SLAK interrupt is disabled (SLKIE=0), no polling on SLAKI is possible.
510  In this case the SLAK bit can be polled.*/
511 
512 /* Error Flags */
513 #define CAN_FLAG_EWG ((uint32_t)0x10F00001)
514 #define CAN_FLAG_EPV ((uint32_t)0x10F00002)
515 #define CAN_FLAG_BOF ((uint32_t)0x10F00004)
516 #define CAN_FLAG_LEC ((uint32_t)0x30F00070)
518 #define IS_CAN_GET_FLAG(FLAG) (((FLAG) == CAN_FLAG_LEC) || ((FLAG) == CAN_FLAG_BOF) || \
519  ((FLAG) == CAN_FLAG_EPV) || ((FLAG) == CAN_FLAG_EWG) || \
520  ((FLAG) == CAN_FLAG_WKU) || ((FLAG) == CAN_FLAG_FOV0) || \
521  ((FLAG) == CAN_FLAG_FF0) || ((FLAG) == CAN_FLAG_FMP0) || \
522  ((FLAG) == CAN_FLAG_FOV1) || ((FLAG) == CAN_FLAG_FF1) || \
523  ((FLAG) == CAN_FLAG_FMP1) || ((FLAG) == CAN_FLAG_RQCP2) || \
524  ((FLAG) == CAN_FLAG_RQCP1)|| ((FLAG) == CAN_FLAG_RQCP0) || \
525  ((FLAG) == CAN_FLAG_SLAK ))
526 
527 #define IS_CAN_CLEAR_FLAG(FLAG)(((FLAG) == CAN_FLAG_LEC) || ((FLAG) == CAN_FLAG_RQCP2) || \
528  ((FLAG) == CAN_FLAG_RQCP1) || ((FLAG) == CAN_FLAG_RQCP0) || \
529  ((FLAG) == CAN_FLAG_FF0) || ((FLAG) == CAN_FLAG_FOV0) ||\
530  ((FLAG) == CAN_FLAG_FF1) || ((FLAG) == CAN_FLAG_FOV1) || \
531  ((FLAG) == CAN_FLAG_WKU) || ((FLAG) == CAN_FLAG_SLAK))
532 
540 #define CAN_IT_TME ((uint32_t)0x00000001)
542 /* Receive Interrupts */
543 #define CAN_IT_FMP0 ((uint32_t)0x00000002)
544 #define CAN_IT_FF0 ((uint32_t)0x00000004)
545 #define CAN_IT_FOV0 ((uint32_t)0x00000008)
546 #define CAN_IT_FMP1 ((uint32_t)0x00000010)
547 #define CAN_IT_FF1 ((uint32_t)0x00000020)
548 #define CAN_IT_FOV1 ((uint32_t)0x00000040)
550 /* Operating Mode Interrupts */
551 #define CAN_IT_WKU ((uint32_t)0x00010000)
552 #define CAN_IT_SLK ((uint32_t)0x00020000)
554 /* Error Interrupts */
555 #define CAN_IT_EWG ((uint32_t)0x00000100)
556 #define CAN_IT_EPV ((uint32_t)0x00000200)
557 #define CAN_IT_BOF ((uint32_t)0x00000400)
558 #define CAN_IT_LEC ((uint32_t)0x00000800)
559 #define CAN_IT_ERR ((uint32_t)0x00008000)
561 /* Flags named as Interrupts : kept only for FW compatibility */
562 #define CAN_IT_RQCP0 CAN_IT_TME
563 #define CAN_IT_RQCP1 CAN_IT_TME
564 #define CAN_IT_RQCP2 CAN_IT_TME
565 
566 
567 #define IS_CAN_IT(IT) (((IT) == CAN_IT_TME) || ((IT) == CAN_IT_FMP0) ||\
568  ((IT) == CAN_IT_FF0) || ((IT) == CAN_IT_FOV0) ||\
569  ((IT) == CAN_IT_FMP1) || ((IT) == CAN_IT_FF1) ||\
570  ((IT) == CAN_IT_FOV1) || ((IT) == CAN_IT_EWG) ||\
571  ((IT) == CAN_IT_EPV) || ((IT) == CAN_IT_BOF) ||\
572  ((IT) == CAN_IT_LEC) || ((IT) == CAN_IT_ERR) ||\
573  ((IT) == CAN_IT_WKU) || ((IT) == CAN_IT_SLK))
574 
575 #define IS_CAN_CLEAR_IT(IT) (((IT) == CAN_IT_TME) || ((IT) == CAN_IT_FF0) ||\
576  ((IT) == CAN_IT_FOV0)|| ((IT) == CAN_IT_FF1) ||\
577  ((IT) == CAN_IT_FOV1)|| ((IT) == CAN_IT_EWG) ||\
578  ((IT) == CAN_IT_EPV) || ((IT) == CAN_IT_BOF) ||\
579  ((IT) == CAN_IT_LEC) || ((IT) == CAN_IT_ERR) ||\
580  ((IT) == CAN_IT_WKU) || ((IT) == CAN_IT_SLK))
581 
589 /* Exported macro ------------------------------------------------------------*/
590 /* Exported functions --------------------------------------------------------*/
591 
592 /* Function used to set the CAN configuration to the default reset state *****/
593 void CAN_DeInit(CAN_TypeDef* CANx);
594 
595 /* Initialization and Configuration functions *********************************/
596 uint8_t CAN_Init(CAN_TypeDef* CANx, CAN_InitTypeDef* CAN_InitStruct);
597 void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct);
598 void CAN_StructInit(CAN_InitTypeDef* CAN_InitStruct);
599 void CAN_SlaveStartBank(uint8_t CAN_BankNumber);
600 void CAN_DBGFreeze(CAN_TypeDef* CANx, FunctionalState NewState);
601 void CAN_TTComModeCmd(CAN_TypeDef* CANx, FunctionalState NewState);
602 
603 /* CAN Frames Transmission functions ******************************************/
604 uint8_t CAN_Transmit(CAN_TypeDef* CANx, CanTxMsg* TxMessage);
605 uint8_t CAN_TransmitStatus(CAN_TypeDef* CANx, uint8_t TransmitMailbox);
606 void CAN_CancelTransmit(CAN_TypeDef* CANx, uint8_t Mailbox);
607 
608 /* CAN Frames Reception functions *********************************************/
609 void CAN_Receive(CAN_TypeDef* CANx, uint8_t FIFONumber, CanRxMsg* RxMessage);
610 void CAN_FIFORelease(CAN_TypeDef* CANx, uint8_t FIFONumber);
611 uint8_t CAN_MessagePending(CAN_TypeDef* CANx, uint8_t FIFONumber);
612 
613 /* Operation modes functions **************************************************/
614 uint8_t CAN_OperatingModeRequest(CAN_TypeDef* CANx, uint8_t CAN_OperatingMode);
615 uint8_t CAN_Sleep(CAN_TypeDef* CANx);
616 uint8_t CAN_WakeUp(CAN_TypeDef* CANx);
617 
618 /* CAN Bus Error management functions *****************************************/
619 uint8_t CAN_GetLastErrorCode(CAN_TypeDef* CANx);
620 uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef* CANx);
621 uint8_t CAN_GetLSBTransmitErrorCounter(CAN_TypeDef* CANx);
622 
623 /* Interrupts and flags management functions **********************************/
624 void CAN_ITConfig(CAN_TypeDef* CANx, uint32_t CAN_IT, FunctionalState NewState);
625 FlagStatus CAN_GetFlagStatus(CAN_TypeDef* CANx, uint32_t CAN_FLAG);
626 void CAN_ClearFlag(CAN_TypeDef* CANx, uint32_t CAN_FLAG);
627 ITStatus CAN_GetITStatus(CAN_TypeDef* CANx, uint32_t CAN_IT);
628 void CAN_ClearITPendingBit(CAN_TypeDef* CANx, uint32_t CAN_IT);
629 
630 #ifdef __cplusplus
631 }
632 #endif
633 
634 #endif /* __STM32F4xx_CAN_H */
635 
644 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
uint8_t IDE
void CAN_FIFORelease(CAN_TypeDef *CANx, uint8_t FIFONumber)
Releases the specified receive FIFO.
void CAN_FilterInit(CAN_FilterInitTypeDef *CAN_FilterInitStruct)
Configures the CAN reception filter according to the specified parameters in the CAN_FilterInitStruct...
uint8_t RTR
uint8_t IDE
uint8_t RTR
uint8_t CAN_WakeUp(CAN_TypeDef *CANx)
Wakes up the CAN peripheral from sleep mode .
uint32_t StdId
uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef *CANx)
Returns the CANx Receive Error Counter (REC).
ITStatus CAN_GetITStatus(CAN_TypeDef *CANx, uint32_t CAN_IT)
Checks whether the specified CANx interrupt has occurred or not.
uint32_t StdId
uint8_t CAN_TransmitStatus(CAN_TypeDef *CANx, uint8_t TransmitMailbox)
Checks the transmission status of a CAN Frame.
uint8_t FMI
uint16_t CAN_Prescaler
Definition: stm32f4xx_can.h:58
void CAN_ITConfig(CAN_TypeDef *CANx, uint32_t CAN_IT, FunctionalState NewState)
Enables or disables the specified CANx interrupts.
void CAN_Receive(CAN_TypeDef *CANx, uint8_t FIFONumber, CanRxMsg *RxMessage)
Receives a correct CAN frame.
void CAN_CancelTransmit(CAN_TypeDef *CANx, uint8_t Mailbox)
Cancels a transmit request.
CAN Tx message structure definition.
FunctionalState CAN_NART
Definition: stm32f4xx_can.h:85
void CAN_ClearFlag(CAN_TypeDef *CANx, uint32_t CAN_FLAG)
Clears the CAN's pending flags.
uint8_t CAN_OperatingModeRequest(CAN_TypeDef *CANx, uint8_t CAN_OperatingMode)
Selects the CAN Operation mode.
uint8_t CAN_Init(CAN_TypeDef *CANx, CAN_InitTypeDef *CAN_InitStruct)
Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct.
CAN Rx message structure definition.
CAN init structure definition.
Definition: stm32f4xx_can.h:56
CAN filter init structure definition.
Definition: stm32f4xx_can.h:98
uint16_t CAN_FilterFIFOAssignment
void CAN_ClearITPendingBit(CAN_TypeDef *CANx, uint32_t CAN_IT)
Clears the CANx's interrupt pending bits.
void CAN_DeInit(CAN_TypeDef *CANx)
Deinitializes the CAN peripheral registers to their default reset values.
FunctionalState CAN_ABOM
Definition: stm32f4xx_can.h:79
uint8_t CAN_MessagePending(CAN_TypeDef *CANx, uint8_t FIFONumber)
Returns the number of pending received messages.
uint32_t ExtId
uint8_t DLC
uint32_t ExtId
uint8_t DLC
uint8_t CAN_GetLSBTransmitErrorCounter(CAN_TypeDef *CANx)
Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC).
void CAN_TTComModeCmd(CAN_TypeDef *CANx, FunctionalState NewState)
Enables or disables the CAN Time TriggerOperation communication mode.
uint8_t CAN_Transmit(CAN_TypeDef *CANx, CanTxMsg *TxMessage)
Initiates and transmits a CAN frame message.
FunctionalState CAN_TTCM
Definition: stm32f4xx_can.h:76
FunctionalState CAN_RFLM
Definition: stm32f4xx_can.h:88
FunctionalState CAN_TXFP
Definition: stm32f4xx_can.h:91
FlagStatus CAN_GetFlagStatus(CAN_TypeDef *CANx, uint32_t CAN_FLAG)
Checks whether the specified CAN flag is set or not.
uint8_t CAN_Sleep(CAN_TypeDef *CANx)
Enters the Sleep (low power) mode.
void CAN_SlaveStartBank(uint8_t CAN_BankNumber)
Select the start bank filter for slave CAN.
void CAN_DBGFreeze(CAN_TypeDef *CANx, FunctionalState NewState)
Enables or disables the DBG Freeze for CAN.
void CAN_StructInit(CAN_InitTypeDef *CAN_InitStruct)
Fills each CAN_InitStruct member with its default value.
uint8_t CAN_GetLastErrorCode(CAN_TypeDef *CANx)
Returns the CANx's last error code (LEC).
FunctionalState CAN_FilterActivation
FunctionalState CAN_AWUM
Definition: stm32f4xx_can.h:82