CAN driver APIs. More...
Data Structures | |
| struct | can_bit_timing_param_t |
| CAN Bit timing parameters. More... | |
| struct | can_filter_config_t |
| CAN acceptance filter configuration. More... | |
| struct | can_config_t |
| CAN configuration. More... | |
Typedefs | |
| typedef enum _can_mode | can_node_mode_t |
| CAN loopback types. More... | |
| typedef enum _can_bit_timing_option | can_bit_timing_option_t |
| CAN bit timing options. More... | |
| typedef union _can_rx_buf | can_receive_buf_t |
| CAN receive buffer data structure. More... | |
| typedef union _can_tx_buf | can_transmit_buf_t |
| CAN transmit buffer data structure. More... | |
| typedef enum _can_filter_id_mode | can_filter_id_mode_t |
| CAN acceptance filter modes. More... | |
Enumerations | |
| enum | { status_can_bit_error = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 0 )) , status_can_form_error = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 1 )) , status_can_stuff_error = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 2 )) , status_can_ack_error = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 3 )) , status_can_crc_error = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 4 )) , status_can_other_error = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 5 )) , status_can_tx_fifo_full = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 6 )) , status_can_filter_index_invalid = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 7 )) , status_can_filter_num_invalid = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 8 )) , status_can_invalid_bit_timing = ((uint32_t)( status_group_can )*1000U + (uint32_t)( 9 )) } |
| CAN error codes. More... | |
| enum | { can_payload_size_0 = 0 , can_payload_size_1 , can_payload_size_2 , can_payload_size_3 , can_payload_size_4 , can_payload_size_5 , can_payload_size_6 , can_payload_size_7 , can_payload_size_8 , can_payload_size_12 , can_payload_size_16 , can_payload_size_20 , can_payload_size_24 , can_payload_size_32 , can_payload_size_48 , can_payload_size_64 , can_payload_size_max = can_payload_size_64 } |
| CAN DLC definitions. More... | |
Functions | |
| static void | can_reset (CAN_Type *base, bool enable) |
| Reset CAN controller. More... | |
| static void | can_force_bus_off (CAN_Type *base) |
| Force CAN controller to Bus-off mode. More... | |
| static void | can_set_node_mode (CAN_Type *base, can_node_mode_t mode) |
| Set CAN mode. More... | |
| static void | can_enable_listen_only_mode (CAN_Type *base, bool enable) |
| Enable CAN listen-only mode. More... | |
| static void | can_enter_standby_mode (CAN_Type *base, bool enable) |
| Enter CAN standby mode. More... | |
| static void | can_disable_ptb_retransmission (CAN_Type *base, bool enable) |
| Disable the re-transmission for the primary transmission buffer. More... | |
| static bool | can_is_ptb_retransmission_disabled (CAN_Type *base) |
| Check whether re-transmission is disabled for PTB or not. More... | |
| static void | can_disable_stb_retransmission (CAN_Type *base, bool enable) |
| Disable the re-transmission for the secondary transmission buffer. More... | |
| static bool | can_is_stb_retransmission_disabled (CAN_Type *base) |
| Check whether re-transmission is disabled for STB or not. More... | |
| static void | can_select_tx_buffer (CAN_Type *base, bool select_secondary_buffer) |
| Select CAN TX buffer. More... | |
| static void | can_start_high_priority_message_transmit (CAN_Type *base) |
| Start CAN high priority message transmit. More... | |
| static void | can_abort_high_priority_message_transmit (CAN_Type *base) |
| Abort CAN high priority message transmit. More... | |
| static void | can_start_message_transmit (CAN_Type *base) |
| Start CAN message transmit. More... | |
| static void | can_start_all_message_transmit (CAN_Type *base) |
| Start CAN all messages transmit. More... | |
| static void | can_abort_message_transmit (CAN_Type *base) |
| Abort CAN message transmit. More... | |
| static void | can_switch_to_next_tx_buffer (CAN_Type *base) |
| Switch to next CAN tx buffer. More... | |
| static void | can_select_tx_buffer_priority_mode (CAN_Type *base, bool enable_priority_decision) |
| Select CAN tx buffer priority mode. More... | |
| static uint8_t | can_get_secondary_transmit_buffer_status (CAN_Type *base) |
| Get CAN secondary transmit buffer status. More... | |
| static bool | can_is_primary_transmit_buffer_full (CAN_Type *base) |
| Check whether the primary transmit buffer is full. More... | |
| static bool | can_is_secondary_transmit_buffer_full (CAN_Type *base) |
| Check whether the secondary transmit buffer is full. More... | |
| static bool | can_is_in_bus_off_mode (CAN_Type *base) |
| Check whether the CAN is in BUS off mode. More... | |
| static void | can_enable_self_ack (CAN_Type *base, bool enable) |
| Enable can self ack. More... | |
| static void | can_set_receive_buffer_overflow_mode (CAN_Type *base, bool override_enable) |
| Set CAN receive buffer overflow mode. More... | |
| static bool | can_is_receive_buffer_overflow (CAN_Type *base) |
| Check whether CAN receive buffer is overflow. More... | |
| static void | can_release_receive_buffer (CAN_Type *base) |
| Release CAN receive buffer. More... | |
| static void | can_allow_store_all_data_in_receive_buffer (CAN_Type *base, bool allow) |
| Allow can store all date in receive buffer. More... | |
| static uint8_t | can_get_receive_buffer_status (CAN_Type *base) |
| Get CAN receive buffer status. More... | |
| static bool | can_is_data_available_in_receive_buffer (CAN_Type *base) |
| Check whether there are data available in receive buffer. More... | |
| static void | can_enable_can_fd_iso_mode (CAN_Type *base, bool enable) |
| Enable CAN FD ISO mode. More... | |
| static void | can_enable_tx_rx_irq (CAN_Type *base, uint8_t mask) |
| Enable CAN TX/RX interrupt. More... | |
| static void | can_disable_tx_rx_irq (CAN_Type *base, uint8_t mask) |
| Disable CAN TX/RX interrupt. More... | |
| static void | can_clear_tx_rx_flags (CAN_Type *base, uint8_t flags) |
| Clear CAN TX/RX flags. More... | |
| static uint8_t | can_get_tx_rx_flags (CAN_Type *base) |
| Get CAN TX/RX flags. More... | |
| static void | can_enable_error_irq (CAN_Type *base, uint8_t mask) |
| Enable CAN error interrupt. More... | |
| static void | can_disable_error_irq (CAN_Type *base, uint8_t mask) |
| Disable CAN error interrupt. More... | |
| static uint8_t | can_get_error_interrupt_flags (CAN_Type *base) |
| Get CAN error interrupt flags. More... | |
| static void | can_clear_error_interrupt_flags (CAN_Type *base, uint8_t flags) |
| Get CAN clear interrupt flags. More... | |
| static uint8_t | can_get_last_error_kind (CAN_Type *base) |
| Get last CAN error kind. More... | |
| static uint8_t | can_get_last_arbitration_lost_position (CAN_Type *base) |
| Get CAN last arbitrary lost position. More... | |
| static void | can_set_transmitter_delay_compensation (CAN_Type *base, uint8_t sample_point, bool enable) |
| Set CAN transmitter delay compensation. More... | |
| static void | can_set_warning_limits (CAN_Type *base, uint8_t almost_full_limit, uint8_t error_warning_limit) |
| Set CAN warning limits. More... | |
| static uint8_t | can_get_receive_error_count (CAN_Type *base) |
| Get CAN receive error count. More... | |
| static uint8_t | can_get_transmit_error_count (CAN_Type *base) |
| Get CAN transmit error count. More... | |
| static void | can_enable_filter (CAN_Type *base, uint32_t index) |
| Enable a specified CAN filter. More... | |
| static void | can_disable_filter (CAN_Type *base, uint32_t index) |
| Disable a specified CAN filter. More... | |
| hpm_stat_t | can_get_default_config (can_config_t *config) |
| Get default CAN configuration parameters. More... | |
| hpm_stat_t | can_init (CAN_Type *base, can_config_t *config, uint32_t src_clk_freq) |
| Initialize the CAN controller. More... | |
| void | can_deinit (CAN_Type *base) |
| De-initialize the CAN controller. More... | |
| static void | can_set_slow_speed_timing (CAN_Type *base, const can_bit_timing_param_t *param) |
| Configure the Slow Speed Bit timing using low-level interface. More... | |
| static void | can_set_fast_speed_timing (CAN_Type *base, const can_bit_timing_param_t *param) |
| Configure the Fast Speed Bit timing using low-level interface. More... | |
| hpm_stat_t | can_set_bit_timing (CAN_Type *base, can_bit_timing_option_t option, uint32_t src_clk_freq, uint32_t baudrate, uint16_t samplepoint_min, uint16_t samplepoint_max) |
| Configure the CAN bit timing for CAN BUS. More... | |
| hpm_stat_t | can_calculate_bit_timing (uint32_t src_clk_freq, can_bit_timing_option_t option, uint32_t baudrate, uint16_t samplepoint_min, uint16_t samplepoint_max, can_bit_timing_param_t *timing_param) |
| Calculate the CAN bit timing for CAN BUS. More... | |
| hpm_stat_t | can_set_filter (CAN_Type *base, const can_filter_config_t *config) |
| Configure the acceptable filter. More... | |
| hpm_stat_t | can_send_message_blocking (CAN_Type *base, const can_transmit_buf_t *message) |
| Send CAN message using blocking transfer. More... | |
| hpm_stat_t | can_send_high_priority_message_blocking (CAN_Type *base, const can_transmit_buf_t *message) |
| Send high-priority message using blocking transfer. More... | |
| hpm_stat_t | can_send_message_nonblocking (CAN_Type *base, const can_transmit_buf_t *message) |
| Send CAN message using non-blocking transfer. More... | |
| hpm_stat_t | can_send_high_priority_message_nonblocking (CAN_Type *base, const can_transmit_buf_t *message) |
| Send high-priority message using non-blocking transfer. More... | |
| hpm_stat_t | can_receive_message_blocking (CAN_Type *base, can_receive_buf_t *message) |
| Receive CAN message using blocking transfer. More... | |
| hpm_stat_t | can_read_received_message (CAN_Type *base, can_receive_buf_t *message) |
| Read Received CAN message. More... | |
CAN driver APIs.
| #define CAN_ERROR_ARBITRATION_LOST_INT_ENABLE (CAN_ERRINT_ALIE_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN Arbitration Lost Interrupt Enable
| #define CAN_ERROR_ARBITRATION_LOST_INT_FLAG (CAN_ERRINT_ALIE_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN arbitration Lost Interrupt Flag
| #define CAN_ERROR_BUS_ERROR_INT_ENABLE (CAN_ERRINT_BEIE_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN BUS error Interrupt Enable
| #define CAN_ERROR_BUS_ERROR_INT_FLAG (CAN_ERRINT_BEIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN BUS error Interrupt flag
| #define CAN_ERROR_PASSIVE_INT_ENABLE (CAN_ERRINT_EPIE_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN Passive Interrupt Enable
| #define CAN_ERROR_PASSIVE_INT_FLAG (CAN_ERRINT_EPIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN Passive Interrupt Flag
| #define CAN_ERROR_PASSIVE_MODE_ACTIVE_FLAG (CAN_ERRINT_EPASS_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN Passive mode active
| #define CAN_ERROR_WARNING_LIMIT_FLAG (CAN_ERRINT_EWARN_MASK) |
| #define CAN_EVENT_ABORT (CAN_RTIF_AIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN abort event
| #define CAN_EVENT_ERROR (CAN_RTIF_EIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN error event
| #define CAN_EVENT_RECEIVE (CAN_RTIF_RIF_MASK) |
| #define CAN_EVENT_RX_BUF_ALMOST_FULL (CAN_RTIF_RAFIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN RX buffer almost full event
| #define CAN_EVENT_RX_BUF_FULL (CAN_RTIF_RFIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN RX buffer full event
| #define CAN_EVENT_RX_BUF_OVERRUN (CAN_RTIF_ROIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN RX buffer overrun event
| #define CAN_EVENT_TX_PRIMARY_BUF (CAN_RTIF_TPIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN TX primary buffer event
| #define CAN_EVENT_TX_SECONDARY_BUF (CAN_RTIF_TSIF_MASK) |
#include <drivers/inc/hpm_can_drv.h>
CAN TX secondary buffer event
| #define CAN_KIND_OF_ERROR_ACK_ERROR (4U) |
#include <drivers/inc/hpm_can_drv.h>
Acknowledgment error
| #define CAN_KIND_OF_ERROR_BIT_ERROR (1U) |
#include <drivers/inc/hpm_can_drv.h>
Bit error
| #define CAN_KIND_OF_ERROR_BUS_OFF (7U) |
#include <drivers/inc/hpm_can_drv.h>
BUS off error
| #define CAN_KIND_OF_ERROR_CRC_ERROR (5U) |
#include <drivers/inc/hpm_can_drv.h>
CRC error
| #define CAN_KIND_OF_ERROR_FORM_ERROR (2U) |
#include <drivers/inc/hpm_can_drv.h>
Form error
| #define CAN_KIND_OF_ERROR_NO_ERROR (0U) |
| #define CAN_KIND_OF_ERROR_OTHER_ERROR (6U) |
#include <drivers/inc/hpm_can_drv.h>
Other errors
| #define CAN_KIND_OF_ERROR_STUFF_ERROR (3U) |
#include <drivers/inc/hpm_can_drv.h>
Stuff error
| #define CAN_RXBUF_ALMOST_FULL (2U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Receive buffer is almost full
| #define CAN_RXBUF_HAS_DATA (1U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Receive buffer has data
| #define CAN_RXBUF_IS_EMPTY (0U) |
| #define CAN_RXBUF_IS_FULL (3U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Receive buffer is full
| #define CAN_STB_IS_EMPTY (0U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Secondary Transmit buffer Status.
CAN Secondary Transmit buffer is empty
| #define CAN_STB_IS_FULL (3U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Secondary Transmit buffer is full
| #define CAN_STB_LESS_EQUAL_HALF_FULL (1U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Secondary Transmit buffer <= 1/2 * FULL
| #define CAN_STB_MORE_THAN_HALF_FULL (2U) |
#include <drivers/inc/hpm_can_drv.h>
CAN Secondary Transmit buffer > 1/2 * FULL
| typedef enum _can_bit_timing_option can_bit_timing_option_t |
#include <drivers/inc/hpm_can_drv.h>
CAN bit timing options.
| typedef enum _can_filter_id_mode can_filter_id_mode_t |
#include <drivers/inc/hpm_can_drv.h>
CAN acceptance filter modes.
| typedef enum _can_mode can_node_mode_t |
#include <drivers/inc/hpm_can_drv.h>
CAN loopback types.
| typedef union _can_rx_buf can_receive_buf_t |
#include <drivers/inc/hpm_can_drv.h>
CAN receive buffer data structure.
| typedef union _can_tx_buf can_transmit_buf_t |
#include <drivers/inc/hpm_can_drv.h>
CAN transmit buffer data structure.
| anonymous enum |
#include <drivers/inc/hpm_can_drv.h>
CAN error codes.
| anonymous enum |
#include <drivers/inc/hpm_can_drv.h>
CAN DLC definitions.
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Abort CAN high priority message transmit.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Abort CAN message transmit.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Allow can store all date in receive buffer.
| [in] | base | CAN base address |
| [in] | allow | flag to determine whether to store error data frame |
| hpm_stat_t can_calculate_bit_timing | ( | uint32_t | src_clk_freq, |
| can_bit_timing_option_t | option, | ||
| uint32_t | baudrate, | ||
| uint16_t | samplepoint_min, | ||
| uint16_t | samplepoint_max, | ||
| can_bit_timing_param_t * | timing_param | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Calculate the CAN bit timing for CAN BUS.
| [in] | src_clk_freq | CAN IP source clock frequency |
| [in] | option | CAN bit timing option |
| [in] | baudrate | CAN baudrate in MHz |
| [in] | samplepoint_min | Minimum Sample point, range(0-1000), samplepoint_min / 1000 will be used in calculation |
| [in] | samplepoint_max | Maximum Sample point, range(0-1000), samplepoint_max / 1000 will be used in calculation |
| [out] | timing_param | Calculated CAN bit timing parameter |
| API | execution status, status_success or status_invalid_argument |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN clear interrupt flags.
| [in] | base | CAN base address |
| [in] | flags | CAN error interrupt flags |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Clear CAN TX/RX flags.
| [in] | base | CAN base address |
| [in] | flags | CAN TX/RX interrupt flags |
| void can_deinit | ( | CAN_Type * | base | ) |
#include <drivers/inc/hpm_can_drv.h>
De-initialize the CAN controller.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Disable CAN error interrupt.
| [in] | base | CAN base address |
| [in] | mask | CAN error interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Disable a specified CAN filter.
| [in] | base | CAN base address |
| index | CAN filter index |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Disable the re-transmission for the primary transmission buffer.
| [in] | base | CAN base address |
| [in] | enable | Flag for disabling re-transmission for PTB |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Disable the re-transmission for the secondary transmission buffer.
| [in] | base | CAN base address |
| [in] | enable | Flag for disabling re-transmission for STB |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Disable CAN TX/RX interrupt.
| [in] | base | CAN base address |
| [in] | mask | CAN interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enable CAN FD ISO mode.
| [in] | base | CAN base address |
| enable | CAN-FD ISO mode enable flag |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enable CAN error interrupt.
| [in] | base | CAN base address |
| [in] | mask | CAN error interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enable a specified CAN filter.
| [in] | base | CAN base address |
| index | CAN filter index |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enable CAN listen-only mode.
| [in] | base | CAN base address |
| [in] | enable | CAN listen-only mode enable flag
|
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enable can self ack.
| [in] | base | CAN base address |
| [in] | enable | Self-ack enable flag, true or false |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enable CAN TX/RX interrupt.
| [in] | base | CAN base address |
| [in] | mask | CAN interrupt mask |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Enter CAN standby mode.
| [in] | base | CAN base address |
| [in] | enable | Can standby mode enable flag
|
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Force CAN controller to Bus-off mode.
| [in] | base | CAN base address |
| hpm_stat_t can_get_default_config | ( | can_config_t * | config | ) |
#include <drivers/inc/hpm_can_drv.h>
Get default CAN configuration parameters.
| [out] | config | CAN configuration structure |
| API | execution status, status_success or status_invalid_argument |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN error interrupt flags.
| [in] | base | CAN base address |
| CAN | error interrupt flags |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN last arbitrary lost position.
| [in] | base | CAN base address |
| CAN | last arbitrary lost position |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get last CAN error kind.
| [in] | base | CAN base address |
| CAN | last error kind |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN receive buffer status.
| [in] | base | CAN base address |
| Receive | buffer status, 0: empty, 1: > empty, < almost full, 2: >= almost full, 3: full |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN receive error count.
| [in] | base | CAN base address |
| CAN | receive error count |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN secondary transmit buffer status.
| [in] | base | CAN base address |
| secondary | transmit buffer status, 0: empty, 1: <= 1/2 full, 2: > 1/2 full, 3: full |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN transmit error count.
| [in] | base | CAN base address |
| CAN | transmit error count |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Get CAN TX/RX flags.
| [in] | base | CAN base address |
| CAN | Tx/RX interrupt flags |
| hpm_stat_t can_init | ( | CAN_Type * | base, |
| can_config_t * | config, | ||
| uint32_t | src_clk_freq | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Initialize the CAN controller.
| [in] | base | CAN base address |
| [in] | config | CAN configuration |
| [in] | src_clk_freq | CAN IP source clock frequency |
| API | execution status, status_success or status_invalid_argument |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether there are data available in receive buffer.
| [in] | base | CAN base address |
< CAN Receive buffer is empty
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether the CAN is in BUS off mode.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether the primary transmit buffer is full.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether re-transmission is disabled for PTB or not.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether CAN receive buffer is overflow.
| [in] | base | CAN base address |
| true | or false |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether the secondary transmit buffer is full.
| [in] | base | CAN base address |
< CAN Secondary Transmit buffer is full
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Check whether re-transmission is disabled for STB or not.
| [in] | base | CAN base address |
| hpm_stat_t can_read_received_message | ( | CAN_Type * | base, |
| can_receive_buf_t * | message | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Read Received CAN message.
| [in] | base | CAN base address |
| [out] | message | CAN message buffer |
| status_success | API execution is successful |
| status_invalid_argument | Invalid parameters |
| status_can_bit_error | CAN bit error happened during receiving message |
| status_can_form_error | CAN form error happened during receiving message |
| status_can_stuff_error | CAN stuff error happened during receiving message |
| status_can_ack_error | CAN ack error happened during receiving message |
| status_can_crc_error | CAN crc error happened during receiving message |
| status_can_other_error | Other error happened during receiving message |
| hpm_stat_t can_receive_message_blocking | ( | CAN_Type * | base, |
| can_receive_buf_t * | message | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Receive CAN message using blocking transfer.
| [in] | base | CAN base address |
| [out] | message | CAN message buffer |
| status_success | API execution is successful |
| status_invalid_argument | Invalid parameters |
| status_can_bit_error | CAN bit error happened during receiving message |
| status_can_form_error | CAN form error happened during receiving message |
| status_can_stuff_error | CAN stuff error happened during receiving message |
| status_can_ack_error | CAN ack error happened during receiving message |
| status_can_crc_error | CAN crc error happened during receiving message |
| status_can_other_error | Other error happened during receiving message |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Release CAN receive buffer.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Reset CAN controller.
| [in] | base | CAN base address |
| [in] | enable | reset flag for CAN controller
|
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Select CAN TX buffer.
| [in] | base | CAN base address |
| [in] | select_secondary_buffer | CAN secondary transmit buffer selection flag
|
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Select CAN tx buffer priority mode.
| [in] | base | CAN base address |
| [in] | enable_priority_decision | CAN tx buffer priority mode selection flag
|
| hpm_stat_t can_send_high_priority_message_blocking | ( | CAN_Type * | base, |
| const can_transmit_buf_t * | message | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Send high-priority message using blocking transfer.
| [in] | base | CAN base address |
| [in] | message | CAN message to be sent out |
| API | execution status, status_success or status_invalid_argument |
| hpm_stat_t can_send_high_priority_message_nonblocking | ( | CAN_Type * | base, |
| const can_transmit_buf_t * | message | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Send high-priority message using non-blocking transfer.
| [in] | base | CAN base address |
| [in] | message | CAN message to be sent out |
| API | execution status, status_success or status_invalid_argument |
| hpm_stat_t can_send_message_blocking | ( | CAN_Type * | base, |
| const can_transmit_buf_t * | message | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Send CAN message using blocking transfer.
| [in] | base | CAN base address |
| [in] | message | CAN message to be sent out |
| API | execution status, status_success or status_invalid_argument |
| hpm_stat_t can_send_message_nonblocking | ( | CAN_Type * | base, |
| const can_transmit_buf_t * | message | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Send CAN message using non-blocking transfer.
| [in] | base | CAN base address |
| [in] | message | CAN message to be sent out |
| API | execution status, status_success or status_invalid_argument |
| hpm_stat_t can_set_bit_timing | ( | CAN_Type * | base, |
| can_bit_timing_option_t | option, | ||
| uint32_t | src_clk_freq, | ||
| uint32_t | baudrate, | ||
| uint16_t | samplepoint_min, | ||
| uint16_t | samplepoint_max | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Configure the CAN bit timing for CAN BUS.
| [in] | base | CAN base address |
| [in] | option | CAN bit timing option |
| [in] | src_clk_freq | CAN IP source clock frequency |
| [in] | baudrate | CAN baudrate in MHz |
| [in] | samplepoint_min | Minimum Sample point, range(0-1000), samplepoint_min / 1000 will be used in calculation |
| [in] | samplepoint_max | Maximum Sample point, range(0-1000), samplepoint_max / 1000 will be used in calculation |
| API | execution status, status_success or status_invalid_argument |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Configure the Fast Speed Bit timing using low-level interface.
| [in] | base | CAN base address |
| [in] | param | CAN bit timing parameter |
| hpm_stat_t can_set_filter | ( | CAN_Type * | base, |
| const can_filter_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_can_drv.h>
Configure the acceptable filter.
| [in] | base | CAN base address |
| [in] | config | CAN filter configuration |
| API | execution status, status_success or status_invalid_argument |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Set CAN mode.
| [in] | base | CAN base address |
| [in] | mode | CAN loopback mode
|
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Set CAN receive buffer overflow mode.
| [in] | base | CAN base address |
| [in] | override_enable | receive buffer overflow mode option
|
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Configure the Slow Speed Bit timing using low-level interface.
| [in] | base | CAN base address |
| [in] | param | CAN bit timing parameter |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Set CAN transmitter delay compensation.
| [in] | base | CAN base address |
| [in] | sample_point | delay compensation sample point |
| [in] | enable | delay compensation enable flag |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Set CAN warning limits.
| [in] | base | CAN base address |
| [in] | almost_full_limit | |
| [in] | error_warning_limit |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Start CAN all messages transmit.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Start CAN high priority message transmit.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Start CAN message transmit.
| [in] | base | CAN base address |
|
inlinestatic |
#include <drivers/inc/hpm_can_drv.h>
Switch to next CAN tx buffer.
| [in] | base | CAN base address |