STM32H735xx HAL User Manual
Functions
Control functions
FDCAN Exported Functions

Control functions. More...

Functions

HAL_StatusTypeDef HAL_FDCAN_Start (FDCAN_HandleTypeDef *hfdcan)
 Start the FDCAN module.
HAL_StatusTypeDef HAL_FDCAN_Stop (FDCAN_HandleTypeDef *hfdcan)
 Stop the FDCAN module and enable access to configuration registers.
HAL_StatusTypeDef HAL_FDCAN_AddMessageToTxFifoQ (FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTypeDef *pTxHeader, uint8_t *pTxData)
 Add a message to the Tx FIFO/Queue and activate the corresponding transmission request.
HAL_StatusTypeDef HAL_FDCAN_AddMessageToTxBuffer (FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTypeDef *pTxHeader, uint8_t *pTxData, uint32_t BufferIndex)
 Add a message to a dedicated Tx buffer.
HAL_StatusTypeDef HAL_FDCAN_EnableTxBufferRequest (FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndex)
 Enable transmission request.
uint32_t HAL_FDCAN_GetLatestTxFifoQRequestBuffer (FDCAN_HandleTypeDef *hfdcan)
 Get Tx buffer index of latest Tx FIFO/Queue request.
HAL_StatusTypeDef HAL_FDCAN_AbortTxRequest (FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndex)
 Abort transmission request.
HAL_StatusTypeDef HAL_FDCAN_GetRxMessage (FDCAN_HandleTypeDef *hfdcan, uint32_t RxLocation, FDCAN_RxHeaderTypeDef *pRxHeader, uint8_t *pRxData)
 Get an FDCAN frame from the Rx Buffer/FIFO zone into the message RAM.
HAL_StatusTypeDef HAL_FDCAN_GetTxEvent (FDCAN_HandleTypeDef *hfdcan, FDCAN_TxEventFifoTypeDef *pTxEvent)
 Get an FDCAN Tx event from the Tx Event FIFO zone into the message RAM.
HAL_StatusTypeDef HAL_FDCAN_GetHighPriorityMessageStatus (FDCAN_HandleTypeDef *hfdcan, FDCAN_HpMsgStatusTypeDef *HpMsgStatus)
 Get high priority message status.
HAL_StatusTypeDef HAL_FDCAN_GetProtocolStatus (FDCAN_HandleTypeDef *hfdcan, FDCAN_ProtocolStatusTypeDef *ProtocolStatus)
 Get protocol status.
HAL_StatusTypeDef HAL_FDCAN_GetErrorCounters (FDCAN_HandleTypeDef *hfdcan, FDCAN_ErrorCountersTypeDef *ErrorCounters)
 Get error counter values.
uint32_t HAL_FDCAN_IsRxBufferMessageAvailable (FDCAN_HandleTypeDef *hfdcan, uint32_t RxBufferIndex)
 Check if a new message is received in the selected Rx buffer.
uint32_t HAL_FDCAN_IsTxBufferMessagePending (FDCAN_HandleTypeDef *hfdcan, uint32_t TxBufferIndex)
 Check if a transmission request is pending on the selected Tx buffer.
uint32_t HAL_FDCAN_GetRxFifoFillLevel (FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo)
 Return Rx FIFO fill level.
uint32_t HAL_FDCAN_GetTxFifoFreeLevel (FDCAN_HandleTypeDef *hfdcan)
 Return Tx FIFO free level: number of consecutive free Tx FIFO elements starting from Tx FIFO GetIndex.
uint32_t HAL_FDCAN_IsRestrictedOperationMode (FDCAN_HandleTypeDef *hfdcan)
 Check if the FDCAN peripheral entered Restricted Operation Mode.
HAL_StatusTypeDef HAL_FDCAN_ExitRestrictedOperationMode (FDCAN_HandleTypeDef *hfdcan)
 Exit Restricted Operation Mode.

Detailed Description

Control functions.

  ==============================================================================
                          ##### Control functions #####
  ==============================================================================
    [..]  This section provides functions allowing to:
      (+) HAL_FDCAN_Start                         : Start the FDCAN module
      (+) HAL_FDCAN_Stop                          : Stop the FDCAN module and enable access to configuration registers
      (+) HAL_FDCAN_AddMessageToTxFifoQ           : Add a message to the Tx FIFO/Queue and activate the corresponding transmission request
      (+) HAL_FDCAN_AddMessageToTxBuffer          : Add a message to a dedicated Tx buffer
      (+) HAL_FDCAN_EnableTxBufferRequest         : Enable transmission request
      (+) HAL_FDCAN_GetLatestTxFifoQRequestBuffer : Get Tx buffer index of latest Tx FIFO/Queue request
      (+) HAL_FDCAN_AbortTxRequest                : Abort transmission request
      (+) HAL_FDCAN_GetRxMessage                  : Get an FDCAN frame from the Rx Buffer/FIFO zone into the message RAM
      (+) HAL_FDCAN_GetTxEvent                    : Get an FDCAN Tx event from the Tx Event FIFO zone into the message RAM
      (+) HAL_FDCAN_GetHighPriorityMessageStatus  : Get high priority message status
      (+) HAL_FDCAN_GetProtocolStatus             : Get protocol status
      (+) HAL_FDCAN_GetErrorCounters              : Get error counter values
      (+) HAL_FDCAN_IsRxBufferMessageAvailable    : Check if a new message is received in the selected Rx buffer
      (+) HAL_FDCAN_IsTxBufferMessagePending      : Check if a transmission request is pending on the selected Tx buffer
      (+) HAL_FDCAN_GetRxFifoFillLevel            : Return Rx FIFO fill level
      (+) HAL_FDCAN_GetTxFifoFreeLevel            : Return Tx FIFO free level
      (+) HAL_FDCAN_IsRestrictedOperationMode     : Check if the FDCAN peripheral entered Restricted Operation Mode
      (+) HAL_FDCAN_ExitRestrictedOperationMode   : Exit Restricted Operation Mode


Function Documentation

HAL_StatusTypeDef HAL_FDCAN_AbortTxRequest ( FDCAN_HandleTypeDef hfdcan,
uint32_t  BufferIndex 
)

Abort transmission request.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
BufferIndexbuffer index. This parameter can be any combination of
  • FDCAN_Tx_location.
Return values:
HALstatus

Definition at line 2879 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::ErrorCode, HAL_FDCAN_ERROR_NOT_STARTED, HAL_FDCAN_STATE_BUSY, __FDCAN_HandleTypeDef::Instance, and __FDCAN_HandleTypeDef::State.

HAL_StatusTypeDef HAL_FDCAN_AddMessageToTxBuffer ( FDCAN_HandleTypeDef hfdcan,
FDCAN_TxHeaderTypeDef pTxHeader,
uint8_t *  pTxData,
uint32_t  BufferIndex 
)
HAL_StatusTypeDef HAL_FDCAN_AddMessageToTxFifoQ ( FDCAN_HandleTypeDef hfdcan,
FDCAN_TxHeaderTypeDef pTxHeader,
uint8_t *  pTxData 
)
HAL_StatusTypeDef HAL_FDCAN_EnableTxBufferRequest ( FDCAN_HandleTypeDef hfdcan,
uint32_t  BufferIndex 
)

Enable transmission request.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
BufferIndexbuffer index. This parameter can be any combination of
  • FDCAN_Tx_location.
Return values:
HALstatus

Definition at line 2838 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::ErrorCode, HAL_FDCAN_ERROR_NOT_STARTED, HAL_FDCAN_STATE_BUSY, __FDCAN_HandleTypeDef::Instance, and __FDCAN_HandleTypeDef::State.

Exit Restricted Operation Mode.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
Return values:
HALstatus

Definition at line 3392 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::ErrorCode, HAL_FDCAN_ERROR_NOT_INITIALIZED, HAL_FDCAN_STATE_BUSY, HAL_FDCAN_STATE_READY, __FDCAN_HandleTypeDef::Instance, and __FDCAN_HandleTypeDef::State.

HAL_StatusTypeDef HAL_FDCAN_GetErrorCounters ( FDCAN_HandleTypeDef hfdcan,
FDCAN_ErrorCountersTypeDef ErrorCounters 
)

Get error counter values.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
ErrorCounterspointer to an FDCAN_ErrorCountersTypeDef structure.
Return values:
HALstatus

Definition at line 3247 of file stm32h7xx_hal_fdcan.c.

References FDCAN_ErrorCountersTypeDef::ErrorLogging, __FDCAN_HandleTypeDef::Instance, FDCAN_ErrorCountersTypeDef::RxErrorCnt, FDCAN_ErrorCountersTypeDef::RxErrorPassive, and FDCAN_ErrorCountersTypeDef::TxErrorCnt.

HAL_StatusTypeDef HAL_FDCAN_GetHighPriorityMessageStatus ( FDCAN_HandleTypeDef hfdcan,
FDCAN_HpMsgStatusTypeDef HpMsgStatus 
)

Get high priority message status.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
HpMsgStatuspointer to an FDCAN_HpMsgStatusTypeDef structure.
Return values:
HALstatus

Definition at line 3198 of file stm32h7xx_hal_fdcan.c.

References FDCAN_HpMsgStatusTypeDef::FilterIndex, FDCAN_HpMsgStatusTypeDef::FilterList, __FDCAN_HandleTypeDef::Instance, FDCAN_HpMsgStatusTypeDef::MessageIndex, and FDCAN_HpMsgStatusTypeDef::MessageStorage.

Get Tx buffer index of latest Tx FIFO/Queue request.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
Return values:
Txbuffer index of last Tx FIFO/Queue request
  • Any value of
    • FDCAN_Tx_location if Tx request has been submitted.
  • 0 if no Tx FIFO/Queue request have been submitted.

Definition at line 2865 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::LatestTxFifoQRequest.

HAL_StatusTypeDef HAL_FDCAN_GetProtocolStatus ( FDCAN_HandleTypeDef hfdcan,
FDCAN_ProtocolStatusTypeDef ProtocolStatus 
)
uint32_t HAL_FDCAN_GetRxFifoFillLevel ( FDCAN_HandleTypeDef hfdcan,
uint32_t  RxFifo 
)

Return Rx FIFO fill level.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
RxFifoRx FIFO. This parameter can be one of the following values:
  • FDCAN_RX_FIFO0: Rx FIFO 0
  • FDCAN_RX_FIFO1: Rx FIFO 1
Return values:
LevelRx FIFO fill level.

Definition at line 3331 of file stm32h7xx_hal_fdcan.c.

References assert_param, FDCAN_RX_FIFO0, __FDCAN_HandleTypeDef::Instance, and IS_FDCAN_RX_FIFO.

HAL_StatusTypeDef HAL_FDCAN_GetRxMessage ( FDCAN_HandleTypeDef hfdcan,
uint32_t  RxLocation,
FDCAN_RxHeaderTypeDef pRxHeader,
uint8_t *  pRxData 
)

Get an FDCAN frame from the Rx Buffer/FIFO zone into the message RAM.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
RxLocationLocation of the received message to be read. This parameter can be a value of
  • FDCAN_Rx_location.
pRxHeaderpointer to a FDCAN_RxHeaderTypeDef structure.
pRxDatapointer to a buffer where the payload of the Rx frame will be stored.
Return values:
HALstatus

Definition at line 2908 of file stm32h7xx_hal_fdcan.c.

References FDCAN_RxHeaderTypeDef::BitRateSwitch, FDCAN_RxHeaderTypeDef::DataLength, DLCtoBytes, __FDCAN_HandleTypeDef::ErrorCode, FDCAN_RxHeaderTypeDef::ErrorStateIndicator, FDCAN_ELEMENT_MASK_ANMF, FDCAN_ELEMENT_MASK_BRS, FDCAN_ELEMENT_MASK_DLC, FDCAN_ELEMENT_MASK_ESI, FDCAN_ELEMENT_MASK_EXTID, FDCAN_ELEMENT_MASK_FDF, FDCAN_ELEMENT_MASK_FIDX, FDCAN_ELEMENT_MASK_RTR, FDCAN_ELEMENT_MASK_STDID, FDCAN_ELEMENT_MASK_TS, FDCAN_ELEMENT_MASK_XTD, FDCAN_RX_BUFFER32, FDCAN_RX_FIFO0, FDCAN_RX_FIFO1, FDCAN_RX_FIFO_OVERWRITE, FDCAN_STANDARD_ID, FDCAN_RxHeaderTypeDef::FDFormat, FDCAN_RxHeaderTypeDef::FilterIndex, HAL_FDCAN_ERROR_FIFO_EMPTY, HAL_FDCAN_ERROR_NOT_STARTED, HAL_FDCAN_ERROR_PARAM, HAL_FDCAN_STATE_BUSY, FDCAN_RxHeaderTypeDef::Identifier, FDCAN_RxHeaderTypeDef::IdType, __FDCAN_HandleTypeDef::Init, __FDCAN_HandleTypeDef::Instance, FDCAN_RxHeaderTypeDef::IsFilterMatchingFrame, __FDCAN_HandleTypeDef::msgRam, FDCAN_MsgRamAddressTypeDef::RxBufferSA, FDCAN_InitTypeDef::RxBufferSize, FDCAN_InitTypeDef::RxBuffersNbr, FDCAN_InitTypeDef::RxFifo0ElmtSize, FDCAN_MsgRamAddressTypeDef::RxFIFO0SA, FDCAN_InitTypeDef::RxFifo1ElmtSize, FDCAN_MsgRamAddressTypeDef::RxFIFO1SA, FDCAN_RxHeaderTypeDef::RxFrameType, FDCAN_RxHeaderTypeDef::RxTimestamp, and __FDCAN_HandleTypeDef::State.

HAL_StatusTypeDef HAL_FDCAN_GetTxEvent ( FDCAN_HandleTypeDef hfdcan,
FDCAN_TxEventFifoTypeDef pTxEvent 
)

Return Tx FIFO free level: number of consecutive free Tx FIFO elements starting from Tx FIFO GetIndex.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
Return values:
LevelTx FIFO free level.

Definition at line 3358 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::Instance.

Check if the FDCAN peripheral entered Restricted Operation Mode.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
Return values:
Status
  • 0 : Normal FDCAN operation.
  • 1 : Restricted Operation Mode active.

Definition at line 3376 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::Instance.

uint32_t HAL_FDCAN_IsRxBufferMessageAvailable ( FDCAN_HandleTypeDef hfdcan,
uint32_t  RxBufferIndex 
)

Check if a new message is received in the selected Rx buffer.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
RxBufferIndexRx buffer index. This parameter must be a number between 0 and 63.
Return values:
Status
  • 0 : No new message on RxBufferIndex.
  • 1 : New message received on RxBufferIndex.

Definition at line 3274 of file stm32h7xx_hal_fdcan.c.

References assert_param, __FDCAN_HandleTypeDef::Instance, and IS_FDCAN_MAX_VALUE.

uint32_t HAL_FDCAN_IsTxBufferMessagePending ( FDCAN_HandleTypeDef hfdcan,
uint32_t  TxBufferIndex 
)

Check if a transmission request is pending on the selected Tx buffer.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
TxBufferIndexTx buffer index. This parameter can be any combination of
  • FDCAN_Tx_location.
Return values:
Status
  • 0 : No pending transmission request on TxBufferIndex.
  • 1 : Pending transmission request on TxBufferIndex.

Definition at line 3311 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_FDCAN_Start ( FDCAN_HandleTypeDef hfdcan)

Start the FDCAN module.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
Return values:
HALstatus

Definition at line 2579 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::ErrorCode, HAL_FDCAN_ERROR_NONE, HAL_FDCAN_ERROR_NOT_READY, HAL_FDCAN_STATE_BUSY, HAL_FDCAN_STATE_READY, __FDCAN_HandleTypeDef::Instance, and __FDCAN_HandleTypeDef::State.

HAL_StatusTypeDef HAL_FDCAN_Stop ( FDCAN_HandleTypeDef hfdcan)

Stop the FDCAN module and enable access to configuration registers.

Parameters:
hfdcanpointer to an FDCAN_HandleTypeDef structure that contains the configuration information for the specified FDCAN.
Return values:
HALstatus

Definition at line 2610 of file stm32h7xx_hal_fdcan.c.

References __FDCAN_HandleTypeDef::ErrorCode, FDCAN_TIMEOUT_COUNT, HAL_FDCAN_ERROR_NOT_STARTED, HAL_FDCAN_ERROR_TIMEOUT, HAL_FDCAN_STATE_BUSY, HAL_FDCAN_STATE_ERROR, HAL_FDCAN_STATE_READY, __FDCAN_HandleTypeDef::Instance, __FDCAN_HandleTypeDef::LatestTxFifoQRequest, and __FDCAN_HandleTypeDef::State.

Referenced by HAL_FDCAN_DeInit().