MCAN driver APIs. More...
Data Structures | |
| struct | mcan_bit_timing_param_struct |
| CAN Bit Timing Parameters. More... | |
| struct | mcan_tx_message_struct |
| CAN Transmit Message Frame. More... | |
| struct | mcan_rx_message_struct |
| CAN Receive Message Frame. More... | |
| union | mcan_tx_event_fifo_elem_struct |
| TX Event Fifo Element Structure. More... | |
| union | mcan_filter_config_struct |
| MCAN Filter Configuration. More... | |
| union | mcan_rxfifo_config_struct |
| MCAN RXFIFO Configuration. More... | |
| struct | mcan_rxbuf_config_t |
| MCAN RXBUF Configuration. More... | |
| union | mcan_rx_fifo_or_buf_elem_config_struct |
| MCAN RXBUF or RXFIFO Element Configuration. More... | |
| union | mcan_txbuf_config_struct |
| struct | mcan_txbuf_elem_config_struct |
| union | mcan_tx_evt_fifo_config_t |
| MCAN TX Event FIFO Structure. More... | |
| struct | mcan_ram_flexible_config_struct |
| MCAN RAM Flexible Configuration. More... | |
| struct | mcan_ram_config_struct |
| MCAN RAM configuration. More... | |
| struct | mcan_global_filter_config_struct |
| MCAN Global CAN configuration. More... | |
| struct | mcan_std_id_filter_elem_struct |
| MCAN Filter Element definitions. More... | |
| struct | mcan_filter_elem_list_struct |
| MCAN Filter Element List structure. More... | |
| struct | mcan_all_filters_config_struct |
| MCAN Configuration for all filters. More... | |
| struct | mcan_timestamp_value_struct |
| MCAN Timestamp Value. More... | |
| struct | mcan_tsu_config_struct |
| MCAN TSU Configuration. More... | |
| struct | mcan_internal_timestamp_config_struct |
| MCAN Internal timestamp configuration. More... | |
| struct | mcan_timeout_config_struct |
| MCAN Timeout configuration structure. More... | |
| struct | mcan_tdc_config_t |
| MCAN Transmitter Delay Compensation Configuration. More... | |
| struct | mcan_config_struct |
| MCAN Configuration Structure. More... | |
| struct | mcan_timeout_counter_config_struct |
| MCAN Timeout Counter Configuration. More... | |
| struct | mcan_error_count_struct |
| MCAN Error Count Information. More... | |
| struct | mcan_protocol_status |
| MCAN Protocol Status. More... | |
| struct | mcan_high_priority_message_status_struct |
| MCAN High Priority Message Status Information. More... | |
Enumerations | |
| enum | { status_mcan_filter_index_out_of_range = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 0 )) , status_mcan_rxfifo_empty = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 1 )) , status_mcan_rxfifo_full = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 2 )) , status_mcan_txbuf_full = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 3 )) , status_mcan_txfifo_full = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 4 )) , status_mcan_rxfifo0_busy = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 5 )) , status_mcan_rxfifo1_busy = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 6 )) , status_mcan_txbuf_index_out_of_range = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 7 )) , status_mcan_rxbuf_index_out_of_range = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 8 )) , status_mcan_rxbuf_empty = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 9 )) , status_mcan_tx_evt_fifo_empty = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 10 )) , status_mcan_timestamp_not_exist = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 11 )) , status_mcan_ram_out_of_range = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 12 )) , status_mcan_timeout = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 13 )) , status_mcan_invalid_bit_timing = ((uint32_t)( status_group_mcan )*1000U + (uint32_t)( 14 )) } |
| enum | mcan_last_error_code { mcan_last_error_code_no_error = 0 , mcan_last_error_code_stuff_error , mcan_last_error_code_format_error , mcan_last_error_code_ack_error , mcan_last_error_code_bit1_error , mcan_last_error_code_bit0_error , mcan_last_error_code_crc_error , mcan_last_error_code_no_change } |
| MCAN Last Error Code. More... | |
| enum | mcan_activity_enum { mcan_activity_sync = 0 , mcan_activity_idle , mcan_activity_receiver , mcan_activity_transmitter } |
| MCAN Communication State. More... | |
| enum | mcan_bit_timing_option { mcan_bit_timing_can2_0 , mcan_bit_timing_canfd_nominal , mcan_bit_timing_canfd_data } |
| CAN Bit Timing Options. More... | |
| enum | mcan_node_mode_enum { mcan_mode_normal = 0 , mcan_mode_loopback_internal = 1 , mcan_mode_loopback_external = 2 , mcan_mode_listen_only = 3 } |
| CAN Node Mode types. More... | |
| enum | mcan_timeout_sel_enum { mcan_timeout_continuous_operation = 0 , mcan_timeout_triggered_by_tx_evt_fifo = 1 , mcan_timeout_triggered_by_rx_fifo0 = 2 , mcan_timeout_triggered_by_rx_fifo1 = 3 } |
| MCAN Timeout Selection Options. More... | |
Functions | |
| static void | mcan_enable_transmit_pause (MCAN_Type *ptr) |
| Enable Transmit Pause. More... | |
| static void | mcan_disable_transmit_pause (MCAN_Type *ptr) |
| Disable Transmit Pause. More... | |
| static void | mcan_enable_edge_filtering (MCAN_Type *ptr) |
| Enable Edge Filtering. More... | |
| static void | mcan_disable_edge_filtering (MCAN_Type *ptr) |
| Disable Edge Filtering. More... | |
| static void | mcan_enable_protocol_exception_handling (MCAN_Type *ptr) |
| Enable Protocol Exception Handling. More... | |
| static void | mcan_disable_protocol_exception_handling (MCAN_Type *ptr) |
| Disable Protocol Exception Handling. More... | |
| static void | mcan_enable_wide_message_marker (MCAN_Type *ptr) |
| Enable Wide Message Marker. More... | |
| static void | mcan_disable_wide_message_marker (MCAN_Type *ptr) |
| Disable Wide Message Marker. More... | |
| static void | mcan_enable_tsu (MCAN_Type *ptr) |
| Enable External Timestamp Unit. More... | |
| static void | mcan_disable_tsu (MCAN_Type *ptr) |
| Disable External Timestamp Unit. More... | |
| static bool | mcan_is_tsu_used (MCAN_Type *ptr) |
| Check whether TSU is used. More... | |
| static bool | mcan_is_64bit_tsu_timestamp_used (MCAN_Type *ptr) |
| Check whether 64-bit TSU timestamp is used. More... | |
| static void | mcan_enable_bitrate_switch (MCAN_Type *ptr) |
| Enable Bit Rate Switch. More... | |
| static void | mcan_disable_bitrate_switch (MCAN_Type *ptr) |
| Disable Bit Rate Switch. More... | |
| static void | mcan_enable_auto_retransmission (MCAN_Type *ptr) |
| Enable Auto Retransmission. More... | |
| static void | mcan_disable_auto_retransmission (MCAN_Type *ptr) |
| Disable Auto Transmission. More... | |
| static void | mcan_enable_bus_monitoring_mode (MCAN_Type *ptr) |
| Enable Bus monitoring Mode. More... | |
| static void | mcan_stop_clock (MCAN_Type *ptr) |
| Stop MCAN clock. More... | |
| static void | mcan_enable_clock (MCAN_Type *ptr) |
| Enable MCAN clock. More... | |
| static bool | mcan_is_clock_enabled (MCAN_Type *ptr) |
| static void | mcan_disable_bus_monitoring_mode (MCAN_Type *ptr) |
| Disable Bus monitoring Mode. More... | |
| static bool | mcan_is_clock_stopped (MCAN_Type *ptr) |
| Check whether CAN clock is stopped or not. More... | |
| static void | mcan_enable_restricted_operation_mode (MCAN_Type *ptr) |
| Enable Restricted Operation Mode. More... | |
| static void | mcan_disable_restricted_operation_mode (MCAN_Type *ptr) |
| Disable Restricted Operation Mode. More... | |
| static void | mcan_enable_write_to_prot_config_registers (MCAN_Type *ptr) |
| Enable Write Access to Protected Configuration Registers. More... | |
| static void | mcan_disable_write_to_prot_config_registers (MCAN_Type *ptr) |
| Disable Write Access to Protected Configuration Registers. More... | |
| static uint16_t | mcan_get_timestamp_counter_value (MCAN_Type *ptr) |
| Get Timestamp Counter Value. More... | |
| static void | mcan_enter_init_mode (MCAN_Type *ptr) |
| Switch MCAN to Initialization mode. More... | |
| static void | mcan_enter_normal_mode (MCAN_Type *ptr) |
| Switch MCAN to Normal mode. More... | |
| static uint16_t | mcan_get_timeout_counter_value (MCAN_Type *ptr) |
| Get Timeout value. More... | |
| static void | mcan_reset_timeout_counter_value (MCAN_Type *ptr) |
| Reset Timeout counter value. More... | |
| static void | mcan_get_error_counter (MCAN_Type *ptr, mcan_error_count_t *err_cnt) |
| Get Error Counter Information. More... | |
| static uint8_t | mcan_get_last_error_code (MCAN_Type *ptr) |
| Get Last Error Code. More... | |
| static uint8_t | mcan_get_last_data_error_code (MCAN_Type *ptr) |
| Get Last Data Phase Error Code. More... | |
| static uint8_t | mcan_get_activity (MCAN_Type *ptr) |
| Get CAN Activity. More... | |
| static bool | mcan_is_in_err_passive_state (MCAN_Type *ptr) |
| Check whether the CAN node is under error passive state. More... | |
| static bool | mcan_is_in_error_warning_state (MCAN_Type *ptr) |
| Check whether the CAN mode is under Warning State. More... | |
| static bool | mcan_is_in_busoff_state (MCAN_Type *ptr) |
| Check whether the CAN node is under Bus-off state. More... | |
| static uint8_t | mcan_get_data_phase_last_error_code (MCAN_Type *ptr) |
| Get the Last Data Phase Error. More... | |
| 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. More... | |
| 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. More... | |
| static bool | mcan_is_canfd_message_received (MCAN_Type *ptr) |
| Check whether CANFD messages were received. More... | |
| static bool | mcan_is_protocol_exception_event_occurred (MCAN_Type *ptr) |
| Check whether Protocol Exception Events were occurred. More... | |
| static uint8_t | mcan_get_transmitter_delay_compensation_value (MCAN_Type *ptr) |
| Get the Transmitter Delay Compensation Value. More... | |
| static uint32_t | mcan_get_interrupt_flags (MCAN_Type *ptr) |
| Get Interrupt Flags. More... | |
| static void | mcan_clear_interrupt_flags (MCAN_Type *ptr, uint32_t mask) |
| Clear Interrupt Flags. More... | |
| static void | mcan_enable_interrupts (MCAN_Type *ptr, uint32_t mask) |
| Enable Interrupts. More... | |
| static void | mcan_enable_txbuf_interrupt (MCAN_Type *ptr, uint32_t mask) |
| Enable TXBUF Interrupt. More... | |
| static void | mcan_disable_txbuf_interrupt (MCAN_Type *ptr, uint32_t mask) |
| Disable TXBUF Interrupt. More... | |
| static void | mcan_disable_interrupts (MCAN_Type *ptr, uint32_t mask) |
| Disable Interrupts. More... | |
| static void | mcan_enable_txbuf_transmission_interrupt (MCAN_Type *ptr, uint32_t mask) |
| Enable TXBUF Transmission interrupt. More... | |
| static void | mcan_disable_txbuf_transmission_interrupt (MCAN_Type *ptr, uint32_t mask) |
| Disable TXBUF Transmission interrupt. More... | |
| static void | mcan_enable_txbuf_cancel_finish_interrupt (MCAN_Type *ptr, uint32_t mask) |
| Enable TXBUF Cancellation Finish interrupt. More... | |
| static void | mcan_disable_txbuf_cancel_finish_interrupt (MCAN_Type *ptr, uint32_t mask) |
| Disable TXBUF Cancellation Finish interrupt. More... | |
| static void | mcan_interrupt_line_select (MCAN_Type *ptr, uint32_t mask, uint8_t line_index) |
| Select Interrupt Line. More... | |
| static bool | mcan_is_transmit_request_pending (MCAN_Type *ptr, uint32_t index) |
| Check whether a TXFIFO/TXBUF transmission request is pending. More... | |
| static bool | mcan_is_txfifo_full (MCAN_Type *ptr) |
| Check whether TXFIFO is full. More... | |
| static uint32_t | mcan_get_txfifo_put_index (MCAN_Type *ptr) |
| Get the TXFIFO Put Index. More... | |
| static void | mcan_send_add_request (MCAN_Type *ptr, uint32_t index) |
| Request A Transmission via specified TXBUF Index. More... | |
| 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 buffer if corresponding bit in index_bitmask is asserted. More... | |
| static void | mcan_cancel_tx_buf_send_request (MCAN_Type *ptr, uint32_t index) |
| Cancel the TXBUF Send request. More... | |
| static bool | mcan_is_transmit_occurred (MCAN_Type *ptr, uint32_t index) |
| Check whether the Transmission completed via specified TXBUF/TXFIFO. More... | |
| static bool | mcan_is_rxbuf_data_available (MCAN_Type *ptr, uint32_t index) |
| Check Whether there are data available in specified RXBUF. More... | |
| static void | mcan_clear_rxbuf_data_available_flag (MCAN_Type *ptr, uint32_t index) |
| Clear RXBUF Data available Flag for specified RXBUF. More... | |
| static bool | mcan_is_interrupt_flag_set (MCAN_Type *ptr, uint32_t mask) |
| Check whether specified Interrupt is set. More... | |
| static bool | mcan_is_tsu_timestamp_available (MCAN_Type *ptr, uint32_t index) |
| Check whether the TSU timestamp is available. More... | |
| uint32_t | mcan_read_32bit_tsu_timestamp (MCAN_Type *ptr, uint32_t index) |
| Read 32bit Timestamp value from TSU. More... | |
| uint64_t | mcan_read_64bit_tsu_timestamp (MCAN_Type *ptr, uint32_t index) |
| Read 64bit Timestamp value from TSU. More... | |
| void | mcan_get_high_priority_message_status (MCAN_Type *ptr, mcan_high_priority_message_status_t *status) |
| Get High Priority Message Status. More... | |
| void | mcan_get_default_config (MCAN_Type *ptr, mcan_config_t *config) |
| Get Default CAN configuration. More... | |
| uint8_t | mcan_get_message_size_from_dlc (uint8_t dlc) |
| Get message Size from Data Length Code. More... | |
| uint8_t | mcan_get_data_field_size (uint8_t data_field_size_option) |
| Get the Data field size from data field size option. More... | |
| 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, the default CAN RAM settings are as below: More... | |
| 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, the default CAN RAM settings are as below: More... | |
| hpm_stat_t | mcan_init (MCAN_Type *ptr, mcan_config_t *config, uint32_t src_clk_freq) |
| Initialize CAN controller. More... | |
| void | mcan_deinit (MCAN_Type *ptr) |
| De-Initialize CAN controller. More... | |
| 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. More... | |
| hpm_stat_t | mcan_config_ram (MCAN_Type *ptr, mcan_ram_config_t *config) |
| Configure MCAN RAM will Simplified RAM configuration. More... | |
| hpm_stat_t | mcan_config_all_filters (MCAN_Type *ptr, mcan_all_filters_config_t *config) |
| Configure All CAN filters. More... | |
| hpm_stat_t | mcan_config_transmitter_delay_compensation (MCAN_Type *ptr, mcan_tdc_config_t *config) |
| Configure Transmitter Delay Compensation. More... | |
| hpm_stat_t | mcan_set_global_filter_config (MCAN_Type *ptr, mcan_global_filter_config_t *filter_config) |
| Configure Global Filter. More... | |
| hpm_stat_t | mcan_set_filter_element (MCAN_Type *ptr, const mcan_filter_elem_t *filter_elem, uint32_t index) |
| Set CAN filter element. More... | |
| hpm_stat_t | mcan_write_txbuf (MCAN_Type *ptr, uint32_t index, mcan_tx_frame_t *tx_frame) |
| Write Frame to CAN TX Buffer. More... | |
| hpm_stat_t | mcan_write_txfifo (MCAN_Type *ptr, mcan_tx_frame_t *tx_frame) |
| Write Frame CAN to TXFIFO. More... | |
| hpm_stat_t | mcan_read_rxbuf (MCAN_Type *ptr, uint32_t index, mcan_rx_message_t *rx_frame) |
| Read message from CAN RXBUF. More... | |
| hpm_stat_t | mcan_read_rxfifo (MCAN_Type *ptr, uint32_t fifo_index, mcan_rx_message_t *rx_frame) |
| Read message from CAN RXBUF. More... | |
| 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. More... | |
| hpm_stat_t | mcan_transmit_blocking (MCAN_Type *ptr, mcan_tx_frame_t *tx_frame) |
| Transmit CAN message in blocking way. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| hpm_stat_t | mcan_parse_protocol_status (uint32_t psr, mcan_protocol_status_t *protocol_status) |
| Parse the Protocol Status register value. More... | |
| hpm_stat_t | mcan_get_protocol_status (MCAN_Type *ptr, mcan_protocol_status_t *protocol_status) |
| Get MCAN Protocol Status. More... | |
MCAN driver APIs.
| #define MCAN_ACCEPT_NON_MATCHING_FRAME_OPTION_IN_RXFIFO0 (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Accept Non-Matching Frame options.
Save non-matching frame to RXFIFO0
| #define MCAN_ACCEPT_NON_MATCHING_FRAME_OPTION_IN_RXFIFO1 (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
Save non-matching frame to RXFIFO1
| #define MCAN_ACCEPT_NON_MATCHING_FRAME_OPTION_REJECT (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
Reject non-matching frame
| #define MCAN_CAN_ID_TYPE_EXTENDED (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
Extended Identifier
| #define MCAN_CAN_ID_TYPE_STANDARD (0U) |
| #define MCAN_DATA_FIELD_SIZE_12BYTES (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_16BYTES (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_20BYTES (3U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_24BYTES (4U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_32BYTES (5U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_48BYTES (6U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_64BYTES (7U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_DATA_FIELD_SIZE_8BYTES (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Data Field Size Definitions.
| #define MCAN_EVENT_ERROR |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Error Event Flags.
| #define MCAN_EVENT_RECEIVE (MCAN_INT_RXFIFO0_NEW_MSG | MCAN_INT_RXFIFO1_NEW_MSG | MCAN_INT_MSG_STORE_TO_RXBUF) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Receive Event Flags.
| #define MCAN_EVENT_TRANSMIT (MCAN_INT_TX_COMPLETED) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Transmit Event Flags.
| #define MCAN_EXT_FILTER_ELEM_SIZE_MAX (64U) |
#include <drivers/inc/hpm_mcan_drv.h>
Maximum Extended Filter Element Count
| #define MCAN_FIFO_OPERATION_MODE_BLOCKING (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN FIFO Operation Mode types.
| #define MCAN_FIFO_OPERATION_MODE_OVERWRITE (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_FILTER_ELEM_CFG_DISABLED (0) |
| #define MCAN_FILTER_ELEM_CFG_REJECT_ID_IF_MATCH (3U) |
#include <drivers/inc/hpm_mcan_drv.h>
Reject ID if matching
| #define MCAN_FILTER_ELEM_CFG_SET_PRIORITY_AND_STORE_IN_FIFO0_IF_MATCH (5U) |
#include <drivers/inc/hpm_mcan_drv.h>
Set Priority and store into RXFIFO1 if matching
| #define MCAN_FILTER_ELEM_CFG_SET_PRIORITY_AND_STORE_IN_FIFO1_IF_MATCH (6U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_FILTER_ELEM_CFG_SET_PRIORITY_IF_MATCH (4U) |
#include <drivers/inc/hpm_mcan_drv.h>
Set Priority if matching Set Priority and store into RXFIFO0 if matching
| #define MCAN_FILTER_ELEM_CFG_STORE_IN_RX_FIFO0_IF_MATCH (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
Store data into RXFIFO0 if matching
| #define MCAN_FILTER_ELEM_CFG_STORE_IN_RX_FIFO1_IF_MATCH (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
Store data into RXFIFO1 if matching
| #define MCAN_FILTER_ELEM_CFG_STORE_INTO_RX_BUFFER_OR_AS_DBG_MSG (7U) |
#include <drivers/inc/hpm_mcan_drv.h>
Store into RXBUF if matching
| #define MCAN_FILTER_ELEM_EXT_ID_SIZE (8U) |
#include <drivers/inc/hpm_mcan_drv.h>
Extended Filter Element SIze in Bytes
| #define MCAN_FILTER_ELEM_STD_ID_SIZE (4U) |
#include <drivers/inc/hpm_mcan_drv.h>
Standard Filter Element Size in Bytes
| #define MCAN_FILTER_SIZE_CAN_DEFAULT (32U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_FILTER_SIZE_CANFD_DEFAULT (16U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_FILTER_TYPE_CLASSIC_FILTER (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
CAN classic filter
| #define MCAN_FILTER_TYPE_DUAL_ID_EXT_FILTER_IGNORE_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Identifier Range filter, ignoring extended ID mask
| #define MCAN_FILTER_TYPE_FILTER_DISABLED (3U) |
#include <drivers/inc/hpm_mcan_drv.h>
CAN filter disabled
| #define MCAN_FILTER_TYPE_RANGE_FILTER (0U) |
| #define MCAN_FILTER_TYPE_SPECIFIED_ID_FILTER (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Identifier ID filter
| #define MCAN_INT_ACCESS_TO_RESERVED_ADDR MCAN_IR_ARA_MASK |
| #define MCAN_INT_BIT_ERROR_CORRECTED MCAN_IR_BEC_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Bit Error was corrected
| #define MCAN_INT_BIT_ERROR_UNCORRECTED MCAN_IR_BEU_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Bit Error was not corrected
| #define MCAN_INT_BUS_OFF_STATUS MCAN_IR_BO_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Bus-off State Change
| #define MCAN_INT_ERROR_LOGGING_OVERFLOW MCAN_IR_ELO_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Error Logging Overflow
| #define MCAN_INT_ERROR_PASSIVE MCAN_IR_EP_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Error Passive State Change
| #define MCAN_INT_HIGH_PRIORITY_MSG MCAN_IR_HPM_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
High Priority Message
| #define MCAN_INT_MSG_RAM_ACCESS_FAILURE MCAN_IR_MRAF_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Message RAM Access Failure
| #define MCAN_INT_MSG_STORE_TO_RXBUF MCAN_IR_DRX_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Message was stored to RX Buffer
| #define MCAN_INT_PROTOCOL_ERR_IN_ARB_PHASE MCAN_IR_PEA_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Protocol Error Happened at Arbitration Phase
| #define MCAN_INT_PROTOCOL_ERR_IN_DATA_PHASE MCAN_IR_PED_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Protocol Error Happened at Data Phase
| #define MCAN_INT_RXFIFO0_FULL MCAN_IR_RF0F_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO0 Full
| #define MCAN_INT_RXFIFO0_MSG_LOST MCAN_IR_RF0L_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO0 Message Lost
| #define MCAN_INT_RXFIFO0_NEW_MSG MCAN_IR_RF0N_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO0 New Message
| #define MCAN_INT_RXFIFO0_WMK_REACHED MCAN_IR_RF0W_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO0 Watermark Reached
| #define MCAN_INT_RXFIFO1_FULL MCAN_IR_RF1F_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO1 Full
| #define MCAN_INT_RXFIFO1_MSG_LOST MCAN_IR_RF1L_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO1 Message Lost
| #define MCAN_INT_RXFIFO1_NEW_MSG MCAN_IR_RF1N_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO1 New Message
| #define MCAN_INT_RXFIFO1_WMK_REACHED MCAN_IR_RF1W_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
RX FIFO1 Watermark Reached
| #define MCAN_INT_TIMEOUT_OCCURRED MCAN_IR_TOO_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Timeout Interrupt
| #define MCAN_INT_TIMESTAMP_WRAPAROUND MCAN_IR_TSW_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Timestamp Counter Wrap Around
| #define MCAN_INT_TX_CANCEL_FINISHED MCAN_IR_TCF_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Transmission Cancellation Finished
| #define MCAN_INT_TX_COMPLETED MCAN_IR_TC_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Transmission Completed
| #define MCAN_INT_TX_EVT_FIFO_EVT_LOST MCAN_IR_TEFL_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
TX Event FIFO Element Lost
| #define MCAN_INT_TX_EVT_FIFO_FULL MCAN_IR_TEFF_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
TX Event FIFO Full
| #define MCAN_INT_TX_EVT_FIFO_NEW_ENTRY MCAN_IR_TEFN_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
TX Event FIFO New Entry
| #define MCAN_INT_TX_EVT_FIFO_WMK_REACHED MCAN_IR_TEFW_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
TX Event FIFO Watermark Reached
| #define MCAN_INT_TXFIFO_EMPTY MCAN_IR_TFE_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
TX FIFO Empty
| #define MCAN_INT_WARNING_STATUS MCAN_IR_EW_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Error Warning State Change
| #define MCAN_INT_WATCHDOG_INT MCAN_IR_WDI_MASK |
#include <drivers/inc/hpm_mcan_drv.h>
Watchdog interrupt
| #define MCAN_MESSAGE_HEADER_SIZE_IN_BYTES (8U) |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Message Header Size.
| #define MCAN_MESSAGE_HEADER_SIZE_IN_WORDS (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_MESSAGE_STORAGE_INDICATOR_FIFO_MESSAGE_LOST (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_MESSAGE_STORAGE_INDICATOR_NO_FIFO_SELECTED (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Message Storage Indicator Types.
| #define MCAN_MESSAGE_STORAGE_INDICATOR_RXFIFO0 (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_MESSAGE_STORAGE_INDICATOR_RXFIFO1 (3U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_RAM_WORD_SIZE (640U) |
#include <drivers/inc/hpm_mcan_drv.h>
RAM WORD Size
| #define MCAN_RX_RETRY_COUNT_MAX (80000000UL) |
#include <drivers/inc/hpm_mcan_drv.h>
Maximum Receive Wait Retry Count.
| #define MCAN_RXBUF_SIZE_CAN_DEFAULT (16U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_RXBUF_SIZE_CANFD_DEFAULT (4U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_RXFIFO_SIZE_CAN_DEFAULT (32U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_RXFIFO_SIZE_CANFD_DEFAULT (8U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_STD_FILTER_ELEM_SIZE_MAX (128U) |
#include <drivers/inc/hpm_mcan_drv.h>
Maximum Standard Filter Element Count
| #define MCAN_TIMEOUT_SEL_TYPE_CONTINUOUS_OPERATION (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timeout Selection Options.
| #define MCAN_TIMEOUT_SEL_TYPE_TIMEOUT_CTRL_BY_RX_FIFO0 (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TIMEOUT_SEL_TYPE_TIMEOUT_CTRL_BY_RX_FIFO1 (3U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TIMEOUT_SEL_TYPE_TIMEOUT_CTRL_BY_TX_EVT_FIFO (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TIMESTAMP_SEL_EXT_TS_VAL_USED (2U) |
#include <drivers/inc/hpm_mcan_drv.h>
External Timestamp value used
| #define MCAN_TIMESTAMP_SEL_MAX (MCAN_TIMESTAMP_SEL_EXT_TS_VAL_USED) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TIMESTAMP_SEL_MIN (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timestamp Select.
| #define MCAN_TIMESTAMP_SEL_VALUE_ALWAYS_ZERO (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
Timestamp value always equal to 0
| #define MCAN_TIMESTAMP_SEL_VALUE_INCREMENT (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
Timestamp value increments according to prescaler
| #define MCAN_TX_RETRY_COUNT_MAX (10000000UL) |
#include <drivers/inc/hpm_mcan_drv.h>
Maximum Transmission Retry Count.
| #define MCAN_TXBUF_OPERATION_MODE_FIFO (0U) |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN TXBUF operation mode types.
| #define MCAN_TXBUF_OPERATION_MODE_QUEUE (1U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TXBUF_SIZE_CAN_DEFAULT (32U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TXBUF_SIZE_CANFD_DEFAULT (8U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TXEVT_ELEM_SIZE (8U) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TXRX_ELEM_SIZE_CAN_MAX (4U * sizeof(uint32_t)) |
#include <drivers/inc/hpm_mcan_drv.h>
| #define MCAN_TXRX_ELEM_SIZE_CANFD_MAX (18U * sizeof(uint32_t)) |
#include <drivers/inc/hpm_mcan_drv.h>
| typedef enum mcan_activity_enum mcan_activity_state_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Communication State.
| typedef struct mcan_all_filters_config_struct mcan_all_filters_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Configuration for all filters.
| typedef enum mcan_bit_timing_option mcan_bit_timing_option_t |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Bit Timing Options.
| typedef struct mcan_bit_timing_param_struct mcan_bit_timing_param_t |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Bit Timing Parameters.
| typedef struct mcan_config_struct mcan_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Configuration Structure.
| typedef struct mcan_error_count_struct mcan_error_count_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Error Count Information.
| typedef union mcan_filter_config_struct mcan_filter_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Filter Configuration.
| typedef struct mcan_filter_elem_list_struct mcan_filter_elem_list_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Filter Element List structure.
| typedef struct mcan_std_id_filter_elem_struct mcan_filter_elem_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Filter Element definitions.
| typedef struct mcan_global_filter_config_struct mcan_global_filter_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Global CAN configuration.
#include <drivers/inc/hpm_mcan_drv.h>
MCAN High Priority Message Status Information.
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Internal timestamp configuration.
| typedef enum mcan_last_error_code mcan_last_err_code_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Last Error Code.
| typedef enum mcan_node_mode_enum mcan_node_mode_t |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Node Mode types.
| typedef struct mcan_protocol_status mcan_protocol_status_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Protocol Status.
| typedef struct mcan_ram_config_struct mcan_ram_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN RAM configuration.
| typedef struct mcan_ram_flexible_config_struct mcan_ram_flexible_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN RAM Flexible Configuration.
#include <drivers/inc/hpm_mcan_drv.h>
MCAN RXBUF or RXFIFO Element Configuration.
| typedef struct mcan_rx_message_struct mcan_rx_message_t |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Receive Message Frame.
| typedef union mcan_rxfifo_config_struct mcan_rxfifo_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN RXFIFO Configuration.
| typedef struct mcan_tdc_config_t mcan_tdc_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Transmitter Delay Compensation Configuration.
| typedef struct mcan_timeout_config_struct mcan_timeout_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timeout configuration structure.
| typedef struct mcan_timeout_counter_config_struct mcan_timeout_counter_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timeout Counter Configuration.
| typedef enum mcan_timeout_sel_enum mcan_timeout_sel_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timeout Selection Options.
| typedef struct mcan_timestamp_value_struct mcan_timestamp_value_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timestamp Value.
| typedef struct mcan_tsu_config_struct mcan_tsu_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN TSU Configuration.
| typedef union mcan_tx_event_fifo_elem_struct mcan_tx_event_fifo_elem_t |
#include <drivers/inc/hpm_mcan_drv.h>
TX Event Fifo Element Structure.
| typedef struct mcan_tx_message_struct mcan_tx_frame_t |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Transmit Message Frame.
| typedef union mcan_txbuf_config_struct mcan_txbuf_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
| typedef struct mcan_txbuf_elem_config_struct mcan_txbuf_elem_config_t |
#include <drivers/inc/hpm_mcan_drv.h>
| anonymous enum |
#include <drivers/inc/hpm_mcan_drv.h>
| enum mcan_activity_enum |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Communication State.
#include <drivers/inc/hpm_mcan_drv.h>
CAN Bit Timing Options.
| Enumerator | |
|---|---|
| mcan_bit_timing_can2_0 | CAN 2.0 bit timing option |
| mcan_bit_timing_canfd_nominal | CANFD nominal timing option |
| mcan_bit_timing_canfd_data | CANFD data timing option |
| enum mcan_last_error_code |
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Last Error Code.
| enum mcan_node_mode_enum |
#include <drivers/inc/hpm_mcan_drv.h>
CAN Node Mode types.
#include <drivers/inc/hpm_mcan_drv.h>
MCAN Timeout Selection Options.
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Cancel the TXBUF Send request.
| [in] | ptr | MCAN Base |
| [in] | index | TXBUF index |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Clear Interrupt Flags.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt Mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Clear RXBUF Data available Flag for specified RXBUF.
| [in] | ptr | MCAN base |
| [in] | index | RXBUF index |
| hpm_stat_t mcan_config_all_filters | ( | MCAN_Type * | ptr, |
| mcan_all_filters_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Configure All CAN filters.
| [in] | ptr | MCAN base |
| [in] | config | All CAN Filter configuration |
| hpm_stat_t mcan_config_ram | ( | MCAN_Type * | ptr, |
| mcan_ram_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Configure MCAN RAM will Simplified RAM configuration.
| [in] | ptr | MCAN base |
| [in] | config | MCAN RAM configuration |
| hpm_stat_t mcan_config_ram_with_flexible_config | ( | MCAN_Type * | ptr, |
| mcan_ram_flexible_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Configure MCAN RAM will Full RAM configuration.
| [in] | ptr | MCAN base |
| [in] | config | MCAN RAM Full Configuration |
| hpm_stat_t mcan_config_transmitter_delay_compensation | ( | MCAN_Type * | ptr, |
| mcan_tdc_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Configure Transmitter Delay Compensation.
| [in] | ptr | MCAN base |
| [in] | config | Transmitter Delay compensation configure |
| void mcan_deinit | ( | MCAN_Type * | ptr | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable Interrupts.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable Protocol Exception Handling.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable Restricted Operation Mode.
| [in] | ptr | MCAN base |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable TXBUF Cancellation Finish interrupt.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable TXBUF Interrupt.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable TXBUF Transmission interrupt.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Disable Write Access to Protected Configuration Registers.
| [in] | ptr | MCAN base |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Enable Interrupts.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Enable Protocol Exception Handling.
| [in] | ptr | MCAN base |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Enable TXBUF Cancellation Finish interrupt.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Enable TXBUF Interrupt.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Enable TXBUF Transmission interrupt.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Enable Write Access to Protected Configuration Registers.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Switch MCAN to Initialization mode.
| [in] | ptr | MCAN base |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get CAN Activity.
| [in] | ptr | MCAN base |
| uint8_t mcan_get_data_field_size | ( | uint8_t | data_field_size_option | ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get the Data field size from data field size option.
| [in] | data_field_size_option | Data size option |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get the Last Data Phase Error.
| [in] | ptr | MCAN base |
| void mcan_get_default_config | ( | MCAN_Type * | ptr, |
| mcan_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get Default CAN configuration.
| [in] | ptr | MCAN base |
| [out] | config | CAN configuration |
< Default CAN2.0 baudrate:500 kbps
< Default CANFD baudrate: 2 Mbps
| void mcan_get_default_ram_config | ( | MCAN_Type * | ptr, |
| mcan_ram_config_t * | simple_config, | ||
| bool | enable_canfd | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get Default MCAN RAM configuration If the device is configured as classic CAN node, the default CAN RAM settings are as below:
If the device is configured as CANFD node, the default CAN RAM settings are as below:
| [in] | ptr | MCAN base |
| [out] | simple_config | Simple CAN RAM Configuration |
| [in] | enable_canfd | CANFD enable flag |
| void mcan_get_default_ram_flexible_config | ( | MCAN_Type * | ptr, |
| mcan_ram_flexible_config_t * | ram_config, | ||
| bool | enable_canfd | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get Default Full MCAN RAM configuration If the device is configured as classic CAN node, the default CAN RAM settings are as below:
If the device is configured as CANFD node, the default CAN RAM settings are as below:
| [in] | ptr | MCAN base |
| [out] | ram_config | CAN RAM Configuration |
| [in] | enable_canfd | CANFD enable flag |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get Error Counter Information.
| [in] | ptr | MCAN base |
| [out] | err_cnt | Error Count buffer |
| void mcan_get_high_priority_message_status | ( | MCAN_Type * | ptr, |
| mcan_high_priority_message_status_t * | status | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get High Priority Message Status.
| [in] | ptr | MCAN base |
| [out] | status | Pointer to High Priority Message Status Buffer |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get Interrupt Flags.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get Last Data Phase Error Code.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get Last Error Code.
| [in] | ptr | MCAN base |
| uint8_t mcan_get_message_size_from_dlc | ( | uint8_t | dlc | ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get message Size from Data Length Code.
| [in] | dlc | Data Length Code |
| hpm_stat_t mcan_get_protocol_status | ( | MCAN_Type * | ptr, |
| mcan_protocol_status_t * | protocol_status | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get MCAN Protocol Status.
| [in] | ptr | MCAN base |
| [out] | protocol_status | Translated Protocol status |
| status_invalid_argument | if any parameters are invalid |
| status_success | if no errors happened |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get Timeout value.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get Timestamp Counter Value.
| [in] | ptr | MCAN base |
| hpm_stat_t mcan_get_timestamp_from_received_message | ( | MCAN_Type * | ptr, |
| const mcan_rx_message_t * | rx_msg, | ||
| mcan_timestamp_value_t * | timestamp | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get Timestamp from MCAN RX frame.
| [in] | ptr | MCAN base |
| [in] | rx_msg | Received message |
| [out] | timestamp | Timestamp value |
| status_success | if no errors happened |
| status_invalid_argument | if any parameters are invalid |
| status_mcan_timestamp_not_exist | if no timestamp information is available |
| 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 | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Get Timestamp from MCAN TX Event.
| [in] | ptr | MCAN base |
| [in] | tx_evt | TX Event Element |
| [out] | timestamp | Timestamp value |
| status_success | if no errors happened |
| status_invalid_argument | if any parameters are invalid |
| status_mcan_timestamp_not_exist | if no timestamp information is available |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get the Transmitter Delay Compensation Value.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Get the TXFIFO Put Index.
| [in] | ptr | MCAN base |
| hpm_stat_t mcan_init | ( | MCAN_Type * | ptr, |
| mcan_config_t * | config, | ||
| uint32_t | src_clk_freq | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Initialize CAN controller.
| [in] | ptr | MCAN base |
| [in] | config | CAN configuration |
| [in] | src_clk_freq | CAN clock frequency |
| status_success | if operation is successful |
| status_invalid_argument | if any parameters are invalid |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Select Interrupt Line.
| [in] | ptr | MCAN base |
| [in] | mask | Interrupt mask |
| [in] | line_index | Interrupt Line Index |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether 64-bit TSU timestamp is used.
| [in] | ptr | MCAN base |
| true | if 64-bit timestamp is used |
| false | if 32-bit timestamp is used |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether the Bitrate Switch Flag is set in the last received CANFD message.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether CANFD messages were received.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether CAN clock is stopped or not.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check Whether the Error Status Indicator Flag is set in the last received CANFD message.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether the CAN node is under Bus-off state.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether the CAN node is under error passive state.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether the CAN mode is under Warning State.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether specified Interrupt is set.
| [in] | ptr | MCAN Base |
| [in] | mask | Interrupt Flags |
| true | if corresponding bits are set |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether Protocol Exception Events were occurred.
| [in] | ptr | MCAN base |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check Whether there are data available in specified RXBUF.
| [in] | ptr | MCAN Base |
| [in] | index | RXBUF index |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether the Transmission completed via specified TXBUF/TXFIFO.
| [in] | ptr | MCAN base |
| [in] | index | TXBUF Index |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether a TXFIFO/TXBUF transmission request is pending.
| [in] | ptr | CAN Base |
| [in] | index | TXBUF/TXFIFO Index |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether the TSU timestamp is available.
| [in] | ptr | MCAN base |
| [in] | index | Timestamp pointer |
| true | TSU Timestamp is available |
| false | TSU timestamp is unavailable |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether TSU is used.
| [in] | ptr | MCAN base |
| true | if TSU is used |
| false | if TSU is not used |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Check whether TXFIFO is full.
| [in] | ptr | MCAN base |
| hpm_stat_t mcan_parse_protocol_status | ( | uint32_t | psr, |
| mcan_protocol_status_t * | protocol_status | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Parse the Protocol Status register value.
| [in] | psr | Protocol Status Register Value |
| [out] | protocol_status | Translated Protocol Status |
| status_invalid_argument | if any parameters are invalid |
| status_success | if no errors happened |
| uint32_t mcan_read_32bit_tsu_timestamp | ( | MCAN_Type * | ptr, |
| uint32_t | index | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Read 32bit Timestamp value from TSU.
| [in] | ptr | MCAN Base |
| [in] | index | Timestamp pointer |
| uint64_t mcan_read_64bit_tsu_timestamp | ( | MCAN_Type * | ptr, |
| uint32_t | index | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Read 64bit Timestamp value from TSU.
| [in] | ptr | MCAN Base |
| [in] | index | Timestamp pointer |
| hpm_stat_t mcan_read_rxbuf | ( | MCAN_Type * | ptr, |
| uint32_t | index, | ||
| mcan_rx_message_t * | rx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Read message from CAN RXBUF.
| [in] | ptr | MCAN base |
| [in] | index | Index of RXBUF |
| [out] | rx_frame | Buffer to hold RX frame |
| hpm_stat_t mcan_read_rxfifo | ( | MCAN_Type * | ptr, |
| uint32_t | fifo_index, | ||
| mcan_rx_message_t * | rx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Read message from CAN RXBUF.
| [in] | ptr | MCAN base |
| [in] | fifo_index | RXFIFO index, 0 - RXFO0, 1 - RXFIFO1 |
| [out] | rx_frame | Buffer to hold RX frame |
| hpm_stat_t mcan_read_tx_evt_fifo | ( | MCAN_Type * | ptr, |
| mcan_tx_event_fifo_elem_t * | tx_evt | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Read TX Event from CAN TX EVENT FIFO.
| [in] | ptr | MCAN base |
| [out] | tx_evt | TX Event Buffer |
| status_success | if no errors happened |
| status_mcan_tx_evt_fifo_empty | if there are no TX events available |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t mcan_receive_from_buf_blocking | ( | MCAN_Type * | ptr, |
| uint32_t | index, | ||
| mcan_rx_message_t * | rx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Receive CAN Frame from RXBUF in blocking way.
| [in] | ptr | MCAN base |
| [in] | index | RXBUF index |
| [out] | rx_frame | Buffer to hold Received Frame |
| hpm_stat_t mcan_receive_from_fifo_blocking | ( | MCAN_Type * | ptr, |
| uint32_t | fifo_index, | ||
| mcan_rx_message_t * | rx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Receive CAN Frame from RXFIFO in blocking way.
| [in] | ptr | MCAN base |
| [in] | fifo_index | RXFIFO index, 0 - RXFIFO0, 1 - RXFIFO1 |
| [out] | rx_frame | Buffer to hold Received Frame |
| hpm_stat_t mcan_request_and_fill_txfifo | ( | MCAN_Type * | ptr, |
| mcan_tx_frame_t * | tx_frame, | ||
| uint32_t * | fifo_index | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Request TXFIFO and fill data into TXFIFO.
mcan_send_add_request(ptr, *fifo_index) API to trigger a transmission or call mcan_send_add_requests(ptr, fifo_index_masks) to trigger several transmissions | [in] | ptr | MCAN base |
| [in] | tx_frame | CAN Transmit Message buffer |
| [out] | fifo_index | The index of the element in FIFO assigned to the tx_frame |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Request several transmission via specified TXBUF/FIFO Bit masks MCAN IP will transmit data in the buffer if corresponding bit in index_bitmask is asserted.
| [in] | ptr | MCAN Base |
| [in] | index_bitmask | TXFIFO/BUF bit masks |
|
inlinestatic |
#include <drivers/inc/hpm_mcan_drv.h>
Request A Transmission via specified TXBUF Index.
| [in] | ptr | MCAN Base |
| [in] | index | TXBUF index |
| hpm_stat_t mcan_set_filter_element | ( | MCAN_Type * | ptr, |
| const mcan_filter_elem_t * | filter_elem, | ||
| uint32_t | index | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Set CAN filter element.
| [in] | ptr | MCAN base |
| [in] | filter_elem | CAN filter element |
| [in] | index | CAN Filter element index |
| hpm_stat_t mcan_set_global_filter_config | ( | MCAN_Type * | ptr, |
| mcan_global_filter_config_t * | filter_config | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Configure Global Filter.
| [in] | ptr | MCAN base |
| [in] | filter_config | Global Filter Configuration |
|
inlinestatic |
| hpm_stat_t mcan_transmit_blocking | ( | MCAN_Type * | ptr, |
| mcan_tx_frame_t * | tx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Transmit CAN message in blocking way.
| [in] | ptr | MCAN base |
| [in] | tx_frame | CAN Transmit Message buffer |
| hpm_stat_t mcan_transmit_via_txbuf_nonblocking | ( | MCAN_Type * | ptr, |
| uint32_t | index, | ||
| mcan_tx_frame_t * | tx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Transmit CAN message via TX in non-blocking way.
| [in] | ptr | MCAN base |
| [in] | index | Index of TX Buffer |
| [in] | tx_frame | CAN Transmit Message buffer |
| hpm_stat_t mcan_transmit_via_txfifo_nonblocking | ( | MCAN_Type * | ptr, |
| mcan_tx_frame_t * | tx_frame, | ||
| uint32_t * | fifo_index | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Transmit CAN message via TX FIFO in non-blocking way.
| [in] | ptr | MCAN base |
| [in] | tx_frame | CAN Transmit Message buffer |
| [out] | fifo_index | The index of the element in FIFO assigned to the tx_frame |
| hpm_stat_t mcan_write_txbuf | ( | MCAN_Type * | ptr, |
| uint32_t | index, | ||
| mcan_tx_frame_t * | tx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Write Frame to CAN TX Buffer.
| [in] | ptr | MCAN base |
| [in] | index | TX Buffer Index |
| [in] | tx_frame | TX frame |
| hpm_stat_t mcan_write_txfifo | ( | MCAN_Type * | ptr, |
| mcan_tx_frame_t * | tx_frame | ||
| ) |
#include <drivers/inc/hpm_mcan_drv.h>
Write Frame CAN to TXFIFO.
| [in] | ptr | MCAN base |
| [in] | tx_frame | TX frame |