Functions
Collaboration diagram for CAN_Exported_Functions:

Functions

void CAN_CancelTransmit (CAN_TypeDef *CANx, uint8_t Mailbox)
 Cancels a transmit request. More...
 
void CAN_ClearFlag (CAN_TypeDef *CANx, uint32_t CAN_FLAG)
 Clears the CAN's pending flags. More...
 
void CAN_ClearITPendingBit (CAN_TypeDef *CANx, uint32_t CAN_IT)
 Clears the CANx's interrupt pending bits. More...
 
void CAN_DBGFreeze (CAN_TypeDef *CANx, FunctionalState NewState)
 Enables or disables the DBG Freeze for CAN. More...
 
void CAN_DeInit (CAN_TypeDef *CANx)
 Deinitializes the CAN peripheral registers to their default reset values. More...
 
void CAN_FIFORelease (CAN_TypeDef *CANx, uint8_t FIFONumber)
 Releases the specified receive FIFO. More...
 
void CAN_FilterInit (CAN_FilterInitTypeDef *CAN_FilterInitStruct)
 Configures the CAN reception filter according to the specified parameters in the CAN_FilterInitStruct. More...
 
FlagStatus CAN_GetFlagStatus (CAN_TypeDef *CANx, uint32_t CAN_FLAG)
 Checks whether the specified CAN flag is set or not. More...
 
ITStatus CAN_GetITStatus (CAN_TypeDef *CANx, uint32_t CAN_IT)
 Checks whether the specified CANx interrupt has occurred or not. More...
 
uint8_t CAN_GetLastErrorCode (CAN_TypeDef *CANx)
 Returns the CANx's last error code (LEC). More...
 
uint8_t CAN_GetLSBTransmitErrorCounter (CAN_TypeDef *CANx)
 Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC). More...
 
uint8_t CAN_GetReceiveErrorCounter (CAN_TypeDef *CANx)
 Returns the CANx Receive Error Counter (REC). More...
 
uint8_t CAN_Init (CAN_TypeDef *CANx, CAN_InitTypeDef *CAN_InitStruct)
 Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct. More...
 
void CAN_ITConfig (CAN_TypeDef *CANx, uint32_t CAN_IT, FunctionalState NewState)
 Enables or disables the specified CANx interrupts. More...
 
uint8_t CAN_MessagePending (CAN_TypeDef *CANx, uint8_t FIFONumber)
 Returns the number of pending received messages. More...
 
uint8_t CAN_OperatingModeRequest (CAN_TypeDef *CANx, uint8_t CAN_OperatingMode)
 Selects the CAN Operation mode. More...
 
void CAN_Receive (CAN_TypeDef *CANx, uint8_t FIFONumber, CanRxMsg *RxMessage)
 Receives a correct CAN frame. More...
 
void CAN_SlaveStartBank (uint8_t CAN_BankNumber)
 Select the start bank filter for slave CAN. More...
 
uint8_t CAN_Sleep (CAN_TypeDef *CANx)
 Enters the Sleep (low power) mode. More...
 
void CAN_StructInit (CAN_InitTypeDef *CAN_InitStruct)
 Fills each CAN_InitStruct member with its default value. More...
 
uint8_t CAN_Transmit (CAN_TypeDef *CANx, CanTxMsg *TxMessage)
 Initiates and transmits a CAN frame message. More...
 
uint8_t CAN_TransmitStatus (CAN_TypeDef *CANx, uint8_t TransmitMailbox)
 Checks the transmission status of a CAN Frame. More...
 
void CAN_TTComModeCmd (CAN_TypeDef *CANx, FunctionalState NewState)
 Enables or disables the CAN Time TriggerOperation communication mode. More...
 
uint8_t CAN_WakeUp (CAN_TypeDef *CANx)
 Wakes up the CAN peripheral from sleep mode . More...
 

Detailed Description

Function Documentation

void CAN_CancelTransmit ( CAN_TypeDef CANx,
uint8_t  Mailbox 
)

Cancels a transmit request.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
MailboxMailbox number.
Return values
None
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
MailboxMailbox number.
Return values
None
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
MailboxMailbox number.
Return values
None.

Definition at line 703 of file stm32f4xx_can.c.

void CAN_ClearFlag ( CAN_TypeDef CANx,
uint32_t  CAN_FLAG 
)

Clears the CAN's pending flags.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_FLAGspecifies the flag to clear. This parameter can be one of the following values:
  • CAN_FLAG_RQCP0: Request MailBox0 Flag
  • CAN_FLAG_RQCP1: Request MailBox1 Flag
  • CAN_FLAG_RQCP2: Request MailBox2 Flag
  • CAN_FLAG_FF0: FIFO 0 Full Flag
  • CAN_FLAG_FOV0: FIFO 0 Overrun Flag
  • CAN_FLAG_FF1: FIFO 1 Full Flag
  • CAN_FLAG_FOV1: FIFO 1 Overrun Flag
  • CAN_FLAG_WKU: Wake up Flag
  • CAN_FLAG_SLAK: Sleep acknowledge Flag
  • CAN_FLAG_LEC: Last error code Flag
Return values
None
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_FLAGspecifies the flag to clear. This parameter can be one of the following flags:
  • CAN_FLAG_RQCP0
  • CAN_FLAG_RQCP1
  • CAN_FLAG_RQCP2
  • CAN_FLAG_FF1
  • CAN_FLAG_FOV1
  • CAN_FLAG_FF0
  • CAN_FLAG_FOV0
  • CAN_FLAG_WKU
  • CAN_FLAG_SLAK
  • CAN_FLAG_LEC
Return values
None.

Definition at line 1430 of file stm32f4xx_can.c.

void CAN_ClearITPendingBit ( CAN_TypeDef CANx,
uint32_t  CAN_IT 
)

Clears the CANx's interrupt pending bits.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_ITspecifies the interrupt pending bit to clear. This parameter can be one of the following values:
  • CAN_IT_TME: Transmit mailbox empty Interrupt
  • CAN_IT_FF0: FIFO 0 full Interrupt
  • CAN_IT_FOV0: FIFO 0 overrun Interrupt
  • CAN_IT_FF1: FIFO 1 full Interrupt
  • CAN_IT_FOV1: FIFO 1 overrun Interrupt
  • CAN_IT_WKU: Wake-up Interrupt
  • CAN_IT_SLK: Sleep acknowledge Interrupt
  • CAN_IT_EWG: Error warning Interrupt
  • CAN_IT_EPV: Error passive Interrupt
  • CAN_IT_BOF: Bus-off Interrupt
  • CAN_IT_LEC: Last error code Interrupt
  • CAN_IT_ERR: Error Interrupt
Return values
None
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_ITspecifies the interrupt pending bit to clear.
  • CAN_IT_TME
  • CAN_IT_FF0
  • CAN_IT_FOV0
  • CAN_IT_FF1
  • CAN_IT_FOV1
  • CAN_IT_WKU
  • CAN_IT_SLK
  • CAN_IT_EWG
  • CAN_IT_EPV
  • CAN_IT_BOF
  • CAN_IT_LEC
  • CAN_IT_ERR
Return values
None.

Definition at line 1594 of file stm32f4xx_can.c.

void CAN_DBGFreeze ( CAN_TypeDef CANx,
FunctionalState  NewState 
)

Enables or disables the DBG Freeze for CAN.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
NewStatenew state of the CAN peripheral. This parameter can be: ENABLE (CAN reception/transmission is frozen during debug. Reception FIFOs can still be accessed/controlled normally) or DISABLE (CAN is working during debug).
Return values
None
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
NewStatenew state of the CAN peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None.

Definition at line 493 of file stm32f4xx_can.c.

void CAN_DeInit ( CAN_TypeDef CANx)

Deinitializes the CAN peripheral registers to their default reset values.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
Return values
None.
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
Return values
None.
Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
Return values
None.

Definition at line 167 of file stm32f4xx_can.c.

void CAN_FIFORelease ( CAN_TypeDef CANx,
uint8_t  FIFONumber 
)

Releases the specified receive FIFO.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
FIFONumberFIFO to release, CAN_FIFO0 or CAN_FIFO1.
Return values
None
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
FIFONumberFIFO to release, CAN_FIFO0 or CAN_FIFO1.
Return values
NoneReleases the specified receive FIFO.
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
FIFONumberFIFO to release, CAN_FIFO0 or CAN_FIFO1.
Return values
None.

Definition at line 799 of file stm32f4xx_can.c.

void CAN_FilterInit ( CAN_FilterInitTypeDef CAN_FilterInitStruct)

Configures the CAN reception filter according to the specified parameters in the CAN_FilterInitStruct.

Parameters
CAN_FilterInitStructpointer to a CAN_FilterInitTypeDef structure that contains the configuration information.
Return values
NoneConfigures the CAN reception filter according to the specified parameters in the CAN_FilterInitStruct.
Parameters
CAN_FilterInitStructpointer to a CAN_FilterInitTypeDef structure that contains the configuration information.
Return values
None.

Definition at line 334 of file stm32f4xx_can.c.

FlagStatus CAN_GetFlagStatus ( CAN_TypeDef CANx,
uint32_t  CAN_FLAG 
)

Checks whether the specified CAN flag is set or not.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • CAN_FLAG_RQCP0: Request MailBox0 Flag
  • CAN_FLAG_RQCP1: Request MailBox1 Flag
  • CAN_FLAG_RQCP2: Request MailBox2 Flag
  • CAN_FLAG_FMP0: FIFO 0 Message Pending Flag
  • CAN_FLAG_FF0: FIFO 0 Full Flag
  • CAN_FLAG_FOV0: FIFO 0 Overrun Flag
  • CAN_FLAG_FMP1: FIFO 1 Message Pending Flag
  • CAN_FLAG_FF1: FIFO 1 Full Flag
  • CAN_FLAG_FOV1: FIFO 1 Overrun Flag
  • CAN_FLAG_WKU: Wake up Flag
  • CAN_FLAG_SLAK: Sleep acknowledge Flag
  • CAN_FLAG_EWG: Error Warning Flag
  • CAN_FLAG_EPV: Error Passive Flag
  • CAN_FLAG_BOF: Bus-Off Flag
  • CAN_FLAG_LEC: Last error code Flag
Return values
Thenew state of CAN_FLAG (SET or RESET).
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_FLAGspecifies the flag to check. This parameter can be one of the following flags:
  • CAN_FLAG_EWG
  • CAN_FLAG_EPV
  • CAN_FLAG_BOF
  • CAN_FLAG_RQCP0
  • CAN_FLAG_RQCP1
  • CAN_FLAG_RQCP2
  • CAN_FLAG_FMP1
  • CAN_FLAG_FF1
  • CAN_FLAG_FOV1
  • CAN_FLAG_FMP0
  • CAN_FLAG_FF0
  • CAN_FLAG_FOV0
  • CAN_FLAG_WKU
  • CAN_FLAG_SLAK
  • CAN_FLAG_LEC
Return values
Thenew state of CAN_FLAG (SET or RESET).

Definition at line 1330 of file stm32f4xx_can.c.

ITStatus CAN_GetITStatus ( CAN_TypeDef CANx,
uint32_t  CAN_IT 
)

Checks whether the specified CANx interrupt has occurred or not.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_ITspecifies the CAN interrupt source to check. This parameter can be one of the following values:
  • CAN_IT_TME: Transmit mailbox empty Interrupt
  • CAN_IT_FMP0: FIFO 0 message pending Interrupt
  • CAN_IT_FF0: FIFO 0 full Interrupt
  • CAN_IT_FOV0: FIFO 0 overrun Interrupt
  • CAN_IT_FMP1: FIFO 1 message pending Interrupt
  • CAN_IT_FF1: FIFO 1 full Interrupt
  • CAN_IT_FOV1: FIFO 1 overrun Interrupt
  • CAN_IT_WKU: Wake-up Interrupt
  • CAN_IT_SLK: Sleep acknowledge Interrupt
  • CAN_IT_EWG: Error warning Interrupt
  • CAN_IT_EPV: Error passive Interrupt
  • CAN_IT_BOF: Bus-off Interrupt
  • CAN_IT_LEC: Last error code Interrupt
  • CAN_IT_ERR: Error Interrupt
Return values
Thecurrent state of CAN_IT (SET or RESET).
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_ITspecifies the CAN interrupt source to check. This parameter can be one of the following flags:
  • CAN_IT_TME
  • CAN_IT_FMP0
  • CAN_IT_FF0
  • CAN_IT_FOV0
  • CAN_IT_FMP1
  • CAN_IT_FF1
  • CAN_IT_FOV1
  • CAN_IT_WKU
  • CAN_IT_SLK
  • CAN_IT_EWG
  • CAN_IT_EPV
  • CAN_IT_BOF
  • CAN_IT_LEC
  • CAN_IT_ERR
Return values
Thecurrent state of CAN_IT (SET or RESET).

Definition at line 1490 of file stm32f4xx_can.c.

uint8_t CAN_GetLastErrorCode ( CAN_TypeDef CANx)

Returns the CANx's last error code (LEC).

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
Return values
Errorcode:
  • CAN_ERRORCODE_NoErr: No Error
  • CAN_ERRORCODE_StuffErr: Stuff Error
  • CAN_ERRORCODE_FormErr: Form Error
  • CAN_ERRORCODE_ACKErr : Acknowledgment Error
  • CAN_ERRORCODE_BitRecessiveErr: Bit Recessive Error
  • CAN_ERRORCODE_BitDominantErr: Bit Dominant Error
  • CAN_ERRORCODE_CRCErr: CRC Error
  • CAN_ERRORCODE_SoftwareSetErr: Software Set Error
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
Return values
Errorcode:
  • CAN_ERRORCODE_NoErr: No Error
  • CAN_ERRORCODE_StuffErr: Stuff Error
  • CAN_ERRORCODE_FormErr: Form Error
  • CAN_ERRORCODE_ACKErr : Acknowledgment Error
  • CAN_ERRORCODE_BitRecessiveErr: Bit Recessive Error
  • CAN_ERRORCODE_BitDominantErr: Bit Dominant Error
  • CAN_ERRORCODE_CRCErr: CRC Error
  • CAN_ERRORCODE_SoftwareSetErr: Software Set Error
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
Return values
CAN_ErrorCodespecifies the Error code :
  • CAN_ERRORCODE_NoErr No Error
  • CAN_ERRORCODE_StuffErr Stuff Error
  • CAN_ERRORCODE_FormErr Form Error
  • CAN_ERRORCODE_ACKErr Acknowledgment Error
  • CAN_ERRORCODE_BitRecessiveErr Bit Recessive Error
  • CAN_ERRORCODE_BitDominantErr Bit Dominant Error
  • CAN_ERRORCODE_CRCErr CRC Error
  • CAN_ERRORCODE_SoftwareSetErr Software Set Error

Definition at line 1040 of file stm32f4xx_can.c.

uint8_t CAN_GetLSBTransmitErrorCounter ( CAN_TypeDef CANx)

Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC).

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
Return values
LSBof the 9-bit CAN Transmit Error Counter.

Definition at line 1085 of file stm32f4xx_can.c.

uint8_t CAN_GetReceiveErrorCounter ( CAN_TypeDef CANx)

Returns the CANx Receive Error Counter (REC).

Note
In case of an error during reception, this counter is incremented by 1 or by 8 depending on the error condition as defined by the CAN standard. After every successful reception, the counter is decremented by 1 or reset to 120 if its value was higher than 128. When the counter value exceeds 127, the CAN controller enters the error passive state.
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
Return values
CANReceive Error Counter.

Definition at line 1065 of file stm32f4xx_can.c.

uint8_t CAN_Init ( CAN_TypeDef CANx,
CAN_InitTypeDef CAN_InitStruct 
)

Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
CAN_InitStructpointer to a CAN_InitTypeDef structure that contains the configuration information for the CAN peripheral.
Return values
Constantindicates initialization succeed which will be CAN_InitStatus_Failed or CAN_InitStatus_Success.
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
CAN_InitStructpointer to a CAN_InitTypeDef structure that contains the configuration information for the CAN peripheral.
Return values
Constantindicates initialization succeed which will be CAN_InitStatus_Failed or CAN_InitStatus_Success.
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_InitStructpointer to a CAN_InitTypeDef structure that contains the configuration information for the CAN peripheral.
Return values
Constantindicates initialization succeed which will be CAN_InitStatus_Failed or CAN_InitStatus_Success.

Definition at line 197 of file stm32f4xx_can.c.

void CAN_ITConfig ( CAN_TypeDef CANx,
uint32_t  CAN_IT,
FunctionalState  NewState 
)

Enables or disables the specified CANx interrupts.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_ITspecifies the CAN interrupt sources to be enabled or disabled. This parameter can be:
  • CAN_IT_TME: Transmit mailbox empty Interrupt
  • CAN_IT_FMP0: FIFO 0 message pending Interrupt
  • CAN_IT_FF0: FIFO 0 full Interrupt
  • CAN_IT_FOV0: FIFO 0 overrun Interrupt
  • CAN_IT_FMP1: FIFO 1 message pending Interrupt
  • CAN_IT_FF1: FIFO 1 full Interrupt
  • CAN_IT_FOV1: FIFO 1 overrun Interrupt
  • CAN_IT_WKU: Wake-up Interrupt
  • CAN_IT_SLK: Sleep acknowledge Interrupt
  • CAN_IT_EWG: Error warning Interrupt
  • CAN_IT_EPV: Error passive Interrupt
  • CAN_IT_BOF: Bus-off Interrupt
  • CAN_IT_LEC: Last error code Interrupt
  • CAN_IT_ERR: Error Interrupt
NewStatenew state of the CAN interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
CAN_ITspecifies the CAN interrupt sources to be enabled or disabled. This parameter can be:
  • CAN_IT_TME,
  • CAN_IT_FMP0,
  • CAN_IT_FF0,
  • CAN_IT_FOV0,
  • CAN_IT_FMP1,
  • CAN_IT_FF1,
  • CAN_IT_FOV1,
  • CAN_IT_EWG,
  • CAN_IT_EPV,
  • CAN_IT_LEC,
  • CAN_IT_ERR,
  • CAN_IT_WKU or
  • CAN_IT_SLK.
NewStatenew state of the CAN interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None.

Definition at line 1290 of file stm32f4xx_can.c.

uint8_t CAN_MessagePending ( CAN_TypeDef CANx,
uint8_t  FIFONumber 
)

Returns the number of pending received messages.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
FIFONumberReceive FIFO number, CAN_FIFO0 or CAN_FIFO1.
Return values
NbMessage: which is the number of pending message.
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
FIFONumberReceive FIFO number, CAN_FIFO0 or CAN_FIFO1.
Return values
NbMessage: which is the number of pending message.

Returns the number of pending received messages.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
FIFONumberReceive FIFO number, CAN_FIFO0 or CAN_FIFO1.
Return values
NbMessage: which is the number of pending message.

Definition at line 822 of file stm32f4xx_can.c.

uint8_t CAN_OperatingModeRequest ( CAN_TypeDef CANx,
uint8_t  CAN_OperatingMode 
)

Selects the CAN Operation mode.

Parameters
CAN_OperatingModeCAN Operating Mode. This parameter can be one of CAN_OperatingMode_TypeDef enumeration.
Return values
statusof the requested mode which can be
  • CAN_ModeStatus_Failed: CAN failed entering the specific mode
  • CAN_ModeStatus_Success: CAN Succeed entering the specific mode
Parameters
CAN_OperatingModeCAN Operating Mode. This parameter can be one of CAN_OperatingMode_TypeDef enumeration.
Return values
statusof the requested mode which can be:
  • CAN_ModeStatus_Failed: CAN failed entering the specific mode
  • CAN_ModeStatus_Success: CAN Succeed entering the specific mode

Selects the CAN Operation mode.

Parameters
CAN_OperatingMode: CAN Operating Mode. This parameter can be one of CAN_OperatingMode_TypeDef enumeration.
Return values
statusof the requested mode which can be
  • CAN_ModeStatus_Failed CAN failed entering the specific mode
  • CAN_ModeStatus_Success CAN Succeed entering the specific mode

Definition at line 872 of file stm32f4xx_can.c.

void CAN_Receive ( CAN_TypeDef CANx,
uint8_t  FIFONumber,
CanRxMsg RxMessage 
)

Receives a correct CAN frame.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
FIFONumberReceive FIFO number, CAN_FIFO0 or CAN_FIFO1.
RxMessagepointer to a structure receive frame which contains CAN Id, CAN DLC, CAN data and FMI number.
Return values
None
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
FIFONumberReceive FIFO number, CAN_FIFO0 or CAN_FIFO1.
RxMessagepointer to a structure receive frame which contains CAN Id, CAN DLC, CAN data and FMI number.
Return values
NoneReceives a correct CAN frame.
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
FIFONumberReceive FIFO number, CAN_FIFO0 or CAN_FIFO1.
RxMessagepointer to a structure receive message which contains CAN Id, CAN DLC, CAN datas and FMI number.
Return values
None.

Definition at line 750 of file stm32f4xx_can.c.

void CAN_SlaveStartBank ( uint8_t  CAN_BankNumber)

Select the start bank filter for slave CAN.

Parameters
CAN_BankNumberSelect the start slave bank filter from 1..27.
Return values
None
Note
This function applies only to STM32 Connectivity line devices.
Parameters
CAN_BankNumberSelect the start slave bank filter from 1..27.
Return values
None.

Definition at line 468 of file stm32f4xx_can.c.

uint8_t CAN_Sleep ( CAN_TypeDef CANx)

Enters the Sleep (low power) mode.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
Return values
CAN_Sleep_Okif sleep entered, CAN_Sleep_Failed otherwise.
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
Return values
CAN_Sleep_Okif sleep entered, CAN_Sleep_Failed otherwise.

Enters the Sleep (low power) mode.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
Return values
statusCAN_Sleep_Ok if sleep entered, CAN_Sleep_Failed in an other case.

Definition at line 953 of file stm32f4xx_can.c.

void CAN_StructInit ( CAN_InitTypeDef CAN_InitStruct)

Fills each CAN_InitStruct member with its default value.

Parameters
CAN_InitStructpointer to a CAN_InitTypeDef structure which ill be initialized.
Return values
None
Parameters
CAN_InitStructpointer to a CAN_InitTypeDef structure which will be initialized.
Return values
None.

Definition at line 425 of file stm32f4xx_can.c.

uint8_t CAN_Transmit ( CAN_TypeDef CANx,
CanTxMsg TxMessage 
)

Initiates and transmits a CAN frame message.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
TxMessagepointer to a structure which contains CAN Id, CAN DLC and CAN data.
Return values
Thenumber of the mailbox that is used for transmission or CAN_TxStatus_NoMailBox if there is no empty mailbox.

Initiates and transmits a CAN frame message.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
TxMessagepointer to a structure which contains CAN Id, CAN DLC and CAN data.
Return values
Thenumber of the mailbox that is used for transmission or CAN_TxStatus_NoMailBox if there is no empty mailbox.

Definition at line 577 of file stm32f4xx_can.c.

uint8_t CAN_TransmitStatus ( CAN_TypeDef CANx,
uint8_t  TransmitMailbox 
)

Checks the transmission status of a CAN Frame.

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
TransmitMailboxthe number of the mailbox that is used for transmission.
Return values
CAN_TxStatus_Okif the CAN driver transmits the message, CAN_TxStatus_Failed in an other case.
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
TransmitMailboxthe number of the mailbox that is used for transmission.
Return values
CAN_TxStatus_Okif the CAN driver transmits the message, CAN_TxStatus_Failed in an other case.

Checks the transmission status of a CAN Frame.

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
TransmitMailboxthe number of the mailbox that is used for transmission.
Return values
CAN_TxStatus_Okif the CAN driver transmits the message, CAN_TxStatus_Failed in an other case.

Definition at line 649 of file stm32f4xx_can.c.

void CAN_TTComModeCmd ( CAN_TypeDef CANx,
FunctionalState  NewState 
)

Enables or disables the CAN Time TriggerOperation communication mode.

Note
DLC must be programmed as 8 in order Time Stamp (2 bytes) to be sent over the CAN bus.
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
NewStateMode new state. This parameter can be: ENABLE or DISABLE. When enabled, Time stamp (TIME[15:0]) value is sent in the last two data bytes of the 8-byte message: TIME[7:0] in data byte 6 and TIME[15:8] in data byte 7.
Return values
NoneEnables or disables the CAN Time TriggerOperation communication mode.
Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
NewState: Mode new state , can be one of FunctionalState.
Note
when enabled, Time stamp (TIME[15:0]) value is sent in the last two data bytes of the 8-byte message: TIME[7:0] in data byte 6 and TIME[15:8] in data byte 7
DLC must be programmed as 8 in order Time Stamp (2 bytes) to be sent over the CAN bus.
Return values
None

Definition at line 523 of file stm32f4xx_can.c.

uint8_t CAN_WakeUp ( CAN_TypeDef CANx)

Wakes up the CAN peripheral from sleep mode .

Parameters
CANxwhere x can be 1 or 2 to select the CAN peripheral.
Return values
CAN_WakeUp_Okif sleep mode left, CAN_WakeUp_Failed otherwise.
Parameters
CANxwhere x can be 1 to select the CAN1 peripheral.
Return values
CAN_WakeUp_Okif sleep mode left, CAN_WakeUp_Failed otherwise.

Wakes up the CAN peripheral from sleep mode .

Parameters
CANxwhere x can be 1 or 2 to to select the CAN peripheral.
Return values
statusCAN_WakeUp_Ok if sleep mode left, CAN_WakeUp_Failed in an other case.

Definition at line 978 of file stm32f4xx_can.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:56