HAL FDCAN Functions ¶
Initialization and de-initialization functions ¶
- group FDCAN_Exported_Functions_Group1
-
A set of functions allowing to initialize and deinitialize the FDCAN peripheral:
-
HAL_FDCAN_Init() : Initialize the selected device with the FDCAN instance.
-
HAL_FDCAN_DeInit() : Restore the default configuration of the selected FDCAN peripheral.
Functions
-
hal_status_t
HAL_FDCAN_Init
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_t
instance
)
¶
-
Initializes the FDCAN peripheral according to the associated handle.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
instance – HAL FDCAN instance.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
HAL_ERROR – HAL FDCAN semaphore creation has failed (USE_HAL_MUTEX is set to 1).
-
-
void
HAL_FDCAN_DeInit
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Deinitialize the FDCAN driver for the given handle and disable the peripheral.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
- group FDCAN_Exported_Functions_Group1
-
A set of functions allowing to initialize and deinitialize the FDCAN peripheral:
-
HAL_FDCAN_Init() : Initialize the selected device with the FDCAN instance.
-
HAL_FDCAN_DeInit() : Restore the default configuration of the selected FDCAN peripheral.
Functions
-
hal_status_t
HAL_FDCAN_Init
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_t
instance
)
-
Initializes the FDCAN peripheral according to the associated handle.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
instance – HAL FDCAN instance.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
HAL_ERROR – HAL FDCAN semaphore creation has failed (USE_HAL_MUTEX is set to 1).
-
-
void
HAL_FDCAN_DeInit
(
hal_fdcan_handle_t
*
hfdcan
)
-
Deinitialize the FDCAN driver for the given handle and disable the peripheral.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
- group FDCAN_Exported_Functions_Group1
-
A set of functions allowing to initialize and deinitialize the FDCAN peripheral:
-
HAL_FDCAN_Init() : Initialize the selected device with the FDCAN instance.
-
HAL_FDCAN_DeInit() : Restore the default configuration of the selected FDCAN peripheral.
Functions
-
hal_status_t
HAL_FDCAN_Init
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_t
instance
)
-
Initializes the FDCAN peripheral according to the associated handle.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
instance – HAL FDCAN instance.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
HAL_ERROR – HAL FDCAN semaphore creation has failed (USE_HAL_MUTEX is set to 1).
-
-
void
HAL_FDCAN_DeInit
(
hal_fdcan_handle_t
*
hfdcan
)
-
Deinitialize the FDCAN driver for the given handle and disable the peripheral.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
Enter and Exit Power Down mode ¶
- group FDCAN_Exported_Functions_Group2
-
A set of functions allowing to enter and exit sleep mode for the FDCAN peripheral:
-
HAL_FDCAN_EnterPowerDownMode() : Enter in Power Down (sleep mode).
-
HAL_FDCAN_ExitPowerDownMode() : Exit Power Down (sleep mode).
Functions
-
hal_status_t
HAL_FDCAN_EnterPowerDownMode
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Set the FDCAN peripheral in power down mode (sleep mode).
Note
Called from HAL_FDCAN_STATE_ACTIVE state and sets the fdcan in HAL_FDCAN_STATE_POWER_DOWN state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot be set in power down mode.
-
-
hal_status_t
HAL_FDCAN_ExitPowerDownMode
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Exit the FDCAN peripheral power down mode (sleep mode).
Note
Called from HAL_FDCAN_STATE_POWER_DOWN state and sets the fdcan in HAL_FDCAN_STATE_ACTIVE state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot leave the power down mode.
-
-
- group FDCAN_Exported_Functions_Group2
-
A set of functions allowing to enter and exit sleep mode for the FDCAN peripheral:
-
HAL_FDCAN_EnterPowerDownMode() : Enter in Power Down (sleep mode).
-
HAL_FDCAN_ExitPowerDownMode() : Exit Power Down (sleep mode).
Functions
-
hal_status_t
HAL_FDCAN_EnterPowerDownMode
(
hal_fdcan_handle_t
*
hfdcan
)
-
Set the FDCAN peripheral in power down mode (sleep mode).
Note
Called from HAL_FDCAN_STATE_ACTIVE state and sets the fdcan in HAL_FDCAN_STATE_POWER_DOWN state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot be set in power down mode.
-
-
hal_status_t
HAL_FDCAN_ExitPowerDownMode
(
hal_fdcan_handle_t
*
hfdcan
)
-
Exit the FDCAN peripheral power down mode (sleep mode).
Note
Called from HAL_FDCAN_STATE_POWER_DOWN state and sets the fdcan in HAL_FDCAN_STATE_ACTIVE state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot leave the power down mode.
-
-
- group FDCAN_Exported_Functions_Group2
-
A set of functions allowing to enter and exit sleep mode for the FDCAN peripheral:
-
HAL_FDCAN_EnterPowerDownMode() : Enter in Power Down (sleep mode).
-
HAL_FDCAN_ExitPowerDownMode() : Exit Power Down (sleep mode).
Functions
-
hal_status_t
HAL_FDCAN_EnterPowerDownMode
(
hal_fdcan_handle_t
*
hfdcan
)
-
Set the FDCAN peripheral in power down mode (sleep mode).
Note
Called from HAL_FDCAN_STATE_ACTIVE state and sets the fdcan in HAL_FDCAN_STATE_POWER_DOWN state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot be set in power down mode.
-
-
hal_status_t
HAL_FDCAN_ExitPowerDownMode
(
hal_fdcan_handle_t
*
hfdcan
)
-
Exit the FDCAN peripheral power down mode (sleep mode).
Note
Called from HAL_FDCAN_STATE_POWER_DOWN state and sets the fdcan in HAL_FDCAN_STATE_ACTIVE state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot leave the power down mode.
-
-
Configuration functions ¶
- group FDCAN_Exported_Functions_Group3
-
There are two categories of HAL configuration set of functions for the peripheral configuration:
-
Global configuration set of functions:
-
HAL_FDCAN_SetConfig() : Allowing to set the HAL FDCAN peripheral instance into a ready to use state (idle) according to the user parameters
-
HAL_FDCAN_GetConfig() : Allowing to retrieve the HAL FDCAN peripheral configuration
-
-
Unitary configuration set of functions
-
Apply/Get one single configuration item
-
These sets of functions are intended to dynamically modify/retrieve a unitary item meaning that a global configuration has been already applied. Unitary configuration set of functions must check first if the FDCAN module is in IDLE state (meaning a global configuration was applied) in order to modify or retrieve a single item. Integrity check must be ensured when setting an item.
Items that can alter other config parameters must not be handled within unitary set of functions.
-
This section provides functions allowing:
-
HAL_FDCAN_SetNominalBitTiming() : Configure the nominal bit timing
-
HAL_FDCAN_GetNominalBitTiming() : Get the nominal bit timing configuration
-
HAL_FDCAN_SetDataBitTiming() : Configure the data bit timing
-
HAL_FDCAN_GetDataBitTiming() : Get the data bit timing configuration
-
HAL_FDCAN_SetFilter() : Configure the FDCAN reception filter
-
HAL_FDCAN_GetFilter() : Get the FDCAN reception filter configuration
-
HAL_FDCAN_SetGlobalFilter() : Configure the FDCAN global filter
-
HAL_FDCAN_GetGlobalFilter() : Get the FDCAN global filter configuration
-
HAL_FDCAN_SetExtendedIdMask() : Configure the extended ID mask
-
HAL_FDCAN_GetExtendedIdMask() : Get the extended ID mask configuration
-
HAL_FDCAN_SetClockDivider() : Configure the clock divider
-
HAL_FDCAN_GetClockDivider() : Get the clock divider configuration
-
HAL_FDCAN_SetRxFifoOverwrite() : Configure the Rx FIFO operation mode
-
HAL_FDCAN_GetRxFifoOverwrite() : Get the Rx FIFO operation mode configuration
-
HAL_FDCAN_SetRamWatchdog() : Configure the RAM watchdog
-
HAL_FDCAN_GetRamWatchdog() : Get the RAM watchdog value
-
HAL_FDCAN_SetConfigTimestampCounter() : Configure the timestamp counter
-
HAL_FDCAN_GetConfigTimestampCounter() : Get the timestamp counter configuration
-
HAL_FDCAN_GetTimestampCounter() : Get the timestamp counter value
-
HAL_FDCAN_ResetTimestampCounter() : Reset the timestamp counter to zero
-
HAL_FDCAN_SetConfigTimeoutCounter() : Configure the timeout counter
-
HAL_FDCAN_GetConfigTimeoutCounter() : Get the timeout counter configuration
-
HAL_FDCAN_GetTimeoutCounter() : Get the timeout counter value
-
HAL_FDCAN_ResetTimeoutCounter() : Reset the timeout counter to its starting value
-
HAL_FDCAN_EnableTimeoutCounter() : Enable the timeout counter
-
HAL_FDCAN_DisableTimeoutCounter() : Disable the timeout counter
-
HAL_FDCAN_IsEnabledTimeoutCounter() : Check if the timeout counter is enabled
-
HAL_FDCAN_SetConfigTxDelayCompensation() : Configure the transmitter delay compensation
-
HAL_FDCAN_GetConfigTxDelayCompensation() : Get the transmitter delay compensation configuration
-
HAL_FDCAN_DisableTxDelayCompensation() : Disable the transmitter delay compensation
-
HAL_FDCAN_EnableTxDelayCompensation() : Enable the transmitter delay compensation
-
HAL_FDCAN_IsEnabledTxDelayCompensation() : Check if the transmitter delay compensation is enabled
-
HAL_FDCAN_DisableISOMode() : Disable ISO 11898-1 protocol mode
-
HAL_FDCAN_EnableISOMode() : Enable ISO 11898-1 protocol mode
-
HAL_FDCAN_IsEnabledISOMode() : Check if the ISO mode is enabled
-
HAL_FDCAN_DisableEdgeFiltering() : Disable edge filtering during bus integration
-
HAL_FDCAN_EnableEdgeFiltering() : Enable edge filtering during bus integration
-
HAL_FDCAN_IsEnabledEdgeFiltering() : Check if the Edge Filtering is enabled
-
HAL_FDCAN_SetMode() : Configure operating mode
-
HAL_FDCAN_GetMode() : Get the current operative mode configuration
-
HAL_FDCAN_SetFrameFormat() : Configure the frame format
-
HAL_FDCAN_GetFrameFormat() : Get the frame format configuration
-
HAL_FDCAN_SetAutoRetransmission() : Configure the auto retransmission
-
HAL_FDCAN_GetAutoRetransmission() : Get the auto retransmission configuration
-
HAL_FDCAN_SetTransmitPause() : Configure the transmit pause
-
HAL_FDCAN_GetTransmitPause() : Get the transmit pause configuration
-
HAL_FDCAN_SetProtocolException() : Configure the protocol exception
-
HAL_FDCAN_GetProtocolException() : Get the protocol exception configuration
-
HAL_FDCAN_GetClockFreq() : Get the current FDCAN kernel clock
-
HAL_FDCAN_SetTxMode() : Configure the transmission FIFO/Queue mode
-
HAL_FDCAN_GetTxMode() : Get the transmission FIFO/Queue mode configuration
-
Functions
-
hal_status_t
HAL_FDCAN_SetConfig
(
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_config_t
*
p_config
)
¶
-
Configures the FDCAN according to the user parameters.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_config – Pointer to the configuration structure.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_config is NULL.
-
HAL_ERROR – FDCAN cannot leave the power down mode..
-
-
void
HAL_FDCAN_GetConfig
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_config_t
*
p_config
)
¶
-
Get the FDCAN global configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_config – Pointer to the configuration structure hal_fdcan_config_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetTxMode
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_mode_t
tx_mode
)
¶
-
Set the transmission FIFO/Queue mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_mode – Transmission mode to configure.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_tx_mode_t
HAL_FDCAN_GetTxMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the transmission FIFO/Queue mode configuration.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_tx_mode_t Current transmission mode.
-
hal_status_t
HAL_FDCAN_SetNominalBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_nominal_bit_timing_t
*
p_nominal_bit_timing
)
¶
-
Set the FDCAN nominal bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_nominal_bit_timing – Pointer to nominal bit timing structure hal_fdcan_nominal_bit_timing_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_nominal_bit_timing is NULL.
-
-
void
HAL_FDCAN_GetNominalBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_nominal_bit_timing_t
*
nominal_bit_timing
)
¶
-
Get the FDCAN nominal bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
nominal_bit_timing – Pointer to the nominal bit timing structure hal_fdcan_nominal_bit_timing_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetDataBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_data_bit_timing_t
*
p_data_bit_timing
)
¶
-
Set the FDCAN data bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_data_bit_timing – Pointer to data bit timing structure hal_fdcan_data_bit_timing_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_data_bit_timing is NULL.
-
-
void
HAL_FDCAN_GetDataBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_data_bit_timing_t
*
data_bit_timing
)
¶
-
Get the FDCAN data bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
data_bit_timing – Pointer to the data bit timing structure hal_fdcan_data_bit_timing_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_filter_t
*
p_filter_config
)
¶
-
Configure the FDCAN reception filter according to the user parameters.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_filter_config – Pointer to a hal_fdcan_filter_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_filter_config is NULL.
-
-
void
HAL_FDCAN_GetFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_filter_t
*
p_filter_config
,
uint32_t
filter_index
,
uint32_t
id_type
)
¶
-
Configure the FDCAN reception filter according to the specified parameters in the hal_fdcan_filter_t structure.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_filter_config – Pointer to a structure based on hal_fdcan_filter_t to be filled with current configuration.
-
filter_index – Index of the filter to be set.
-
id_type – Specifies the type of filter based on FDCAN ID type .
-
-
hal_status_t
HAL_FDCAN_SetGlobalFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_global_filter_config_t
*
p_global_filter_config
)
¶
-
Configure the FDCAN global filter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle structure.
-
p_global_filter_config – Pointer to a structure based on hal_fdcan_global_filter_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_global_filter_config is NULL.
-
-
void
HAL_FDCAN_GetGlobalFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_global_filter_config_t
*
p_global_filter_config
)
¶
-
Get the FDCAN global filter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_global_filter_config – Pointer to a structure based on hal_fdcan_global_filter_config_t
-
-
hal_status_t
HAL_FDCAN_SetExtendedIdMask
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
mask
)
¶
-
Set the extended ID mask value.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
mask – Value of the Extended ID Mask, this parameter must be a number between 0 and 0x1FFFFFFF.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetExtendedIdMask
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the extended ID mask value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current extended ID mask.
-
hal_status_t
HAL_FDCAN_SetClockDivider
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_clock_divider_t
clock_divider
)
¶
-
Set the FDCAN clock divider value.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
clock_divider – Value of the FDCAN clock divider based on hal_fdcan_clock_divider_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_clock_divider_t
HAL_FDCAN_GetClockDivider
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the clock divider for FDCAN.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_clock_divider_t Current clock divider.
-
hal_status_t
HAL_FDCAN_SetRxFifoOverwrite
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_idx
,
hal_fdcan_rx_fifo_operative_mode_t
operation_mode
)
¶
-
Configure the Rx FIFO operation mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_idx – Index of the Rx FIFO, this parameter must be a value of hal_fdcan_rx_location_t .
-
operation_mode – Operation mode, this parameter must be a value of hal_fdcan_rx_fifo_operative_mode_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
void
HAL_FDCAN_GetRxFifoOverwrite
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_sel
,
hal_fdcan_rx_fifo_operative_mode_t
*
p_rx_operation
)
¶
-
Get the Rx FIFO operation mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_sel – Selection of the Rx FIFO, value of hal_fdcan_rx_location_t .
-
p_rx_operation – Pointer to structure based on hal_fdcan_rx_fifo_operative_mode_t .
-
-
hal_status_t
HAL_FDCAN_SetRamWatchdog
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
counter_start_value
)
¶
-
Configure the RAM watchdog.
Warning
With the reset value of 0x00 the counter is disabled.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
counter_start_value – Start value of the message RAM watchdog counter, this parameter must be a number between 0x00 and 0xFF.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetRamWatchdog
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the current RAM watchdog counter - not the configured value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current message RAM watchdog counter value.
-
hal_status_t
HAL_FDCAN_SetConfigTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_timestamp_config_t
*
p_timestamp_config
)
¶
-
Configure the timestamp counter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timestamp_config – Pointer to a structure based on hal_fdcan_timestamp_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_timestamp_config is NULL.
-
-
void
HAL_FDCAN_GetConfigTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_timestamp_config_t
*
p_timestamp_config
)
¶
-
Get the timestamp counter configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timestamp_config – Pointer to a structure based on hal_fdcan_timestamp_config_t .
-
-
uint16_t
HAL_FDCAN_GetTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the timestamp counter value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current timestamp counter value.
-
hal_status_t
HAL_FDCAN_ResetTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Reset the timestamp counter to zero.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Timestamp counter source is not internal.
-
-
hal_status_t
HAL_FDCAN_SetConfigTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_timeout_config_t
*
p_timeout_param
)
¶
-
Configure the timeout counter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timeout_param – Pointer to a structure based on hal_fdcan_timeout_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_timeout_param is NULL.
-
-
void
HAL_FDCAN_GetConfigTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_timeout_config_t
*
p_timeout_param
)
¶
-
Get the timeout counter configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timeout_param – Pointer to a structure based on hal_fdcan_timeout_config_t .
-
-
uint32_t
HAL_FDCAN_GetTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the timeout counter value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current timeout counter value.
-
hal_status_t
HAL_FDCAN_EnableTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Enable the timeout counter.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Disable the timeout counter.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_timeout_counter_status_t
HAL_FDCAN_IsEnabledTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Check timeout Counter status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_timeout_counter_status_t Current timeout counter status.
-
hal_status_t
HAL_FDCAN_ResetTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Reset the timeout counter to its start value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Timeout counter source is not continuous.
-
-
hal_status_t
HAL_FDCAN_SetConfigTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_tx_delay_compensation_config_t
*
p_tx_delay_param
)
¶
-
Configure the transmitter delay compensation.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_delay_param – Pointer to a structure based on hal_fdcan_tx_delay_compensation_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_delay_param is NULL.
-
-
void
HAL_FDCAN_GetConfigTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_delay_compensation_config_t
*
p_tx_delay_param
)
¶
-
Get the transmitter delay compensation offset.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_delay_param – Pointer to a structure based on hal_fdcan_tx_delay_compensation_config_t
-
-
hal_status_t
HAL_FDCAN_EnableTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Enable the transmitter delay compensation.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Disable the transmitter delay compensation.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_transmitter_delay_comp_status_t
HAL_FDCAN_IsEnabledTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Check Transmitter Delay Compensation status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_transmitter_delay_comp_status_t Current transmitter delay compensation status.
-
hal_status_t
HAL_FDCAN_EnableISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Enable ISO 11898-1 protocol mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Disable ISO 11898-1 protocol mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_iso_mode_status_t
HAL_FDCAN_IsEnabledISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Check ISO 11898-1 protocol mode status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_iso_mode_status_t Current protocol mode status.
-
hal_status_t
HAL_FDCAN_EnableEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Enable edge filtering during bus integration.
Note
Two consecutive dominant tq’s are required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Disable edge filtering during bus integration.
Note
One dominant tq is required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_edge_filtering_status_t
HAL_FDCAN_IsEnabledEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Check edge filtering during bus integration status.
Note
One dominant tq is required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_edge_filtering_status_t Current edge filtering status.
-
hal_status_t
HAL_FDCAN_SetMode
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_mode_t
mode
)
¶
-
Set the FDCAN mode.
Warning
This function can only be called from HAL_FDCAN_STATE_IDLE state.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t
-
mode – Value of the mode to set based on hal_fdcan_mode_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_mode_t
HAL_FDCAN_GetMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the FDCAN mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_mode_t Current FDCAN mode configuration.
-
hal_status_t
HAL_FDCAN_SetFrameFormat
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_frame_format_t
frame_format
)
¶
-
Set the frame format.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
frame_format – The frame format to set.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_frame_format_t
HAL_FDCAN_GetFrameFormat
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the frame format.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_frame_format_t Current FDCAN frame format.
-
hal_status_t
HAL_FDCAN_SetAutoRetransmission
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_auto_retransmission_status_t
auto_retransmit
)
¶
-
Set auto retransmission.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
auto_retransmit – Value to enable or disable the automatic retransmission of messages.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_auto_retransmission_status_t
HAL_FDCAN_GetAutoRetransmission
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get auto retransmission status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_auto_retransmission_status_t Current auto retransmission status.
-
hal_status_t
HAL_FDCAN_SetTransmitPause
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_transmit_pause_status_t
transmit_pause
)
¶
-
Set transmit pause.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
transmit_pause – Value to enable/disable the FDCAN pauses for two CAN bit times before starting the next transmission.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_transmit_pause_status_t
HAL_FDCAN_GetTransmitPause
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the transmit pause status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_transmit_pause_status_t Current transmit pause status.
-
hal_status_t
HAL_FDCAN_SetProtocolException
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_protocol_exception_status_t
protocol_exception
)
¶
-
Set protocol exception.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
protocol_exception – Value to enable or disable the protocol exception.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_protocol_exception_status_t
HAL_FDCAN_GetProtocolException
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the protocol exception status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_protocol_exception_status_t Current protocol exception status.
-
uint32_t
HAL_FDCAN_GetClockFreq
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Return the peripheral clock frequency for FDCAN.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle. structure
- Returns :
-
Current clock frequency(hz) or 0 if FDCAN is not configured or not ready.
-
hal_status_t
HAL_FDCAN_RegisterTxEventFifoCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
¶
-
Register Tx event FIFO callback to be used instead of the weak HAL_FDCAN_TxEventFifoCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx Event FIFO Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterRxFifo0Callback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
¶
-
Register Rx FIFO 0 callback to be used instead of the weak HAL_FDCAN_RxFifo0Callback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Rx FIFO 0 Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterRxFifo1Callback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
¶
-
Register Rx FIFO 1 callback to be used instead of the weak HAL_FDCAN_RxFifo1Callback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Rx FIFO 1 Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxBufferCompleteCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_buffer_cb_t
p_callback
)
¶
-
Register Tx Buffer Complete callback to be used instead of the weak HAL_FDCAN_TxBufferCompleteCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx Buffer Complete Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxBufferAbortCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_buffer_cb_t
p_callback
)
¶
-
Register Tx buffer abort callback to be used instead of the weak HAL_FDCAN_TxBufferAbortCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx buffer abort callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterHighPriorityMessageCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
¶
-
Register high priority message callback to be used instead of the weak HAL_FDCAN_HighPriorityMessageCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the high priority message callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxFifoEmptyCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
¶
-
Register Tx FIFO empty callback to be used instead of the weak HAL_FDCAN_TxFifoEmptyCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx FIFO empty callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTimestampWraparoundCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
¶
-
Register timestamp wrapAround callback to be used instead of the weak HAL_FDCAN_TimestampWraparoundCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the timestamp wrapAround callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterErrorCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
¶
-
Register error callback to be used instead of the weak HAL_FDCAN_ErrorCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the FDCAN error callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
- group FDCAN_Exported_Functions_Group3
-
There are two categories of HAL configuration set of functions for the peripheral configuration:
-
Global configuration set of functions:
-
HAL_FDCAN_SetConfig() : Allowing to set the HAL FDCAN peripheral instance into a ready to use state (idle) according to the user parameters
-
HAL_FDCAN_GetConfig() : Allowing to retrieve the HAL FDCAN peripheral configuration
-
-
Unitary configuration set of functions
-
Apply/Get one single configuration item
-
These sets of functions are intended to dynamically modify/retrieve a unitary item meaning that a global configuration has been already applied. Unitary configuration set of functions must check first if the FDCAN module is in IDLE state (meaning a global configuration was applied) in order to modify or retrieve a single item. Integrity check must be ensured when setting an item.
Items that can alter other config parameters must not be handled within unitary set of functions.
-
This section provides functions allowing:
-
HAL_FDCAN_SetNominalBitTiming() : Configure the nominal bit timing
-
HAL_FDCAN_GetNominalBitTiming() : Get the nominal bit timing configuration
-
HAL_FDCAN_SetDataBitTiming() : Configure the data bit timing
-
HAL_FDCAN_GetDataBitTiming() : Get the data bit timing configuration
-
HAL_FDCAN_SetFilter() : Configure the FDCAN reception filter
-
HAL_FDCAN_GetFilter() : Get the FDCAN reception filter configuration
-
HAL_FDCAN_SetGlobalFilter() : Configure the FDCAN global filter
-
HAL_FDCAN_GetGlobalFilter() : Get the FDCAN global filter configuration
-
HAL_FDCAN_SetExtendedIdMask() : Configure the extended ID mask
-
HAL_FDCAN_GetExtendedIdMask() : Get the extended ID mask configuration
-
HAL_FDCAN_SetClockDivider() : Configure the clock divider
-
HAL_FDCAN_GetClockDivider() : Get the clock divider configuration
-
HAL_FDCAN_SetRxFifoOverwrite() : Configure the Rx FIFO operation mode
-
HAL_FDCAN_GetRxFifoOverwrite() : Get the Rx FIFO operation mode configuration
-
HAL_FDCAN_SetRamWatchdog() : Configure the RAM watchdog
-
HAL_FDCAN_GetRamWatchdog() : Get the RAM watchdog value
-
HAL_FDCAN_SetConfigTimestampCounter() : Configure the timestamp counter
-
HAL_FDCAN_GetConfigTimestampCounter() : Get the timestamp counter configuration
-
HAL_FDCAN_GetTimestampCounter() : Get the timestamp counter value
-
HAL_FDCAN_ResetTimestampCounter() : Reset the timestamp counter to zero
-
HAL_FDCAN_SetConfigTimeoutCounter() : Configure the timeout counter
-
HAL_FDCAN_GetConfigTimeoutCounter() : Get the timeout counter configuration
-
HAL_FDCAN_GetTimeoutCounter() : Get the timeout counter value
-
HAL_FDCAN_ResetTimeoutCounter() : Reset the timeout counter to its starting value
-
HAL_FDCAN_EnableTimeoutCounter() : Enable the timeout counter
-
HAL_FDCAN_DisableTimeoutCounter() : Disable the timeout counter
-
HAL_FDCAN_IsEnabledTimeoutCounter() : Check if the timeout counter is enabled
-
HAL_FDCAN_SetConfigTxDelayCompensation() : Configure the transmitter delay compensation
-
HAL_FDCAN_GetConfigTxDelayCompensation() : Get the transmitter delay compensation configuration
-
HAL_FDCAN_DisableTxDelayCompensation() : Disable the transmitter delay compensation
-
HAL_FDCAN_EnableTxDelayCompensation() : Enable the transmitter delay compensation
-
HAL_FDCAN_IsEnabledTxDelayCompensation() : Check if the transmitter delay compensation is enabled
-
HAL_FDCAN_DisableISOMode() : Disable ISO 11898-1 protocol mode
-
HAL_FDCAN_EnableISOMode() : Enable ISO 11898-1 protocol mode
-
HAL_FDCAN_IsEnabledISOMode() : Check if the ISO mode is enabled
-
HAL_FDCAN_DisableEdgeFiltering() : Disable edge filtering during bus integration
-
HAL_FDCAN_EnableEdgeFiltering() : Enable edge filtering during bus integration
-
HAL_FDCAN_IsEnabledEdgeFiltering() : Check if the Edge Filtering is enabled
-
HAL_FDCAN_SetMode() : Configure operating mode
-
HAL_FDCAN_GetMode() : Get the current operative mode configuration
-
HAL_FDCAN_SetFrameFormat() : Configure the frame format
-
HAL_FDCAN_GetFrameFormat() : Get the frame format configuration
-
HAL_FDCAN_SetAutoRetransmission() : Configure the auto retransmission
-
HAL_FDCAN_GetAutoRetransmission() : Get the auto retransmission configuration
-
HAL_FDCAN_SetTransmitPause() : Configure the transmit pause
-
HAL_FDCAN_GetTransmitPause() : Get the transmit pause configuration
-
HAL_FDCAN_SetProtocolException() : Configure the protocol exception
-
HAL_FDCAN_GetProtocolException() : Get the protocol exception configuration
-
HAL_FDCAN_GetClockFreq() : Get the current FDCAN kernel clock
-
HAL_FDCAN_SetTxMode() : Configure the transmission FIFO/Queue mode
-
HAL_FDCAN_GetTxMode() : Get the transmission FIFO/Queue mode configuration
-
Functions
-
hal_status_t
HAL_FDCAN_SetConfig
(
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_config_t
*
p_config
)
-
Configures the FDCAN according to the user parameters.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_config – Pointer to the configuration structure.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_config is NULL.
-
HAL_ERROR – FDCAN cannot leave the power down mode..
-
-
void
HAL_FDCAN_GetConfig
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_config_t
*
p_config
)
-
Get the FDCAN global configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_config – Pointer to the configuration structure hal_fdcan_config_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetTxMode
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_mode_t
tx_mode
)
-
Set the transmission FIFO/Queue mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_mode – Transmission mode to configure.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_tx_mode_t
HAL_FDCAN_GetTxMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the transmission FIFO/Queue mode configuration.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_tx_mode_t Current transmission mode.
-
hal_status_t
HAL_FDCAN_SetNominalBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_nominal_bit_timing_t
*
p_nominal_bit_timing
)
-
Set the FDCAN nominal bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_nominal_bit_timing – Pointer to nominal bit timing structure hal_fdcan_nominal_bit_timing_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_nominal_bit_timing is NULL.
-
-
void
HAL_FDCAN_GetNominalBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_nominal_bit_timing_t
*
nominal_bit_timing
)
-
Get the FDCAN nominal bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
nominal_bit_timing – Pointer to the nominal bit timing structure hal_fdcan_nominal_bit_timing_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetDataBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_data_bit_timing_t
*
p_data_bit_timing
)
-
Set the FDCAN data bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_data_bit_timing – Pointer to data bit timing structure hal_fdcan_data_bit_timing_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_data_bit_timing is NULL.
-
-
void
HAL_FDCAN_GetDataBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_data_bit_timing_t
*
data_bit_timing
)
-
Get the FDCAN data bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
data_bit_timing – Pointer to the data bit timing structure hal_fdcan_data_bit_timing_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_filter_t
*
p_filter_config
)
-
Configure the FDCAN reception filter according to the user parameters.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_filter_config – Pointer to a hal_fdcan_filter_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_filter_config is NULL.
-
-
void
HAL_FDCAN_GetFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_filter_t
*
p_filter_config
,
uint32_t
filter_index
,
uint32_t
id_type
)
-
Configure the FDCAN reception filter according to the specified parameters in the hal_fdcan_filter_t structure.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_filter_config – Pointer to a structure based on hal_fdcan_filter_t to be filled with current configuration.
-
filter_index – Index of the filter to be set.
-
id_type – Specifies the type of filter based on FDCAN ID type .
-
-
hal_status_t
HAL_FDCAN_SetGlobalFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_global_filter_config_t
*
p_global_filter_config
)
-
Configure the FDCAN global filter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle structure.
-
p_global_filter_config – Pointer to a structure based on hal_fdcan_global_filter_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_global_filter_config is NULL.
-
-
void
HAL_FDCAN_GetGlobalFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_global_filter_config_t
*
p_global_filter_config
)
-
Get the FDCAN global filter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_global_filter_config – Pointer to a structure based on hal_fdcan_global_filter_config_t
-
-
hal_status_t
HAL_FDCAN_SetExtendedIdMask
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
mask
)
-
Set the extended ID mask value.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
mask – Value of the Extended ID Mask, this parameter must be a number between 0 and 0x1FFFFFFF.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetExtendedIdMask
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the extended ID mask value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current extended ID mask.
-
hal_status_t
HAL_FDCAN_SetClockDivider
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_clock_divider_t
clock_divider
)
-
Set the FDCAN clock divider value.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
clock_divider – Value of the FDCAN clock divider based on hal_fdcan_clock_divider_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_clock_divider_t
HAL_FDCAN_GetClockDivider
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the clock divider for FDCAN.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_clock_divider_t Current clock divider.
-
hal_status_t
HAL_FDCAN_SetRxFifoOverwrite
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_idx
,
hal_fdcan_rx_fifo_operative_mode_t
operation_mode
)
-
Configure the Rx FIFO operation mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_idx – Index of the Rx FIFO, this parameter must be a value of hal_fdcan_rx_location_t .
-
operation_mode – Operation mode, this parameter must be a value of hal_fdcan_rx_fifo_operative_mode_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
void
HAL_FDCAN_GetRxFifoOverwrite
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_sel
,
hal_fdcan_rx_fifo_operative_mode_t
*
p_rx_operation
)
-
Get the Rx FIFO operation mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_sel – Selection of the Rx FIFO, value of hal_fdcan_rx_location_t .
-
p_rx_operation – Pointer to structure based on hal_fdcan_rx_fifo_operative_mode_t .
-
-
hal_status_t
HAL_FDCAN_SetRamWatchdog
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
counter_start_value
)
-
Configure the RAM watchdog.
Warning
With the reset value of 0x00 the counter is disabled.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
counter_start_value – Start value of the message RAM watchdog counter, this parameter must be a number between 0x00 and 0xFF.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetRamWatchdog
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the current RAM watchdog counter - not the configured value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current message RAM watchdog counter value.
-
hal_status_t
HAL_FDCAN_SetConfigTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_timestamp_config_t
*
p_timestamp_config
)
-
Configure the timestamp counter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timestamp_config – Pointer to a structure based on hal_fdcan_timestamp_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_timestamp_config is NULL.
-
-
void
HAL_FDCAN_GetConfigTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_timestamp_config_t
*
p_timestamp_config
)
-
Get the timestamp counter configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timestamp_config – Pointer to a structure based on hal_fdcan_timestamp_config_t .
-
-
uint16_t
HAL_FDCAN_GetTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the timestamp counter value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current timestamp counter value.
-
hal_status_t
HAL_FDCAN_ResetTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Reset the timestamp counter to zero.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Timestamp counter source is not internal.
-
-
hal_status_t
HAL_FDCAN_SetConfigTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_timeout_config_t
*
p_timeout_param
)
-
Configure the timeout counter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timeout_param – Pointer to a structure based on hal_fdcan_timeout_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_timeout_param is NULL.
-
-
void
HAL_FDCAN_GetConfigTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_timeout_config_t
*
p_timeout_param
)
-
Get the timeout counter configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timeout_param – Pointer to a structure based on hal_fdcan_timeout_config_t .
-
-
uint32_t
HAL_FDCAN_GetTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the timeout counter value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current timeout counter value.
-
hal_status_t
HAL_FDCAN_EnableTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable the timeout counter.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable the timeout counter.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_timeout_counter_status_t
HAL_FDCAN_IsEnabledTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check timeout Counter status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_timeout_counter_status_t Current timeout counter status.
-
hal_status_t
HAL_FDCAN_ResetTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Reset the timeout counter to its start value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Timeout counter source is not continuous.
-
-
hal_status_t
HAL_FDCAN_SetConfigTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_tx_delay_compensation_config_t
*
p_tx_delay_param
)
-
Configure the transmitter delay compensation.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_delay_param – Pointer to a structure based on hal_fdcan_tx_delay_compensation_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_delay_param is NULL.
-
-
void
HAL_FDCAN_GetConfigTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_delay_compensation_config_t
*
p_tx_delay_param
)
-
Get the transmitter delay compensation offset.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_delay_param – Pointer to a structure based on hal_fdcan_tx_delay_compensation_config_t
-
-
hal_status_t
HAL_FDCAN_EnableTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable the transmitter delay compensation.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable the transmitter delay compensation.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_transmitter_delay_comp_status_t
HAL_FDCAN_IsEnabledTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check Transmitter Delay Compensation status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_transmitter_delay_comp_status_t Current transmitter delay compensation status.
-
hal_status_t
HAL_FDCAN_EnableISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable ISO 11898-1 protocol mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable ISO 11898-1 protocol mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_iso_mode_status_t
HAL_FDCAN_IsEnabledISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check ISO 11898-1 protocol mode status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_iso_mode_status_t Current protocol mode status.
-
hal_status_t
HAL_FDCAN_EnableEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable edge filtering during bus integration.
Note
Two consecutive dominant tq’s are required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable edge filtering during bus integration.
Note
One dominant tq is required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_edge_filtering_status_t
HAL_FDCAN_IsEnabledEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check edge filtering during bus integration status.
Note
One dominant tq is required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_edge_filtering_status_t Current edge filtering status.
-
hal_status_t
HAL_FDCAN_SetMode
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_mode_t
mode
)
-
Set the FDCAN mode.
Warning
This function can only be called from HAL_FDCAN_STATE_IDLE state.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t
-
mode – Value of the mode to set based on hal_fdcan_mode_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_mode_t
HAL_FDCAN_GetMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the FDCAN mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_mode_t Current FDCAN mode configuration.
-
hal_status_t
HAL_FDCAN_SetFrameFormat
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_frame_format_t
frame_format
)
-
Set the frame format.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
frame_format – The frame format to set.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_frame_format_t
HAL_FDCAN_GetFrameFormat
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the frame format.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_frame_format_t Current FDCAN frame format.
-
hal_status_t
HAL_FDCAN_SetAutoRetransmission
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_auto_retransmission_status_t
auto_retransmit
)
-
Set auto retransmission.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
auto_retransmit – Value to enable or disable the automatic retransmission of messages.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_auto_retransmission_status_t
HAL_FDCAN_GetAutoRetransmission
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get auto retransmission status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_auto_retransmission_status_t Current auto retransmission status.
-
hal_status_t
HAL_FDCAN_SetTransmitPause
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_transmit_pause_status_t
transmit_pause
)
-
Set transmit pause.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
transmit_pause – Value to enable/disable the FDCAN pauses for two CAN bit times before starting the next transmission.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_transmit_pause_status_t
HAL_FDCAN_GetTransmitPause
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the transmit pause status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_transmit_pause_status_t Current transmit pause status.
-
hal_status_t
HAL_FDCAN_SetProtocolException
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_protocol_exception_status_t
protocol_exception
)
-
Set protocol exception.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
protocol_exception – Value to enable or disable the protocol exception.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_protocol_exception_status_t
HAL_FDCAN_GetProtocolException
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the protocol exception status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_protocol_exception_status_t Current protocol exception status.
-
uint32_t
HAL_FDCAN_GetClockFreq
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the peripheral clock frequency for FDCAN.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle. structure
- Returns :
-
Current clock frequency(hz) or 0 if FDCAN is not configured or not ready.
-
hal_status_t
HAL_FDCAN_RegisterTxEventFifoCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
-
Register Tx event FIFO callback to be used instead of the weak HAL_FDCAN_TxEventFifoCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx Event FIFO Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterRxFifo0Callback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
-
Register Rx FIFO 0 callback to be used instead of the weak HAL_FDCAN_RxFifo0Callback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Rx FIFO 0 Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterRxFifo1Callback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
-
Register Rx FIFO 1 callback to be used instead of the weak HAL_FDCAN_RxFifo1Callback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Rx FIFO 1 Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxBufferCompleteCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_buffer_cb_t
p_callback
)
-
Register Tx Buffer Complete callback to be used instead of the weak HAL_FDCAN_TxBufferCompleteCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx Buffer Complete Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxBufferAbortCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_buffer_cb_t
p_callback
)
-
Register Tx buffer abort callback to be used instead of the weak HAL_FDCAN_TxBufferAbortCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx buffer abort callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterHighPriorityMessageCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register high priority message callback to be used instead of the weak HAL_FDCAN_HighPriorityMessageCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the high priority message callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxFifoEmptyCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register Tx FIFO empty callback to be used instead of the weak HAL_FDCAN_TxFifoEmptyCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx FIFO empty callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTimestampWraparoundCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register timestamp wrapAround callback to be used instead of the weak HAL_FDCAN_TimestampWraparoundCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the timestamp wrapAround callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterErrorCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register error callback to be used instead of the weak HAL_FDCAN_ErrorCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the FDCAN error callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
- group FDCAN_Exported_Functions_Group3
-
There are two categories of HAL configuration set of functions for the peripheral configuration:
-
Global configuration set of functions:
-
HAL_FDCAN_SetConfig() : Allowing to set the HAL FDCAN peripheral instance into a ready to use state (idle) according to the user parameters
-
HAL_FDCAN_GetConfig() : Allowing to retrieve the HAL FDCAN peripheral configuration
-
-
Unitary configuration set of functions
-
Apply/Get one single configuration item
-
These sets of functions are intended to dynamically modify/retrieve a unitary item meaning that a global configuration has been already applied. Unitary configuration set of functions must check first if the FDCAN module is in IDLE state (meaning a global configuration was applied) in order to modify or retrieve a single item. Integrity check must be ensured when setting an item.
Items that can alter other config parameters must not be handled within unitary set of functions.
-
This section provides functions allowing:
-
HAL_FDCAN_SetNominalBitTiming() : Configure the nominal bit timing
-
HAL_FDCAN_GetNominalBitTiming() : Get the nominal bit timing configuration
-
HAL_FDCAN_SetDataBitTiming() : Configure the data bit timing
-
HAL_FDCAN_GetDataBitTiming() : Get the data bit timing configuration
-
HAL_FDCAN_SetFilter() : Configure the FDCAN reception filter
-
HAL_FDCAN_GetFilter() : Get the FDCAN reception filter configuration
-
HAL_FDCAN_SetGlobalFilter() : Configure the FDCAN global filter
-
HAL_FDCAN_GetGlobalFilter() : Get the FDCAN global filter configuration
-
HAL_FDCAN_SetExtendedIdMask() : Configure the extended ID mask
-
HAL_FDCAN_GetExtendedIdMask() : Get the extended ID mask configuration
-
HAL_FDCAN_SetClockDivider() : Configure the clock divider
-
HAL_FDCAN_GetClockDivider() : Get the clock divider configuration
-
HAL_FDCAN_SetRxFifoOverwrite() : Configure the Rx FIFO operation mode
-
HAL_FDCAN_GetRxFifoOverwrite() : Get the Rx FIFO operation mode configuration
-
HAL_FDCAN_SetRamWatchdog() : Configure the RAM watchdog
-
HAL_FDCAN_GetRamWatchdog() : Get the RAM watchdog value
-
HAL_FDCAN_SetConfigTimestampCounter() : Configure the timestamp counter
-
HAL_FDCAN_GetConfigTimestampCounter() : Get the timestamp counter configuration
-
HAL_FDCAN_GetTimestampCounter() : Get the timestamp counter value
-
HAL_FDCAN_ResetTimestampCounter() : Reset the timestamp counter to zero
-
HAL_FDCAN_SetConfigTimeoutCounter() : Configure the timeout counter
-
HAL_FDCAN_GetConfigTimeoutCounter() : Get the timeout counter configuration
-
HAL_FDCAN_GetTimeoutCounter() : Get the timeout counter value
-
HAL_FDCAN_ResetTimeoutCounter() : Reset the timeout counter to its starting value
-
HAL_FDCAN_EnableTimeoutCounter() : Enable the timeout counter
-
HAL_FDCAN_DisableTimeoutCounter() : Disable the timeout counter
-
HAL_FDCAN_IsEnabledTimeoutCounter() : Check if the timeout counter is enabled
-
HAL_FDCAN_SetConfigTxDelayCompensation() : Configure the transmitter delay compensation
-
HAL_FDCAN_GetConfigTxDelayCompensation() : Get the transmitter delay compensation configuration
-
HAL_FDCAN_DisableTxDelayCompensation() : Disable the transmitter delay compensation
-
HAL_FDCAN_EnableTxDelayCompensation() : Enable the transmitter delay compensation
-
HAL_FDCAN_IsEnabledTxDelayCompensation() : Check if the transmitter delay compensation is enabled
-
HAL_FDCAN_DisableISOMode() : Disable ISO 11898-1 protocol mode
-
HAL_FDCAN_EnableISOMode() : Enable ISO 11898-1 protocol mode
-
HAL_FDCAN_IsEnabledISOMode() : Check if the ISO mode is enabled
-
HAL_FDCAN_DisableEdgeFiltering() : Disable edge filtering during bus integration
-
HAL_FDCAN_EnableEdgeFiltering() : Enable edge filtering during bus integration
-
HAL_FDCAN_IsEnabledEdgeFiltering() : Check if the Edge Filtering is enabled
-
HAL_FDCAN_SetMode() : Configure operating mode
-
HAL_FDCAN_GetMode() : Get the current operative mode configuration
-
HAL_FDCAN_SetFrameFormat() : Configure the frame format
-
HAL_FDCAN_GetFrameFormat() : Get the frame format configuration
-
HAL_FDCAN_SetAutoRetransmission() : Configure the auto retransmission
-
HAL_FDCAN_GetAutoRetransmission() : Get the auto retransmission configuration
-
HAL_FDCAN_SetTransmitPause() : Configure the transmit pause
-
HAL_FDCAN_GetTransmitPause() : Get the transmit pause configuration
-
HAL_FDCAN_SetProtocolException() : Configure the protocol exception
-
HAL_FDCAN_GetProtocolException() : Get the protocol exception configuration
-
HAL_FDCAN_GetClockFreq() : Get the current FDCAN kernel clock
-
HAL_FDCAN_SetTxMode() : Configure the transmission FIFO/Queue mode
-
HAL_FDCAN_GetTxMode() : Get the transmission FIFO/Queue mode configuration
-
Functions
-
hal_status_t
HAL_FDCAN_SetConfig
(
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_config_t
*
p_config
)
-
Configures the FDCAN according to the user parameters.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_config – Pointer to the configuration structure.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_config is NULL.
-
HAL_ERROR – FDCAN cannot leave the power down mode..
-
-
void
HAL_FDCAN_GetConfig
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_config_t
*
p_config
)
-
Get the FDCAN global configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_config – Pointer to the configuration structure hal_fdcan_config_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetTxMode
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_mode_t
tx_mode
)
-
Set the transmission FIFO/Queue mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_mode – Transmission mode to configure.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_tx_mode_t
HAL_FDCAN_GetTxMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the transmission FIFO/Queue mode configuration.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_tx_mode_t Current transmission mode.
-
hal_status_t
HAL_FDCAN_SetNominalBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_nominal_bit_timing_t
*
p_nominal_bit_timing
)
-
Set the FDCAN nominal bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_nominal_bit_timing – Pointer to nominal bit timing structure hal_fdcan_nominal_bit_timing_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_nominal_bit_timing is NULL.
-
-
void
HAL_FDCAN_GetNominalBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_nominal_bit_timing_t
*
nominal_bit_timing
)
-
Get the FDCAN nominal bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
nominal_bit_timing – Pointer to the nominal bit timing structure hal_fdcan_nominal_bit_timing_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetDataBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_data_bit_timing_t
*
p_data_bit_timing
)
-
Set the FDCAN data bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_data_bit_timing – Pointer to data bit timing structure hal_fdcan_data_bit_timing_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_data_bit_timing is NULL.
-
-
void
HAL_FDCAN_GetDataBitTiming
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_data_bit_timing_t
*
data_bit_timing
)
-
Get the FDCAN data bit timing configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
data_bit_timing – Pointer to the data bit timing structure hal_fdcan_data_bit_timing_t to be filled with current configuration.
-
-
hal_status_t
HAL_FDCAN_SetFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_filter_t
*
p_filter_config
)
-
Configure the FDCAN reception filter according to the user parameters.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_filter_config – Pointer to a hal_fdcan_filter_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_filter_config is NULL.
-
-
void
HAL_FDCAN_GetFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_filter_t
*
p_filter_config
,
uint32_t
filter_index
,
uint32_t
id_type
)
-
Configure the FDCAN reception filter according to the specified parameters in the hal_fdcan_filter_t structure.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_filter_config – Pointer to a structure based on hal_fdcan_filter_t to be filled with current configuration.
-
filter_index – Index of the filter to be set.
-
id_type – Specifies the type of filter based on FDCAN ID type .
-
-
hal_status_t
HAL_FDCAN_SetGlobalFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_global_filter_config_t
*
p_global_filter_config
)
-
Configure the FDCAN global filter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle structure.
-
p_global_filter_config – Pointer to a structure based on hal_fdcan_global_filter_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_global_filter_config is NULL.
-
-
void
HAL_FDCAN_GetGlobalFilter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_global_filter_config_t
*
p_global_filter_config
)
-
Get the FDCAN global filter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_global_filter_config – Pointer to a structure based on hal_fdcan_global_filter_config_t
-
-
hal_status_t
HAL_FDCAN_SetExtendedIdMask
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
mask
)
-
Set the extended ID mask value.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
mask – Value of the Extended ID Mask, this parameter must be a number between 0 and 0x1FFFFFFF.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetExtendedIdMask
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the extended ID mask value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current extended ID mask.
-
hal_status_t
HAL_FDCAN_SetClockDivider
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_clock_divider_t
clock_divider
)
-
Set the FDCAN clock divider value.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
clock_divider – Value of the FDCAN clock divider based on hal_fdcan_clock_divider_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_clock_divider_t
HAL_FDCAN_GetClockDivider
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the clock divider for FDCAN.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_clock_divider_t Current clock divider.
-
hal_status_t
HAL_FDCAN_SetRxFifoOverwrite
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_idx
,
hal_fdcan_rx_fifo_operative_mode_t
operation_mode
)
-
Configure the Rx FIFO operation mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_idx – Index of the Rx FIFO, this parameter must be a value of hal_fdcan_rx_location_t .
-
operation_mode – Operation mode, this parameter must be a value of hal_fdcan_rx_fifo_operative_mode_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
void
HAL_FDCAN_GetRxFifoOverwrite
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_sel
,
hal_fdcan_rx_fifo_operative_mode_t
*
p_rx_operation
)
-
Get the Rx FIFO operation mode.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_sel – Selection of the Rx FIFO, value of hal_fdcan_rx_location_t .
-
p_rx_operation – Pointer to structure based on hal_fdcan_rx_fifo_operative_mode_t .
-
-
hal_status_t
HAL_FDCAN_SetRamWatchdog
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
counter_start_value
)
-
Configure the RAM watchdog.
Warning
With the reset value of 0x00 the counter is disabled.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
counter_start_value – Start value of the message RAM watchdog counter, this parameter must be a number between 0x00 and 0xFF.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetRamWatchdog
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the current RAM watchdog counter - not the configured value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current message RAM watchdog counter value.
-
hal_status_t
HAL_FDCAN_SetConfigTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_timestamp_config_t
*
p_timestamp_config
)
-
Configure the timestamp counter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timestamp_config – Pointer to a structure based on hal_fdcan_timestamp_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_timestamp_config is NULL.
-
-
void
HAL_FDCAN_GetConfigTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_timestamp_config_t
*
p_timestamp_config
)
-
Get the timestamp counter configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timestamp_config – Pointer to a structure based on hal_fdcan_timestamp_config_t .
-
-
uint16_t
HAL_FDCAN_GetTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the timestamp counter value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current timestamp counter value.
-
hal_status_t
HAL_FDCAN_ResetTimestampCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Reset the timestamp counter to zero.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Timestamp counter source is not internal.
-
-
hal_status_t
HAL_FDCAN_SetConfigTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_timeout_config_t
*
p_timeout_param
)
-
Configure the timeout counter.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timeout_param – Pointer to a structure based on hal_fdcan_timeout_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_timeout_param is NULL.
-
-
void
HAL_FDCAN_GetConfigTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_timeout_config_t
*
p_timeout_param
)
-
Get the timeout counter configuration.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_timeout_param – Pointer to a structure based on hal_fdcan_timeout_config_t .
-
-
uint32_t
HAL_FDCAN_GetTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the timeout counter value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current timeout counter value.
-
hal_status_t
HAL_FDCAN_EnableTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable the timeout counter.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable the timeout counter.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_timeout_counter_status_t
HAL_FDCAN_IsEnabledTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check timeout Counter status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_timeout_counter_status_t Current timeout counter status.
-
hal_status_t
HAL_FDCAN_ResetTimeoutCounter
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Reset the timeout counter to its start value.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Timeout counter source is not continuous.
-
-
hal_status_t
HAL_FDCAN_SetConfigTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_tx_delay_compensation_config_t
*
p_tx_delay_param
)
-
Configure the transmitter delay compensation.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_delay_param – Pointer to a structure based on hal_fdcan_tx_delay_compensation_config_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_delay_param is NULL.
-
-
void
HAL_FDCAN_GetConfigTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_delay_compensation_config_t
*
p_tx_delay_param
)
-
Get the transmitter delay compensation offset.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_delay_param – Pointer to a structure based on hal_fdcan_tx_delay_compensation_config_t
-
-
hal_status_t
HAL_FDCAN_EnableTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable the transmitter delay compensation.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable the transmitter delay compensation.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_transmitter_delay_comp_status_t
HAL_FDCAN_IsEnabledTxDelayCompensation
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check Transmitter Delay Compensation status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_transmitter_delay_comp_status_t Current transmitter delay compensation status.
-
hal_status_t
HAL_FDCAN_EnableISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable ISO 11898-1 protocol mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable ISO 11898-1 protocol mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_iso_mode_status_t
HAL_FDCAN_IsEnabledISOMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check ISO 11898-1 protocol mode status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_iso_mode_status_t Current protocol mode status.
-
hal_status_t
HAL_FDCAN_EnableEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable edge filtering during bus integration.
Note
Two consecutive dominant tq’s are required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable edge filtering during bus integration.
Note
One dominant tq is required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_edge_filtering_status_t
HAL_FDCAN_IsEnabledEdgeFiltering
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check edge filtering during bus integration status.
Note
One dominant tq is required to detect an edge for hard synchronization.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_edge_filtering_status_t Current edge filtering status.
-
hal_status_t
HAL_FDCAN_SetMode
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_mode_t
mode
)
-
Set the FDCAN mode.
Warning
This function can only be called from HAL_FDCAN_STATE_IDLE state.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t
-
mode – Value of the mode to set based on hal_fdcan_mode_t .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_mode_t
HAL_FDCAN_GetMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the FDCAN mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_mode_t Current FDCAN mode configuration.
-
hal_status_t
HAL_FDCAN_SetFrameFormat
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_frame_format_t
frame_format
)
-
Set the frame format.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
frame_format – The frame format to set.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_frame_format_t
HAL_FDCAN_GetFrameFormat
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the frame format.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_frame_format_t Current FDCAN frame format.
-
hal_status_t
HAL_FDCAN_SetAutoRetransmission
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_auto_retransmission_status_t
auto_retransmit
)
-
Set auto retransmission.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
auto_retransmit – Value to enable or disable the automatic retransmission of messages.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_auto_retransmission_status_t
HAL_FDCAN_GetAutoRetransmission
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get auto retransmission status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_auto_retransmission_status_t Current auto retransmission status.
-
hal_status_t
HAL_FDCAN_SetTransmitPause
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_transmit_pause_status_t
transmit_pause
)
-
Set transmit pause.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
transmit_pause – Value to enable/disable the FDCAN pauses for two CAN bit times before starting the next transmission.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_transmit_pause_status_t
HAL_FDCAN_GetTransmitPause
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the transmit pause status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_transmit_pause_status_t Current transmit pause status.
-
hal_status_t
HAL_FDCAN_SetProtocolException
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_protocol_exception_status_t
protocol_exception
)
-
Set protocol exception.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
protocol_exception – Value to enable or disable the protocol exception.
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_protocol_exception_status_t
HAL_FDCAN_GetProtocolException
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the protocol exception status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_protocol_exception_status_t Current protocol exception status.
-
uint32_t
HAL_FDCAN_GetClockFreq
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the peripheral clock frequency for FDCAN.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle. structure
- Returns :
-
Current clock frequency(hz) or 0 if FDCAN is not configured or not ready.
-
hal_status_t
HAL_FDCAN_RegisterTxEventFifoCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
-
Register Tx event FIFO callback to be used instead of the weak HAL_FDCAN_TxEventFifoCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx Event FIFO Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterRxFifo0Callback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
-
Register Rx FIFO 0 callback to be used instead of the weak HAL_FDCAN_RxFifo0Callback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Rx FIFO 0 Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterRxFifo1Callback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_fifo_cb_t
p_callback
)
-
Register Rx FIFO 1 callback to be used instead of the weak HAL_FDCAN_RxFifo1Callback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Rx FIFO 1 Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxBufferCompleteCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_buffer_cb_t
p_callback
)
-
Register Tx Buffer Complete callback to be used instead of the weak HAL_FDCAN_TxBufferCompleteCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx Buffer Complete Callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxBufferAbortCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_buffer_cb_t
p_callback
)
-
Register Tx buffer abort callback to be used instead of the weak HAL_FDCAN_TxBufferAbortCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx buffer abort callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterHighPriorityMessageCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register high priority message callback to be used instead of the weak HAL_FDCAN_HighPriorityMessageCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the high priority message callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTxFifoEmptyCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register Tx FIFO empty callback to be used instead of the weak HAL_FDCAN_TxFifoEmptyCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the Tx FIFO empty callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterTimestampWraparoundCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register timestamp wrapAround callback to be used instead of the weak HAL_FDCAN_TimestampWraparoundCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the timestamp wrapAround callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
hal_status_t
HAL_FDCAN_RegisterErrorCallback
(
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_cb_t
p_callback
)
-
Register error callback to be used instead of the weak HAL_FDCAN_ErrorCallback() predefined callback.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_callback – Pointer to the FDCAN error callback function.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_callback is NULL.
-
-
Control Functions ¶
- group FDCAN_Exported_Functions_Group4
-
A set of functions allowing to control the peripheral and initiate an operation on the bus:
-
HAL_FDCAN_Start() : Start the FDCAN module
-
HAL_FDCAN_Stop() : Stop the FDCAN module and enable access to configuration registers
-
HAL_FDCAN_ReqTransmitMsgFromFIFOQ() : Add a message to the Tx FIFO/Queue and activate the corresponding transmission request
-
HAL_FDCAN_GetLatestTxFifoQRequestBuffer() : Get the Tx buffer index of latest Tx FIFO/Queue request
-
HAL_FDCAN_ReqAbortOfTxBuffer() : Abort transmission request
-
HAL_FDCAN_GetReceivedMessage() : Get a FDCAN frame from the Rx FIFO zone into the message RAM
-
HAL_FDCAN_GetTxEvent() : Get a FDCAN Tx event from the Tx Event FIFO zone into the message RAM
-
HAL_FDCAN_GetHighPriorityMessageStatus() : Get the high priority message status
-
HAL_FDCAN_GetProtocolStatus() : Get the protocol status
-
HAL_FDCAN_GetErrorCounters() : Get the error counter values
-
HAL_FDCAN_GetTxBufferMessageStatus() : Check if a transmission request is pending on the selected Tx buffer
-
HAL_FDCAN_GetRxFifoFillLevel() : Get the Rx FIFO fill level
-
HAL_FDCAN_GetTxFifoFreeLevel() : Get the Tx FIFO free level
-
HAL_FDCAN_EnableRestrictedOperationMode() : Enable the restricted operation mode
-
HAL_FDCAN_DisableRestrictedOperationMode() : Disable the restricted operation mode
-
HAL_FDCAN_IsEnabledRestrictedOperationMode() : Check if the FDCAN peripheral entered Restricted Operation Mode
Functions
-
hal_status_t
HAL_FDCAN_Start
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Start the FDCAN module.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
-
hal_status_t
HAL_FDCAN_Stop
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Stop the FDCAN module and enable access to configuration registers.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot leave the power down mode.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
-
hal_status_t
HAL_FDCAN_ReqTransmitMsgFromFIFOQ
(
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_tx_header_t
*
p_tx_element_header
,
const
uint8_t
*
p_tx_data
)
¶
-
Add a message to the Tx FIFO/Queue and activate the corresponding transmission request.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_element_header – Pointer to a structure based on hal_fdcan_tx_header_t containing the header of the element to transmit.
-
p_tx_data – Pointer to a buffer containing the payload of the Tx frame.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_element_header or p_tx_data are NULL.
-
-
hal_fdcan_fifo_status_t
HAL_FDCAN_GetTxFifoStatus
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the Tx FIFO status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_fifo_status_t Current Tx FIFO status.
-
uint32_t
HAL_FDCAN_GetLatestTxFifoQRequestBuffer
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the Tx buffer index of latest Tx FIFO/Queue request.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current index of last Tx FIFO/Queue request or 0 if no Tx submitted request.
-
hal_fdcan_tx_fifo_free_level_t
HAL_FDCAN_GetTxFifoFreeLevel
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Return the Tx FIFO free level - number of consecutive free Tx FIFO elements starting from Tx FIFO get_index.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_tx_fifo_free_level_t Current Tx FIFO free level.
-
hal_status_t
HAL_FDCAN_ReqAbortOfTxBuffer
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_index
)
¶
-
Abort transmission request.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_index – buffer index. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_GetTxEvent
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_evt_fifo_header_t
*
p_tx_event
)
¶
-
Get a FDCAN Tx event from the Tx Event FIFO zone into the message RAM.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_event – Pointer to a hal_fdcan_tx_event_fifo_t structure.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_event is NULL.
-
HAL_ERROR – FIFO is empty or no RAM was allocated for it.
-
-
hal_fdcan_buffer_status_t
HAL_FDCAN_GetTxBufferMessageStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
tx_buffer_index
)
¶
-
Check if a transmission request is pending on the selected Tx buffer.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_buffer_index – Transmission buffer index. This parameter can be any combination of HAL FDCAN Tx Location .
-
- Returns :
-
hal_fdcan_buffer_status_t Current transmission pending status.
-
hal_status_t
HAL_FDCAN_GetReceivedMessage
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_location
,
hal_fdcan_rx_header_t
*
p_rx_header
,
uint8_t
*
p_rx_data
)
¶
-
Get a FDCAN frame from the Rx FIFO zone into the message RAM.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_location – Location of the received message to be read.
-
p_rx_header – Pointer to the Rx header element to fill.
-
p_rx_data – Pointer to a buffer where the payload of the Rx message will be stored.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_rx_header or p_rx_data are NULL.
-
HAL_ERROR – Rx FIFO empty.
-
-
void
HAL_FDCAN_GetRxFifoFillLevel
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_sel
,
uint32_t
*
p_fill_level
)
¶
-
Get the Rx FIFO fill level.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_sel – value to select the right available Rx FIFO 0/1.
-
p_fill_level – Pointer to the Rx FIFO fill level.
-
-
hal_status_t
HAL_FDCAN_GetHighPriorityMessageStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_high_prio_msg_status_t
*
p_hp_msg_status
)
¶
-
Get the high priority message status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_hp_msg_status – Pointer to a structure based on hal_fdcan_high_prio_msg_status_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_hp_msg_status is NULL.
-
-
hal_status_t
HAL_FDCAN_GetProtocolStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_protocol_status_t
*
p_protocol_status
)
¶
-
Get the protocol status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_protocol_status – Pointer to a structure based on hal_fdcan_protocol_status_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_protocol_status is NULL.
-
-
hal_status_t
HAL_FDCAN_GetErrorCounters
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_error_counters_t
*
p_error_counters
)
¶
-
Get the error counter values.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_error_counters – Pointer to a structure based on hal_fdcan_error_counters_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_error_counters is NULL.
-
-
hal_status_t
HAL_FDCAN_EnableRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Enable the restricted operation mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Disable the restricted operation mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_restricted_op_mode_status_t
HAL_FDCAN_IsEnabledRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Check the FDCAN restricted operation mode status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_restricted_op_mode_status_t Current restricted operation mode status.
-
- group FDCAN_Exported_Functions_Group4
-
A set of functions allowing to control the peripheral and initiate an operation on the bus:
-
HAL_FDCAN_Start() : Start the FDCAN module
-
HAL_FDCAN_Stop() : Stop the FDCAN module and enable access to configuration registers
-
HAL_FDCAN_ReqTransmitMsgFromFIFOQ() : Add a message to the Tx FIFO/Queue and activate the corresponding transmission request
-
HAL_FDCAN_GetLatestTxFifoQRequestBuffer() : Get the Tx buffer index of latest Tx FIFO/Queue request
-
HAL_FDCAN_ReqAbortOfTxBuffer() : Abort transmission request
-
HAL_FDCAN_GetReceivedMessage() : Get a FDCAN frame from the Rx FIFO zone into the message RAM
-
HAL_FDCAN_GetTxEvent() : Get a FDCAN Tx event from the Tx Event FIFO zone into the message RAM
-
HAL_FDCAN_GetHighPriorityMessageStatus() : Get the high priority message status
-
HAL_FDCAN_GetProtocolStatus() : Get the protocol status
-
HAL_FDCAN_GetErrorCounters() : Get the error counter values
-
HAL_FDCAN_GetTxBufferMessageStatus() : Check if a transmission request is pending on the selected Tx buffer
-
HAL_FDCAN_GetRxFifoFillLevel() : Get the Rx FIFO fill level
-
HAL_FDCAN_GetTxFifoFreeLevel() : Get the Tx FIFO free level
-
HAL_FDCAN_EnableRestrictedOperationMode() : Enable the restricted operation mode
-
HAL_FDCAN_DisableRestrictedOperationMode() : Disable the restricted operation mode
-
HAL_FDCAN_IsEnabledRestrictedOperationMode() : Check if the FDCAN peripheral entered Restricted Operation Mode
Functions
-
hal_status_t
HAL_FDCAN_Start
(
hal_fdcan_handle_t
*
hfdcan
)
-
Start the FDCAN module.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
-
hal_status_t
HAL_FDCAN_Stop
(
hal_fdcan_handle_t
*
hfdcan
)
-
Stop the FDCAN module and enable access to configuration registers.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot leave the power down mode.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
-
hal_status_t
HAL_FDCAN_ReqTransmitMsgFromFIFOQ
(
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_tx_header_t
*
p_tx_element_header
,
const
uint8_t
*
p_tx_data
)
-
Add a message to the Tx FIFO/Queue and activate the corresponding transmission request.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_element_header – Pointer to a structure based on hal_fdcan_tx_header_t containing the header of the element to transmit.
-
p_tx_data – Pointer to a buffer containing the payload of the Tx frame.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_element_header or p_tx_data are NULL.
-
-
hal_fdcan_fifo_status_t
HAL_FDCAN_GetTxFifoStatus
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the Tx FIFO status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_fifo_status_t Current Tx FIFO status.
-
uint32_t
HAL_FDCAN_GetLatestTxFifoQRequestBuffer
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the Tx buffer index of latest Tx FIFO/Queue request.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current index of last Tx FIFO/Queue request or 0 if no Tx submitted request.
-
hal_fdcan_tx_fifo_free_level_t
HAL_FDCAN_GetTxFifoFreeLevel
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the Tx FIFO free level - number of consecutive free Tx FIFO elements starting from Tx FIFO get_index.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_tx_fifo_free_level_t Current Tx FIFO free level.
-
hal_status_t
HAL_FDCAN_ReqAbortOfTxBuffer
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_index
)
-
Abort transmission request.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_index – buffer index. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_GetTxEvent
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_evt_fifo_header_t
*
p_tx_event
)
-
Get a FDCAN Tx event from the Tx Event FIFO zone into the message RAM.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_event – Pointer to a hal_fdcan_tx_event_fifo_t structure.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_event is NULL.
-
HAL_ERROR – FIFO is empty or no RAM was allocated for it.
-
-
hal_fdcan_buffer_status_t
HAL_FDCAN_GetTxBufferMessageStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
tx_buffer_index
)
-
Check if a transmission request is pending on the selected Tx buffer.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_buffer_index – Transmission buffer index. This parameter can be any combination of HAL FDCAN Tx Location .
-
- Returns :
-
hal_fdcan_buffer_status_t Current transmission pending status.
-
hal_status_t
HAL_FDCAN_GetReceivedMessage
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_location
,
hal_fdcan_rx_header_t
*
p_rx_header
,
uint8_t
*
p_rx_data
)
-
Get a FDCAN frame from the Rx FIFO zone into the message RAM.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_location – Location of the received message to be read.
-
p_rx_header – Pointer to the Rx header element to fill.
-
p_rx_data – Pointer to a buffer where the payload of the Rx message will be stored.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_rx_header or p_rx_data are NULL.
-
HAL_ERROR – Rx FIFO empty.
-
-
void
HAL_FDCAN_GetRxFifoFillLevel
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_sel
,
uint32_t
*
p_fill_level
)
-
Get the Rx FIFO fill level.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_sel – value to select the right available Rx FIFO 0/1.
-
p_fill_level – Pointer to the Rx FIFO fill level.
-
-
hal_status_t
HAL_FDCAN_GetHighPriorityMessageStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_high_prio_msg_status_t
*
p_hp_msg_status
)
-
Get the high priority message status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_hp_msg_status – Pointer to a structure based on hal_fdcan_high_prio_msg_status_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_hp_msg_status is NULL.
-
-
hal_status_t
HAL_FDCAN_GetProtocolStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_protocol_status_t
*
p_protocol_status
)
-
Get the protocol status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_protocol_status – Pointer to a structure based on hal_fdcan_protocol_status_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_protocol_status is NULL.
-
-
hal_status_t
HAL_FDCAN_GetErrorCounters
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_error_counters_t
*
p_error_counters
)
-
Get the error counter values.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_error_counters – Pointer to a structure based on hal_fdcan_error_counters_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_error_counters is NULL.
-
-
hal_status_t
HAL_FDCAN_EnableRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable the restricted operation mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable the restricted operation mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_restricted_op_mode_status_t
HAL_FDCAN_IsEnabledRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check the FDCAN restricted operation mode status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_restricted_op_mode_status_t Current restricted operation mode status.
-
- group FDCAN_Exported_Functions_Group4
-
A set of functions allowing to control the peripheral and initiate an operation on the bus:
-
HAL_FDCAN_Start() : Start the FDCAN module
-
HAL_FDCAN_Stop() : Stop the FDCAN module and enable access to configuration registers
-
HAL_FDCAN_ReqTransmitMsgFromFIFOQ() : Add a message to the Tx FIFO/Queue and activate the corresponding transmission request
-
HAL_FDCAN_GetLatestTxFifoQRequestBuffer() : Get the Tx buffer index of latest Tx FIFO/Queue request
-
HAL_FDCAN_ReqAbortOfTxBuffer() : Abort transmission request
-
HAL_FDCAN_GetReceivedMessage() : Get a FDCAN frame from the Rx FIFO zone into the message RAM
-
HAL_FDCAN_GetTxEvent() : Get a FDCAN Tx event from the Tx Event FIFO zone into the message RAM
-
HAL_FDCAN_GetHighPriorityMessageStatus() : Get the high priority message status
-
HAL_FDCAN_GetProtocolStatus() : Get the protocol status
-
HAL_FDCAN_GetErrorCounters() : Get the error counter values
-
HAL_FDCAN_GetTxBufferMessageStatus() : Check if a transmission request is pending on the selected Tx buffer
-
HAL_FDCAN_GetRxFifoFillLevel() : Get the Rx FIFO fill level
-
HAL_FDCAN_GetTxFifoFreeLevel() : Get the Tx FIFO free level
-
HAL_FDCAN_EnableRestrictedOperationMode() : Enable the restricted operation mode
-
HAL_FDCAN_DisableRestrictedOperationMode() : Disable the restricted operation mode
-
HAL_FDCAN_IsEnabledRestrictedOperationMode() : Check if the FDCAN peripheral entered Restricted Operation Mode
Functions
-
hal_status_t
HAL_FDCAN_Start
(
hal_fdcan_handle_t
*
hfdcan
)
-
Start the FDCAN module.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
-
hal_status_t
HAL_FDCAN_Stop
(
hal_fdcan_handle_t
*
hfdcan
)
-
Stop the FDCAN module and enable access to configuration registers.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – FDCAN cannot leave the power down mode.
-
HAL_INVALID_PARAM – hfdcan is NULL.
-
-
hal_status_t
HAL_FDCAN_ReqTransmitMsgFromFIFOQ
(
hal_fdcan_handle_t
*
hfdcan
,
const
hal_fdcan_tx_header_t
*
p_tx_element_header
,
const
uint8_t
*
p_tx_data
)
-
Add a message to the Tx FIFO/Queue and activate the corresponding transmission request.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_element_header – Pointer to a structure based on hal_fdcan_tx_header_t containing the header of the element to transmit.
-
p_tx_data – Pointer to a buffer containing the payload of the Tx frame.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_element_header or p_tx_data are NULL.
-
-
hal_fdcan_fifo_status_t
HAL_FDCAN_GetTxFifoStatus
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the Tx FIFO status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_fifo_status_t Current Tx FIFO status.
-
uint32_t
HAL_FDCAN_GetLatestTxFifoQRequestBuffer
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the Tx buffer index of latest Tx FIFO/Queue request.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Current index of last Tx FIFO/Queue request or 0 if no Tx submitted request.
-
hal_fdcan_tx_fifo_free_level_t
HAL_FDCAN_GetTxFifoFreeLevel
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the Tx FIFO free level - number of consecutive free Tx FIFO elements starting from Tx FIFO get_index.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_tx_fifo_free_level_t Current Tx FIFO free level.
-
hal_status_t
HAL_FDCAN_ReqAbortOfTxBuffer
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_index
)
-
Abort transmission request.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_index – buffer index. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_GetTxEvent
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_tx_evt_fifo_header_t
*
p_tx_event
)
-
Get a FDCAN Tx event from the Tx Event FIFO zone into the message RAM.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_tx_event – Pointer to a hal_fdcan_tx_event_fifo_t structure.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_tx_event is NULL.
-
HAL_ERROR – FIFO is empty or no RAM was allocated for it.
-
-
hal_fdcan_buffer_status_t
HAL_FDCAN_GetTxBufferMessageStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
tx_buffer_index
)
-
Check if a transmission request is pending on the selected Tx buffer.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_buffer_index – Transmission buffer index. This parameter can be any combination of HAL FDCAN Tx Location .
-
- Returns :
-
hal_fdcan_buffer_status_t Current transmission pending status.
-
hal_status_t
HAL_FDCAN_GetReceivedMessage
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_location
,
hal_fdcan_rx_header_t
*
p_rx_header
,
uint8_t
*
p_rx_data
)
-
Get a FDCAN frame from the Rx FIFO zone into the message RAM.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_location – Location of the received message to be read.
-
p_rx_header – Pointer to the Rx header element to fill.
-
p_rx_data – Pointer to a buffer where the payload of the Rx message will be stored.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_rx_header or p_rx_data are NULL.
-
HAL_ERROR – Rx FIFO empty.
-
-
void
HAL_FDCAN_GetRxFifoFillLevel
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_rx_location_t
rx_fifo_sel
,
uint32_t
*
p_fill_level
)
-
Get the Rx FIFO fill level.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo_sel – value to select the right available Rx FIFO 0/1.
-
p_fill_level – Pointer to the Rx FIFO fill level.
-
-
hal_status_t
HAL_FDCAN_GetHighPriorityMessageStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_high_prio_msg_status_t
*
p_hp_msg_status
)
-
Get the high priority message status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_hp_msg_status – Pointer to a structure based on hal_fdcan_high_prio_msg_status_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_hp_msg_status is NULL.
-
-
hal_status_t
HAL_FDCAN_GetProtocolStatus
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_protocol_status_t
*
p_protocol_status
)
-
Get the protocol status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_protocol_status – Pointer to a structure based on hal_fdcan_protocol_status_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_protocol_status is NULL.
-
-
hal_status_t
HAL_FDCAN_GetErrorCounters
(
const
hal_fdcan_handle_t
*
hfdcan
,
hal_fdcan_error_counters_t
*
p_error_counters
)
-
Get the error counter values.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
p_error_counters – Pointer to a structure based on hal_fdcan_error_counters_t .
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_INVALID_PARAM – p_error_counters is NULL.
-
-
hal_status_t
HAL_FDCAN_EnableRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Enable the restricted operation mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Disable the restricted operation mode.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_restricted_op_mode_status_t
HAL_FDCAN_IsEnabledRestrictedOperationMode
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Check the FDCAN restricted operation mode status.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_restricted_op_mode_status_t Current restricted operation mode status.
-
Interrupts Management Functions ¶
- group FDCAN_Exported_Functions_Group5
-
A set of functions allowing to deal with interruptions of the peripheral:
-
HAL_FDCAN_SetInterruptGroupsToLine() : Assign interrupt groups to either interrupt line 0 or 1
-
HAL_FDCAN_GetLineFromInterruptGroup() : Get the line associated to an interrupt group
-
HAL_FDCAN_EnableInterrupts() : Enable interrupt sources
-
HAL_FDCAN_DisableInterrupts() : Disable interrupt sources
-
HAL_FDCAN_IsEnabledInterrupt() : Check if a given interrupt source is enabled
-
HAL_FDCAN_EnableInterruptLines() : Enable the given interrupt line
-
HAL_FDCAN_DisableInterruptLines() : Disable the given interrupt line
-
HAL_FDCAN_IsEnabledInterruptLine() : Check if a given interrupt line is enabled
-
HAL_FDCAN_EnableTxBufferCompleteInterrupts() : Enable interrupt for Tx buffer Complete
-
HAL_FDCAN_DisableTxBufferCompleteInterrupts() : Disable interrupt for Tx buffer Complete
-
HAL_FDCAN_IsEnabledTxBufferCompleteInterrupt() : Check if interrupt for Tx buffer Complete is enabled
-
HAL_FDCAN_EnableTxBufferCancellationInterrupts() : Enable interrupt for Tx buffer cancellation finished
-
HAL_FDCAN_DisableTxBufferCancellationInterrupts() : Disable interrupt for Tx buffer cancellation finished
-
HAL_FDCAN_IsEnabledTxBufferCancellationInterrupt() : Check if interrupt for Tx buffer cancellation finished is enabled
-
HAL_FDCAN_IRQHandler() : FDCAN interrupt request handler
Functions
-
void
HAL_FDCAN_IRQHandler
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Processes the FDCAN interrupt requests.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
hal_status_t
HAL_FDCAN_SetInterruptGroupsToLine
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt_groups
,
uint32_t
it_line
)
¶
-
Assign the interrupt group(s) to an interrupt line.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt_groups – Interrupt group(s) to connect to the given interrupt line. This parameter can be any combination of FDCAN Interrupt Groups .
-
it_line – Indicates which interrupt line must be assigned to the interrupt groups. This parameter must be one unique item of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetLineFromInterruptGroup
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt_group
)
¶
-
Get the interrupt line assigned to an interrupt group - applies to a single interrupt group.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt_group – Interrupt group. This parameter must be one unique item of FDCAN Interrupt Groups .
-
- Return values :
-
-
HAL_FDCAN_IT_LINE_0 – Interrupt group is assigned to line 0.
-
HAL_FDCAN_IT_LINE_1 – Interrupt group is assigned to line 1.
-
-
hal_status_t
HAL_FDCAN_EnableInterruptLines
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_lines
)
¶
-
Enable the interrupt line.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_lines – Interrupt line(s) to enable. Can be OR-ed. This parameter can be a combination of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableInterruptLines
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_lines
)
¶
-
Disable the interrupt lines.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_lines – Interrupt line(s) to disable. This parameter can be any combination of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_lines_status_t
HAL_FDCAN_IsEnabledInterruptLine
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_line
)
¶
-
Check the interrupt line status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_line – Interrupt line to be checked. This parameter must be a unique value of FDCAN Interrupt Lines .
-
- Returns :
-
hal_fdcan_it_lines_status_t Current interrupt line status.
-
hal_status_t
HAL_FDCAN_EnableInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupts
)
¶
-
Enable the interrupts.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupts – Interrupt signal(s) to enable, can be OR-ed with different interrupt signals. This parameter can be any combination of FDCAN Interrupt Sources .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupts
)
¶
-
Disable the interrupts.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupts – Interrupt signal(s) to disable - Can be OR-ed with other interrupt signals. This parameter can be any combination of
-
FDCAN_Interrupt_Sources.
-
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_status_t
HAL_FDCAN_IsEnabledInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt
)
¶
-
Check the interrupt status. Apply to one single interrupt signal.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt – Interrupt signal to check. Only one single interrupt signal can be checked at a time. This parameter must be one unique sample of
-
FDCAN_Interrupt_Sources.
-
-
- Returns :
-
hal_fdcan_it_status_t Current interrupt status.
-
hal_status_t
HAL_FDCAN_EnableTxBufferCompleteInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
¶
-
Enable the transmission buffer complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffers to select to enable the transmission complete interrupt - can be OR-ed. This parameter can be any combination of FDCAN Interrupt Tx Complete Buffers select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxBufferCompleteInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
¶
-
Disable the transmission buffer complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffers to select to disable the transmission complete interrupt - can be OR-ed. This parameter can be any combination of FDCAN Interrupt Tx Complete Buffers select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_txbuffer_complete_status_t
HAL_FDCAN_IsEnabledTxBufferCompleteInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
¶
-
Check the status of the buffer connected to transmission complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffer to check with transmission complete interrupt status. This is applicable to a single buffer only. This parameter must be an unique sample of FDCAN Interrupt Tx Complete Buffers select
-
- Returns :
-
hal_fdcan_it_txbuffer_complete_status_t Current Tx complete interrupt buffer status.
-
hal_status_t
HAL_FDCAN_EnableTxBufferCancellationInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
¶
-
Enable the transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – The buffers on which to enable the transmission cancellation finished interrupt. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxBufferCancellationInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
¶
-
Disable the transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – The buffers on which to enable the transmission cancellation finished interrupt. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_txbuffer_abort_status_t
HAL_FDCAN_IsEnabledTxBufferCancellationInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
¶
-
Check the status of the buffer connected to transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffer to check with transmission cancellation finished status. This is applicable to a single buffer only. This parameter must be an unique sample of FDCAN Interrupt Tx Abort Buffer select
-
- Returns :
-
hal_fdcan_it_txbuffer_abort_status_t Current Tx cancellation finished interrupt buffer status.
-
uint32_t
HAL_FDCAN_GetFlag
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
flag
)
¶
-
Check whether the specified FDCAN flag is set or not.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t .
-
flag – FDCAN flag. This parameter can be one of
-
FDCAN_Interrupt_Sources
-
-
- Return values :
-
uint32_t – FlagStatus
-
- group FDCAN_Exported_Functions_Group5
-
A set of functions allowing to deal with interruptions of the peripheral:
-
HAL_FDCAN_SetInterruptGroupsToLine() : Assign interrupt groups to either interrupt line 0 or 1
-
HAL_FDCAN_GetLineFromInterruptGroup() : Get the line associated to an interrupt group
-
HAL_FDCAN_EnableInterrupts() : Enable interrupt sources
-
HAL_FDCAN_DisableInterrupts() : Disable interrupt sources
-
HAL_FDCAN_IsEnabledInterrupt() : Check if a given interrupt source is enabled
-
HAL_FDCAN_EnableInterruptLines() : Enable the given interrupt line
-
HAL_FDCAN_DisableInterruptLines() : Disable the given interrupt line
-
HAL_FDCAN_IsEnabledInterruptLine() : Check if a given interrupt line is enabled
-
HAL_FDCAN_EnableTxBufferCompleteInterrupts() : Enable interrupt for Tx buffer Complete
-
HAL_FDCAN_DisableTxBufferCompleteInterrupts() : Disable interrupt for Tx buffer Complete
-
HAL_FDCAN_IsEnabledTxBufferCompleteInterrupt() : Check if interrupt for Tx buffer Complete is enabled
-
HAL_FDCAN_EnableTxBufferCancellationInterrupts() : Enable interrupt for Tx buffer cancellation finished
-
HAL_FDCAN_DisableTxBufferCancellationInterrupts() : Disable interrupt for Tx buffer cancellation finished
-
HAL_FDCAN_IsEnabledTxBufferCancellationInterrupt() : Check if interrupt for Tx buffer cancellation finished is enabled
-
HAL_FDCAN_IRQHandler() : FDCAN interrupt request handler
Functions
-
void
HAL_FDCAN_IRQHandler
(
hal_fdcan_handle_t
*
hfdcan
)
-
Processes the FDCAN interrupt requests.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
hal_status_t
HAL_FDCAN_SetInterruptGroupsToLine
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt_groups
,
uint32_t
it_line
)
-
Assign the interrupt group(s) to an interrupt line.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt_groups – Interrupt group(s) to connect to the given interrupt line. This parameter can be any combination of FDCAN Interrupt Groups .
-
it_line – Indicates which interrupt line must be assigned to the interrupt groups. This parameter must be one unique item of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetLineFromInterruptGroup
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt_group
)
-
Get the interrupt line assigned to an interrupt group - applies to a single interrupt group.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt_group – Interrupt group. This parameter must be one unique item of FDCAN Interrupt Groups .
-
- Return values :
-
-
HAL_FDCAN_IT_LINE_0 – Interrupt group is assigned to line 0.
-
HAL_FDCAN_IT_LINE_1 – Interrupt group is assigned to line 1.
-
-
hal_status_t
HAL_FDCAN_EnableInterruptLines
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_lines
)
-
Enable the interrupt line.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_lines – Interrupt line(s) to enable. Can be OR-ed. This parameter can be a combination of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableInterruptLines
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_lines
)
-
Disable the interrupt lines.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_lines – Interrupt line(s) to disable. This parameter can be any combination of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_lines_status_t
HAL_FDCAN_IsEnabledInterruptLine
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_line
)
-
Check the interrupt line status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_line – Interrupt line to be checked. This parameter must be a unique value of FDCAN Interrupt Lines .
-
- Returns :
-
hal_fdcan_it_lines_status_t Current interrupt line status.
-
hal_status_t
HAL_FDCAN_EnableInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupts
)
-
Enable the interrupts.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupts – Interrupt signal(s) to enable, can be OR-ed with different interrupt signals. This parameter can be any combination of FDCAN Interrupt Sources .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupts
)
-
Disable the interrupts.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupts – Interrupt signal(s) to disable - Can be OR-ed with other interrupt signals. This parameter can be any combination of
-
FDCAN_Interrupt_Sources.
-
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_status_t
HAL_FDCAN_IsEnabledInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt
)
-
Check the interrupt status. Apply to one single interrupt signal.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt – Interrupt signal to check. Only one single interrupt signal can be checked at a time. This parameter must be one unique sample of
-
FDCAN_Interrupt_Sources.
-
-
- Returns :
-
hal_fdcan_it_status_t Current interrupt status.
-
hal_status_t
HAL_FDCAN_EnableTxBufferCompleteInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Enable the transmission buffer complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffers to select to enable the transmission complete interrupt - can be OR-ed. This parameter can be any combination of FDCAN Interrupt Tx Complete Buffers select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxBufferCompleteInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Disable the transmission buffer complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffers to select to disable the transmission complete interrupt - can be OR-ed. This parameter can be any combination of FDCAN Interrupt Tx Complete Buffers select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_txbuffer_complete_status_t
HAL_FDCAN_IsEnabledTxBufferCompleteInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Check the status of the buffer connected to transmission complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffer to check with transmission complete interrupt status. This is applicable to a single buffer only. This parameter must be an unique sample of FDCAN Interrupt Tx Complete Buffers select
-
- Returns :
-
hal_fdcan_it_txbuffer_complete_status_t Current Tx complete interrupt buffer status.
-
hal_status_t
HAL_FDCAN_EnableTxBufferCancellationInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Enable the transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – The buffers on which to enable the transmission cancellation finished interrupt. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxBufferCancellationInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Disable the transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – The buffers on which to enable the transmission cancellation finished interrupt. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_txbuffer_abort_status_t
HAL_FDCAN_IsEnabledTxBufferCancellationInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Check the status of the buffer connected to transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffer to check with transmission cancellation finished status. This is applicable to a single buffer only. This parameter must be an unique sample of FDCAN Interrupt Tx Abort Buffer select
-
- Returns :
-
hal_fdcan_it_txbuffer_abort_status_t Current Tx cancellation finished interrupt buffer status.
-
uint32_t
HAL_FDCAN_GetFlag
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
flag
)
-
Check whether the specified FDCAN flag is set or not.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t .
-
flag – FDCAN flag. This parameter can be one of
-
FDCAN_Interrupt_Sources
-
-
- Return values :
-
uint32_t – FlagStatus
-
- group FDCAN_Exported_Functions_Group5
-
A set of functions allowing to deal with interruptions of the peripheral:
-
HAL_FDCAN_SetInterruptGroupsToLine() : Assign interrupt groups to either interrupt line 0 or 1
-
HAL_FDCAN_GetLineFromInterruptGroup() : Get the line associated to an interrupt group
-
HAL_FDCAN_EnableInterrupts() : Enable interrupt sources
-
HAL_FDCAN_DisableInterrupts() : Disable interrupt sources
-
HAL_FDCAN_IsEnabledInterrupt() : Check if a given interrupt source is enabled
-
HAL_FDCAN_EnableInterruptLines() : Enable the given interrupt line
-
HAL_FDCAN_DisableInterruptLines() : Disable the given interrupt line
-
HAL_FDCAN_IsEnabledInterruptLine() : Check if a given interrupt line is enabled
-
HAL_FDCAN_EnableTxBufferCompleteInterrupts() : Enable interrupt for Tx buffer Complete
-
HAL_FDCAN_DisableTxBufferCompleteInterrupts() : Disable interrupt for Tx buffer Complete
-
HAL_FDCAN_IsEnabledTxBufferCompleteInterrupt() : Check if interrupt for Tx buffer Complete is enabled
-
HAL_FDCAN_EnableTxBufferCancellationInterrupts() : Enable interrupt for Tx buffer cancellation finished
-
HAL_FDCAN_DisableTxBufferCancellationInterrupts() : Disable interrupt for Tx buffer cancellation finished
-
HAL_FDCAN_IsEnabledTxBufferCancellationInterrupt() : Check if interrupt for Tx buffer cancellation finished is enabled
-
HAL_FDCAN_IRQHandler() : FDCAN interrupt request handler
Functions
-
void
HAL_FDCAN_IRQHandler
(
hal_fdcan_handle_t
*
hfdcan
)
-
Processes the FDCAN interrupt requests.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
hal_status_t
HAL_FDCAN_SetInterruptGroupsToLine
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt_groups
,
uint32_t
it_line
)
-
Assign the interrupt group(s) to an interrupt line.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt_groups – Interrupt group(s) to connect to the given interrupt line. This parameter can be any combination of FDCAN Interrupt Groups .
-
it_line – Indicates which interrupt line must be assigned to the interrupt groups. This parameter must be one unique item of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
uint32_t
HAL_FDCAN_GetLineFromInterruptGroup
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt_group
)
-
Get the interrupt line assigned to an interrupt group - applies to a single interrupt group.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt_group – Interrupt group. This parameter must be one unique item of FDCAN Interrupt Groups .
-
- Return values :
-
-
HAL_FDCAN_IT_LINE_0 – Interrupt group is assigned to line 0.
-
HAL_FDCAN_IT_LINE_1 – Interrupt group is assigned to line 1.
-
-
hal_status_t
HAL_FDCAN_EnableInterruptLines
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_lines
)
-
Enable the interrupt line.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_lines – Interrupt line(s) to enable. Can be OR-ed. This parameter can be a combination of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableInterruptLines
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_lines
)
-
Disable the interrupt lines.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_lines – Interrupt line(s) to disable. This parameter can be any combination of FDCAN Interrupt Lines .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_lines_status_t
HAL_FDCAN_IsEnabledInterruptLine
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
it_line
)
-
Check the interrupt line status.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
it_line – Interrupt line to be checked. This parameter must be a unique value of FDCAN Interrupt Lines .
-
- Returns :
-
hal_fdcan_it_lines_status_t Current interrupt line status.
-
hal_status_t
HAL_FDCAN_EnableInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupts
)
-
Enable the interrupts.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupts – Interrupt signal(s) to enable, can be OR-ed with different interrupt signals. This parameter can be any combination of FDCAN Interrupt Sources .
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupts
)
-
Disable the interrupts.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupts – Interrupt signal(s) to disable - Can be OR-ed with other interrupt signals. This parameter can be any combination of
-
FDCAN_Interrupt_Sources.
-
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_status_t
HAL_FDCAN_IsEnabledInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
interrupt
)
-
Check the interrupt status. Apply to one single interrupt signal.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
interrupt – Interrupt signal to check. Only one single interrupt signal can be checked at a time. This parameter must be one unique sample of
-
FDCAN_Interrupt_Sources.
-
-
- Returns :
-
hal_fdcan_it_status_t Current interrupt status.
-
hal_status_t
HAL_FDCAN_EnableTxBufferCompleteInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Enable the transmission buffer complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffers to select to enable the transmission complete interrupt - can be OR-ed. This parameter can be any combination of FDCAN Interrupt Tx Complete Buffers select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxBufferCompleteInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Disable the transmission buffer complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffers to select to disable the transmission complete interrupt - can be OR-ed. This parameter can be any combination of FDCAN Interrupt Tx Complete Buffers select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_txbuffer_complete_status_t
HAL_FDCAN_IsEnabledTxBufferCompleteInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Check the status of the buffer connected to transmission complete interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffer to check with transmission complete interrupt status. This is applicable to a single buffer only. This parameter must be an unique sample of FDCAN Interrupt Tx Complete Buffers select
-
- Returns :
-
hal_fdcan_it_txbuffer_complete_status_t Current Tx complete interrupt buffer status.
-
hal_status_t
HAL_FDCAN_EnableTxBufferCancellationInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Enable the transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – The buffers on which to enable the transmission cancellation finished interrupt. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_status_t
HAL_FDCAN_DisableTxBufferCancellationInterrupts
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Disable the transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – The buffers on which to enable the transmission cancellation finished interrupt. This parameter can be any combination of FDCAN Interrupt Tx Abort Buffer select
-
- Return values :
-
HAL_OK – Operation completed successfully.
-
hal_fdcan_it_txbuffer_abort_status_t
HAL_FDCAN_IsEnabledTxBufferCancellationInterrupt
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_idx
)
-
Check the status of the buffer connected to transmission cancellation finished interrupt.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_idx – Buffer to check with transmission cancellation finished status. This is applicable to a single buffer only. This parameter must be an unique sample of FDCAN Interrupt Tx Abort Buffer select
-
- Returns :
-
hal_fdcan_it_txbuffer_abort_status_t Current Tx cancellation finished interrupt buffer status.
-
uint32_t
HAL_FDCAN_GetFlag
(
const
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
flag
)
-
Check whether the specified FDCAN flag is set or not.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t .
-
flag – FDCAN flag. This parameter can be one of
-
FDCAN_Interrupt_Sources
-
-
- Return values :
-
uint32_t – FlagStatus
-
Weak Callback Functions ¶
- group FDCAN_Exported_Functions_Group6
-
A set of Weak functions if USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 0 (or custom Callbacks functions if USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 1) which are used to asynchronously informed the application in non-blocking modes:
-
HAL_FDCAN_TxEventFifoCallback() : Transmission event FIFO callback
-
HAL_FDCAN_RxFifo0Callback() : Reception FIFO 0 callback
-
HAL_FDCAN_RxFifo1Callback() : Reception FIFO 1 callback
-
HAL_FDCAN_TxFifoEmptyCallback() : Transmission FIFO Empty callback
-
HAL_FDCAN_TxBufferCompleteCallback() : Transmission completed callback
-
HAL_FDCAN_TxBufferAbortCallback() : Abort Transmission callback
-
HAL_FDCAN_HighPriorityMessageCallback() : High Priority Message receiving callback
-
HAL_FDCAN_TimestampWraparoundCallback() : Timestamp WrapAround callback
-
HAL_FDCAN_ErrorCallback() : Global Error callback
Functions
-
void
HAL_FDCAN_TxEventFifoCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
tx_event_fifo_interrupts
)
¶
-
Tx event callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_event_fifo_interrupts – Indicates which Tx event FIFO interrupts are raised. This parameter can be any combination of
-
FDCAN_Tx_Event_Fifo_Interrupts
-
-
-
void
HAL_FDCAN_RxFifo0Callback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
rx_fifo0_interrupts
)
¶
-
Rx FIFO 0 callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo0_interrupts – indicates which Rx FIFO 0 interrupts are raised. This parameter can be any combination of
-
FDCAN_Rx_Fifo0_Interrupts.
-
-
-
void
HAL_FDCAN_RxFifo1Callback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
rx_fifo1_interrupts
)
¶
-
Rx FIFO 1 callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo1_interrupts – indicates which Rx FIFO 1 interrupts are raised. This parameter can be any combination of
-
FDCAN_Rx_Fifo1_Interrupts.
-
-
-
void
HAL_FDCAN_TxFifoEmptyCallback
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Tx FIFO Empty callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_TxBufferCompleteCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_indexes
)
¶
-
Transmission complete callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_indexes – Indexes of the transmitted buffers. This parameter can be any combination of
-
FDCAN_IT_Tx_Complete_Buffers_select.
-
-
-
void
HAL_FDCAN_TxBufferAbortCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_indexes
)
¶
-
Transmission cancellation callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_indexes – Indexes of the aborted buffers. This parameter can be any combination of
-
FDCAN_IT_Tx_Abort_Buffers_select.
-
-
-
void
HAL_FDCAN_HighPriorityMessageCallback
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
High priority message callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_TimestampWraparoundCallback
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Timestamp wraparound callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_ErrorCallback
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Error callback.
Warning
The hfdcan handle’s last_error_codes parameter is updated by the FDCAN processes, and the user can use HAL_FDCAN_GetLastErrorCodes() to verify the most recent error that occurred.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
- group FDCAN_Exported_Functions_Group6
-
A set of Weak functions if USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 0 (or custom Callbacks functions if USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 1) which are used to asynchronously informed the application in non-blocking modes:
-
HAL_FDCAN_TxEventFifoCallback() : Transmission event FIFO callback
-
HAL_FDCAN_RxFifo0Callback() : Reception FIFO 0 callback
-
HAL_FDCAN_RxFifo1Callback() : Reception FIFO 1 callback
-
HAL_FDCAN_TxFifoEmptyCallback() : Transmission FIFO Empty callback
-
HAL_FDCAN_TxBufferCompleteCallback() : Transmission completed callback
-
HAL_FDCAN_TxBufferAbortCallback() : Abort Transmission callback
-
HAL_FDCAN_HighPriorityMessageCallback() : High Priority Message receiving callback
-
HAL_FDCAN_TimestampWraparoundCallback() : Timestamp WrapAround callback
-
HAL_FDCAN_ErrorCallback() : Global Error callback
Functions
-
void
HAL_FDCAN_TxEventFifoCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
tx_event_fifo_interrupts
)
-
Tx event callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_event_fifo_interrupts – Indicates which Tx event FIFO interrupts are raised. This parameter can be any combination of
-
FDCAN_Tx_Event_Fifo_Interrupts
-
-
-
void
HAL_FDCAN_RxFifo0Callback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
rx_fifo0_interrupts
)
-
Rx FIFO 0 callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo0_interrupts – indicates which Rx FIFO 0 interrupts are raised. This parameter can be any combination of
-
FDCAN_Rx_Fifo0_Interrupts.
-
-
-
void
HAL_FDCAN_RxFifo1Callback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
rx_fifo1_interrupts
)
-
Rx FIFO 1 callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo1_interrupts – indicates which Rx FIFO 1 interrupts are raised. This parameter can be any combination of
-
FDCAN_Rx_Fifo1_Interrupts.
-
-
-
void
HAL_FDCAN_TxFifoEmptyCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
Tx FIFO Empty callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_TxBufferCompleteCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_indexes
)
-
Transmission complete callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_indexes – Indexes of the transmitted buffers. This parameter can be any combination of
-
FDCAN_IT_Tx_Complete_Buffers_select.
-
-
-
void
HAL_FDCAN_TxBufferAbortCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_indexes
)
-
Transmission cancellation callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_indexes – Indexes of the aborted buffers. This parameter can be any combination of
-
FDCAN_IT_Tx_Abort_Buffers_select.
-
-
-
void
HAL_FDCAN_HighPriorityMessageCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
High priority message callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_TimestampWraparoundCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
Timestamp wraparound callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_ErrorCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
Error callback.
Warning
The hfdcan handle’s last_error_codes parameter is updated by the FDCAN processes, and the user can use HAL_FDCAN_GetLastErrorCodes() to verify the most recent error that occurred.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
- group FDCAN_Exported_Functions_Group6
-
A set of Weak functions if USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 0 (or custom Callbacks functions if USE_HAL_FDCAN_REGISTER_CALLBACKS is set to 1) which are used to asynchronously informed the application in non-blocking modes:
-
HAL_FDCAN_TxEventFifoCallback() : Transmission event FIFO callback
-
HAL_FDCAN_RxFifo0Callback() : Reception FIFO 0 callback
-
HAL_FDCAN_RxFifo1Callback() : Reception FIFO 1 callback
-
HAL_FDCAN_TxFifoEmptyCallback() : Transmission FIFO Empty callback
-
HAL_FDCAN_TxBufferCompleteCallback() : Transmission completed callback
-
HAL_FDCAN_TxBufferAbortCallback() : Abort Transmission callback
-
HAL_FDCAN_HighPriorityMessageCallback() : High Priority Message receiving callback
-
HAL_FDCAN_TimestampWraparoundCallback() : Timestamp WrapAround callback
-
HAL_FDCAN_ErrorCallback() : Global Error callback
Functions
-
void
HAL_FDCAN_TxEventFifoCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
tx_event_fifo_interrupts
)
-
Tx event callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
tx_event_fifo_interrupts – Indicates which Tx event FIFO interrupts are raised. This parameter can be any combination of
-
FDCAN_Tx_Event_Fifo_Interrupts
-
-
-
void
HAL_FDCAN_RxFifo0Callback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
rx_fifo0_interrupts
)
-
Rx FIFO 0 callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo0_interrupts – indicates which Rx FIFO 0 interrupts are raised. This parameter can be any combination of
-
FDCAN_Rx_Fifo0_Interrupts.
-
-
-
void
HAL_FDCAN_RxFifo1Callback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
rx_fifo1_interrupts
)
-
Rx FIFO 1 callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
rx_fifo1_interrupts – indicates which Rx FIFO 1 interrupts are raised. This parameter can be any combination of
-
FDCAN_Rx_Fifo1_Interrupts.
-
-
-
void
HAL_FDCAN_TxFifoEmptyCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
Tx FIFO Empty callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_TxBufferCompleteCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_indexes
)
-
Transmission complete callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_indexes – Indexes of the transmitted buffers. This parameter can be any combination of
-
FDCAN_IT_Tx_Complete_Buffers_select.
-
-
-
void
HAL_FDCAN_TxBufferAbortCallback
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
buffer_indexes
)
-
Transmission cancellation callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
buffer_indexes – Indexes of the aborted buffers. This parameter can be any combination of
-
FDCAN_IT_Tx_Abort_Buffers_select.
-
-
-
void
HAL_FDCAN_HighPriorityMessageCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
High priority message callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_TimestampWraparoundCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
Timestamp wraparound callback.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
void
HAL_FDCAN_ErrorCallback
(
hal_fdcan_handle_t
*
hfdcan
)
-
Error callback.
Warning
The hfdcan handle’s last_error_codes parameter is updated by the FDCAN processes, and the user can use HAL_FDCAN_GetLastErrorCodes() to verify the most recent error that occurred.
Warning
This weak function must not be modified. When the callback is needed, it must be implemented in the user file.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
Error and State functions ¶
- group FDCAN_Exported_Functions_Group7
-
A set of functions allowing to process with the state and last process errors.
-
HAL_FDCAN_GetState() : Get the FDCAN state.
-
HAL_FDCAN_GetLastErrorCodes() : Get the last error codes limited to the last process.
Functions
-
hal_fdcan_state_t
HAL_FDCAN_GetState
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Return the FDCAN state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_state_t Current FDCAN state.
-
uint32_t
HAL_FDCAN_GetLastErrorCodes
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Return the FDCAN error code.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Last error code, this code must be a value of FDCAN Error Codes .
-
- group FDCAN_Exported_Functions_Group7
-
A set of functions allowing to process with the state and last process errors.
-
HAL_FDCAN_GetState() : Get the FDCAN state.
-
HAL_FDCAN_GetLastErrorCodes() : Get the last error codes limited to the last process.
Functions
-
hal_fdcan_state_t
HAL_FDCAN_GetState
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the FDCAN state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_state_t Current FDCAN state.
-
uint32_t
HAL_FDCAN_GetLastErrorCodes
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the FDCAN error code.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Last error code, this code must be a value of FDCAN Error Codes .
-
- group FDCAN_Exported_Functions_Group7
-
A set of functions allowing to process with the state and last process errors.
-
HAL_FDCAN_GetState() : Get the FDCAN state.
-
HAL_FDCAN_GetLastErrorCodes() : Get the last error codes limited to the last process.
Functions
-
hal_fdcan_state_t
HAL_FDCAN_GetState
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the FDCAN state.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
hal_fdcan_state_t Current FDCAN state.
-
uint32_t
HAL_FDCAN_GetLastErrorCodes
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Return the FDCAN error code.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Returns :
-
Last error code, this code must be a value of FDCAN Error Codes .
-
Peripheral Acquire/Release/Free the bus ¶
- group FDCAN_Exported_Functions_Group8
-
A set of functions allowing to Acquire/Release the bus based on the HAL OS abstraction layer (stm32_hal_os.c/.h osal):
-
HAL_FDCAN_AcquireBus() : Acquire the FDCAN bus.
-
HAL_FDCAN_ReleaseBus() : Release the FDCAN bus.
Functions
-
hal_status_t
HAL_FDCAN_AcquireBus
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
timeout_ms
)
¶
-
Acquire the FDCAN bus through the HAL OS abstraction layer (stm32_hal_os.c/.h osal).
Note
HAL_FDCAN_AcquireBus() must be called from thread mode only (not from handler mode i.e from ISR).
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
timeout_ms – Timeout duration in millisecond.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Semaphore cannot be taken.
-
-
hal_status_t
HAL_FDCAN_ReleaseBus
(
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Release the FDCAN bus through the HAL OS abstraction layer (stm32_hal_os.c/.h osal).
Note
HAL_FDCAN_ReleaseBus() can be called from thread mode or from handler mode i.e from ISR.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Semaphore cannot be released.
-
-
- group FDCAN_Exported_Functions_Group8
-
A set of functions allowing to Acquire/Release the bus based on the HAL OS abstraction layer (stm32_hal_os.c/.h osal):
-
HAL_FDCAN_AcquireBus() : Acquire the FDCAN bus.
-
HAL_FDCAN_ReleaseBus() : Release the FDCAN bus.
Functions
-
hal_status_t
HAL_FDCAN_AcquireBus
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
timeout_ms
)
-
Acquire the FDCAN bus through the HAL OS abstraction layer (stm32_hal_os.c/.h osal).
Note
HAL_FDCAN_AcquireBus() must be called from thread mode only (not from handler mode i.e from ISR).
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
timeout_ms – Timeout duration in millisecond.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Semaphore cannot be taken.
-
-
hal_status_t
HAL_FDCAN_ReleaseBus
(
hal_fdcan_handle_t
*
hfdcan
)
-
Release the FDCAN bus through the HAL OS abstraction layer (stm32_hal_os.c/.h osal).
Note
HAL_FDCAN_ReleaseBus() can be called from thread mode or from handler mode i.e from ISR.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Semaphore cannot be released.
-
-
- group FDCAN_Exported_Functions_Group8
-
A set of functions allowing to Acquire/Release the bus based on the HAL OS abstraction layer (stm32_hal_os.c/.h osal):
-
HAL_FDCAN_AcquireBus() : Acquire the FDCAN bus.
-
HAL_FDCAN_ReleaseBus() : Release the FDCAN bus.
Functions
-
hal_status_t
HAL_FDCAN_AcquireBus
(
hal_fdcan_handle_t
*
hfdcan
,
uint32_t
timeout_ms
)
-
Acquire the FDCAN bus through the HAL OS abstraction layer (stm32_hal_os.c/.h osal).
Note
HAL_FDCAN_AcquireBus() must be called from thread mode only (not from handler mode i.e from ISR).
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
-
timeout_ms – Timeout duration in millisecond.
-
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Semaphore cannot be taken.
-
-
hal_status_t
HAL_FDCAN_ReleaseBus
(
hal_fdcan_handle_t
*
hfdcan
)
-
Release the FDCAN bus through the HAL OS abstraction layer (stm32_hal_os.c/.h osal).
Note
HAL_FDCAN_ReleaseBus() can be called from thread mode or from handler mode i.e from ISR.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t handle.
- Return values :
-
-
HAL_OK – Operation completed successfully.
-
HAL_ERROR – Semaphore cannot be released.
-
-
User data Set/Get ¶
- group FDCAN_Exported_Functions_Group9
-
A set of functions allowing to manage a user data Pointer stored to the FDCAN handle:
-
HAL_FDCAN_SetUserData() : Configure the user data into the handle
-
HAL_FDCAN_GetUserData() : Get the user data from the handle
Functions
-
void
HAL_FDCAN_SetUserData
(
hal_fdcan_handle_t
*
hfdcan
,
const
void
*
p_user_data
)
¶
-
Set the user data pointer into the handle.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t .
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_FDCAN_GetUserData
(
const
hal_fdcan_handle_t
*
hfdcan
)
¶
-
Get the user data pointer from the handle.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t .
- Returns :
-
Current pointer to the user data.
-
- group FDCAN_Exported_Functions_Group9
-
A set of functions allowing to manage a user data Pointer stored to the FDCAN handle:
-
HAL_FDCAN_SetUserData() : Configure the user data into the handle
-
HAL_FDCAN_GetUserData() : Get the user data from the handle
Functions
-
void
HAL_FDCAN_SetUserData
(
hal_fdcan_handle_t
*
hfdcan
,
const
void
*
p_user_data
)
-
Set the user data pointer into the handle.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t .
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_FDCAN_GetUserData
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the user data pointer from the handle.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t .
- Returns :
-
Current pointer to the user data.
-
- group FDCAN_Exported_Functions_Group9
-
A set of functions allowing to manage a user data Pointer stored to the FDCAN handle:
-
HAL_FDCAN_SetUserData() : Configure the user data into the handle
-
HAL_FDCAN_GetUserData() : Get the user data from the handle
Functions
-
void
HAL_FDCAN_SetUserData
(
hal_fdcan_handle_t
*
hfdcan
,
const
void
*
p_user_data
)
-
Set the user data pointer into the handle.
- Parameters :
-
-
hfdcan – Pointer to a hal_fdcan_handle_t .
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_FDCAN_GetUserData
(
const
hal_fdcan_handle_t
*
hfdcan
)
-
Get the user data pointer from the handle.
- Parameters :
-
hfdcan – Pointer to a hal_fdcan_handle_t .
- Returns :
-
Current pointer to the user data.
-