HAL FDCAN Types

HAL FDCAN Types

group FDCAN_Exported_Types

Typedefs

typedef struct hal_fdcan_handle_s hal_fdcan_handle_t

FDCAN handle structure type

typedef void ( * hal_fdcan_fifo_cb_t ) ( hal_fdcan_handle_t * hfdcan , uint32_t interrupts_list )

HAL FDCAN callback pointer definition.

Pointer to interrupts list FDCAN callback function

typedef void ( * hal_fdcan_tx_buffer_cb_t ) ( hal_fdcan_handle_t * hfdcan , uint32_t tx_buffers_idx )

Pointer to interrupts Tx buffer complete/abort FDCAN callback function

typedef void ( * hal_fdcan_cb_t ) ( hal_fdcan_handle_t * hfdcan )

Pointer to a generic FDCAN callback function

Enums

enum hal_fdcan_frame_type_t

HAL FDCAN frame type.

Note

When a Tx frame is configured as HAL_FDCAN_FRAME_REMOTE, the FDCAN core always transmits a classic CAN remote frame HAL_FDCAN_HEADER_FRAME_FORMAT_CAN according to ISO 11898-1, even if CAN FD operation is HAL_FDCAN_FRAME_FORMAT_FD_NO_BRS or HAL_FDCAN_FRAME_FORMAT_FD_BRS. There is no remote frame in CAN FD format by design.

Values:

enumerator HAL_FDCAN_FRAME_DATA

Data frame type

enumerator HAL_FDCAN_FRAME_REMOTE

Remote frame type

enum hal_fdcan_id_type_t

HAL FDCAN ID type.

Values:

enumerator HAL_FDCAN_ID_STANDARD

Standard ID type

enumerator HAL_FDCAN_ID_EXTENDED

Extended ID type

enum hal_fdcan_error_state_indicator_t

HAL FDCAN error state indicator.

Note

This field controls the ESI bit in the transmitted frame only for CAN FD data HAL_FDCAN_HEADER_FRAME_FORMAT_FD_CAN. For classic CAN frames HAL_FDCAN_HEADER_FRAME_FORMAT_CAN there is no ESI bit in the frame format; in that case the core ignores this field and behaves according to its own CAN error state machine.

Values:

enumerator HAL_FDCAN_ERROR_STATE_IND_ACTIVE

Active error state indicator

enumerator HAL_FDCAN_ERROR_STATE_IND_PASSIVE

Passive error state indicator

enum hal_fdcan_bit_rate_switch_t

HAL FDCAN bitrate switching.

Note

Bit rate switch is only used for CAN FD data frames. For classic CAN HAL_FDCAN_FRAME_FORMAT_CLASSIC_CAN or remote frames HAL_FDCAN_FRAME_REMOTE, this field is ignored by the hardware.

Values:

enumerator HAL_FDCAN_BIT_RATE_SWITCH_OFF

Bit rate switching off

enumerator HAL_FDCAN_BIT_RATE_SWITCH_ON

Bit rate switching on

enum hal_fdcan_header_frame_format_t

HAL FDCAN header frame format.

Note

This field reflects the intended frame format, but the FDCAN core will override it to classic format to comply with the CAN/CAN FD protocol:

Values:

enumerator HAL_FDCAN_HEADER_FRAME_FORMAT_CAN

Standard frame format

enumerator HAL_FDCAN_HEADER_FRAME_FORMAT_FD_CAN

CAN FD frame format (new DLC-coding and CRC)

enum hal_fdcan_tx_event_fifo_t

HAL FDCAN event FIFO.

Values:

enumerator HAL_FDCAN_TX_EVENTS_FIFO_DISCARD

Do not store Tx event in FIFO

enumerator HAL_FDCAN_TX_EVENTS_FIFO_STORE

Store Tx event in FIFO

enum hal_fdcan_tx_event_type_t

HAL FDCAN Tx event type.

Values:

enumerator HAL_FDCAN_TX_EVENT

A successful frame transmission

enumerator HAL_FDCAN_TX_EVENT_IN_SPITE_OF_ABORT

Transmission in spite of cancellation. Both Corresponding Tx buffer transmission occurred bit FDCAN interrupt Tx complete buffers select and cancellation finished bit FDCAN interrupt Tx abort buffer select are set. This event type is set in case of:

enum hal_fdcan_data_length_code_t

HAL FDCAN data length code. The definition is the following one:

  • For classic CAN:

    • 0 to 8 : received frame has 0 to 8 data bytes

    • 9 to 15: received frame has 8 data bytes (max)

  • For CAN FD:

    • 0 to 8 : received frame has 0 to 8 data bytes

    • 9 to 15: received frame has 12/16/20/24/32/48/64 data bytes

Note

For remote frames HAL_FDCAN_FRAME_REMOTE, only the DLC encoded by this field is transmitted; no data bytes are sent and the contents of the Tx data buffer are ignored by the core.

Values:

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_0_BYTE

0 byte data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_1_BYTE

1 byte data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_2_BYTE

2 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_3_BYTE

3 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_4_BYTE

4 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_5_BYTE

5 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_6_BYTE

6 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_7_BYTE

7 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_CAN_FDCAN_8_BYTE

8 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_12_BYTE

12 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_16_BYTE

16 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_20_BYTE

20 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_24_BYTE

24 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_32_BYTE

32 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_48_BYTE

48 bytes data length code

enumerator HAL_FDCAN_DATA_LEN_FDCAN_64_BYTE

64 bytes data length code

enum hal_fdcan_frame_format_t

HAL FDCAN frame format.

Values:

enumerator HAL_FDCAN_FRAME_FORMAT_CLASSIC_CAN

Classic mode

enumerator HAL_FDCAN_FRAME_FORMAT_FD_NO_BRS

0x00000100 FD Operation Enable FD mode without bitrate switching

enumerator HAL_FDCAN_FRAME_FORMAT_FD_BRS

FD mode with bitrate switching

enum hal_fdcan_timestamp_source_t

HAL FDCAN timestamp selection.

Values:

enumerator HAL_FDCAN_TIMESTAMP_SOURCE_ZERO

Timestamp counter disabled (value is 0)

enumerator HAL_FDCAN_TIMESTAMP_SOURCE_INTERNAL

Internal timestamp counter

enumerator HAL_FDCAN_TIMESTAMP_SOURCE_EXTERNAL

External timestamp counter

enum hal_fdcan_high_prio_filter_list_t

HAL FDCAN high priority filter list definition.

Values:

enumerator HAL_FDCAN_HIGH_PRIO_FILTER_STANDARD

Standard filter list

enumerator HAL_FDCAN_HIGH_PRIO_FILTER_EXTENDED

0x00008000 Filter List Extended filter list

enum hal_fdcan_rx_error_passive_level_t

HAL FDCAN receive error passive level definition.

Values:

enumerator HAL_FDCAN_RX_ERROR_PASSIVE_BELOW_LEVEL

The receive error counter is below the error passive level of 128

enumerator HAL_FDCAN_RX_ERROR_PASSIVE_REACH_LEVEL

0x00008000 Receive Error Passive The receive error counter has reached the error passive level of 128

enum hal_fdcan_state_t

HAL FDCAN state structures definition.

Values:

enumerator HAL_FDCAN_STATE_RESET

Not yet initialized

enumerator HAL_FDCAN_STATE_INIT

Initialized but not yet configured

enumerator HAL_FDCAN_STATE_IDLE

Initialized and a global config applied

enumerator HAL_FDCAN_STATE_ACTIVE

The peripheral is running

enumerator HAL_FDCAN_STATE_POWER_DOWN

The peripheral is in power down mode (sleep mode)

enum hal_fdcan_mode_t

HAL FDCAN mode enumeration definition.

Values:

enumerator HAL_FDCAN_MODE_NORMAL

Normal mode

enumerator HAL_FDCAN_MODE_RESTRICTED_OPERATION

0x00000004 ASM Restricted Operation Mode Restricted operation mode

enumerator HAL_FDCAN_MODE_BUS_MONITORING

0x00000020 Bus Monitoring Mode Bus monitoring mode

enumerator HAL_FDCAN_MODE_EXTERNAL_LOOPBACK

0x00000080 Test Mode Enable External loopback mode

enumerator HAL_FDCAN_MODE_INTERNAL_LOOPBACK

0x00000080 Test Mode Enable 0x00000020 Bus Monitoring Mode Internal loopback mode

enumerator HAL_FDCAN_MODE_INVALID

0x00000004 ASM Restricted Operation Mode 0x00000020 Bus Monitoring Mode 0x00000080 Test Mode Enable FDCAN invalid mode

enum hal_fdcan_rx_fifo_mode_t

HAL FDCAN FIFO operation mode.

Values:

enumerator HAL_FDCAN_RX_FIFO_MODE_BLOCKING

Rx FIFO blocking mode

enumerator HAL_FDCAN_RX_FIFO_MODE_OVERWRITE

Rx FIFO overwrite mode

enum hal_fdcan_auto_retransmission_state_t

HAL FDCAN auto retransmission setting.

Values:

enumerator HAL_FDCAN_AUTO_RETRANSMISSION_ENABLE

Enable transmitter auto retransmission

enumerator HAL_FDCAN_AUTO_RETRANSMISSION_DISABLE

0x00000040 Disable Automatic Retransmission Disable transmitter auto retransmission

enum hal_fdcan_transmit_pause_state_t

HAL FDCAN transmit pause setting.

Values:

enumerator HAL_FDCAN_TRANSMIT_PAUSE_DISABLE

Disable transmitter transmit pause

enumerator HAL_FDCAN_TRANSMIT_PAUSE_ENABLE

0x00004000 Two CAN bit times Pause Enable transmitter transmit pause

enum hal_fdcan_protocol_exception_state_t

HAL FDCAN protocol exception setting.

Values:

enumerator HAL_FDCAN_PROTOCOL_EXCEPTION_ENABLE

Enable transmitter protocol exception

enumerator HAL_FDCAN_PROTOCOL_EXCEPTION_DISABLE

0x00001000 Protocol Exception Handling Disable Disable transmitter protocol exception

enum hal_fdcan_tx_delay_comp_status_t

HAL FDCAN transmitter delay Compensation status.

Values:

enumerator HAL_FDCAN_TX_DLY_COMPENSATION_DISABLED

Transmitter delay compensation disabled

enumerator HAL_FDCAN_TX_DLY_COMPENSATION_ENABLED

0x00800000 Transceiver Delay Compensation Transmitter delay compensation enabled

enum hal_fdcan_iso_mode_status_t

HAL FDCAN ISO mode status.

Values:

enumerator HAL_FDCAN_ISO_MODE_ENABLED

Protocol configured for ISO mode

enumerator HAL_FDCAN_ISO_MODE_DISABLED

0x00008000 Non ISO Operation Protocol configured for CAN FD v2.0 mode

enum hal_fdcan_tx_buffer_status_t

HAL FDCAN Tx buffer pending status.

Values:

enumerator HAL_FDCAN_TX_BUFFER_NOT_PENDING

No buffer pending

enumerator HAL_FDCAN_TX_BUFFER_PENDING

At least one buffer pending

enum hal_fdcan_rx_frame_status_t

HAL FDCAN received frame status.

Values:

enumerator HAL_FDCAN_RX_FRAME_MATCHED

Received frame matches filter index FIDx

enumerator HAL_FDCAN_RX_FRAME_NOT_MATCHED

Received frame did not match any Rx filter element

enum hal_fdcan_restricted_op_mode_status_t

HAL FDCAN restricted operation mode status.

Values:

enumerator HAL_FDCAN_RESTRICTED_OP_MODE_DISABLED

Restricted mode disabled

enumerator HAL_FDCAN_RESTRICTED_OP_MODE_ENABLED

0x00000004 ASM Restricted Operation Mode Restricted mode enabled

enum hal_fdcan_edge_filtering_status_t

HAL FDCAN edge filtering status.

Values:

enumerator HAL_FDCAN_EDGE_FILTERING_DISABLED

Edge filtering disabled

enumerator HAL_FDCAN_EDGE_FILTERING_ENABLED

0x00002000 Edge Filtering during Bus Integration Edge filtering enabled

enum hal_fdcan_fifo_status_t

HAL FDCAN FIFO/queue status - free or full.

Values:

enumerator HAL_FDCAN_FIFO_STATUS_FREE

Tx FIFO/Queue not full

enumerator HAL_FDCAN_FIFO_STATUS_FULL

0x00200000 Tx FIFO/Queue Full Tx FIFO/Queue full

enum hal_fdcan_timeout_counter_status_t

HAL FDCAN timeout counter status.

Values:

enumerator HAL_FDCAN_TIMEOUT_COUNTER_DISABLED

Timeout counter disabled

enumerator HAL_FDCAN_TIMEOUT_COUNTER_ENABLED

0x00000001 Enable Timeout Counter Timeout counter enabled

enum hal_fdcan_it_status_t

HAL FDCAN interrupts status.

Values:

enumerator HAL_FDCAN_IT_DISABLED

Interrupt disabled

enumerator HAL_FDCAN_IT_ENABLED

Interrupt enabled

enum hal_fdcan_it_lines_status_t

HAL FDCAN interrupt lines status.

Values:

enumerator HAL_FDCAN_IT_LINE_DISABLED

Interrupt line disabled

enumerator HAL_FDCAN_IT_LINE_ENABLED

Interrupt line enabled

enum hal_fdcan_it_tx_buffer_complete_status_t

HAL FDCAN Tx buffer transmission complete interrupt status.

Values:

enumerator HAL_FDCAN_IT_TX_BUFFER_CPLT_DISABLED

Tx buffer transmission complete interrupt disabled

enumerator HAL_FDCAN_IT_TX_BUFFER_CPLT_ENABLED

Tx buffer transmission complete interrupt enabled

enum hal_fdcan_it_tx_buffer_abort_status_t

HAL FDCAN Tx buffer abort finished interrupt status.

Values:

enumerator HAL_FDCAN_IT_TX_BUFFER_ABORT_DISABLED

Tx buffer abort finished interrupt disabled

enumerator HAL_FDCAN_IT_TX_BUFFER_ABORT_ENABLED

Tx buffer abort finished interrupt enabled

enum hal_fdcan_warning_status_t

HAL FDCAN warning status.

Values:

enumerator HAL_FDCAN_WARNING_ERROR_ALL_COUNTERS_UNDER_LIMIT

Both error counters are below the error_warning of 96

enumerator HAL_FDCAN_WARNING_ERROR_ANY_COUNTER_OVER_LIMIT

0x00000040 Warning Status At least one of the error counter has reached the error_warning limit of 96

enum hal_fdcan_bus_off_status_t

HAL FDCAN bus_off status.

Values:

enumerator HAL_FDCAN_BUS_OFF_FLAG_RESET

The FDCAN is not in bus_off state

enumerator HAL_FDCAN_BUS_OFF_FLAG_SET

0x00000080 Bus_Off Status The FDCAN is in bus_off state

enum hal_fdcan_esi_flag_status_t

HAL FDCAN ESI (Error Status Indicator) flag of last received FDCAN message.

Values:

enumerator HAL_FDCAN_ESI_FLAG_RESET

Last received FDCAN message did not have its ESI flag set

enumerator HAL_FDCAN_ESI_FLAG_SET

0x00000800 ESI flag of last received FDCAN Message Last received FDCAN message has its ESI flag set

enum hal_fdcan_brs_flag_status_t

HAL FDCAN BSR (Bit Rate Switch) flag of last received FDCAN message.

Values:

enumerator HAL_FDCAN_BRS_FLAG_RESET

Last received FDCAN message did not have its BRS flag set

enumerator HAL_FDCAN_BRS_FLAG_SET

0x00001000 BRS flag of last received FDCAN Message Last received FDCAN message has its BRS flag set

enum hal_fdcan_edl_flag_status_t

HAL FDCAN received EDL (Extended Data length) message.

Values:

enumerator HAL_FDCAN_EDL_FLAG_RESET

No FDCAN message has been received since this bit was reset by CPU

enumerator HAL_FDCAN_EDL_FLAG_SET

0x00002000 Received FDCAN Message Message in FDCAN format with EDL flag

enum hal_fdcan_protocol_error_status_t

HAL FDCAN error status definition.

Values:

enumerator HAL_FDCAN_ERROR_ACTIVE

Error active state

enumerator HAL_FDCAN_ERROR_PASSIVE

0x00000020 Error Passive Error passive state

enum hal_fdcan_filter_type_t

HAL FDCAN filter type, defines the filtering method used for FDCAN standard and extended filters. The case HAL_FDCAN_FILTER_TYPE_RANGE_NO_EIDM must be processed differently depending on standard or extended filter.

Values:

enumerator HAL_FDCAN_FILTER_TYPE_RANGE

Range filter from FilterID1 to FilterID2

enumerator HAL_FDCAN_FILTER_TYPE_DUAL

Dual ID filter for FilterID1 or FilterID2

enumerator HAL_FDCAN_FILTER_TYPE_CLASSIC

Classic filter: FilterID1 = filter, FilterID2 = mask

enumerator HAL_FDCAN_FILTER_TYPE_RANGE_NO_EIDM

Range filter from FilterID1 to FilterID2, EIDM mask not applied

enum hal_fdcan_clock_divider_t

HAL FDCAN kernel clock divider.

Values:

enumerator HAL_FDCAN_CLOCK_DIV_1

Divide kernel clock by 1

enumerator HAL_FDCAN_CLOCK_DIV_2

Divide kernel clock by 2

enumerator HAL_FDCAN_CLOCK_DIV_4

Divide kernel clock by 4

enumerator HAL_FDCAN_CLOCK_DIV_6

Divide kernel clock by 6

enumerator HAL_FDCAN_CLOCK_DIV_8

Divide kernel clock by 8

enumerator HAL_FDCAN_CLOCK_DIV_10

Divide kernel clock by 10

enumerator HAL_FDCAN_CLOCK_DIV_12

Divide kernel clock by 12

enumerator HAL_FDCAN_CLOCK_DIV_14

Divide kernel clock by 14

enumerator HAL_FDCAN_CLOCK_DIV_16

Divide kernel clock by 16

enumerator HAL_FDCAN_CLOCK_DIV_18

Divide kernel clock by 18

enumerator HAL_FDCAN_CLOCK_DIV_20

Divide kernel clock by 20

enumerator HAL_FDCAN_CLOCK_DIV_22

Divide kernel clock by 22

enumerator HAL_FDCAN_CLOCK_DIV_24

Divide kernel clock by 24

enumerator HAL_FDCAN_CLOCK_DIV_26

Divide kernel clock by 26

enumerator HAL_FDCAN_CLOCK_DIV_28

Divide kernel clock by 28

enumerator HAL_FDCAN_CLOCK_DIV_30

Divide kernel clock by 30

enum hal_fdcan_tx_mode_t

HAL FDCAN Tx FIFO/queue mode.

Values:

enumerator HAL_FDCAN_TX_MODE_FIFO

Tx FIFO mode

enumerator HAL_FDCAN_TX_MODE_QUEUE

0x01000000 Tx FIFO/Queue Mode Tx queue mode

enum hal_fdcan_high_prio_message_storage_t

HAL FDCAN high priority storage.

Values:

enumerator HAL_FDCAN_HP_MSG_FIFO_NONE

No FIFO selected

enumerator HAL_FDCAN_HP_MSG_FIFO_LOST

FIFO message lost

enumerator HAL_FDCAN_HP_MSG_RX_FIFO_0

Message stored in FIFO 0

enumerator HAL_FDCAN_HP_MSG_RX_FIFO_1

0x000000C0 Message Storage Indicator Message stored in FIFO 1

enum hal_fdcan_protocol_exception_event_t

HAL FDCAN protocol exception event.

Values:

enumerator HAL_FDCAN_PROTOCOL_NO_EVENT_OCCURRED

No protocol event occurred since last read access

enumerator HAL_FDCAN_PROTOCOL_EVENT_OCCURRED

0x00004000 Protocol Exception Event Protocol event occurred

enum hal_fdcan_filter_config_t

HAL FDCAN filter Configuration.

Values:

enumerator HAL_FDCAN_FILTER_DISABLE

Disable filter element

enumerator HAL_FDCAN_FILTER_TO_RX_FIFO_0

Store in Rx FIFO 0 if filter matches

enumerator HAL_FDCAN_FILTER_TO_RX_FIFO_1

Store in Rx FIFO 1 if filter matches

enumerator HAL_FDCAN_FILTER_REJECT

Reject ID if filter matches

enumerator HAL_FDCAN_FILTER_HP

Set high priority if filter matches

enumerator HAL_FDCAN_FILTER_TO_RX_FIFO_0_HP

Set high priority and store in FIFO 0 if filter matches

enumerator HAL_FDCAN_FILTER_TO_RX_FIFO_1_HP

Set high priority and store in FIFO 1 if filter matches

enum hal_fdcan_rx_location_t

HAL FDCAN Rx location.

Values:

enumerator HAL_FDCAN_RX_FIFO_0

Index for access to Rx FIFO 0

enumerator HAL_FDCAN_RX_FIFO_1

Index for access to Rx FIFO 1

enum hal_fdcan_protocol_error_code_t

HAL FDCAN protocol error code.

Values:

enumerator HAL_FDCAN_PROTOCOL_ERROR_NONE

No error occurred

enumerator HAL_FDCAN_PROTOCOL_ERROR_STUFF

Stuff error

enumerator HAL_FDCAN_PROTOCOL_ERROR_FORM

Form error

enumerator HAL_FDCAN_PROTOCOL_ERROR_ACK

Acknowledge error

enumerator HAL_FDCAN_PROTOCOL_ERROR_BIT1

Bit 1 (recessive) error

enumerator HAL_FDCAN_PROTOCOL_ERROR_BIT0

Bit 0 (dominant) error

enumerator HAL_FDCAN_PROTOCOL_ERROR_CRC

CRC check sum error

enumerator HAL_FDCAN_PROTOCOL_ERROR_NO_CHANGE

No change since last read

enum hal_fdcan_communication_state_t

HAL FDCAN communication state.

Values:

enumerator HAL_FDCAN_COM_STATE_SYNC

Node is synchronizing on CAN communication

enumerator HAL_FDCAN_COM_STATE_IDLE

Node is neither receiver nor transmitter

enumerator HAL_FDCAN_COM_STATE_RX

Node is operating as receiver

enumerator HAL_FDCAN_COM_STATE_TX

0x00000018 Activity Node is operating as transmitter

enum hal_fdcan_non_matching_acceptance_rules_t

HAL FDCAN non-matching frames acceptance rules.

Values:

enumerator HAL_FDCAN_NO_MATCH_TO_RX_FIFO_0

Accept non-matching frames to Rx FIFO0

enumerator HAL_FDCAN_NO_MATCH_TO_RX_FIFO_1

Accept non-matching frames to Rx FIFO1

enumerator HAL_FDCAN_NO_MATCH_REJECT

Reject non-matching frames

enum hal_fdcan_remote_acceptance_frame_t

HAL FDCAN remote frames acceptance rules.

Values:

enumerator HAL_FDCAN_REMOTE_ACCEPT

Accept remote frames

enumerator HAL_FDCAN_REMOTE_REJECT

Reject all remote frames

enum hal_fdcan_timestamp_prescaler_t

HAL FDCAN timestamp prescaler.

Values:

enumerator HAL_FDCAN_TIMESTAMP_PRESC_1

Timestamp counter time unit is x1 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_2

Timestamp counter time unit is x2 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_3

Timestamp counter time unit is x3 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_4

Timestamp counter time unit is x4 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_5

Timestamp counter time unit is x5 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_6

Timestamp counter time unit is x6 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_7

Timestamp counter time unit is x7 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_8

Timestamp counter time unit is x8 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_9

Timestamp counter time unit is x9 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_10

Timestamp counter time unit is x10 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_11

Timestamp counter time unit is x11 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_12

Timestamp counter time unit is x12 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_13

Timestamp counter time unit is x13 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_14

Timestamp counter time unit is x14 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_15

Timestamp counter time unit is x15 CAN bit time

enumerator HAL_FDCAN_TIMESTAMP_PRESC_16

Timestamp counter time unit is x16 CAN bit time

enum hal_fdcan_tx_fifo_free_level_t

HAL FDCAN Tx FIFO free level.

Values:

enumerator HAL_FDCAN_TX_FIFO_FREE_LEVEL_0

Tx FIFO Full - no free FIFO slot

enumerator HAL_FDCAN_TX_FIFO_FREE_LEVEL_1

1 free FIFO slot available in Tx FIFO

enumerator HAL_FDCAN_TX_FIFO_FREE_LEVEL_2

2 free FIFO slots available in Tx FIFO

enumerator HAL_FDCAN_TX_FIFO_FREE_LEVEL_3

3 free FIFO slots available in Tx FIFO

enum hal_fdcan_timeout_operation_t

HAL FDCAN timeout operation.

Values:

enumerator HAL_FDCAN_TIMEOUT_CONTINUOUS

Timeout continuous operation

enumerator HAL_FDCAN_TIMEOUT_TX_EVENT_FIFO

Timeout controlled by Tx event FIFO

enumerator HAL_FDCAN_TIMEOUT_RX_FIFO_0

Timeout controlled by Rx FIFO 0

enumerator HAL_FDCAN_TIMEOUT_RX_FIFO_1

Timeout controlled by Rx FIFO 1

enum hal_fdcan_t

HAL FDCAN instance definition.

Values:

enumerator HAL_FDCAN1

Peripheral instance FDCAN1

union hal_fdcan_rx_header_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN Rx element header definition.

Public Members

uint64_t d64

64-bit FDCAN Rx element header

uint32_t identifier

Received identifier. A standard identifier is stored in bits [28:18]

hal_fdcan_frame_type_t frame_type

Frame type

hal_fdcan_id_type_t identifier_type

Received identifier type

hal_fdcan_error_state_indicator_t error_state_indicator

Error state indicator

uint32_t rx_timestamp

Rx timestamp. Timestamp counter value is captured at the start of frame reception. Resolution depends on the timestamp counter prescaler

hal_fdcan_data_length_code_t data_length

Received frame data length code

hal_fdcan_bit_rate_switch_t bit_rate_switch

Bit rate switch indicator

hal_fdcan_header_frame_format_t frame_format

Received frame format

uint32_t __pad0__

Rx reserved

uint32_t filter_index

Filter index.

hal_fdcan_rx_frame_status_t frame_status

Bit fields of the received frame status. It is useful when the Acceptance rule for non-matching frames is enabled by selecting HAL_FDCAN_NO_MATCH_TO_RX_FIFO_0 or HAL_FDCAN_NO_MATCH_TO_RX_FIFO_1

struct hal_fdcan_rx_header_t b

Bit fields of the 64-bit Rx header

union hal_fdcan_tx_header_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN Tx element header definition.

Public Members

uint64_t d64

64-bit FDCAN Tx element header

uint32_t identifier

Frame identifier. A standard identifier is stored in bits [28:18]

hal_fdcan_frame_type_t frame_type

Frame type

hal_fdcan_id_type_t identifier_type

Identifier type

hal_fdcan_error_state_indicator_t error_state_indicator

Error state indicator

uint32_t __pad0__

Tx reserved field

hal_fdcan_data_length_code_t data_length

Data length code

hal_fdcan_bit_rate_switch_t bit_rate_switch

Bit rate switch

hal_fdcan_header_frame_format_t frame_format

Frame format

uint32_t __pad1__

Tx reserved bit

hal_fdcan_tx_event_fifo_t event_fifo_control

Event FIFO control

uint32_t message_marker

Message marker. Written by CPU during Tx buffer configuration. Copied into Tx event FIFO element for identification of Tx message status

struct hal_fdcan_tx_header_t b

Bit fields of the 64-bit Tx header

union hal_fdcan_tx_evt_fifo_header_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN Tx Event FIFO element header definition.

Public Members

uint64_t d64

64-bit FDCAN Tx Event FIFO element header

uint32_t identifier

Frame identifier, standard or extended. A standard identifier is stored into ID[28:18] field of Rx element

hal_fdcan_frame_type_t frame_type

Frame type

hal_fdcan_id_type_t identifier_type

Identifier type

hal_fdcan_error_state_indicator_t error_state_indicator

Error state indicator

uint32_t tx_timestamp

Tx timestamp. The timestamp counter value is captured on start of frame transmission. Resolution depends on the configuration of the timestamp counter prescaler

hal_fdcan_data_length_code_t data_length

Data length code

hal_fdcan_bit_rate_switch_t bit_rate_switch

Bit rate switch

hal_fdcan_header_frame_format_t frame_format

Frame format

hal_fdcan_tx_event_type_t event_type

Event type

uint32_t message_marker

Message marker. Copied from Tx event FIFO element for identification of Tx message status

struct hal_fdcan_tx_evt_fifo_header_t b

Bit fields of the 64-bit Tx event FIFO header

struct hal_fdcan_global_filter_config_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN global filter parameters.

Public Members

hal_fdcan_non_matching_acceptance_rules_t acceptance_non_matching_std

Acceptance rule for standard non-matching frames

hal_fdcan_non_matching_acceptance_rules_t acceptance_non_matching_ext

Acceptance rule for extended non-matching frames

hal_fdcan_remote_acceptance_frame_t acceptance_remote_std

Acceptance rule for standard remote frames

hal_fdcan_remote_acceptance_frame_t acceptance_remote_ext

Acceptance rule for extended remote frames

struct hal_fdcan_timestamp_config_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN timestamp parameters.

Public Members

hal_fdcan_timestamp_source_t timestamp_source

Timestamp source

hal_fdcan_timestamp_prescaler_t timestamp_prescaler

Value of the timestamp prescaler counter

struct hal_fdcan_timeout_config_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN timeout parameters.

Public Members

hal_fdcan_timeout_operation_t timeout_operation

Timeout select

uint32_t timeout_period

Value of the timeout counter (down-counter)

struct hal_fdcan_tx_delay_comp_config_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN Tx delay compensation parameters.

Public Members

uint32_t tx_delay_comp_offset

Transmitter delay compensation offset between 0 and 0x7F

uint32_t tx_delay_comp_win_length

Transmitter delay compensation filter window length between 0 and 0x7F

struct hal_fdcan_filter_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN filter structure definition.

Public Members

hal_fdcan_id_type_t id_type

Specifies the identifier type.

uint32_t filter_index

Specifies the filter index. The range of this parameter depends on the filter identifier type: hal_fdcan_filter_t::id_type.

hal_fdcan_filter_type_t filter_type

Specifies the filter type. HAL_FDCAN_FILTER_TYPE_RANGE_NO_EIDM is permitted only when hal_fdcan_filter_t::id_type is HAL_FDCAN_ID_EXTENDED

hal_fdcan_filter_config_t filter_config

Specifies the filter configuration

uint32_t filter_id1

Specifies the filter first identifier. The range of this parameter depends on the configured hal_fdcan_filter_t::id_type, if:

uint32_t filter_id2

Specifies the filter second identifier. The range of this parameter depends on the configured hal_fdcan_filter_t::id_type, if:

struct hal_fdcan_high_prio_msg_status_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN high priority message status structure definition.

Public Members

hal_fdcan_high_prio_filter_list_t filter_list

Filter list of the matching filter elements

uint32_t filter_index

Index of matching filter element. This index only correspond to a previously configured filter

hal_fdcan_high_prio_message_storage_t message_location_status

High priority message storage

uint32_t message_index

Index of Rx FIFO element to which the message was stored. This parameter is valid only when HAL_FDCAN_HP_MSG_RX_FIFO_0 or HAL_FDCAN_HP_MSG_RX_FIFO_1 are selected as high priority message storage

struct hal_fdcan_protocol_status_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN protocol status structure definition.

Public Members

hal_fdcan_protocol_error_code_t last_error_code

Type of the last error that occurred on the FDCAN bus

hal_fdcan_protocol_error_code_t data_last_error_code

Type of the last error that occurred in the data phase of a CAN FD format frame with its bitrate switching flag set

hal_fdcan_communication_state_t activity

Communication state

hal_fdcan_protocol_error_status_t error_status

Error status

hal_fdcan_warning_status_t error_warning

Warning status

hal_fdcan_bus_off_status_t bus_off

Bus off status

hal_fdcan_esi_flag_status_t rx_esi_flag

Error state indicator flag of last received CAN FD message

hal_fdcan_brs_flag_status_t rx_brs_flag

Switching flag of last received CAN FD message

hal_fdcan_edl_flag_status_t rx_fdf_flag

Specifies if CAN FD message (FDF flag set) has been received since last protocol status

hal_fdcan_protocol_exception_event_t protocol_exception

Protocol exception status

uint32_t tdc_value

Transmitter Delay Compensation value. This parameter can be a number between 0 and 127

struct hal_fdcan_error_counters_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN error counters structure definition.

Public Members

uint32_t tx_error_cnt

Specifies the transmit error counter value. This parameter can be a number between 0 and 255

uint32_t rx_error_cnt

Specifies the receive error counter value. This parameter can be a number between 0 and 127

hal_fdcan_rx_error_passive_level_t rx_error_passive_status

Specifies the receive error passive status

uint32_t global_cnt

Specifies the transmit/receive error logging counter value. This parameter can be a number between 0 and 255. This counter is incremented each time when a FDCAN protocol error causes the hal_fdcan_error_counters_t::tx_error_cnt or the hal_fdcan_error_counters_t::rx_error_cnt to be incremented. The counter stops at 255, the next increment of hal_fdcan_error_counters_t::tx_error_cnt or hal_fdcan_error_counters_t::rx_error_cnt sets the flag of interrupt HAL_FDCAN_IT_ERROR_LOGGING_OVERFLOW

struct hal_fdcan_msg_ram_address_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN message RAM blocks.

Public Members

uint32_t std_filter_start_addr

Specifies the standard filter list start address

uint32_t ext_filter_start_addr

Specifies the extended filter list start address

uint32_t rx_fifo0_start_addr

Specifies the Rx FIFO 0 start address

uint32_t rx_fifo1_start_addr

Specifies the Rx FIFO 1 start address

uint32_t tx_event_start_addr

Specifies the Tx event FIFO start address

uint32_t tx_fifo_start_addr

Specifies the Tx FIFO/queue start address

struct hal_fdcan_nominal_bit_timing_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN nominal bit timing structure definition.

Public Members

uint32_t nominal_prescaler

Specifies the value by which the oscillator frequency is divided for generating the nominal bit time quanta. This parameter must be a number between 1 and 512

uint32_t nominal_jump_width

Specifies the maximum number of time quanta the FDCAN hardware is allowed to lengthen or shorten a bit to perform resynchronization. This parameter must be a number between 1 and 128

uint32_t nominal_time_seg1

Specifies the number of time quanta in bit segment 1. This parameter must be a number between 2 and 256

uint32_t nominal_time_seg2

Specifies the number of time quanta in bit segment 2. This parameter must be a number between 2 and 128

struct hal_fdcan_data_bit_timing_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN data bit timing structure definition.

Public Members

uint32_t data_prescaler

Specifies the value by which the oscillator frequency is divided for generating the data bit time quanta. This parameter must be a number between 1 and 32

uint32_t data_jump_width

Specifies the maximum number of time quanta the FDCAN hardware is allowed to lengthen or shorten a data bit to perform resynchronization. This parameter must be a number between 1 and 16

uint32_t data_time_seg1

Specifies the number of time quanta in data bit segment 1. This parameter must be a number between 1 and 32

uint32_t data_time_seg2

Specifies the number of time quanta in Data Bit Segment 2. This parameter must be a number between 1 and 16

struct hal_fdcan_config_t
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN global configuration structure definition.

Public Members

hal_fdcan_nominal_bit_timing_t nominal_bit_timing

Nominal bit timing

hal_fdcan_data_bit_timing_t data_bit_timing

Data bit Timing

hal_fdcan_mode_t mode

Mode

hal_fdcan_frame_format_t frame_format

Frame format

hal_fdcan_auto_retransmission_state_t auto_retransmission

Automatic retransmission feature

hal_fdcan_transmit_pause_state_t transmit_pause

Transmit pause feature

hal_fdcan_protocol_exception_state_t protocol_exception

Protocol exception handling

uint32_t std_filters_nbr

Number of standard message ID filters. This parameter must be a number between 0 and 28

uint32_t ext_filters_nbr

Number of extended message ID filters. This parameter must be a number between 0 and 8

hal_fdcan_tx_mode_t tx_fifo_queue_mode

Tx FIFO/queue mode selection

struct hal_fdcan_handle_s
#include <stm32c5xx_hal_fdcan.h>

HAL FDCAN handle structure definition.

Public Members

hal_fdcan_t instance

FDCAN instance

hal_fdcan_msg_ram_address_t msg_ram

Message RAM blocks

volatile hal_fdcan_state_t global_state

Communication current state

volatile uint32_t last_error_codes

Last error codes

uint32_t latest_tx_fifo_q_request

Tx buffer index of latest Tx FIFO/queue request

hal_os_semaphore_t semaphore

FDCAN OS semaphore

const void * p_user_data

User data pointer

hal_fdcan_fifo_cb_t p_tx_event_fifo_cb

Tx event FIFO callback

hal_fdcan_fifo_cb_t p_rx_fifo_0_cb

Rx FIFO 0 callback

hal_fdcan_fifo_cb_t p_rx_fifo_1_cb

Rx FIFO 1 callback

hal_fdcan_cb_t p_tx_fifo_empty_cb

Tx FIFO empty callback

hal_fdcan_tx_buffer_cb_t p_tx_buffer_complete_cb

Tx buffer complete callback

hal_fdcan_tx_buffer_cb_t p_tx_buffer_abort_cb

Tx buffer abort callback

hal_fdcan_cb_t p_high_priority_msg_cb

High priority message callback

hal_fdcan_cb_t p_ts_wraparound_cb

Timestamp wraparound callback

hal_fdcan_cb_t p_error_cb

Error callback