Data Structures

group group_canfd_data_structures


typedef void (*cy_canfd_tx_msg_func_ptr_t)(void)

Message transmission complete callback function (cy_canfd_tx_msg_func_ptr_t).

Signals a successful completed transmission. Triggered with CY_CANFD_TRANSMISSION_COMPLETE interrupt event

typedef void (*cy_canfd_rx_msg_func_ptr_t)(bool rxFIFOMsg, uint8_t msgBufOrRxFIFONum, cy_stc_canfd_rx_buffer_t *basemsg)

The message reception callback function for message received in the dedicated Rx Buffer or in Rx FIFO (cy_canfd_rx_msg_func_ptr_t)

Signals that CAN FD has received a new message.

  • If message was received in the dedicated Rx Buffer (0 - 63), rxFIFOMsg is False and u8MsgBufOrFIFONum indicates the Rx Buffer number.

  • If message was received in Rx FIFO (0/1), rxFIFOMsg is True and u8MsgBufOrFIFONum indicates the FIFO number.


typedef void (*cy_canfd_error_func_ptr_t)(uint32_t errorMask)

The error callback function (cy_canfd_error_func_ptr_t).

Signals that the CAN bus status changed or an error occurred.

Triggered with


struct cy_stc_canfd_r0_t
#include <>

R0 register.

Public Members

uint32_t id


cy_en_canfd_rtr_t rtr

Remote transmission request.

cy_en_canfd_xtd_t xtd

Extended identifier.

cy_en_canfd_esi_t esi

Error state indicator.

struct cy_stc_canfd_r1_t
#include <>

R1 register.

Public Members

uint32_t rxts

Rx timestamp.

uint32_t dlc

Data length code.

bool brs

Bit rate switch.

cy_en_canfd_fdf_t fdf

Extended data length.

uint32_t fidx

Filter index.

cy_en_canfd_anmf_t anmf

Accepted non-matching frame.

struct cy_stc_canfd_rx_buffer_t
#include <>

Rx buffer.

Public Members

cy_stc_canfd_r0_t *r0_f

Rx buffer element for R0.

See cy_stc_canfd_r0_t

cy_stc_canfd_r1_t *r1_f

Rx buffer element for R1.

See cy_stc_canfd_r1_t

uint32_t *data_area_f

Rx buffer element for Rn.

struct cy_stc_canfd_t0_t
#include <>

T0 register.

Public Members

uint32_t id


cy_en_canfd_rtr_t rtr

Remote transmission request.

0:data frame, 1:remote frame

cy_en_canfd_xtd_t xtd

Extended identifier.

0:11-bit standard identifier, 1:29-bit extended identifier

cy_en_canfd_esi_t esi

Error state indicator.

struct cy_stc_canfd_t1_t
#include <>

T1 register.

Public Members

uint32_t dlc

Data length code.

bool brs

Bit rate switching.

cy_en_canfd_fdf_t fdf

FD Format.

bool efc

Event FIFO control.

false: Do not store Tx events, true: Store Tx events

uint32_t mm

Message marker.

struct cy_stc_canfd_tx_buffer_t
#include <>

Tx buffer register.

Public Members

cy_stc_canfd_t0_t *t0_f

Tx buffer element for T0.

See cy_stc_canfd_t0_t

cy_stc_canfd_t1_t *t1_f

Tx buffer element for T1.

See cy_stc_canfd_t1_t

uint32_t *data_area_f

Tx buffer element for Tn.

struct cy_stc_id_filter_t
#include <>

Message ID filter register.

Public Members

uint32_t sfid2

Standard filter ID 2.

uint32_t sfid1

Standard filter ID 1.

cy_en_canfd_sfec_t sfec

Standard filter element configuration.

cy_en_canfd_sft_t sft

Standard filter Type.

struct cy_stc_canfd_f0_t
#include <>

F0 register.

Public Members

uint32_t efid1

Extended filter ID 1.

cy_en_canfd_efec_t efec

Extended filter element configuration.

struct cy_stc_canfd_f1_t
#include <>

F1 register.

Public Members

uint32_t efid2

Extended filter ID 2.

cy_en_canfd_eft_t eft

Extended filter type.

struct cy_stc_extid_filter_t
#include <>

Extended message ID filter register.

Public Members

const cy_stc_canfd_f0_t *f0_f

Extended message ID filter element for F0.

See cy_stc_canfd_f0_t

const cy_stc_canfd_f1_t *f1_f

Extended message ID filter element for F1.

See cy_stc_canfd_f1_t

struct cy_stc_canfd_bitrate_t
#include <>

CAN FD bitrate.

Public Members

uint16_t prescaler

Baud rate prescaler.

uint8_t timeSegment1

Time segment before sample point.

uint8_t timeSegment2

Time segment after sample point.

uint8_t syncJumpWidth

Synchronization jump width.

struct cy_stc_canfd_transceiver_delay_compensation_t
#include <>

CAN FD transceiver delay compensation offset configuration.

Public Members

bool tdcEnabled

Transceiver delay compensation enabled.

uint8_t tdcOffset

Transmitter delay compensation offset.

uint8_t tdcFilterWindow

Transmitter delay compensation filter window length.

struct cy_stc_canfd_sid_filter_config_t
#include <>

Standard ID filter configuration.

Public Members

uint8_t numberOfSIDFilters

Number Of standard ID filters.

const cy_stc_id_filter_t *sidFilter

Message ID Filter register.

struct cy_stc_canfd_extid_filter_config_t
#include <>

Extended ID filter configuration.

Public Members

uint8_t numberOfEXTIDFilters

Number Of extended ID filters.

const cy_stc_extid_filter_t *extidFilter

Extended message ID filter register.

uint32_t extIDANDMask

Extended ID AND Mask.

struct cy_stc_canfd_global_filter_config_t
#include <>

Global filter configuration.

Public Members

cy_en_accept_non_matching_frames_t nonMatchingFramesStandard

Non matching frames standard.

cy_en_accept_non_matching_frames_t nonMatchingFramesExtended

Non matching frames extended.

bool rejectRemoteFramesStandard

Reject remote frames standard.

bool rejectRemoteFramesExtended

Reject remote frames extended.

struct cy_en_canfd_fifo_config_t
#include <>

Rx FIFO configuration.

Public Members

cy_en_canfd_fifo_mode_t mode

CAN FD Rx FIFO operating mode.

uint8_t watermark


uint8_t numberOfFIFOElements

Number Of FIFO elements.

Note: The Rx FIFO size must be greater than 1 when FIFO Top Pointer Logic is enabled.

bool topPointerLogicEnabled

Top pointer logic enabled.

struct cy_stc_canfd_config_t
#include <>

CAN FD configuration.

Public Members

cy_canfd_tx_msg_func_ptr_t txCallback

Callback function for transmit completed.

Can be NULL

cy_canfd_rx_msg_func_ptr_t rxCallback

Callback function for receive completed.

Can be NULL

cy_canfd_error_func_ptr_t errorCallback

Callback function for CAN related errors.

Can be NULL

bool canFDMode

TRUE:CAN FD mode, FALSE:Classic CAN mode.

const cy_stc_canfd_bitrate_t *bitrate

CAN bitrate setting.

const cy_stc_canfd_bitrate_t *fastBitrate

CAN Fast bitrate setting.

const cy_stc_canfd_transceiver_delay_compensation_t *tdcConfig

CAN transceiver delay compensation setting.

const cy_stc_canfd_sid_filter_config_t *sidFilterConfig

CAN Standard ID filter setting.

const cy_stc_canfd_extid_filter_config_t *extidFilterConfig

CAN Extended ID filter setting.

const cy_stc_canfd_global_filter_config_t *globalFilterConfig

CAN global filter setting.

cy_en_canfd_buffer_data_size_t rxBufferDataSize

Rx Buffer Data Size.

cy_en_canfd_buffer_data_size_t rxFIFO1DataSize

Rx FIFO 1 Data Size.

cy_en_canfd_buffer_data_size_t rxFIFO0DataSize

Rx FIFO 0 Data Size.

cy_en_canfd_buffer_data_size_t txBufferDataSize

Tx Buffer Data Size.

const cy_en_canfd_fifo_config_t *rxFIFO0Config

Rx FIFO 0 configuration.

const cy_en_canfd_fifo_config_t *rxFIFO1Config

Rx FIFO 1 configuration.

uint8_t noOfRxBuffers

Number of Rx Buffers (Max 64)

uint8_t noOfTxBuffers

Number of Rx Buffers (Max 32)

uint32_t messageRAMaddress

The start address of Message RAM for the channel.

uint32_t messageRAMsize

The size in bytes of Message RAM for the channel.

struct cy_stc_canfd_interrupt_handling_t
#include <>

CAN FD interrupt pointer structure.

Holds some pointers to callback functions and buffer

Public Members

cy_canfd_tx_msg_func_ptr_t canFDTxInterruptFunction

The pointer to transmit interrupt callback.

cy_canfd_rx_msg_func_ptr_t canFDRxInterruptFunction

The pointer to receive interrupt callback (dedicated Rx Buffer or RxFIFO without Top pointer logic)

cy_canfd_error_func_ptr_t canFDErrorInterruptFunction

The pointer to error interrupt callback.

struct cy_stc_canfd_context_t
#include <>

Context structure.

Public Members

cy_stc_canfd_interrupt_handling_t canFDInterruptHandling

Interrupt callback.

uint32_t messageRAMaddress

The start address of Message RAM for the channel.

uint32_t messageRAMsize

The size in bytes of Message RAM for the channel.