PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Data Structures | Typedefs
Data Structures
PDL API Reference » CAN FD (CAN with Flexible Data-Rate)

## General Description

## Data Structures
struct | cy_stc_canfd_r0_t
| R0 register. More...
struct | cy_stc_canfd_r1_t
| R1 register. More...
struct | cy_stc_canfd_rx_buffer_t
| Rx buffer. More...
struct | cy_stc_canfd_t0_t
| T0 register. More...
struct | cy_stc_canfd_t1_t
| T1 register. More...
struct | cy_stc_canfd_tx_buffer_t
| Tx buffer register. More...
struct | cy_stc_id_filter_t
| Message ID filter register. More...
struct | cy_stc_canfd_f0_t
| F0 register. More...
struct | cy_stc_canfd_f1_t
| F1 register. More...
struct | cy_stc_extid_filter_t
| Extended message ID filter register. More...
struct | cy_stc_canfd_bitrate_t
| CAN FD bitrate. More...
struct | cy_stc_canfd_transceiver_delay_compensation_t
| CAN FD transceiver delay compensation offset configuration. More...
struct | cy_stc_canfd_sid_filter_config_t
| Standard ID filter configuration. More...
struct | cy_stc_canfd_extid_filter_config_t
| Extended ID filter configuration. More...
struct | cy_stc_canfd_global_filter_config_t
| Global filter configuration. More...
struct | cy_en_canfd_fifo_config_t
| Rx FIFO configuration. More...
struct | cy_stc_canfd_config_t
| CAN FD configuration. More...
struct | cy_stc_canfd_interrupt_handling_t
| CAN FD interrupt pointer structure. More...
struct | cy_stc_canfd_context_t
| Context structure. More...

## Typedefs
typedef void(* | cy_canfd_tx_msg_func_ptr_t) (void)
| Message transmission complete callback function (cy_canfd_tx_msg_func_ptr_t). More...
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) More...
typedef void(* | cy_canfd_error_func_ptr_t) (uint32_t errorMask)
| The error callback function (cy_canfd_error_func_ptr_t). More...

## Data Structure Documentation

## ◆ cy_stc_canfd_r0_t

struct cy_stc_canfd_r0_t

Data Fields
volatile uint32_t | id | Identifier.
volatile cy_en_canfd_rtr_t | rtr | Remote transmission request.
volatile cy_en_canfd_xtd_t | xtd | Extended identifier.
volatile cy_en_canfd_esi_t | esi | Error state indicator.

## ◆ cy_stc_canfd_r1_t

struct cy_stc_canfd_r1_t

Data Fields
volatile uint32_t | rxts | Rx timestamp.
volatile uint32_t | dlc | Data length code.
volatile bool | brs | Bit rate switch.
volatile cy_en_canfd_fdf_t | fdf | Extended data length.
volatile uint32_t | fidx | Filter index.
volatile cy_en_canfd_anmf_t | anmf | Accepted non-matching frame.

## ◆ cy_stc_canfd_rx_buffer_t

struct cy_stc_canfd_rx_buffer_t

Data Fields
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.

## ◆ cy_stc_canfd_t0_t

struct cy_stc_canfd_t0_t

Data Fields
volatile uint32_t | id | Identifier.
volatile cy_en_canfd_rtr_t | rtr | Remote transmission request. 0:data frame, 1:remote frame
volatile cy_en_canfd_xtd_t | xtd | Extended identifier. 0:11-bit standard identifier, 1:29-bit extended identifier
volatile cy_en_canfd_esi_t | esi | Error state indicator.

## ◆ cy_stc_canfd_t1_t

struct cy_stc_canfd_t1_t

Data Fields
volatile uint32_t | dlc | Data length code.
volatile bool | brs | Bit rate switching.
volatile cy_en_canfd_fdf_t | fdf | FD Format.
volatile bool | efc | Event FIFO control. false: Do not store Tx events, true: Store Tx events
volatile uint32_t | mm | Message marker.

## ◆ cy_stc_canfd_tx_buffer_t

struct cy_stc_canfd_tx_buffer_t

Data Fields
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.

## ◆ cy_stc_id_filter_t

struct cy_stc_id_filter_t

Data Fields
volatile uint32_t | sfid2 | Standard filter ID 2.
volatile uint32_t | sfid1 | Standard filter ID 1.
volatile cy_en_canfd_sfec_t | sfec | Standard filter element configuration.
volatile cy_en_canfd_sft_t | sft | Standard filter Type.

## ◆ cy_stc_canfd_f0_t

struct cy_stc_canfd_f0_t

Data Fields
volatile uint32_t | efid1 | Extended filter ID 1.
volatile cy_en_canfd_efec_t | efec | Extended filter element configuration.

## ◆ cy_stc_canfd_f1_t

struct cy_stc_canfd_f1_t

Data Fields
volatile uint32_t | efid2 | Extended filter ID 2.
volatile cy_en_canfd_eft_t | eft | Extended filter type.

## ◆ cy_stc_extid_filter_t

struct cy_stc_extid_filter_t

Data Fields
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

## ◆ cy_stc_canfd_bitrate_t

struct cy_stc_canfd_bitrate_t

Data Fields
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.

## ◆ cy_stc_canfd_transceiver_delay_compensation_t

struct cy_stc_canfd_transceiver_delay_compensation_t

Data Fields
bool | tdcEnabled | Transceiver delay compensation enabled.
uint8_t | tdcOffset | Transmitter delay compensation offset.
uint8_t | tdcFilterWindow | Transmitter delay compensation filter window length.

## ◆ cy_stc_canfd_sid_filter_config_t

struct cy_stc_canfd_sid_filter_config_t

Data Fields
uint8_t | numberOfSIDFilters | Number Of standard ID filters.
const cy_stc_id_filter_t * | sidFilter | Message ID Filter register.

## ◆ cy_stc_canfd_extid_filter_config_t

struct cy_stc_canfd_extid_filter_config_t

Data Fields
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.

## ◆ cy_stc_canfd_global_filter_config_t

struct cy_stc_canfd_global_filter_config_t

Data Fields
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.

## ◆ cy_en_canfd_fifo_config_t

struct cy_en_canfd_fifo_config_t

Data Fields
cy_en_canfd_fifo_mode_t | mode | CAN FD Rx FIFO operating mode.
uint8_t | watermark | 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.

## ◆ cy_stc_canfd_config_t

struct cy_stc_canfd_config_t

Data Fields
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.

## ◆ cy_stc_canfd_interrupt_handling_t

struct cy_stc_canfd_interrupt_handling_t

Data Fields
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.

## ◆ cy_stc_canfd_context_t

struct cy_stc_canfd_context_t

Data Fields
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.

## Typedef Documentation

## ◆ cy_canfd_tx_msg_func_ptr_t

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

## ◆ cy_canfd_rx_msg_func_ptr_t

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.

Triggered with corresponding
CY_CANFD_RX_BUFFER_NEW_MESSAGE
CY_CANFD_RX_FIFO_0_NEW_MESSAGE
CY_CANFD_RX_FIFO_1_NEW_MESSAGE
interrupt events.

## ◆ cy_canfd_error_func_ptr_t

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
CY_CANFD_RX_FIFO_0_WATERMARK_REACHED
CY_CANFD_RX_FIFO_0_FULL
CY_CANFD_RX_FIFO_0_MSG_LOST
CY_CANFD_RX_FIFO_1_WATERMARK_REACHED
CY_CANFD_RX_FIFO_1_FULL
CY_CANFD_RX_FIFO_1_MSG_LOST
CY_CANFD_TX_FIFO_1_WATERMARK_REACHED
CY_CANFD_TX_FIFO_1_FULL
CY_CANFD_TX_FIFO_1_MSG_LOST
CY_CANFD_TIMESTAMP_WRAPAROUND
CY_CANFD_MRAM_ACCESS_FAILURE
CY_CANFD_TIMEOUT_OCCURRED
CY_CANFD_BIT_ERROR_CORRECTED
CY_CANFD_BIT_ERROR_UNCORRECTED
CY_CANFD_ERROR_LOG_OVERFLOW
CY_CANFD_ERROR_PASSIVE
CY_CANFD_WARNING_STATUS
CY_CANFD_BUS_OFF_STATUS
CY_CANFD_WATCHDOG_INTERRUPT
CY_CANFD_PROTOCOL_ERROR_ARB_PHASE
CY_CANFD_PROTOCOL_ERROR_DATA_PHASE
CY_CANFD_ACCESS_RESERVED_ADDR
interrupt events.