100 #define MCR_DBF ((uint32_t)0x00010000)
103 #define TMIDxR_TXRQ ((uint32_t)0x00000001)
106 #define FMR_FINIT ((uint32_t)0x00000001)
109 #define INAK_TIMEOUT ((uint32_t)0x0000FFFF)
111 #define SLAK_TIMEOUT ((uint32_t)0x0000FFFF)
114 #define CAN_FLAGS_TSR ((uint32_t)0x08000000)
116 #define CAN_FLAGS_RF1R ((uint32_t)0x04000000)
118 #define CAN_FLAGS_RF0R ((uint32_t)0x02000000)
120 #define CAN_FLAGS_MSR ((uint32_t)0x01000000)
122 #define CAN_FLAGS_ESR ((uint32_t)0x00F00000)
125 #define CAN_TXMAILBOX_0 ((uint8_t)0x00)
126 #define CAN_TXMAILBOX_1 ((uint8_t)0x01)
127 #define CAN_TXMAILBOX_2 ((uint8_t)0x02)
129 #define CAN_MODE_MASK ((uint32_t) 0x00000003)
135 static ITStatus
CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit);
170 assert_param(IS_CAN_ALL_PERIPH(CANx));
200 uint32_t wait_ack = 0x00000000;
202 assert_param(IS_CAN_ALL_PERIPH(CANx));
203 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->
CAN_TTCM));
204 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->
CAN_ABOM));
205 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->
CAN_AWUM));
206 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->
CAN_NART));
207 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->
CAN_RFLM));
208 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->
CAN_TXFP));
209 assert_param(IS_CAN_MODE(CAN_InitStruct->
CAN_Mode));
210 assert_param(IS_CAN_SJW(CAN_InitStruct->
CAN_SJW));
211 assert_param(IS_CAN_BS1(CAN_InitStruct->
CAN_BS1));
212 assert_param(IS_CAN_BS2(CAN_InitStruct->
CAN_BS2));
213 assert_param(IS_CAN_PRESCALER(CAN_InitStruct->
CAN_Prescaler));
216 CANx->MCR &= (~(uint32_t)CAN_MCR_SLEEP);
219 CANx->MCR |= CAN_MCR_INRQ ;
222 while (((CANx->MSR & CAN_MSR_INAK) != CAN_MSR_INAK) && (wait_ack != INAK_TIMEOUT))
228 if ((CANx->MSR & CAN_MSR_INAK) != CAN_MSR_INAK)
235 if (CAN_InitStruct->
CAN_TTCM == ENABLE)
237 CANx->MCR |= CAN_MCR_TTCM;
241 CANx->MCR &= ~(uint32_t)CAN_MCR_TTCM;
245 if (CAN_InitStruct->
CAN_ABOM == ENABLE)
247 CANx->MCR |= CAN_MCR_ABOM;
251 CANx->MCR &= ~(uint32_t)CAN_MCR_ABOM;
255 if (CAN_InitStruct->
CAN_AWUM == ENABLE)
257 CANx->MCR |= CAN_MCR_AWUM;
261 CANx->MCR &= ~(uint32_t)CAN_MCR_AWUM;
265 if (CAN_InitStruct->
CAN_NART == ENABLE)
267 CANx->MCR |= CAN_MCR_NART;
271 CANx->MCR &= ~(uint32_t)CAN_MCR_NART;
275 if (CAN_InitStruct->
CAN_RFLM == ENABLE)
277 CANx->MCR |= CAN_MCR_RFLM;
281 CANx->MCR &= ~(uint32_t)CAN_MCR_RFLM;
285 if (CAN_InitStruct->
CAN_TXFP == ENABLE)
287 CANx->MCR |= CAN_MCR_TXFP;
291 CANx->MCR &= ~(uint32_t)CAN_MCR_TXFP;
295 CANx->BTR = (uint32_t)((uint32_t)CAN_InitStruct->
CAN_Mode << 30) | \
296 ((uint32_t)CAN_InitStruct->
CAN_SJW << 24) | \
297 ((uint32_t)CAN_InitStruct->
CAN_BS1 << 16) | \
298 ((uint32_t)CAN_InitStruct->
CAN_BS2 << 20) | \
302 CANx->MCR &= ~(uint32_t)CAN_MCR_INRQ;
307 while (((CANx->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) && (wait_ack != INAK_TIMEOUT))
313 if ((CANx->MSR & CAN_MSR_INAK) == CAN_MSR_INAK)
336 uint32_t filter_number_bit_pos = 0;
339 assert_param(IS_CAN_FILTER_MODE(CAN_FilterInitStruct->
CAN_FilterMode));
340 assert_param(IS_CAN_FILTER_SCALE(CAN_FilterInitStruct->
CAN_FilterScale));
344 filter_number_bit_pos = ((uint32_t)1) << CAN_FilterInitStruct->
CAN_FilterNumber;
347 CAN1->FMR |= FMR_FINIT;
350 CAN1->FA1R &= ~(uint32_t)filter_number_bit_pos;
356 CAN1->FS1R &= ~(uint32_t)filter_number_bit_pos;
374 CAN1->FS1R |= filter_number_bit_pos;
389 CAN1->FM1R &= ~(uint32_t)filter_number_bit_pos;
394 CAN1->FM1R |= (uint32_t)filter_number_bit_pos;
401 CAN1->FFA1R &= ~(uint32_t)filter_number_bit_pos;
407 CAN1->FFA1R |= (uint32_t)filter_number_bit_pos;
413 CAN1->FA1R |= filter_number_bit_pos;
417 CAN1->FMR &= ~FMR_FINIT;
471 assert_param(IS_CAN_BANKNUMBER(CAN_BankNumber));
474 CAN1->FMR |= FMR_FINIT;
477 CAN1->FMR &= (uint32_t)0xFFFFC0F1 ;
478 CAN1->FMR |= (uint32_t)(CAN_BankNumber)<<8;
481 CAN1->FMR &= ~FMR_FINIT;
496 assert_param(IS_CAN_ALL_PERIPH(CANx));
497 assert_param(IS_FUNCTIONAL_STATE(NewState));
499 if (NewState != DISABLE)
502 CANx->MCR |= MCR_DBF;
507 CANx->MCR &= ~MCR_DBF;
526 assert_param(IS_CAN_ALL_PERIPH(CANx));
527 assert_param(IS_FUNCTIONAL_STATE(NewState));
528 if (NewState != DISABLE)
531 CANx->MCR |= CAN_MCR_TTCM;
534 CANx->sTxMailBox[0].TDTR |= ((uint32_t)CAN_TDT0R_TGT);
535 CANx->sTxMailBox[1].TDTR |= ((uint32_t)CAN_TDT1R_TGT);
536 CANx->sTxMailBox[2].TDTR |= ((uint32_t)CAN_TDT2R_TGT);
541 CANx->MCR &= (uint32_t)(~(uint32_t)CAN_MCR_TTCM);
544 CANx->sTxMailBox[0].TDTR &= ((uint32_t)~CAN_TDT0R_TGT);
545 CANx->sTxMailBox[1].TDTR &= ((uint32_t)~CAN_TDT1R_TGT);
546 CANx->sTxMailBox[2].TDTR &= ((uint32_t)~CAN_TDT2R_TGT);
579 uint8_t transmit_mailbox = 0;
581 assert_param(IS_CAN_ALL_PERIPH(CANx));
582 assert_param(IS_CAN_IDTYPE(TxMessage->
IDE));
583 assert_param(IS_CAN_RTR(TxMessage->
RTR));
584 assert_param(IS_CAN_DLC(TxMessage->
DLC));
587 if ((CANx->TSR&CAN_TSR_TME0) == CAN_TSR_TME0)
589 transmit_mailbox = 0;
591 else if ((CANx->TSR&CAN_TSR_TME1) == CAN_TSR_TME1)
593 transmit_mailbox = 1;
595 else if ((CANx->TSR&CAN_TSR_TME2) == CAN_TSR_TME2)
597 transmit_mailbox = 2;
607 CANx->sTxMailBox[transmit_mailbox].TIR &= TMIDxR_TXRQ;
610 assert_param(IS_CAN_STDID(TxMessage->
StdId));
611 CANx->sTxMailBox[transmit_mailbox].TIR |= ((TxMessage->
StdId << 21) | \
616 assert_param(IS_CAN_EXTID(TxMessage->
ExtId));
617 CANx->sTxMailBox[transmit_mailbox].TIR |= ((TxMessage->
ExtId << 3) | \
623 TxMessage->
DLC &= (uint8_t)0x0000000F;
624 CANx->sTxMailBox[transmit_mailbox].TDTR &= (uint32_t)0xFFFFFFF0;
625 CANx->sTxMailBox[transmit_mailbox].TDTR |= TxMessage->
DLC;
628 CANx->sTxMailBox[transmit_mailbox].TDLR = (((uint32_t)TxMessage->
Data[3] << 24) |
629 ((uint32_t)TxMessage->
Data[2] << 16) |
630 ((uint32_t)TxMessage->
Data[1] << 8) |
631 ((uint32_t)TxMessage->
Data[0]));
632 CANx->sTxMailBox[transmit_mailbox].TDHR = (((uint32_t)TxMessage->
Data[7] << 24) |
633 ((uint32_t)TxMessage->
Data[6] << 16) |
634 ((uint32_t)TxMessage->
Data[5] << 8) |
635 ((uint32_t)TxMessage->
Data[4]));
637 CANx->sTxMailBox[transmit_mailbox].TIR |= TMIDxR_TXRQ;
639 return transmit_mailbox;
654 assert_param(IS_CAN_ALL_PERIPH(CANx));
655 assert_param(IS_CAN_TRANSMITMAILBOX(TransmitMailbox));
657 switch (TransmitMailbox)
659 case (CAN_TXMAILBOX_0):
660 state = CANx->TSR & (CAN_TSR_RQCP0 | CAN_TSR_TXOK0 | CAN_TSR_TME0);
662 case (CAN_TXMAILBOX_1):
663 state = CANx->TSR & (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1);
665 case (CAN_TXMAILBOX_2):
666 state = CANx->TSR & (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2);
685 case (CAN_TSR_RQCP0 | CAN_TSR_TXOK0 | CAN_TSR_TME0):state =
CAN_TxStatus_Ok;
687 case (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1):state =
CAN_TxStatus_Ok;
689 case (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2):state =
CAN_TxStatus_Ok;
694 return (uint8_t) state;
706 assert_param(IS_CAN_ALL_PERIPH(CANx));
707 assert_param(IS_CAN_TRANSMITMAILBOX(Mailbox));
711 case (CAN_TXMAILBOX_0): CANx->TSR |= CAN_TSR_ABRQ0;
713 case (CAN_TXMAILBOX_1): CANx->TSR |= CAN_TSR_ABRQ1;
715 case (CAN_TXMAILBOX_2): CANx->TSR |= CAN_TSR_ABRQ2;
753 assert_param(IS_CAN_ALL_PERIPH(CANx));
754 assert_param(IS_CAN_FIFO(FIFONumber));
756 RxMessage->
IDE = (uint8_t)0x04 & CANx->sFIFOMailBox[FIFONumber].RIR;
759 RxMessage->
StdId = (uint32_t)0x000007FF & (CANx->sFIFOMailBox[FIFONumber].RIR >> 21);
763 RxMessage->
ExtId = (uint32_t)0x1FFFFFFF & (CANx->sFIFOMailBox[FIFONumber].RIR >> 3);
766 RxMessage->
RTR = (uint8_t)0x02 & CANx->sFIFOMailBox[FIFONumber].RIR;
768 RxMessage->
DLC = (uint8_t)0x0F & CANx->sFIFOMailBox[FIFONumber].RDTR;
770 RxMessage->
FMI = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDTR >> 8);
772 RxMessage->
Data[0] = (uint8_t)0xFF & CANx->sFIFOMailBox[FIFONumber].RDLR;
773 RxMessage->
Data[1] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDLR >> 8);
774 RxMessage->
Data[2] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDLR >> 16);
775 RxMessage->
Data[3] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDLR >> 24);
776 RxMessage->
Data[4] = (uint8_t)0xFF & CANx->sFIFOMailBox[FIFONumber].RDHR;
777 RxMessage->
Data[5] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDHR >> 8);
778 RxMessage->
Data[6] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDHR >> 16);
779 RxMessage->
Data[7] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDHR >> 24);
784 CANx->RF0R |= CAN_RF0R_RFOM0;
789 CANx->RF1R |= CAN_RF1R_RFOM1;
802 assert_param(IS_CAN_ALL_PERIPH(CANx));
803 assert_param(IS_CAN_FIFO(FIFONumber));
807 CANx->RF0R |= CAN_RF0R_RFOM0;
812 CANx->RF1R |= CAN_RF1R_RFOM1;
824 uint8_t message_pending=0;
826 assert_param(IS_CAN_ALL_PERIPH(CANx));
827 assert_param(IS_CAN_FIFO(FIFONumber));
830 message_pending = (uint8_t)(CANx->RF0R&(uint32_t)0x03);
834 message_pending = (uint8_t)(CANx->RF1R&(uint32_t)0x03);
840 return message_pending;
877 uint32_t timeout = INAK_TIMEOUT;
880 assert_param(IS_CAN_ALL_PERIPH(CANx));
881 assert_param(IS_CAN_OPERATING_MODE(CAN_OperatingMode));
886 CANx->MCR = (uint32_t)((CANx->MCR & (uint32_t)(~(uint32_t)CAN_MCR_SLEEP)) | CAN_MCR_INRQ);
889 while (((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_INAK) && (timeout != 0))
893 if ((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_INAK)
905 CANx->MCR &= (uint32_t)(~(CAN_MCR_SLEEP|CAN_MCR_INRQ));
908 while (((CANx->MSR & CAN_MODE_MASK) != 0) && (timeout!=0))
912 if ((CANx->MSR & CAN_MODE_MASK) != 0)
924 CANx->MCR = (uint32_t)((CANx->MCR & (uint32_t)(~(uint32_t)CAN_MCR_INRQ)) | CAN_MCR_SLEEP);
927 while (((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_SLAK) && (timeout!=0))
931 if ((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_SLAK)
945 return (uint8_t) status;
958 assert_param(IS_CAN_ALL_PERIPH(CANx));
961 CANx->MCR = (((CANx->MCR) & (uint32_t)(~(uint32_t)CAN_MCR_INRQ)) | CAN_MCR_SLEEP);
964 if ((CANx->MSR & (CAN_MSR_SLAK|CAN_MSR_INAK)) == CAN_MSR_SLAK)
970 return (uint8_t)sleepstatus;
980 uint32_t wait_slak = SLAK_TIMEOUT;
984 assert_param(IS_CAN_ALL_PERIPH(CANx));
987 CANx->MCR &= ~(uint32_t)CAN_MCR_SLEEP;
990 while(((CANx->MSR & CAN_MSR_SLAK) == CAN_MSR_SLAK)&&(wait_slak!=0x00))
994 if((CANx->MSR & CAN_MSR_SLAK) != CAN_MSR_SLAK)
1000 return (uint8_t)wakeupstatus;
1042 uint8_t errorcode=0;
1045 assert_param(IS_CAN_ALL_PERIPH(CANx));
1048 errorcode = (((uint8_t)CANx->ESR) & (uint8_t)CAN_ESR_LEC);
1070 assert_param(IS_CAN_ALL_PERIPH(CANx));
1073 counter = (uint8_t)((CANx->ESR & CAN_ESR_REC)>> 24);
1090 assert_param(IS_CAN_ALL_PERIPH(CANx));
1093 counter = (uint8_t)((CANx->ESR & CAN_ESR_TEC)>> 16);
1290 void CAN_ITConfig(CAN_TypeDef* CANx, uint32_t CAN_IT, FunctionalState NewState)
1293 assert_param(IS_CAN_ALL_PERIPH(CANx));
1294 assert_param(IS_CAN_IT(CAN_IT));
1295 assert_param(IS_FUNCTIONAL_STATE(NewState));
1297 if (NewState != DISABLE)
1300 CANx->IER |= CAN_IT;
1305 CANx->IER &= ~CAN_IT;
1332 FlagStatus bitstatus = RESET;
1335 assert_param(IS_CAN_ALL_PERIPH(CANx));
1336 assert_param(IS_CAN_GET_FLAG(CAN_FLAG));
1339 if((CAN_FLAG & CAN_FLAGS_ESR) != (uint32_t)RESET)
1342 if ((CANx->ESR & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET)
1353 else if((CAN_FLAG & CAN_FLAGS_MSR) != (uint32_t)RESET)
1356 if ((CANx->MSR & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET)
1367 else if((CAN_FLAG & CAN_FLAGS_TSR) != (uint32_t)RESET)
1370 if ((CANx->TSR & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET)
1381 else if((CAN_FLAG & CAN_FLAGS_RF0R) != (uint32_t)RESET)
1384 if ((CANx->RF0R & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET)
1398 if ((uint32_t)(CANx->RF1R & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET)
1434 assert_param(IS_CAN_ALL_PERIPH(CANx));
1435 assert_param(IS_CAN_CLEAR_FLAG(CAN_FLAG));
1440 CANx->ESR = (uint32_t)RESET;
1444 flagtmp = CAN_FLAG & 0x000FFFFF;
1446 if ((CAN_FLAG & CAN_FLAGS_RF0R)!=(uint32_t)RESET)
1449 CANx->RF0R = (uint32_t)(flagtmp);
1451 else if ((CAN_FLAG & CAN_FLAGS_RF1R)!=(uint32_t)RESET)
1454 CANx->RF1R = (uint32_t)(flagtmp);
1456 else if ((CAN_FLAG & CAN_FLAGS_TSR)!=(uint32_t)RESET)
1459 CANx->TSR = (uint32_t)(flagtmp);
1464 CANx->MSR = (uint32_t)(flagtmp);
1492 ITStatus itstatus = RESET;
1494 assert_param(IS_CAN_ALL_PERIPH(CANx));
1495 assert_param(IS_CAN_IT(CAN_IT));
1498 if((CANx->IER & CAN_IT) != RESET)
1505 itstatus =
CheckITStatus(CANx->TSR, CAN_TSR_RQCP0|CAN_TSR_RQCP1|CAN_TSR_RQCP2);
1597 assert_param(IS_CAN_ALL_PERIPH(CANx));
1598 assert_param(IS_CAN_CLEAR_IT(CAN_IT));
1604 CANx->TSR = CAN_TSR_RQCP0|CAN_TSR_RQCP1|CAN_TSR_RQCP2;
1608 CANx->RF0R = CAN_RF0R_FULL0;
1612 CANx->RF0R = CAN_RF0R_FOVR0;
1616 CANx->RF1R = CAN_RF1R_FULL1;
1620 CANx->RF1R = CAN_RF1R_FOVR1;
1624 CANx->MSR = CAN_MSR_WKUI;
1628 CANx->MSR = CAN_MSR_SLAKI;
1632 CANx->MSR = CAN_MSR_ERRI;
1637 CANx->MSR = CAN_MSR_ERRI;
1642 CANx->MSR = CAN_MSR_ERRI;
1649 CANx->MSR = CAN_MSR_ERRI;
1655 CANx->MSR = CAN_MSR_ERRI;
1674 ITStatus pendingbitstatus = RESET;
1676 if ((CAN_Reg & It_Bit) != (uint32_t)RESET)
1679 pendingbitstatus = SET;
1684 pendingbitstatus = RESET;
1686 return pendingbitstatus;
This file contains all the functions prototypes for the RCC firmware library.
uint16_t CAN_FilterIdHigh
uint8_t CAN_MessagePending(CAN_TypeDef *CANx, uint8_t FIFONumber)
Returns the number of pending received messages.
void CAN_DBGFreeze(CAN_TypeDef *CANx, FunctionalState NewState)
Enables or disables the DBG Freeze for CAN.
uint8_t CAN_Init(CAN_TypeDef *CANx, CAN_InitTypeDef *CAN_InitStruct)
Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct.
uint8_t CAN_OperatingModeRequest(CAN_TypeDef *CANx, uint8_t CAN_OperatingMode)
Selects the CAN Operation mode.
uint16_t CAN_FilterMaskIdLow
uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef *CANx)
Returns the CANx Receive Error Counter (REC).
void CAN_StructInit(CAN_InitTypeDef *CAN_InitStruct)
Fills each CAN_InitStruct member with its default value.
#define CAN_ModeStatus_Success
#define CAN_InitStatus_Failed
#define CAN_FilterScale_32bit
FlagStatus CAN_GetFlagStatus(CAN_TypeDef *CANx, uint32_t CAN_FLAG)
Checks whether the specified CAN flag is set or not.
CAN Tx message structure definition.
void CAN_CancelTransmit(CAN_TypeDef *CANx, uint8_t Mailbox)
Cancels a transmit request.
#define CAN_TxStatus_NoMailBox
This file contains all the functions prototypes for the CAN firmware library.
#define CAN_TxStatus_Pending
void CAN_DeInit(CAN_TypeDef *CANx)
Deinitializes the CAN peripheral registers to their default reset values.
CAN Rx message structure definition.
CAN init structure definition.
CAN filter init structure definition.
void CAN_SlaveStartBank(uint8_t CAN_BankNumber)
Select the start bank filter for slave CAN.
uint16_t CAN_FilterFIFOAssignment
uint8_t CAN_TransmitStatus(CAN_TypeDef *CANx, uint8_t TransmitMailbox)
Checks the transmission status of a CAN Frame.
void CAN_ClearITPendingBit(CAN_TypeDef *CANx, uint32_t CAN_IT)
Clears the CANx's interrupt pending bits.
#define CAN_OperatingMode_Initialization
#define CAN_InitStatus_Success
static ITStatus CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit)
Checks whether the CAN interrupt has occurred or not.
#define CAN_OperatingMode_Normal
void CAN_ClearFlag(CAN_TypeDef *CANx, uint32_t CAN_FLAG)
Clears the CAN's pending flags.
#define CAN_TxStatus_Failed
uint8_t CAN_WakeUp(CAN_TypeDef *CANx)
Wakes up the CAN peripheral from sleep mode .
void CAN_FilterInit(CAN_FilterInitTypeDef *CAN_FilterInitStruct)
Configures the CAN reception filter according to the specified parameters in the CAN_FilterInitStruct...
uint8_t CAN_GetLSBTransmitErrorCounter(CAN_TypeDef *CANx)
Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC).
ITStatus CAN_GetITStatus(CAN_TypeDef *CANx, uint32_t CAN_IT)
Checks whether the specified CANx interrupt has occurred or not.
void CAN_FIFORelease(CAN_TypeDef *CANx, uint8_t FIFONumber)
Releases the specified receive FIFO.
#define CAN_FilterMode_IdMask
uint8_t CAN_Sleep(CAN_TypeDef *CANx)
Enters the Sleep (low power) mode.
uint8_t CAN_GetLastErrorCode(CAN_TypeDef *CANx)
Returns the CANx's last error code (LEC).
uint8_t CAN_Transmit(CAN_TypeDef *CANx, CanTxMsg *TxMessage)
Initiates and transmits a CAN frame message.
void CAN_Receive(CAN_TypeDef *CANx, uint8_t FIFONumber, CanRxMsg *RxMessage)
Receives a correct CAN frame.
#define CAN_FilterScale_16bit
void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
Forces or releases Low Speed APB (APB1) peripheral reset.
uint16_t CAN_FilterMaskIdHigh
#define CAN_OperatingMode_Sleep
#define CAN_ModeStatus_Failed
void CAN_TTComModeCmd(CAN_TypeDef *CANx, FunctionalState NewState)
Enables or disables the CAN Time TriggerOperation communication mode.
FunctionalState CAN_FilterActivation
void CAN_ITConfig(CAN_TypeDef *CANx, uint32_t CAN_IT, FunctionalState NewState)
Enables or disables the specified CANx interrupts.
#define CAN_WakeUp_Failed