STM32H735xx HAL User Manual
Defines | Functions | Variables
stm32h7xx_hal_fdcan.c File Reference

FDCAN HAL module driver. This file provides firmware functions to manage the following functionalities of the Flexible DataRate Controller Area Network (FDCAN) peripheral: + Initialization and de-initialization functions + IO operation functions + Peripheral Configuration and Control functions + Peripheral State and Error functions. More...

#include "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define FDCAN_TIMEOUT_VALUE   10U
#define FDCAN_TIMEOUT_COUNT   50U
#define FDCAN_TX_EVENT_FIFO_MASK   (FDCAN_IR_TEFL | FDCAN_IR_TEFF | FDCAN_IR_TEFW | FDCAN_IR_TEFN)
#define FDCAN_RX_FIFO0_MASK   (FDCAN_IR_RF0L | FDCAN_IR_RF0F | FDCAN_IR_RF0W | FDCAN_IR_RF0N)
#define FDCAN_RX_FIFO1_MASK   (FDCAN_IR_RF1L | FDCAN_IR_RF1F | FDCAN_IR_RF1W | FDCAN_IR_RF1N)
#define FDCAN_ERROR_MASK   (FDCAN_IR_ELO | FDCAN_IR_WDI | FDCAN_IR_PEA | FDCAN_IR_PED | FDCAN_IR_ARA)
#define FDCAN_ERROR_STATUS_MASK   (FDCAN_IR_EP | FDCAN_IR_EW | FDCAN_IR_BO)
#define FDCAN_TT_SCHEDULE_SYNC_MASK   (FDCAN_TTIR_SBC | FDCAN_TTIR_SMC | FDCAN_TTIR_CSM | FDCAN_TTIR_SOG)
#define FDCAN_TT_TIME_MARK_MASK   (FDCAN_TTIR_RTMI | FDCAN_TTIR_TTMI)
#define FDCAN_TT_GLOBAL_TIME_MASK   (FDCAN_TTIR_GTW | FDCAN_TTIR_GTD)
#define FDCAN_TT_DISTURBING_ERROR_MASK
#define FDCAN_TT_FATAL_ERROR_MASK   (FDCAN_TTIR_IWT | FDCAN_TTIR_WT | FDCAN_TTIR_AW | FDCAN_TTIR_CER)
#define FDCAN_ELEMENT_MASK_STDID   ((uint32_t)0x1FFC0000U) /* Standard Identifier */
#define FDCAN_ELEMENT_MASK_EXTID   ((uint32_t)0x1FFFFFFFU) /* Extended Identifier */
#define FDCAN_ELEMENT_MASK_RTR   ((uint32_t)0x20000000U) /* Remote Transmission Request */
#define FDCAN_ELEMENT_MASK_XTD   ((uint32_t)0x40000000U) /* Extended Identifier */
#define FDCAN_ELEMENT_MASK_ESI   ((uint32_t)0x80000000U) /* Error State Indicator */
#define FDCAN_ELEMENT_MASK_TS   ((uint32_t)0x0000FFFFU) /* Timestamp */
#define FDCAN_ELEMENT_MASK_DLC   ((uint32_t)0x000F0000U) /* Data Length Code */
#define FDCAN_ELEMENT_MASK_BRS   ((uint32_t)0x00100000U) /* Bit Rate Switch */
#define FDCAN_ELEMENT_MASK_FDF   ((uint32_t)0x00200000U) /* FD Format */
#define FDCAN_ELEMENT_MASK_EFC   ((uint32_t)0x00800000U) /* Event FIFO Control */
#define FDCAN_ELEMENT_MASK_MM   ((uint32_t)0xFF000000U) /* Message Marker */
#define FDCAN_ELEMENT_MASK_FIDX   ((uint32_t)0x7F000000U) /* Filter Index */
#define FDCAN_ELEMENT_MASK_ANMF   ((uint32_t)0x80000000U) /* Accepted Non-matching Frame */
#define FDCAN_ELEMENT_MASK_ET   ((uint32_t)0x00C00000U) /* Event type */
#define FDCAN_MESSAGE_RAM_SIZE   0x2800U
#define FDCAN_MESSAGE_RAM_END_ADDRESS   (SRAMCAN_BASE + FDCAN_MESSAGE_RAM_SIZE - 0x4U) /* The Message RAM has a width of 4 Bytes */

Functions

static HAL_StatusTypeDef FDCAN_CalcultateRamBlockAddresses (FDCAN_HandleTypeDef *hfdcan)
 Calculate each RAM block start address and size.
static void FDCAN_CopyMessageToRAM (FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTypeDef *pTxHeader, uint8_t *pTxData, uint32_t BufferIndex)
 Copy Tx message to the message RAM.
HAL_StatusTypeDef HAL_FDCAN_Init (FDCAN_HandleTypeDef *hfdcan)
 Initializes the FDCAN peripheral according to the specified parameters in the FDCAN_InitTypeDef structure.
HAL_StatusTypeDef HAL_FDCAN_DeInit (FDCAN_HandleTypeDef *hfdcan)
 Deinitializes the FDCAN peripheral registers to their default reset values.
__weak void HAL_FDCAN_MspInit (FDCAN_HandleTypeDef *hfdcan)
 Initializes the FDCAN MSP.
__weak void HAL_FDCAN_MspDeInit (FDCAN_HandleTypeDef *hfdcan)
 DeInitializes the FDCAN MSP.
HAL_StatusTypeDef HAL_FDCAN_EnterPowerDownMode (FDCAN_HandleTypeDef *hfdcan)
 Enter FDCAN peripheral in sleep mode.
HAL_StatusTypeDef HAL_FDCAN_ExitPowerDownMode (FDCAN_HandleTypeDef *hfdcan)
 Exit power down mode.
HAL_StatusTypeDef HAL_FDCAN_RegisterCallback (FDCAN_HandleTypeDef *hfdcan, HAL_FDCAN_CallbackIDTypeDef CallbackID, void(*pCallback)(FDCAN_HandleTypeDef *_hFDCAN))
 Register a FDCAN CallBack.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterCallback (FDCAN_HandleTypeDef *hfdcan, HAL_FDCAN_CallbackIDTypeDef CallbackID)
 Unregister a FDCAN CallBack.
HAL_StatusTypeDef HAL_FDCAN_RegisterClockCalibrationCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_ClockCalibrationCallbackTypeDef pCallback)
 Register Clock Calibration FDCAN Callback To be used instead of the weak HAL_FDCAN_ClockCalibrationCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterClockCalibrationCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Clock Calibration FDCAN Callback Clock Calibration FDCAN Callback is redirected to the weak HAL_FDCAN_ClockCalibrationCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTxEventFifoCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TxEventFifoCallbackTypeDef pCallback)
 Register Tx Event Fifo FDCAN Callback To be used instead of the weak HAL_FDCAN_TxEventFifoCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTxEventFifoCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Tx Event Fifo FDCAN Callback Tx Event Fifo FDCAN Callback is redirected to the weak HAL_FDCAN_TxEventFifoCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterRxFifo0Callback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_RxFifo0CallbackTypeDef pCallback)
 Register Rx Fifo 0 FDCAN Callback To be used instead of the weak HAL_FDCAN_RxFifo0Callback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterRxFifo0Callback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Rx Fifo 0 FDCAN Callback Rx Fifo 0 FDCAN Callback is redirected to the weak HAL_FDCAN_RxFifo0Callback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterRxFifo1Callback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_RxFifo1CallbackTypeDef pCallback)
 Register Rx Fifo 1 FDCAN Callback To be used instead of the weak HAL_FDCAN_RxFifo1Callback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterRxFifo1Callback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Rx Fifo 1 FDCAN Callback Rx Fifo 1 FDCAN Callback is redirected to the weak HAL_FDCAN_RxFifo1Callback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTxBufferCompleteCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TxBufferCompleteCallbackTypeDef pCallback)
 Register Tx Buffer Complete FDCAN Callback To be used instead of the weak HAL_FDCAN_TxBufferCompleteCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTxBufferCompleteCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Tx Buffer Complete FDCAN Callback Tx Buffer Complete FDCAN Callback is redirected to the weak HAL_FDCAN_TxBufferCompleteCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTxBufferAbortCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TxBufferAbortCallbackTypeDef pCallback)
 Register Tx Buffer Abort FDCAN Callback To be used instead of the weak HAL_FDCAN_TxBufferAbortCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTxBufferAbortCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Tx Buffer Abort FDCAN Callback Tx Buffer Abort FDCAN Callback is redirected to the weak HAL_FDCAN_TxBufferAbortCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterErrorStatusCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_ErrorStatusCallbackTypeDef pCallback)
 Register Error Status FDCAN Callback To be used instead of the weak HAL_FDCAN_ErrorStatusCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterErrorStatusCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the Error Status FDCAN Callback Error Status FDCAN Callback is redirected to the weak HAL_FDCAN_ErrorStatusCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTTScheduleSyncCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TT_ScheduleSyncCallbackTypeDef pCallback)
 Register TT Schedule Synchronization FDCAN Callback To be used instead of the weak HAL_FDCAN_TT_ScheduleSyncCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTTScheduleSyncCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the TT Schedule Synchronization FDCAN Callback TT Schedule Synchronization Callback is redirected to the weak HAL_FDCAN_TT_ScheduleSyncCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTTTimeMarkCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TT_TimeMarkCallbackTypeDef pCallback)
 Register TT Time Mark FDCAN Callback To be used instead of the weak HAL_FDCAN_TT_TimeMarkCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTTTimeMarkCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the TT Time Mark FDCAN Callback TT Time Mark Callback is redirected to the weak HAL_FDCAN_TT_TimeMarkCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTTStopWatchCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TT_StopWatchCallbackTypeDef pCallback)
 Register TT Stop Watch FDCAN Callback To be used instead of the weak HAL_FDCAN_TT_StopWatchCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTTStopWatchCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the TT Stop Watch FDCAN Callback TT Stop Watch Callback is redirected to the weak HAL_FDCAN_TT_StopWatchCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_RegisterTTGlobalTimeCallback (FDCAN_HandleTypeDef *hfdcan, pFDCAN_TT_GlobalTimeCallbackTypeDef pCallback)
 Register TT Global Time FDCAN Callback To be used instead of the weak HAL_FDCAN_TT_GlobalTimeCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_UnRegisterTTGlobalTimeCallback (FDCAN_HandleTypeDef *hfdcan)
 UnRegister the TT Global Time FDCAN Callback TT Global Time Callback is redirected to the weak HAL_FDCAN_TT_GlobalTimeCallback() predefined callback.
HAL_StatusTypeDef HAL_FDCAN_ConfigClockCalibration (FDCAN_HandleTypeDef *hfdcan, FDCAN_ClkCalUnitTypeDef *sCcuConfig)
 Configure the FDCAN clock calibration unit according to the specified parameters in the FDCAN_ClkCalUnitTypeDef structure.
uint32_t HAL_FDCAN_GetClockCalibrationState (FDCAN_HandleTypeDef *hfdcan)
 Get the clock calibration state.
HAL_StatusTypeDef HAL_FDCAN_ResetClockCalibrationState (FDCAN_HandleTypeDef *hfdcan)
 Reset the clock calibration state.
uint32_t HAL_FDCAN_GetClockCalibrationCounter (FDCAN_HandleTypeDef *hfdcan, uint32_t Counter)
 Get the clock calibration counter value.
HAL_StatusTypeDef HAL_FDCAN_ConfigFilter (FDCAN_HandleTypeDef *hfdcan, FDCAN_FilterTypeDef *sFilterConfig)
 Configure the FDCAN reception filter according to the specified parameters in the FDCAN_FilterTypeDef structure.
HAL_StatusTypeDef HAL_FDCAN_ConfigGlobalFilter (FDCAN_HandleTypeDef *hfdcan, uint32_t NonMatchingStd, uint32_t NonMatchingExt, uint32_t RejectRemoteStd, uint32_t RejectRemoteExt)
 Configure the FDCAN global filter.
HAL_StatusTypeDef HAL_FDCAN_ConfigExtendedIdMask (FDCAN_HandleTypeDef *hfdcan, uint32_t Mask)
 Configure the extended ID mask.
HAL_StatusTypeDef HAL_FDCAN_ConfigRxFifoOverwrite (FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo, uint32_t OperationMode)
 Configure the Rx FIFO operation mode.
HAL_StatusTypeDef HAL_FDCAN_ConfigFifoWatermark (FDCAN_HandleTypeDef *hfdcan, uint32_t FIFO, uint32_t Watermark)
 Configure the FIFO watermark.
HAL_StatusTypeDef HAL_FDCAN_ConfigRamWatchdog (FDCAN_HandleTypeDef *hfdcan, uint32_t CounterStartValue)
 Configure the RAM watchdog.
HAL_StatusTypeDef HAL_FDCAN_ConfigTimestampCounter (FDCAN_HandleTypeDef *hfdcan, uint32_t TimestampPrescaler)
 Configure the timestamp counter.
HAL_StatusTypeDef HAL_FDCAN_EnableTimestampCounter (FDCAN_HandleTypeDef *hfdcan, uint32_t TimestampOperation)
 Enable the timestamp counter.
HAL_StatusTypeDef HAL_FDCAN_DisableTimestampCounter (FDCAN_HandleTypeDef *hfdcan)
 Disable the timestamp counter.
uint16_t HAL_FDCAN_GetTimestampCounter (FDCAN_HandleTypeDef *hfdcan)
 Get the timestamp counter value.
HAL_StatusTypeDef HAL_FDCAN_ResetTimestampCounter (FDCAN_HandleTypeDef *hfdcan)
 Reset the timestamp counter to zero.
HAL_StatusTypeDef HAL_FDCAN_ConfigTimeoutCounter (FDCAN_HandleTypeDef *hfdcan, uint32_t TimeoutOperation, uint32_t TimeoutPeriod)
 Configure the timeout counter.
HAL_StatusTypeDef HAL_FDCAN_EnableTimeoutCounter (FDCAN_HandleTypeDef *hfdcan)
 Enable the timeout counter.
HAL_StatusTypeDef HAL_FDCAN_DisableTimeoutCounter (FDCAN_HandleTypeDef *hfdcan)
 Disable the timeout counter.
uint16_t HAL_FDCAN_GetTimeoutCounter (FDCAN_HandleTypeDef *hfdcan)
 Get the timeout counter value.
HAL_StatusTypeDef HAL_FDCAN_ResetTimeoutCounter (FDCAN_HandleTypeDef *hfdcan)
 Reset the timeout counter to its start value.
HAL_StatusTypeDef HAL_FDCAN_ConfigTxDelayCompensation (FDCAN_HandleTypeDef *hfdcan, uint32_t TdcOffset, uint32_t TdcFilter)
 Configure the transmitter delay compensation.
HAL_StatusTypeDef HAL_FDCAN_EnableTxDelayCompensation (FDCAN_HandleTypeDef *hfdcan)
 Enable the transmitter delay compensation.
HAL_StatusTypeDef HAL_FDCAN_DisableTxDelayCompensation (FDCAN_HandleTypeDef *hfdcan)
 Disable the transmitter delay compensation.
HAL_StatusTypeDef HAL_FDCAN_EnableISOMode (FDCAN_HandleTypeDef *hfdcan)
 Enable ISO 11898-1 protocol mode.
HAL_StatusTypeDef HAL_FDCAN_DisableISOMode (FDCAN_HandleTypeDef *hfdcan)
 Disable ISO 11898-1 protocol mode.
HAL_StatusTypeDef HAL_FDCAN_EnableEdgeFiltering (FDCAN_HandleTypeDef *hfdcan)
 Enable edge filtering during bus integration.
HAL_StatusTypeDef HAL_FDCAN_DisableEdgeFiltering (FDCAN_HandleTypeDef *hfdcan)
 Disable edge filtering during bus integration.
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.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigOperation (FDCAN_HandleTypeDef *hfdcan, FDCAN_TT_ConfigTypeDef *pTTParams)
 Initialize TT operation parameters.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigReferenceMessage (FDCAN_HandleTypeDef *hfdcan, uint32_t IdType, uint32_t Identifier, uint32_t Payload)
 Configure the reference message.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigTrigger (FDCAN_HandleTypeDef *hfdcan, FDCAN_TriggerTypeDef *sTriggerConfig)
 Configure the FDCAN trigger according to the specified parameters in the FDCAN_TriggerTypeDef structure.
HAL_StatusTypeDef HAL_FDCAN_TT_SetGlobalTime (FDCAN_HandleTypeDef *hfdcan, uint32_t TimePreset)
 Schedule global time adjustment for the next reference message.
HAL_StatusTypeDef HAL_FDCAN_TT_SetClockSynchronization (FDCAN_HandleTypeDef *hfdcan, uint32_t NewTURNumerator)
 Schedule TUR numerator update for the next reference message.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigStopWatch (FDCAN_HandleTypeDef *hfdcan, uint32_t Source, uint32_t Polarity)
 Configure stop watch source and polarity.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigRegisterTimeMark (FDCAN_HandleTypeDef *hfdcan, uint32_t TimeMarkSource, uint32_t TimeMarkValue, uint32_t RepeatFactor, uint32_t StartCycle)
 Configure register time mark pulse generation.
HAL_StatusTypeDef HAL_FDCAN_TT_EnableRegisterTimeMarkPulse (FDCAN_HandleTypeDef *hfdcan)
 Enable register time mark pulse generation.
HAL_StatusTypeDef HAL_FDCAN_TT_DisableRegisterTimeMarkPulse (FDCAN_HandleTypeDef *hfdcan)
 Disable register time mark pulse generation.
HAL_StatusTypeDef HAL_FDCAN_TT_EnableTriggerTimeMarkPulse (FDCAN_HandleTypeDef *hfdcan)
 Enable trigger time mark pulse generation.
HAL_StatusTypeDef HAL_FDCAN_TT_DisableTriggerTimeMarkPulse (FDCAN_HandleTypeDef *hfdcan)
 Disable trigger time mark pulse generation.
HAL_StatusTypeDef HAL_FDCAN_TT_EnableHardwareGapControl (FDCAN_HandleTypeDef *hfdcan)
 Enable gap control by input pin fdcan1_evt.
HAL_StatusTypeDef HAL_FDCAN_TT_DisableHardwareGapControl (FDCAN_HandleTypeDef *hfdcan)
 Disable gap control by input pin fdcan1_evt.
HAL_StatusTypeDef HAL_FDCAN_TT_EnableTimeMarkGapControl (FDCAN_HandleTypeDef *hfdcan)
 Enable gap control (finish only) by register time mark interrupt.
HAL_StatusTypeDef HAL_FDCAN_TT_DisableTimeMarkGapControl (FDCAN_HandleTypeDef *hfdcan)
 Disable gap control by register time mark interrupt.
HAL_StatusTypeDef HAL_FDCAN_TT_SetNextIsGap (FDCAN_HandleTypeDef *hfdcan)
 Transmit next reference message with Next_is_Gap = "1".
HAL_StatusTypeDef HAL_FDCAN_TT_SetEndOfGap (FDCAN_HandleTypeDef *hfdcan)
 Finish a Gap by requesting start of reference message.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigExternalSyncPhase (FDCAN_HandleTypeDef *hfdcan, uint32_t TargetPhase)
 Configure target phase used for external synchronization by event trigger input pin fdcan1_evt.
HAL_StatusTypeDef HAL_FDCAN_TT_EnableExternalSynchronization (FDCAN_HandleTypeDef *hfdcan)
 Synchronize the phase of the FDCAN schedule to an external schedule using event trigger input pin fdcan1_evt.
HAL_StatusTypeDef HAL_FDCAN_TT_DisableExternalSynchronization (FDCAN_HandleTypeDef *hfdcan)
 Disable external schedule synchronization.
HAL_StatusTypeDef HAL_FDCAN_TT_GetOperationStatus (FDCAN_HandleTypeDef *hfdcan, FDCAN_TTOperationStatusTypeDef *TTOpStatus)
 Get TT operation status.
HAL_StatusTypeDef HAL_FDCAN_ConfigInterruptLines (FDCAN_HandleTypeDef *hfdcan, uint32_t ITList, uint32_t InterruptLine)
 Assign interrupts to either Interrupt line 0 or 1.
HAL_StatusTypeDef HAL_FDCAN_TT_ConfigInterruptLines (FDCAN_HandleTypeDef *hfdcan, uint32_t TTITList, uint32_t InterruptLine)
 Assign TT interrupts to either Interrupt line 0 or 1.
HAL_StatusTypeDef HAL_FDCAN_ActivateNotification (FDCAN_HandleTypeDef *hfdcan, uint32_t ActiveITs, uint32_t BufferIndexes)
 Enable interrupts.
HAL_StatusTypeDef HAL_FDCAN_DeactivateNotification (FDCAN_HandleTypeDef *hfdcan, uint32_t InactiveITs)
 Disable interrupts.
HAL_StatusTypeDef HAL_FDCAN_TT_ActivateNotification (FDCAN_HandleTypeDef *hfdcan, uint32_t ActiveTTITs)
 Enable TT interrupts.
HAL_StatusTypeDef HAL_FDCAN_TT_DeactivateNotification (FDCAN_HandleTypeDef *hfdcan, uint32_t InactiveTTITs)
 Disable TT interrupts.
void HAL_FDCAN_IRQHandler (FDCAN_HandleTypeDef *hfdcan)
 Handles FDCAN interrupt request.
__weak void HAL_FDCAN_ClockCalibrationCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t ClkCalibrationITs)
 Clock Calibration callback.
__weak void HAL_FDCAN_TxEventFifoCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t TxEventFifoITs)
 Tx Event callback.
__weak void HAL_FDCAN_RxFifo0Callback (FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs)
 Rx FIFO 0 callback.
__weak void HAL_FDCAN_RxFifo1Callback (FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo1ITs)
 Rx FIFO 1 callback.
__weak void HAL_FDCAN_TxFifoEmptyCallback (FDCAN_HandleTypeDef *hfdcan)
 Tx FIFO Empty callback.
__weak void HAL_FDCAN_TxBufferCompleteCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes)
 Transmission Complete callback.
__weak void HAL_FDCAN_TxBufferAbortCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t BufferIndexes)
 Transmission Cancellation callback.
__weak void HAL_FDCAN_RxBufferNewMessageCallback (FDCAN_HandleTypeDef *hfdcan)
 Rx Buffer New Message callback.
__weak void HAL_FDCAN_TimestampWraparoundCallback (FDCAN_HandleTypeDef *hfdcan)
 Timestamp Wraparound callback.
__weak void HAL_FDCAN_TimeoutOccurredCallback (FDCAN_HandleTypeDef *hfdcan)
 Timeout Occurred callback.
__weak void HAL_FDCAN_HighPriorityMessageCallback (FDCAN_HandleTypeDef *hfdcan)
 High Priority Message callback.
__weak void HAL_FDCAN_ErrorCallback (FDCAN_HandleTypeDef *hfdcan)
 Error callback.
__weak void HAL_FDCAN_ErrorStatusCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t ErrorStatusITs)
 Error status callback.
__weak void HAL_FDCAN_TT_ScheduleSyncCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t TTSchedSyncITs)
 TT Schedule Synchronization callback.
__weak void HAL_FDCAN_TT_TimeMarkCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t TTTimeMarkITs)
 TT Time Mark callback.
__weak void HAL_FDCAN_TT_StopWatchCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t SWTime, uint32_t SWCycleCount)
 TT Stop Watch callback.
__weak void HAL_FDCAN_TT_GlobalTimeCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t TTGlobTimeITs)
 TT Global Time callback.
HAL_FDCAN_StateTypeDef HAL_FDCAN_GetState (FDCAN_HandleTypeDef *hfdcan)
 Return the FDCAN state.
uint32_t HAL_FDCAN_GetError (FDCAN_HandleTypeDef *hfdcan)
 Return the FDCAN error code.

Variables

static const uint8_t DLCtoBytes [] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64}

Detailed Description

FDCAN HAL module driver. This file provides firmware functions to manage the following functionalities of the Flexible DataRate Controller Area Network (FDCAN) peripheral: + Initialization and de-initialization functions + IO operation functions + Peripheral Configuration and Control functions + Peripheral State and Error functions.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

  ==============================================================================
                        ##### How to use this driver #####
  ==============================================================================
    [..]
      (#) Initialize the FDCAN peripheral using HAL_FDCAN_Init function.

      (#) If needed , configure the reception filters and optional features using
          the following configuration functions:
            (++) HAL_FDCAN_ConfigClockCalibration
            (++) HAL_FDCAN_ConfigFilter
            (++) HAL_FDCAN_ConfigGlobalFilter
            (++) HAL_FDCAN_ConfigExtendedIdMask
            (++) HAL_FDCAN_ConfigRxFifoOverwrite
            (++) HAL_FDCAN_ConfigFifoWatermark
            (++) HAL_FDCAN_ConfigRamWatchdog
            (++) HAL_FDCAN_ConfigTimestampCounter
            (++) HAL_FDCAN_EnableTimestampCounter
            (++) HAL_FDCAN_DisableTimestampCounter
            (++) HAL_FDCAN_ConfigTimeoutCounter
            (++) HAL_FDCAN_EnableTimeoutCounter
            (++) HAL_FDCAN_DisableTimeoutCounter
            (++) HAL_FDCAN_ConfigTxDelayCompensation
            (++) HAL_FDCAN_EnableTxDelayCompensation
            (++) HAL_FDCAN_DisableTxDelayCompensation
            (++) HAL_FDCAN_EnableISOMode
            (++) HAL_FDCAN_DisableISOMode
            (++) HAL_FDCAN_EnableEdgeFiltering
            (++) HAL_FDCAN_DisableEdgeFiltering
            (++) HAL_FDCAN_TT_ConfigOperation
            (++) HAL_FDCAN_TT_ConfigReferenceMessage
            (++) HAL_FDCAN_TT_ConfigTrigger

      (#) Start the FDCAN module using HAL_FDCAN_Start function. At this level
          the node is active on the bus: it can send and receive messages.

      (#) The following Tx control functions can only be called when the FDCAN
          module is started:
            (++) HAL_FDCAN_AddMessageToTxFifoQ
            (++) HAL_FDCAN_EnableTxBufferRequest
            (++) HAL_FDCAN_AbortTxRequest

      (#) After having submitted a Tx request in Tx Fifo or Queue, it is possible to
          get Tx buffer location used to place the Tx request thanks to
          HAL_FDCAN_GetLatestTxFifoQRequestBuffer API.
          It is then possible to abort later on the corresponding Tx Request using
          HAL_FDCAN_AbortTxRequest API.

      (#) When a message is received into the FDCAN message RAM, it can be
          retrieved using the HAL_FDCAN_GetRxMessage function.

      (#) Calling the HAL_FDCAN_Stop function stops the FDCAN module by entering
          it to initialization mode and re-enabling access to configuration
          registers through the configuration functions listed here above.

      (#) All other control functions can be called any time after initialization
          phase, no matter if the FDCAN module is started or stopped.

      *** Polling mode operation ***
      ==============================

    [..]
        (#) Reception and transmission states can be monitored via the following
            functions:
              (++) HAL_FDCAN_IsRxBufferMessageAvailable
              (++) HAL_FDCAN_IsTxBufferMessagePending
              (++) HAL_FDCAN_GetRxFifoFillLevel
              (++) HAL_FDCAN_GetTxFifoFreeLevel

      *** Interrupt mode operation ***
      ================================
      [..]
        (#) There are two interrupt lines: line 0 and 1.
            By default, all interrupts are assigned to line 0. Interrupt lines
            can be configured using HAL_FDCAN_ConfigInterruptLines function.

        (#) Notifications are activated using HAL_FDCAN_ActivateNotification
            function. Then, the process can be controlled through one of the
            available user callbacks: HAL_FDCAN_xxxCallback.

  *** Callback registration ***
  =============================================

  The compilation define USE_HAL_FDCAN_REGISTER_CALLBACKS when set to 1
  allows the user to configure dynamically the driver callbacks.
  Use Function HAL_FDCAN_RegisterCallback() or HAL_FDCAN_RegisterXXXCallback()
  to register an interrupt callback.

  Function HAL_FDCAN_RegisterCallback() allows to register following callbacks:
    (+) TxFifoEmptyCallback          : Tx Fifo Empty Callback.
    (+) RxBufferNewMessageCallback   : Rx Buffer New Message Callback.
    (+) HighPriorityMessageCallback  : High Priority Message Callback.
    (+) TimestampWraparoundCallback  : Timestamp Wraparound Callback.
    (+) TimeoutOccurredCallback      : Timeout Occurred Callback.
    (+) ErrorCallback                : Error Callback.
    (+) MspInitCallback              : FDCAN MspInit.
    (+) MspDeInitCallback            : FDCAN MspDeInit.
  This function takes as parameters the HAL peripheral handle, the Callback ID
  and a pointer to the user callback function.

  For specific callbacks ClockCalibrationCallback, TxEventFifoCallback, RxFifo0Callback, RxFifo1Callback,
  TxBufferCompleteCallback, TxBufferAbortCallback, ErrorStatusCallback, TT_ScheduleSyncCallback, TT_TimeMarkCallback,
  TT_StopWatchCallback and TT_GlobalTimeCallback, use dedicated register callbacks :
  respectively HAL_FDCAN_RegisterClockCalibrationCallback(), HAL_FDCAN_RegisterTxEventFifoCallback(),
  HAL_FDCAN_RegisterRxFifo0Callback(), HAL_FDCAN_RegisterRxFifo1Callback(),
  HAL_FDCAN_RegisterTxBufferCompleCallback(), HAL_FDCAN_RegisterTxBufferAbortCallback(),
  HAL_FDCAN_RegisterErrorStatusCallback(), HAL_FDCAN_TT_RegisterScheduleSyncCallback(),
  HAL_FDCAN_TT_RegisterTimeMarkCallback(), HAL_FDCAN_TT_RegisterStopWatchCallback() and
  HAL_FDCAN_TT_RegisterGlobalTimeCallback().

  Use function HAL_FDCAN_UnRegisterCallback() to reset a callback to the default
  weak function.
  HAL_FDCAN_UnRegisterCallback takes as parameters the HAL peripheral handle,
  and the Callback ID.
  This function allows to reset following callbacks:
    (+) TxFifoEmptyCallback          : Tx Fifo Empty Callback.
    (+) RxBufferNewMessageCallback   : Rx Buffer New Message Callback.
    (+) HighPriorityMessageCallback  : High Priority Message Callback.
    (+) TimestampWraparoundCallback  : Timestamp Wraparound Callback.
    (+) TimeoutOccurredCallback      : Timeout Occurred Callback.
    (+) ErrorCallback                : Error Callback.
    (+) MspInitCallback              : FDCAN MspInit.
    (+) MspDeInitCallback            : FDCAN MspDeInit.

  For specific callbacks ClockCalibrationCallback, TxEventFifoCallback, RxFifo0Callback,
  RxFifo1Callback, TxBufferCompleteCallback, TxBufferAbortCallback, TT_ScheduleSyncCallback,
  TT_TimeMarkCallback, TT_StopWatchCallback and TT_GlobalTimeCallback, use dedicated
  register callbacks : respectively HAL_FDCAN_UnRegisterClockCalibrationCallback(),
  HAL_FDCAN_UnRegisterTxEventFifoCallback(), HAL_FDCAN_UnRegisterRxFifo0Callback(),
  HAL_FDCAN_UnRegisterRxFifo1Callback(), HAL_FDCAN_UnRegisterTxBufferCompleCallback(),
  HAL_FDCAN_UnRegisterTxBufferAbortCallback(), HAL_FDCAN_UnRegisterErrorStatusCallback(),
  HAL_FDCAN_TT_UnRegisterScheduleSyncCallback(), HAL_FDCAN_TT_UnRegisterTimeMarkCallback(),
  HAL_FDCAN_TT_UnRegisterStopWatchCallback() and HAL_FDCAN_TT_UnRegisterGlobalTimeCallback().

  By default, after the HAL_FDCAN_Init() and when the state is HAL_FDCAN_STATE_RESET,
  all callbacks are set to the corresponding weak functions:
  examples HAL_FDCAN_ErrorCallback().
  Exception done for MspInit and MspDeInit functions that are
  reset to the legacy weak function in the HAL_FDCAN_Init()/ HAL_FDCAN_DeInit() only when
  these callbacks are null (not registered beforehand).
  if not, MspInit or MspDeInit are not null, the HAL_FDCAN_Init()/ HAL_FDCAN_DeInit()
  keep and use the user MspInit/MspDeInit callbacks (registered beforehand)

  Callbacks can be registered/unregistered in HAL_FDCAN_STATE_READY state only.
  Exception done MspInit/MspDeInit that can be registered/unregistered
  in HAL_FDCAN_STATE_READY or HAL_FDCAN_STATE_RESET state,
  thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit.
  In that case first register the MspInit/MspDeInit user callbacks
  using HAL_FDCAN_RegisterCallback() before calling HAL_FDCAN_DeInit()
  or HAL_FDCAN_Init() function.

  When The compilation define USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 0 or
  not defined, the callback registration feature is not available and all callbacks
  are set to the corresponding weak functions.

  

Definition in file stm32h7xx_hal_fdcan.c.