11 #include "hpm_mcan_regs.h"
12 #include "hpm_mcan_soc.h"
48 #define MCAN_INT_ACCESS_TO_RESERVED_ADDR MCAN_IR_ARA_MASK
49 #define MCAN_INT_PROTOCOL_ERR_IN_DATA_PHASE MCAN_IR_PED_MASK
50 #define MCAN_INT_PROTOCOL_ERR_IN_ARB_PHASE MCAN_IR_PEA_MASK
51 #define MCAN_INT_WATCHDOG_INT MCAN_IR_WDI_MASK
53 #define MCAN_INT_BUS_OFF_STATUS MCAN_IR_BO_MASK
54 #define MCAN_INT_WARNING_STATUS MCAN_IR_EW_MASK
55 #define MCAN_INT_ERROR_PASSIVE MCAN_IR_EP_MASK
56 #define MCAN_INT_ERROR_LOGGING_OVERFLOW MCAN_IR_ELO_MASK
57 #define MCAN_INT_BIT_ERROR_UNCORRECTED MCAN_IR_BEU_MASK
58 #define MCAN_INT_BIT_ERROR_CORRECTED MCAN_IR_BEC_MASK
60 #define MCAN_INT_MSG_STORE_TO_RXBUF MCAN_IR_DRX_MASK
61 #define MCAN_INT_TIMEOUT_OCCURRED MCAN_IR_TOO_MASK
62 #define MCAN_INT_MSG_RAM_ACCESS_FAILURE MCAN_IR_MRAF_MASK
63 #define MCAN_INT_TIMESTAMP_WRAPAROUND MCAN_IR_TSW_MASK
65 #define MCAN_INT_TX_EVT_FIFO_EVT_LOST MCAN_IR_TEFL_MASK
66 #define MCAN_INT_TX_EVT_FIFO_FULL MCAN_IR_TEFF_MASK
67 #define MCAN_INT_TX_EVT_FIFO_WMK_REACHED MCAN_IR_TEFW_MASK
68 #define MCAN_INT_TX_EVT_FIFO_NEW_ENTRY MCAN_IR_TEFN_MASK
70 #define MCAN_INT_TXFIFO_EMPTY MCAN_IR_TFE_MASK
71 #define MCAN_INT_TX_CANCEL_FINISHED MCAN_IR_TCF_MASK
72 #define MCAN_INT_TX_COMPLETED MCAN_IR_TC_MASK
73 #define MCAN_INT_HIGH_PRIORITY_MSG MCAN_IR_HPM_MASK
75 #define MCAN_INT_RXFIFO1_MSG_LOST MCAN_IR_RF1L_MASK
76 #define MCAN_INT_RXFIFO1_FULL MCAN_IR_RF1F_MASK
77 #define MCAN_INT_RXFIFO1_WMK_REACHED MCAN_IR_RF1W_MASK
78 #define MCAN_INT_RXFIFO1_NEW_MSG MCAN_IR_RF1N_MASK
80 #define MCAN_INT_RXFIFO0_MSG_LOST MCAN_IR_RF0L_MASK
81 #define MCAN_INT_RXFIFO0_FULL MCAN_IR_RF0F_MASK
82 #define MCAN_INT_RXFIFO0_WMK_REACHED MCAN_IR_RF0W_MASK
83 #define MCAN_INT_RXFIFO0_NEW_MSG MCAN_IR_RF0N_MASK
88 #define MCAN_EVENT_RECEIVE (MCAN_INT_RXFIFO0_NEW_MSG | MCAN_INT_RXFIFO1_NEW_MSG | MCAN_INT_MSG_STORE_TO_RXBUF)
93 #define MCAN_EVENT_TRANSMIT (MCAN_INT_TX_COMPLETED)
97 #define MCAN_EVENT_ERROR (MCAN_INT_BUS_OFF_STATUS | MCAN_INT_WARNING_STATUS \
98 | MCAN_INT_ERROR_PASSIVE | MCAN_INT_BIT_ERROR_UNCORRECTED \
99 | MCAN_INT_PROTOCOL_ERR_IN_DATA_PHASE | MCAN_INT_PROTOCOL_ERR_IN_ARB_PHASE)
104 #define MCAN_TX_RETRY_COUNT_MAX (10000000UL)
108 #define MCAN_RX_RETRY_COUNT_MAX (80000000UL)
137 #define MCAN_RAM_WORD_SIZE (640U)
139 #define MCAN_FILTER_ELEM_STD_ID_SIZE (4U)
140 #define MCAN_FILTER_ELEM_EXT_ID_SIZE (8U)
141 #define MCAN_STD_FILTER_ELEM_SIZE_MAX (128U)
142 #define MCAN_EXT_FILTER_ELEM_SIZE_MAX (64U)
144 #define MCAN_TXRX_ELEM_SIZE_CAN_MAX (4U * sizeof(uint32_t))
145 #define MCAN_FILTER_SIZE_CAN_DEFAULT (32U)
146 #define MCAN_TXBUF_SIZE_CAN_DEFAULT (32U)
147 #define MCAN_RXFIFO_SIZE_CAN_DEFAULT (32U)
148 #define MCAN_RXBUF_SIZE_CAN_DEFAULT (16U)
150 #define MCAN_TXRX_ELEM_SIZE_CANFD_MAX (18U * sizeof(uint32_t))
151 #define MCAN_FILTER_SIZE_CANFD_DEFAULT (16U)
152 #define MCAN_TXBUF_SIZE_CANFD_DEFAULT (8U)
153 #define MCAN_RXFIFO_SIZE_CANFD_DEFAULT (8U)
154 #define MCAN_RXBUF_SIZE_CANFD_DEFAULT (4U)
156 #define MCAN_TXEVT_ELEM_SIZE (8U)
181 #define MCAN_MESSAGE_HEADER_SIZE_IN_BYTES (8U)
182 #define MCAN_MESSAGE_HEADER_SIZE_IN_WORDS (2U)
312 #define MCAN_CAN_ID_TYPE_STANDARD (0U)
313 #define MCAN_CAN_ID_TYPE_EXTENDED (1U)
349 #define MCAN_DATA_FIELD_SIZE_8BYTES (0U)
350 #define MCAN_DATA_FIELD_SIZE_12BYTES (1U)
351 #define MCAN_DATA_FIELD_SIZE_16BYTES (2U)
352 #define MCAN_DATA_FIELD_SIZE_20BYTES (3U)
353 #define MCAN_DATA_FIELD_SIZE_24BYTES (4U)
354 #define MCAN_DATA_FIELD_SIZE_32BYTES (5U)
355 #define MCAN_DATA_FIELD_SIZE_48BYTES (6U)
356 #define MCAN_DATA_FIELD_SIZE_64BYTES (7U)
361 #define MCAN_FIFO_OPERATION_MODE_BLOCKING (0U)
362 #define MCAN_FIFO_OPERATION_MODE_OVERWRITE (1U)
380 #define MCAN_TXBUF_OPERATION_MODE_FIFO (0U)
381 #define MCAN_TXBUF_OPERATION_MODE_QUEUE (1U)
480 #define MCAN_ACCEPT_NON_MATCHING_FRAME_OPTION_IN_RXFIFO0 (0U)
481 #define MCAN_ACCEPT_NON_MATCHING_FRAME_OPTION_IN_RXFIFO1 (1U)
482 #define MCAN_ACCEPT_NON_MATCHING_FRAME_OPTION_REJECT (2U)
497 #define MCAN_FILTER_TYPE_RANGE_FILTER (0U)
498 #define MCAN_FILTER_TYPE_SPECIFIED_ID_FILTER (1U)
499 #define MCAN_FILTER_TYPE_CLASSIC_FILTER (2U)
500 #define MCAN_FILTER_TYPE_FILTER_DISABLED (3U)
501 #define MCAN_FILTER_TYPE_DUAL_ID_EXT_FILTER_IGNORE_MASK
506 #define MCAN_FILTER_ELEM_CFG_DISABLED (0)
507 #define MCAN_FILTER_ELEM_CFG_STORE_IN_RX_FIFO0_IF_MATCH (1U)
508 #define MCAN_FILTER_ELEM_CFG_STORE_IN_RX_FIFO1_IF_MATCH (2U)
509 #define MCAN_FILTER_ELEM_CFG_REJECT_ID_IF_MATCH (3U)
510 #define MCAN_FILTER_ELEM_CFG_SET_PRIORITY_IF_MATCH (4U)
512 #define MCAN_FILTER_ELEM_CFG_SET_PRIORITY_AND_STORE_IN_FIFO0_IF_MATCH (5U)
514 #define MCAN_FILTER_ELEM_CFG_SET_PRIORITY_AND_STORE_IN_FIFO1_IF_MATCH (6U)
515 #define MCAN_FILTER_ELEM_CFG_STORE_INTO_RX_BUFFER_OR_AS_DBG_MSG (7U)
617 #define MCAN_TIMESTAMP_SEL_MIN (0U)
618 #define MCAN_TIMESTAMP_SEL_VALUE_ALWAYS_ZERO (0U)
619 #define MCAN_TIMESTAMP_SEL_VALUE_INCREMENT (1U)
620 #define MCAN_TIMESTAMP_SEL_EXT_TS_VAL_USED (2U)
621 #define MCAN_TIMESTAMP_SEL_MAX (MCAN_TIMESTAMP_SEL_EXT_TS_VAL_USED)
707 #define MCAN_TIMEOUT_SEL_TYPE_CONTINUOUS_OPERATION (0U)
708 #define MCAN_TIMEOUT_SEL_TYPE_TIMEOUT_CTRL_BY_TX_EVT_FIFO (1U)
709 #define MCAN_TIMEOUT_SEL_TYPE_TIMEOUT_CTRL_BY_RX_FIFO0 (2U)
710 #define MCAN_TIMEOUT_SEL_TYPE_TIMEOUT_CTRL_BY_RX_FIFO1 (3U)
750 #define MCAN_MESSAGE_STORAGE_INDICATOR_NO_FIFO_SELECTED (0U)
751 #define MCAN_MESSAGE_STORAGE_INDICATOR_FIFO_MESSAGE_LOST (1U)
752 #define MCAN_MESSAGE_STORAGE_INDICATOR_RXFIFO0 (2U)
753 #define MCAN_MESSAGE_STORAGE_INDICATOR_RXFIFO1 (3U)
1044 *((
volatile uint32_t *) &ptr->
TOCV) = 0;
1054 uint32_t ecr = ptr->
ECR;
1294 if (line_index == 0) {
1299 ptr->
ILE = (1UL << line_index);
1310 return ((ptr->
TXBRP & ((1UL << index))) != 0U);
1340 ptr->
TXBAR = (1UL << index);
1351 ptr->
TXBAR = index_bitmask;
1361 ptr->
TXBCR = (1UL << index);
1372 return ((ptr->
TXBTO & (1UL << index)) != 0U);
1385 result = (ptr->
NDAT1 & (1UL << index)) != 0U;
1386 }
else if (index < 64U) {
1387 result = (ptr->
NDAT2 & (1UL << (index - 32U))) != 0U;
1402 ptr->
NDAT1 = (1UL << index);
1403 }
else if (index < 64U) {
1404 ptr->
NDAT2 = (1UL << (index - 32U));
1418 return ((ptr->
IR & mask) != 0U);
1431 bool is_available =
false;
1433 is_available = ((ptr->
TSS1 & (1UL << index)) != 0U);
1435 return is_available;
#define MCAN_CCCR_UTSU_MASK
Definition: hpm_mcan_regs.h:330
#define MCAN_CCCR_INIT_MASK
Definition: hpm_mcan_regs.h:452
#define MCAN_PSR_TDCV_GET(x)
Definition: hpm_mcan_regs.h:650
#define MCAN_CCCR_DAR_MASK
Definition: hpm_mcan_regs.h:379
#define MCAN_CCCR_WMM_MASK
Definition: hpm_mcan_regs.h:315
#define MCAN_CCCR_CCE_MASK
Definition: hpm_mcan_regs.h:440
#define MCAN_PSR_RESI_GET(x)
Definition: hpm_mcan_regs.h:701
#define MCAN_PSR_EP_GET(x)
Definition: hpm_mcan_regs.h:746
#define MCAN_TSCFG_EN64_MASK
Definition: hpm_mcan_regs.h:2768
#define MCAN_PSR_RFDF_GET(x)
Definition: hpm_mcan_regs.h:675
#define MCAN_TXFQS_TFQPI_GET(x)
Definition: hpm_mcan_regs.h:2401
#define MCAN_CCCR_BRSE_MASK
Definition: hpm_mcan_regs.h:343
#define MCAN_PSR_BO_GET(x)
Definition: hpm_mcan_regs.h:724
#define MCAN_ECR_REC_GET(x)
Definition: hpm_mcan_regs.h:627
#define MCAN_CCCR_TXP_MASK
Definition: hpm_mcan_regs.h:277
#define MCAN_PSR_LEC_GET(x)
Definition: hpm_mcan_regs.h:789
#define MCAN_CCCR_ASM_MASK
Definition: hpm_mcan_regs.h:428
#define MCAN_PSR_EW_GET(x)
Definition: hpm_mcan_regs.h:735
#define MCAN_TXFQS_TFQF_MASK
Definition: hpm_mcan_regs.h:2389
#define MCAN_PSR_ACT_GET(x)
Definition: hpm_mcan_regs.h:761
#define MCAN_ECR_TEC_GET(x)
Definition: hpm_mcan_regs.h:638
#define MCAN_ECR_RP_GET(x)
Definition: hpm_mcan_regs.h:617
#define MCAN_PSR_PXE_GET(x)
Definition: hpm_mcan_regs.h:662
#define MCAN_PSR_DLEC_GET(x)
Definition: hpm_mcan_regs.h:713
#define MCAN_CCCR_CSR_MASK
Definition: hpm_mcan_regs.h:404
#define MCAN_CCCR_PXHD_MASK
Definition: hpm_mcan_regs.h:302
#define MCAN_CCCR_EFBI_MASK
Definition: hpm_mcan_regs.h:289
#define MCAN_CCCR_CSA_MASK
Definition: hpm_mcan_regs.h:416
#define MCAN_ECR_CEL_GET(x)
Definition: hpm_mcan_regs.h:606
#define MCAN_CCCR_MON_MASK
Definition: hpm_mcan_regs.h:392
#define MCAN_PSR_RBRS_GET(x)
Definition: hpm_mcan_regs.h:688
uint32_t hpm_stat_t
Definition: hpm_common.h:123
#define ARRAY_SIZE(a)
Definition: hpm_common.h:42
#define MAKE_STATUS(group, code)
Definition: hpm_common.h:132
@ status_group_mcan
Definition: hpm_common.h:161
enum mcan_node_mode_enum mcan_node_mode_t
CAN Node Mode types.
struct mcan_tdc_config_t mcan_tdc_config_t
MCAN Transmitter Delay Compensation Configuration.
struct mcan_config_struct mcan_config_t
MCAN Configuration Structure.
static void mcan_enter_normal_mode(MCAN_Type *ptr)
Switch MCAN to Normal mode.
Definition: hpm_mcan_drv.h:1022
static void mcan_send_add_multiple_requests(MCAN_Type *ptr, uint32_t index_bitmask)
Request several transmission via specified TXBUF/FIFO Bit masks MCAN IP will transmit data in the buf...
Definition: hpm_mcan_drv.h:1349
uint8_t mcan_get_message_size_from_dlc(uint8_t dlc)
Get message Size from Data Length Code.
Definition: hpm_mcan_drv.c:1415
static void mcan_enable_clock(MCAN_Type *ptr)
Enable MCAN clock.
Definition: hpm_mcan_drv.h:935
static void mcan_disable_protocol_exception_handling(MCAN_Type *ptr)
Disable Protocol Exception Handling.
Definition: hpm_mcan_drv.h:814
static void mcan_cancel_tx_buf_send_request(MCAN_Type *ptr, uint32_t index)
Cancel the TXBUF Send request.
Definition: hpm_mcan_drv.h:1359
enum mcan_bit_timing_option mcan_bit_timing_option_t
CAN Bit Timing Options.
static uint8_t mcan_get_activity(MCAN_Type *ptr)
Get CAN Activity.
Definition: hpm_mcan_drv.h:1086
struct mcan_rx_message_struct mcan_rx_message_t
CAN Receive Message Frame.
static void mcan_enable_txbuf_transmission_interrupt(MCAN_Type *ptr, uint32_t mask)
Enable TXBUF Transmission interrupt.
Definition: hpm_mcan_drv.h:1251
static void mcan_stop_clock(MCAN_Type *ptr)
Stop MCAN clock.
Definition: hpm_mcan_drv.h:926
mcan_bit_timing_option
CAN Bit Timing Options.
Definition: hpm_mcan_drv.h:172
static bool mcan_is_transmit_occurred(MCAN_Type *ptr, uint32_t index)
Check whether the Transmission completed via specified TXBUF/TXFIFO.
Definition: hpm_mcan_drv.h:1370
hpm_stat_t mcan_set_filter_element(MCAN_Type *ptr, const mcan_filter_elem_t *filter_elem, uint32_t index)
Set CAN filter element.
Definition: hpm_mcan_drv.c:1302
hpm_stat_t mcan_get_timestamp_from_tx_event(MCAN_Type *ptr, const mcan_tx_event_fifo_elem_t *tx_evt, mcan_timestamp_value_t *timestamp)
Get Timestamp from MCAN TX Event.
Definition: hpm_mcan_drv.c:1889
static bool mcan_is_rxbuf_data_available(MCAN_Type *ptr, uint32_t index)
Check Whether there are data available in specified RXBUF.
Definition: hpm_mcan_drv.h:1381
hpm_stat_t mcan_parse_protocol_status(uint32_t psr, mcan_protocol_status_t *protocol_status)
Parse the Protocol Status register value.
Definition: hpm_mcan_drv.c:1958
static void mcan_disable_auto_retransmission(MCAN_Type *ptr)
Disable Auto Transmission.
Definition: hpm_mcan_drv.h:908
static void mcan_disable_tsu(MCAN_Type *ptr)
Disable External Timestamp Unit.
Definition: hpm_mcan_drv.h:850
static void mcan_reset_timeout_counter_value(MCAN_Type *ptr)
Reset Timeout counter value.
Definition: hpm_mcan_drv.h:1042
static void mcan_interrupt_line_select(MCAN_Type *ptr, uint32_t mask, uint8_t line_index)
Select Interrupt Line.
Definition: hpm_mcan_drv.h:1292
static void mcan_clear_rxbuf_data_available_flag(MCAN_Type *ptr, uint32_t index)
Clear RXBUF Data available Flag for specified RXBUF.
Definition: hpm_mcan_drv.h:1399
static void mcan_enable_auto_retransmission(MCAN_Type *ptr)
Enable Auto Retransmission.
Definition: hpm_mcan_drv.h:899
static void mcan_clear_interrupt_flags(MCAN_Type *ptr, uint32_t mask)
Clear Interrupt Flags.
Definition: hpm_mcan_drv.h:1197
enum mcan_timeout_sel_enum mcan_timeout_sel_t
MCAN Timeout Selection Options.
hpm_stat_t mcan_receive_from_fifo_blocking(MCAN_Type *ptr, uint32_t fifo_index, mcan_rx_message_t *rx_frame)
Receive CAN Frame from RXFIFO in blocking way.
Definition: hpm_mcan_drv.c:1792
static void mcan_enter_init_mode(MCAN_Type *ptr)
Switch MCAN to Initialization mode.
Definition: hpm_mcan_drv.h:1013
struct mcan_timeout_config_struct mcan_timeout_config_t
MCAN Timeout configuration structure.
hpm_stat_t mcan_write_txfifo(MCAN_Type *ptr, mcan_tx_frame_t *tx_frame)
Write Frame CAN to TXFIFO.
Definition: hpm_mcan_drv.c:1500
struct mcan_ram_flexible_config_struct mcan_ram_flexible_config_t
MCAN RAM Flexible Configuration.
static void mcan_disable_wide_message_marker(MCAN_Type *ptr)
Disable Wide Message Marker.
Definition: hpm_mcan_drv.h:832
static void mcan_disable_interrupts(MCAN_Type *ptr, uint32_t mask)
Disable Interrupts.
Definition: hpm_mcan_drv.h:1241
static void mcan_disable_edge_filtering(MCAN_Type *ptr)
Disable Edge Filtering.
Definition: hpm_mcan_drv.h:796
hpm_stat_t mcan_set_global_filter_config(MCAN_Type *ptr, mcan_global_filter_config_t *filter_config)
Configure Global Filter.
Definition: hpm_mcan_drv.c:1827
hpm_stat_t mcan_transmit_blocking(MCAN_Type *ptr, mcan_tx_frame_t *tx_frame)
Transmit CAN message in blocking way.
Definition: hpm_mcan_drv.c:1687
struct mcan_bit_timing_param_struct mcan_bit_timing_param_t
CAN Bit Timing Parameters.
static void mcan_disable_txbuf_cancel_finish_interrupt(MCAN_Type *ptr, uint32_t mask)
Disable TXBUF Cancellation Finish interrupt.
Definition: hpm_mcan_drv.h:1281
union mcan_filter_config_struct mcan_filter_config_t
MCAN Filter Configuration.
static uint16_t mcan_get_timestamp_counter_value(MCAN_Type *ptr)
Get Timestamp Counter Value.
Definition: hpm_mcan_drv.h:1004
struct mcan_tsu_config_struct mcan_tsu_config_t
MCAN TSU Configuration.
static void mcan_enable_wide_message_marker(MCAN_Type *ptr)
Enable Wide Message Marker.
Definition: hpm_mcan_drv.h:823
struct mcan_timestamp_value_struct mcan_timestamp_value_t
MCAN Timestamp Value.
static void mcan_enable_bus_monitoring_mode(MCAN_Type *ptr)
Enable Bus monitoring Mode.
Definition: hpm_mcan_drv.h:917
hpm_stat_t mcan_receive_from_buf_blocking(MCAN_Type *ptr, uint32_t index, mcan_rx_message_t *rx_frame)
Receive CAN Frame from RXBUF in blocking way.
Definition: hpm_mcan_drv.c:1767
static bool mcan_is_txfifo_full(MCAN_Type *ptr)
Check whether TXFIFO is full.
Definition: hpm_mcan_drv.h:1318
struct mcan_error_count_struct mcan_error_count_t
MCAN Error Count Information.
static uint32_t mcan_get_txfifo_put_index(MCAN_Type *ptr)
Get the TXFIFO Put Index.
Definition: hpm_mcan_drv.h:1328
struct mcan_txbuf_elem_config_struct mcan_txbuf_elem_config_t
static void mcan_enable_write_to_prot_config_registers(MCAN_Type *ptr)
Enable Write Access to Protected Configuration Registers.
Definition: hpm_mcan_drv.h:985
static void mcan_disable_restricted_operation_mode(MCAN_Type *ptr)
Disable Restricted Operation Mode.
Definition: hpm_mcan_drv.h:976
hpm_stat_t mcan_transmit_via_txbuf_nonblocking(MCAN_Type *ptr, uint32_t index, mcan_tx_frame_t *tx_frame)
Transmit CAN message via TX in non-blocking way.
Definition: hpm_mcan_drv.c:1659
static void mcan_enable_txbuf_interrupt(MCAN_Type *ptr, uint32_t mask)
Enable TXBUF Interrupt.
Definition: hpm_mcan_drv.h:1220
static bool mcan_is_clock_stopped(MCAN_Type *ptr)
Check whether CAN clock is stopped or not.
Definition: hpm_mcan_drv.h:958
static void mcan_disable_write_to_prot_config_registers(MCAN_Type *ptr)
Disable Write Access to Protected Configuration Registers.
Definition: hpm_mcan_drv.h:994
hpm_stat_t mcan_get_protocol_status(MCAN_Type *ptr, mcan_protocol_status_t *protocol_status)
Get MCAN Protocol Status.
Definition: hpm_mcan_drv.c:1997
hpm_stat_t mcan_read_rxfifo(MCAN_Type *ptr, uint32_t fifo_index, mcan_rx_message_t *rx_frame)
Read message from CAN RXBUF.
Definition: hpm_mcan_drv.c:1559
static void mcan_disable_bus_monitoring_mode(MCAN_Type *ptr)
Disable Bus monitoring Mode.
Definition: hpm_mcan_drv.h:949
static uint8_t mcan_get_last_error_code(MCAN_Type *ptr)
Get Last Error Code.
Definition: hpm_mcan_drv.h:1066
static void mcan_send_add_request(MCAN_Type *ptr, uint32_t index)
Request A Transmission via specified TXBUF Index.
Definition: hpm_mcan_drv.h:1338
hpm_stat_t mcan_read_rxbuf(MCAN_Type *ptr, uint32_t index, mcan_rx_message_t *rx_frame)
Read message from CAN RXBUF.
Definition: hpm_mcan_drv.c:1529
static bool mcan_is_canfd_message_received(MCAN_Type *ptr)
Check whether CANFD messages were received.
Definition: hpm_mcan_drv.h:1157
void mcan_get_default_ram_config(MCAN_Type *ptr, mcan_ram_config_t *simple_config, bool enable_canfd)
Get Default MCAN RAM configuration If the device is configured as classic CAN node,...
Definition: hpm_mcan_drv.c:480
static void mcan_enable_txbuf_cancel_finish_interrupt(MCAN_Type *ptr, uint32_t mask)
Enable TXBUF Cancellation Finish interrupt.
Definition: hpm_mcan_drv.h:1271
union mcan_txbuf_config_struct mcan_txbuf_config_t
hpm_stat_t mcan_request_and_fill_txfifo(MCAN_Type *ptr, mcan_tx_frame_t *tx_frame, uint32_t *fifo_index)
Request TXFIFO and fill data into TXFIFO.
Definition: hpm_mcan_drv.c:1713
void mcan_get_default_ram_flexible_config(MCAN_Type *ptr, mcan_ram_flexible_config_t *ram_config, bool enable_canfd)
Get Default Full MCAN RAM configuration If the device is configured as classic CAN node,...
Definition: hpm_mcan_drv.c:554
static void mcan_disable_txbuf_interrupt(MCAN_Type *ptr, uint32_t mask)
Disable TXBUF Interrupt.
Definition: hpm_mcan_drv.h:1231
union mcan_rxfifo_config_struct mcan_rxfifo_config_t
MCAN RXFIFO Configuration.
static uint16_t mcan_get_timeout_counter_value(MCAN_Type *ptr)
Get Timeout value.
Definition: hpm_mcan_drv.h:1032
enum mcan_last_error_code mcan_last_err_code_t
MCAN Last Error Code.
struct mcan_std_id_filter_elem_struct mcan_filter_elem_t
MCAN Filter Element definitions.
struct mcan_high_priority_message_status_struct mcan_high_priority_message_status_t
MCAN High Priority Message Status Information.
static bool mcan_is_protocol_exception_event_occurred(MCAN_Type *ptr)
Check whether Protocol Exception Events were occurred.
Definition: hpm_mcan_drv.h:1167
static void mcan_disable_transmit_pause(MCAN_Type *ptr)
Disable Transmit Pause.
Definition: hpm_mcan_drv.h:778
uint8_t mcan_get_data_field_size(uint8_t data_field_size_option)
Get the Data field size from data field size option.
Definition: hpm_mcan_drv.c:1428
struct mcan_global_filter_config_struct mcan_global_filter_config_t
MCAN Global CAN configuration.
static void mcan_disable_bitrate_switch(MCAN_Type *ptr)
Disable Bit Rate Switch.
Definition: hpm_mcan_drv.h:890
struct mcan_ram_config_struct mcan_ram_config_t
MCAN RAM configuration.
hpm_stat_t mcan_write_txbuf(MCAN_Type *ptr, uint32_t index, mcan_tx_frame_t *tx_frame)
Write Frame to CAN TX Buffer.
Definition: hpm_mcan_drv.c:1464
static uint8_t mcan_get_last_data_error_code(MCAN_Type *ptr)
Get Last Data Phase Error Code.
Definition: hpm_mcan_drv.h:1076
hpm_stat_t mcan_config_ram_with_flexible_config(MCAN_Type *ptr, mcan_ram_flexible_config_t *config)
Configure MCAN RAM will Full RAM configuration.
Definition: hpm_mcan_drv.c:844
struct mcan_filter_elem_list_struct mcan_filter_elem_list_t
MCAN Filter Element List structure.
uint32_t mcan_read_32bit_tsu_timestamp(MCAN_Type *ptr, uint32_t index)
Read 32bit Timestamp value from TSU.
Definition: hpm_mcan_drv.c:1864
static void mcan_enable_bitrate_switch(MCAN_Type *ptr)
Enable Bit Rate Switch.
Definition: hpm_mcan_drv.h:881
union mcan_rx_fifo_or_buf_elem_config_struct mcan_rx_fifo_or_buf_elem_config_t
MCAN RXBUF or RXFIFO Element Configuration.
static void mcan_enable_protocol_exception_handling(MCAN_Type *ptr)
Enable Protocol Exception Handling.
Definition: hpm_mcan_drv.h:805
hpm_stat_t mcan_read_tx_evt_fifo(MCAN_Type *ptr, mcan_tx_event_fifo_elem_t *tx_evt)
Read TX Event from CAN TX EVENT FIFO.
Definition: hpm_mcan_drv.c:1624
static void mcan_enable_restricted_operation_mode(MCAN_Type *ptr)
Enable Restricted Operation Mode.
Definition: hpm_mcan_drv.h:967
static bool mcan_is_bitrate_switch_flag_set_in_last_received_canfd_msg(MCAN_Type *ptr)
Check whether the Bitrate Switch Flag is set in the last received CANFD message.
Definition: hpm_mcan_drv.h:1147
hpm_stat_t mcan_get_timestamp_from_received_message(MCAN_Type *ptr, const mcan_rx_message_t *rx_msg, mcan_timestamp_value_t *timestamp)
Get Timestamp from MCAN RX frame.
Definition: hpm_mcan_drv.c:1924
struct mcan_protocol_status mcan_protocol_status_t
MCAN Protocol Status.
static uint8_t mcan_get_data_phase_last_error_code(MCAN_Type *ptr)
Get the Last Data Phase Error.
Definition: hpm_mcan_drv.h:1127
static bool mcan_is_error_state_indicator_flag_set_in_last_received_canfd_msg(MCAN_Type *ptr)
Check Whether the Error Status Indicator Flag is set in the last received CANFD message.
Definition: hpm_mcan_drv.h:1137
hpm_stat_t mcan_config_ram(MCAN_Type *ptr, mcan_ram_config_t *config)
Configure MCAN RAM will Simplified RAM configuration.
Definition: hpm_mcan_drv.c:707
static uint8_t mcan_get_transmitter_delay_compensation_value(MCAN_Type *ptr)
Get the Transmitter Delay Compensation Value.
Definition: hpm_mcan_drv.h:1177
static void mcan_enable_tsu(MCAN_Type *ptr)
Enable External Timestamp Unit.
Definition: hpm_mcan_drv.h:841
static void mcan_enable_edge_filtering(MCAN_Type *ptr)
Enable Edge Filtering.
Definition: hpm_mcan_drv.h:787
hpm_stat_t mcan_init(MCAN_Type *ptr, mcan_config_t *config, uint32_t src_clk_freq)
Initialize CAN controller.
Definition: hpm_mcan_drv.c:1041
static bool mcan_is_tsu_timestamp_available(MCAN_Type *ptr, uint32_t index)
Check whether the TSU timestamp is available.
Definition: hpm_mcan_drv.h:1429
static bool mcan_is_in_err_passive_state(MCAN_Type *ptr)
Check whether the CAN node is under error passive state.
Definition: hpm_mcan_drv.h:1096
struct mcan_tx_message_struct mcan_tx_frame_t
CAN Transmit Message Frame.
struct mcan_timeout_counter_config_struct mcan_timeout_counter_config_t
MCAN Timeout Counter Configuration.
union mcan_tx_event_fifo_elem_struct mcan_tx_event_fifo_elem_t
TX Event Fifo Element Structure.
static bool mcan_is_tsu_used(MCAN_Type *ptr)
Check whether TSU is used.
Definition: hpm_mcan_drv.h:861
static void mcan_disable_txbuf_transmission_interrupt(MCAN_Type *ptr, uint32_t mask)
Disable TXBUF Transmission interrupt.
Definition: hpm_mcan_drv.h:1261
struct mcan_all_filters_config_struct mcan_all_filters_config_t
MCAN Configuration for all filters.
static bool mcan_is_transmit_request_pending(MCAN_Type *ptr, uint32_t index)
Check whether a TXFIFO/TXBUF transmission request is pending.
Definition: hpm_mcan_drv.h:1308
static bool mcan_is_in_busoff_state(MCAN_Type *ptr)
Check whether the CAN node is under Bus-off state.
Definition: hpm_mcan_drv.h:1116
static bool mcan_is_in_error_warning_state(MCAN_Type *ptr)
Check whether the CAN mode is under Warning State.
Definition: hpm_mcan_drv.h:1106
hpm_stat_t mcan_config_transmitter_delay_compensation(MCAN_Type *ptr, mcan_tdc_config_t *config)
Configure Transmitter Delay Compensation.
Definition: hpm_mcan_drv.c:1848
static uint32_t mcan_get_interrupt_flags(MCAN_Type *ptr)
Get Interrupt Flags.
Definition: hpm_mcan_drv.h:1187
void mcan_get_high_priority_message_status(MCAN_Type *ptr, mcan_high_priority_message_status_t *status)
Get High Priority Message Status.
Definition: hpm_mcan_drv.c:1818
static void mcan_enable_transmit_pause(MCAN_Type *ptr)
Enable Transmit Pause.
Definition: hpm_mcan_drv.h:769
void mcan_get_default_config(MCAN_Type *ptr, mcan_config_t *config)
Get Default CAN configuration.
Definition: hpm_mcan_drv.c:644
hpm_stat_t mcan_transmit_via_txfifo_nonblocking(MCAN_Type *ptr, mcan_tx_frame_t *tx_frame, uint32_t *fifo_index)
Transmit CAN message via TX FIFO in non-blocking way.
Definition: hpm_mcan_drv.c:1737
static void mcan_enable_interrupts(MCAN_Type *ptr, uint32_t mask)
Enable Interrupts.
Definition: hpm_mcan_drv.h:1207
enum mcan_activity_enum mcan_activity_state_t
MCAN Communication State.
mcan_activity_enum
MCAN Communication State.
Definition: hpm_mcan_drv.h:127
mcan_timeout_sel_enum
MCAN Timeout Selection Options.
Definition: hpm_mcan_drv.h:634
uint64_t mcan_read_64bit_tsu_timestamp(MCAN_Type *ptr, uint32_t index)
Read 64bit Timestamp value from TSU.
Definition: hpm_mcan_drv.c:1873
void mcan_deinit(MCAN_Type *ptr)
De-Initialize CAN controller.
Definition: hpm_mcan_drv.c:1266
static bool mcan_is_interrupt_flag_set(MCAN_Type *ptr, uint32_t mask)
Check whether specified Interrupt is set.
Definition: hpm_mcan_drv.h:1416
static void mcan_get_error_counter(MCAN_Type *ptr, mcan_error_count_t *err_cnt)
Get Error Counter Information.
Definition: hpm_mcan_drv.h:1052
mcan_last_error_code
MCAN Last Error Code.
Definition: hpm_mcan_drv.h:113
mcan_node_mode_enum
CAN Node Mode types.
Definition: hpm_mcan_drv.h:578
static bool mcan_is_64bit_tsu_timestamp_used(MCAN_Type *ptr)
Check whether 64-bit TSU timestamp is used.
Definition: hpm_mcan_drv.h:872
static bool mcan_is_clock_enabled(MCAN_Type *ptr)
Definition: hpm_mcan_drv.h:940
struct mcan_internal_timestamp_config_struct mcan_internal_timestamp_config_t
MCAN Internal timestamp configuration.
hpm_stat_t mcan_config_all_filters(MCAN_Type *ptr, mcan_all_filters_config_t *config)
Configure All CAN filters.
Definition: hpm_mcan_drv.c:922
@ mcan_bit_timing_canfd_nominal
Definition: hpm_mcan_drv.h:174
@ mcan_bit_timing_can2_0
Definition: hpm_mcan_drv.h:173
@ mcan_bit_timing_canfd_data
Definition: hpm_mcan_drv.h:175
@ status_mcan_txbuf_index_out_of_range
Definition: hpm_mcan_drv.h:35
@ status_mcan_filter_index_out_of_range
Definition: hpm_mcan_drv.h:28
@ status_mcan_timeout
Definition: hpm_mcan_drv.h:41
@ status_mcan_rxbuf_index_out_of_range
Definition: hpm_mcan_drv.h:36
@ status_mcan_invalid_bit_timing
Definition: hpm_mcan_drv.h:42
@ status_mcan_rxfifo0_busy
Definition: hpm_mcan_drv.h:33
@ status_mcan_txbuf_full
Definition: hpm_mcan_drv.h:31
@ status_mcan_tx_evt_fifo_empty
Definition: hpm_mcan_drv.h:38
@ status_mcan_txfifo_full
Definition: hpm_mcan_drv.h:32
@ status_mcan_ram_out_of_range
Definition: hpm_mcan_drv.h:40
@ status_mcan_rxfifo_empty
Definition: hpm_mcan_drv.h:29
@ status_mcan_rxbuf_empty
Definition: hpm_mcan_drv.h:37
@ status_mcan_rxfifo_full
Definition: hpm_mcan_drv.h:30
@ status_mcan_timestamp_not_exist
Definition: hpm_mcan_drv.h:39
@ status_mcan_rxfifo1_busy
Definition: hpm_mcan_drv.h:34
@ mcan_activity_idle
Definition: hpm_mcan_drv.h:129
@ mcan_activity_receiver
Definition: hpm_mcan_drv.h:130
@ mcan_activity_sync
Definition: hpm_mcan_drv.h:128
@ mcan_activity_transmitter
Definition: hpm_mcan_drv.h:131
@ mcan_timeout_triggered_by_rx_fifo1
Definition: hpm_mcan_drv.h:638
@ mcan_timeout_continuous_operation
Definition: hpm_mcan_drv.h:635
@ mcan_timeout_triggered_by_rx_fifo0
Definition: hpm_mcan_drv.h:637
@ mcan_timeout_triggered_by_tx_evt_fifo
Definition: hpm_mcan_drv.h:636
@ mcan_last_error_code_crc_error
Definition: hpm_mcan_drv.h:120
@ mcan_last_error_code_ack_error
Definition: hpm_mcan_drv.h:117
@ mcan_last_error_code_bit0_error
Definition: hpm_mcan_drv.h:119
@ mcan_last_error_code_stuff_error
Definition: hpm_mcan_drv.h:115
@ mcan_last_error_code_format_error
Definition: hpm_mcan_drv.h:116
@ mcan_last_error_code_no_change
Definition: hpm_mcan_drv.h:121
@ mcan_last_error_code_no_error
Definition: hpm_mcan_drv.h:114
@ mcan_last_error_code_bit1_error
Definition: hpm_mcan_drv.h:118
@ mcan_mode_normal
Definition: hpm_mcan_drv.h:579
@ mcan_mode_loopback_internal
Definition: hpm_mcan_drv.h:580
@ mcan_mode_loopback_external
Definition: hpm_mcan_drv.h:581
@ mcan_mode_listen_only
Definition: hpm_mcan_drv.h:582
Definition: hpm_mcan_regs.h:12
__RW uint32_t TXBTIE
Definition: hpm_mcan_regs.h:59
__RW uint32_t IR
Definition: hpm_mcan_regs.h:30
__R uint32_t PSR
Definition: hpm_mcan_regs.h:27
__R uint32_t TSS1
Definition: hpm_mcan_regs.h:69
__RW uint32_t CCCR
Definition: hpm_mcan_regs.h:19
__R uint32_t TOCV
Definition: hpm_mcan_regs.h:24
__RW uint32_t TXBCR
Definition: hpm_mcan_regs.h:56
__R uint32_t TSCV
Definition: hpm_mcan_regs.h:22
__RW uint32_t IE
Definition: hpm_mcan_regs.h:31
__R uint32_t ECR
Definition: hpm_mcan_regs.h:26
__R uint32_t TXBTO
Definition: hpm_mcan_regs.h:57
__RW uint32_t TXBCIE
Definition: hpm_mcan_regs.h:60
__RW uint32_t TSCFG
Definition: hpm_mcan_regs.h:68
__R uint32_t TXFQS
Definition: hpm_mcan_regs.h:52
__RW uint32_t ILE
Definition: hpm_mcan_regs.h:33
__RW uint32_t TXBAR
Definition: hpm_mcan_regs.h:55
__R uint32_t TS_SEL[16]
Definition: hpm_mcan_regs.h:66
__RW uint32_t ILS
Definition: hpm_mcan_regs.h:32
__RW uint32_t NDAT2
Definition: hpm_mcan_regs.h:42
__RW uint32_t NDAT1
Definition: hpm_mcan_regs.h:41
__R uint32_t TXBRP
Definition: hpm_mcan_regs.h:54
Definition: hpm_filter.h:21
MCAN Configuration for all filters.
Definition: hpm_mcan_drv.h:568
mcan_filter_elem_list_t std_id_filter_list
Definition: hpm_mcan_drv.h:571
mcan_global_filter_config_t global_filter_config
Definition: hpm_mcan_drv.h:569
mcan_filter_elem_list_t ext_id_filter_list
Definition: hpm_mcan_drv.h:572
uint32_t ext_id_mask
Definition: hpm_mcan_drv.h:570
CAN Bit Timing Parameters.
Definition: hpm_mcan_drv.h:161
uint16_t num_seg2
Definition: hpm_mcan_drv.h:164
uint8_t num_sjw
Definition: hpm_mcan_drv.h:165
uint16_t num_seg1
Definition: hpm_mcan_drv.h:163
bool enable_tdc
Definition: hpm_mcan_drv.h:166
uint16_t prescaler
Definition: hpm_mcan_drv.h:162
MCAN Configuration Structure.
Definition: hpm_mcan_drv.h:662
bool enable_canfd
Definition: hpm_mcan_drv.h:687
uint32_t baudrate_fd
Definition: hpm_mcan_drv.h:667
mcan_tsu_config_t tsu_config
Definition: hpm_mcan_drv.h:693
bool enable_wide_message_marker
Definition: hpm_mcan_drv.h:685
mcan_ram_config_t ram_config
Definition: hpm_mcan_drv.h:694
uint32_t txbuf_cancel_finish_interrupt_mask
Definition: hpm_mcan_drv.h:701
uint32_t baudrate
Definition: hpm_mcan_drv.h:666
mcan_internal_timestamp_config_t timestamp_cfg
Definition: hpm_mcan_drv.h:692
bool enable_non_iso_mode
Definition: hpm_mcan_drv.h:681
mcan_bit_timing_param_t can_timing
Definition: hpm_mcan_drv.h:675
mcan_timeout_config_t timeout_cfg
Definition: hpm_mcan_drv.h:697
mcan_bit_timing_param_t canfd_timing
Definition: hpm_mcan_drv.h:676
bool enable_tdc
Definition: hpm_mcan_drv.h:688
bool disable_auto_retransmission
Definition: hpm_mcan_drv.h:690
uint32_t txbuf_trans_interrupt_mask
Definition: hpm_mcan_drv.h:700
uint16_t can20_samplepoint_max
Definition: hpm_mcan_drv.h:669
uint32_t interrupt_mask
Definition: hpm_mcan_drv.h:699
mcan_tdc_config_t tdc_config
Definition: hpm_mcan_drv.h:691
bool enable_restricted_operation_mode
Definition: hpm_mcan_drv.h:689
uint16_t canfd_samplepoint_max
Definition: hpm_mcan_drv.h:671
uint16_t can20_samplepoint_min
Definition: hpm_mcan_drv.h:668
mcan_node_mode_t mode
Definition: hpm_mcan_drv.h:680
bool enable_edge_filtering
Definition: hpm_mcan_drv.h:683
bool disable_protocol_exception_handling
Definition: hpm_mcan_drv.h:684
bool use_lowlevel_timing_setting
Definition: hpm_mcan_drv.h:679
uint16_t canfd_samplepoint_min
Definition: hpm_mcan_drv.h:670
bool enable_transmit_pause
Definition: hpm_mcan_drv.h:682
bool use_timestamping_unit
Definition: hpm_mcan_drv.h:686
mcan_all_filters_config_t all_filters_config
Definition: hpm_mcan_drv.h:695
MCAN Error Count Information.
Definition: hpm_mcan_drv.h:724
bool receive_error_passive
Definition: hpm_mcan_drv.h:727
uint8_t transmit_error_count
Definition: hpm_mcan_drv.h:725
uint8_t can_error_logging_count
Definition: hpm_mcan_drv.h:728
uint8_t receive_error_count
Definition: hpm_mcan_drv.h:726
MCAN Filter Element List structure.
Definition: hpm_mcan_drv.h:558
const mcan_filter_elem_t * filter_elem_list
Definition: hpm_mcan_drv.h:560
uint32_t mcan_filter_elem_count
Definition: hpm_mcan_drv.h:559
MCAN Global CAN configuration.
Definition: hpm_mcan_drv.h:487
bool reject_remote_std_frame
Definition: hpm_mcan_drv.h:490
bool reject_remote_ext_frame
Definition: hpm_mcan_drv.h:491
uint8_t accept_non_matching_ext_frame_option
Definition: hpm_mcan_drv.h:489
uint8_t accept_non_matching_std_frame_option
Definition: hpm_mcan_drv.h:488
MCAN High Priority Message Status Information.
Definition: hpm_mcan_drv.h:758
uint8_t filter_index
Definition: hpm_mcan_drv.h:760
uint8_t buffer_index
Definition: hpm_mcan_drv.h:762
uint8_t filter_list_type
Definition: hpm_mcan_drv.h:759
uint8_t message_storage_indicator
Definition: hpm_mcan_drv.h:761
MCAN Internal timestamp configuration.
Definition: hpm_mcan_drv.h:626
uint8_t timestamp_selection
Definition: hpm_mcan_drv.h:628
uint8_t counter_prescaler
Definition: hpm_mcan_drv.h:627
MCAN Protocol Status.
Definition: hpm_mcan_drv.h:734
mcan_activity_state_t activity
Definition: hpm_mcan_drv.h:736
bool in_bus_off_state
Definition: hpm_mcan_drv.h:742
bool canfd_msg_received
Definition: hpm_mcan_drv.h:739
bool in_error_passive_state
Definition: hpm_mcan_drv.h:744
bool in_warning_state
Definition: hpm_mcan_drv.h:743
bool esi_flag_set_in_last_rcv_canfd_msg
Definition: hpm_mcan_drv.h:741
uint8_t tdc_val
Definition: hpm_mcan_drv.h:735
bool protocol_exception_evt_occurred
Definition: hpm_mcan_drv.h:738
bool brs_flag_set_in_last_rcv_canfd_msg
Definition: hpm_mcan_drv.h:740
mcan_last_err_code_t last_error_code
Definition: hpm_mcan_drv.h:737
MCAN RAM configuration.
Definition: hpm_mcan_drv.h:447
uint32_t watermark
Definition: hpm_mcan_drv.h:457
uint8_t txbuf_data_field_size
Definition: hpm_mcan_drv.h:467
uint32_t data_field_size
Definition: hpm_mcan_drv.h:459
uint8_t std_filter_elem_count
Definition: hpm_mcan_drv.h:449
struct mcan_ram_config_struct::@133 rxfifos[2]
uint8_t rxbuf_elem_count
Definition: hpm_mcan_drv.h:463
bool enable_txbuf
Definition: hpm_mcan_drv.h:466
bool enable_std_filter
Definition: hpm_mcan_drv.h:448
uint8_t txbuf_dedicated_txbuf_elem_count
Definition: hpm_mcan_drv.h:468
uint8_t ext_filter_elem_count
Definition: hpm_mcan_drv.h:452
bool enable_tx_evt_fifo
Definition: hpm_mcan_drv.h:472
uint8_t txfifo_or_txqueue_mode
Definition: hpm_mcan_drv.h:470
uint8_t tx_evt_fifo_watermark
Definition: hpm_mcan_drv.h:474
uint32_t operation_mode
Definition: hpm_mcan_drv.h:458
uint32_t elem_count
Definition: hpm_mcan_drv.h:456
bool enable_ext_filter
Definition: hpm_mcan_drv.h:451
bool enable_rxbuf
Definition: hpm_mcan_drv.h:462
uint8_t tx_evt_fifo_elem_count
Definition: hpm_mcan_drv.h:473
uint32_t enable
Definition: hpm_mcan_drv.h:455
uint8_t txbuf_fifo_or_queue_elem_count
Definition: hpm_mcan_drv.h:469
uint16_t rxbuf_data_field_size
Definition: hpm_mcan_drv.h:464
MCAN RAM Flexible Configuration.
Definition: hpm_mcan_drv.h:418
mcan_rxbuf_config_t rxbuf_config
Definition: hpm_mcan_drv.h:436
bool enable_tx_evt_fifo
Definition: hpm_mcan_drv.h:425
bool enable_txbuf
Definition: hpm_mcan_drv.h:424
bool enable_rxbuf
Definition: hpm_mcan_drv.h:423
bool enable_ext_filter
Definition: hpm_mcan_drv.h:420
mcan_txbuf_elem_config_t txbuf_elem_config
Definition: hpm_mcan_drv.h:431
bool enable_std_filter
Definition: hpm_mcan_drv.h:419
mcan_tx_evt_fifo_config_t tx_evt_fifo_config
Definition: hpm_mcan_drv.h:432
mcan_rxfifo_config_t rxfifo1_config
Definition: hpm_mcan_drv.h:435
mcan_rxfifo_config_t rxfifo0_config
Definition: hpm_mcan_drv.h:434
mcan_txbuf_config_t txbuf_config
Definition: hpm_mcan_drv.h:430
mcan_filter_config_t ext_filter_config
Definition: hpm_mcan_drv.h:428
bool enable_rxfifo0
Definition: hpm_mcan_drv.h:421
mcan_rx_fifo_or_buf_elem_config_t rx_elem_config
Definition: hpm_mcan_drv.h:437
mcan_filter_config_t std_filter_config
Definition: hpm_mcan_drv.h:427
bool enable_rxfifo1
Definition: hpm_mcan_drv.h:422
CAN Receive Message Frame.
Definition: hpm_mcan_drv.h:228
uint16_t accepted_non_matching_frame
Definition: hpm_mcan_drv.h:258
uint32_t data_32[16]
Definition: hpm_mcan_drv.h:262
uint16_t bitrate_switch
Definition: hpm_mcan_drv.h:254
uint32_t ext_id
Definition: hpm_mcan_drv.h:231
uint8_t data_8[64]
Definition: hpm_mcan_drv.h:261
uint16_t canfd_frame
Definition: hpm_mcan_drv.h:255
uint16_t rx_timestamp_pointer
Definition: hpm_mcan_drv.h:246
uint32_t std_id
Definition: hpm_mcan_drv.h:238
uint16_t filter_index
Definition: hpm_mcan_drv.h:257
uint16_t rx_timestamp_captured
Definition: hpm_mcan_drv.h:247
uint32_t rtr
Definition: hpm_mcan_drv.h:232
uint32_t use_ext_id
Definition: hpm_mcan_drv.h:233
uint16_t dlc
Definition: hpm_mcan_drv.h:253
uint16_t rx_timestamp
Definition: hpm_mcan_drv.h:244
uint32_t error_state_indicator
Definition: hpm_mcan_drv.h:234
MCAN RXBUF Configuration.
Definition: hpm_mcan_drv.h:342
uint32_t start_addr
Definition: hpm_mcan_drv.h:343
MCAN Filter Element definitions.
Definition: hpm_mcan_drv.h:520
uint32_t offset
Definition: hpm_mcan_drv.h:547
uint8_t can_id_type
Definition: hpm_mcan_drv.h:523
uint8_t filter_type
Definition: hpm_mcan_drv.h:521
uint32_t start_id
Definition: hpm_mcan_drv.h:528
uint32_t store_location
Definition: hpm_mcan_drv.h:549
uint8_t sync_message
Definition: hpm_mcan_drv.h:524
uint32_t filter_id
Definition: hpm_mcan_drv.h:538
uint32_t filter_mask
Definition: hpm_mcan_drv.h:539
uint32_t filter_event
Definition: hpm_mcan_drv.h:548
uint32_t id2
Definition: hpm_mcan_drv.h:534
uint32_t end_id
Definition: hpm_mcan_drv.h:529
uint32_t id1
Definition: hpm_mcan_drv.h:533
uint8_t filter_config
Definition: hpm_mcan_drv.h:522
uint32_t match_id
Definition: hpm_mcan_drv.h:546
MCAN Transmitter Delay Compensation Configuration.
Definition: hpm_mcan_drv.h:653
uint8_t filter_window_length
Definition: hpm_mcan_drv.h:655
uint8_t ssp_offset
Definition: hpm_mcan_drv.h:654
MCAN Timeout configuration structure.
Definition: hpm_mcan_drv.h:644
uint16_t timeout_period
Definition: hpm_mcan_drv.h:647
bool enable_timeout_counter
Definition: hpm_mcan_drv.h:645
mcan_timeout_sel_t timeout_sel
Definition: hpm_mcan_drv.h:646
MCAN Timeout Counter Configuration.
Definition: hpm_mcan_drv.h:715
bool enable_timeout_counter
Definition: hpm_mcan_drv.h:716
uint16_t timeout_period
Definition: hpm_mcan_drv.h:718
uint8_t timeout_selection
Definition: hpm_mcan_drv.h:717
MCAN Timestamp Value.
Definition: hpm_mcan_drv.h:588
uint16_t ts_16bit
Definition: hpm_mcan_drv.h:594
uint64_t ts_64bit
Definition: hpm_mcan_drv.h:596
uint32_t ts_32bit
Definition: hpm_mcan_drv.h:595
bool is_empty
Definition: hpm_mcan_drv.h:592
bool is_32bit
Definition: hpm_mcan_drv.h:590
bool is_64bit
Definition: hpm_mcan_drv.h:591
uint32_t words[2]
Definition: hpm_mcan_drv.h:597
bool is_16bit
Definition: hpm_mcan_drv.h:589
MCAN TSU Configuration.
Definition: hpm_mcan_drv.h:604
bool use_ext_timebase
Definition: hpm_mcan_drv.h:607
uint8_t ext_timebase_src
Definition: hpm_mcan_drv.h:608
uint8_t tbsel_option
Definition: hpm_mcan_drv.h:609
bool enable_64bit_timestamp
Definition: hpm_mcan_drv.h:611
bool capture_on_sof
Definition: hpm_mcan_drv.h:606
bool enable_tsu
Definition: hpm_mcan_drv.h:610
uint16_t prescaler
Definition: hpm_mcan_drv.h:605
CAN Transmit Message Frame.
Definition: hpm_mcan_drv.h:191
uint32_t dlc
Definition: hpm_mcan_drv.h:208
uint32_t rtr
Definition: hpm_mcan_drv.h:195
uint32_t event_fifo_control
Definition: hpm_mcan_drv.h:212
uint32_t std_id
Definition: hpm_mcan_drv.h:201
uint32_t use_ext_id
Definition: hpm_mcan_drv.h:196
uint32_t canfd_frame
Definition: hpm_mcan_drv.h:210
uint32_t timestamp_capture_enable
Definition: hpm_mcan_drv.h:211
uint32_t error_state_indicator
Definition: hpm_mcan_drv.h:197
uint32_t message_marker_h
Definition: hpm_mcan_drv.h:207
uint8_t data_8[64]
Definition: hpm_mcan_drv.h:216
uint32_t message_marker_l
Definition: hpm_mcan_drv.h:213
uint32_t bitrate_switch
Definition: hpm_mcan_drv.h:209
uint32_t data_32[16]
Definition: hpm_mcan_drv.h:217
uint32_t ext_id
Definition: hpm_mcan_drv.h:194
Definition: hpm_mcan_drv.h:396
uint32_t data_field_size
Definition: hpm_mcan_drv.h:397
MCAN Filter Configuration.
Definition: hpm_mcan_drv.h:318
uint16_t list_size
Definition: hpm_mcan_drv.h:321
uint32_t reg_val
Definition: hpm_mcan_drv.h:323
uint16_t list_start_addr
Definition: hpm_mcan_drv.h:320
MCAN RXBUF or RXFIFO Element Configuration.
Definition: hpm_mcan_drv.h:367
uint32_t buf_data_field_size
Definition: hpm_mcan_drv.h:371
uint32_t reg_val
Definition: hpm_mcan_drv.h:374
uint32_t fifo0_data_field_size
Definition: hpm_mcan_drv.h:369
uint32_t fifo1_data_field_size
Definition: hpm_mcan_drv.h:370
MCAN RXFIFO Configuration.
Definition: hpm_mcan_drv.h:329
uint32_t watermark
Definition: hpm_mcan_drv.h:333
uint32_t start_addr
Definition: hpm_mcan_drv.h:331
uint32_t operation_mode
Definition: hpm_mcan_drv.h:334
uint32_t fifo_size
Definition: hpm_mcan_drv.h:332
uint32_t reg_val
Definition: hpm_mcan_drv.h:336
TX Event Fifo Element Structure.
Definition: hpm_mcan_drv.h:269
uint16_t tx_timestamp
Definition: hpm_mcan_drv.h:288
uint32_t error_state_indicator
Definition: hpm_mcan_drv.h:277
uint16_t message_marker
Definition: hpm_mcan_drv.h:301
uint16_t canfd_frame
Definition: hpm_mcan_drv.h:299
uint16_t tx_timestamp_captured
Definition: hpm_mcan_drv.h:291
uint16_t tx_timestamp_pointer
Definition: hpm_mcan_drv.h:290
uint16_t event_type
Definition: hpm_mcan_drv.h:300
uint32_t ext_id
Definition: hpm_mcan_drv.h:274
uint32_t rtr
Definition: hpm_mcan_drv.h:275
uint16_t bitrate_switch
Definition: hpm_mcan_drv.h:298
uint16_t dlc
Definition: hpm_mcan_drv.h:297
uint32_t extend_id
Definition: hpm_mcan_drv.h:276
uint32_t words[2]
Definition: hpm_mcan_drv.h:304
uint32_t std_id
Definition: hpm_mcan_drv.h:281
MCAN TX Event FIFO Structure.
Definition: hpm_mcan_drv.h:403
uint32_t reg_val
Definition: hpm_mcan_drv.h:409
uint8_t fifo_size
Definition: hpm_mcan_drv.h:406
uint16_t start_addr
Definition: hpm_mcan_drv.h:405
uint8_t fifo_watermark
Definition: hpm_mcan_drv.h:407
Definition: hpm_mcan_drv.h:384
uint32_t fifo_queue_size
Definition: hpm_mcan_drv.h:389
uint32_t reg_val
Definition: hpm_mcan_drv.h:393
uint32_t tx_fifo_queue_mode
Definition: hpm_mcan_drv.h:390
uint32_t dedicated_tx_buf_size
Definition: hpm_mcan_drv.h:387
uint32_t start_addr
Definition: hpm_mcan_drv.h:386