SAM Control Area Network (MCAN) Low Level Driver.
Copyright (c) 2015-2019 Microchip Technology Inc. and its subsidiaries.
|
static void | _mcan_enable_peripheral_clock (struct mcan_module *const module_inst) |
| enable can module clock. More...
|
|
static void | _mcan_message_memory_init (Mcan *hw) |
| initialize MCAN memory . More...
|
|
static void | _mcan_set_configuration (Mcan *hw, struct mcan_config *config) |
| set default configuration when initialization. More...
|
|
void | mcan_disable_bus_monitor_mode (struct mcan_module *const module_inst) |
| disable bus monitor mode of mcan module. More...
|
|
void | mcan_disable_fd_mode (struct mcan_module *const module_inst) |
| disable fd mode of mcan module. More...
|
|
void | mcan_disable_restricted_operation_mode (struct mcan_module *const module_inst) |
| disable restricted mode of mcan module. More...
|
|
void | mcan_disable_sleep_mode (struct mcan_module *const module_inst) |
| disable sleep mode of mcan module. More...
|
|
void | mcan_disable_test_mode (struct mcan_module *const module_inst) |
| disable test mode of mcan module. More...
|
|
void | mcan_enable_bus_monitor_mode (struct mcan_module *const module_inst) |
| enable bus monitor mode of mcan module. More...
|
|
void | mcan_enable_fd_mode (struct mcan_module *const module_inst) |
| switch mcan module into fd mode. More...
|
|
void | mcan_enable_restricted_operation_mode (struct mcan_module *const module_inst) |
| enable restricted mode of mcan module. More...
|
|
void | mcan_enable_sleep_mode (struct mcan_module *const module_inst) |
| enable sleep mode of mcan module. More...
|
|
void | mcan_enable_test_mode (struct mcan_module *const module_inst) |
| enable test mode of mcan module. More...
|
|
void | mcan_fd_set_baudrate (Mcan *hw, uint32_t baudrate) |
| Set MCAN_FD baudrate. More...
|
|
enum status_code | mcan_get_rx_buffer_element (struct mcan_module *const module_inst, struct mcan_rx_element_buffer *rx_element, uint32_t index) |
| get dedicated rx buffer element . More...
|
|
enum status_code | mcan_get_rx_fifo_0_element (struct mcan_module *const module_inst, struct mcan_rx_element_fifo_0 *rx_element, uint32_t index) |
| get FIFO rx buffer element . More...
|
|
enum status_code | mcan_get_rx_fifo_1_element (struct mcan_module *const module_inst, struct mcan_rx_element_fifo_1 *rx_element, uint32_t index) |
| get FIFO rx buffer element . More...
|
|
enum status_code | mcan_get_tx_event_fifo_element (struct mcan_module *const module_inst, struct mcan_tx_event_element *tx_event_element, uint32_t index) |
| set FIFO transmit buffer element . More...
|
|
void | mcan_init (struct mcan_module *const module_inst, Mcan *hw, struct mcan_config *config) |
| initialize can module. More...
|
|
void | mcan_set_baudrate (Mcan *hw, uint32_t baudrate) |
| Set MCAN baudrate. More...
|
|
enum status_code | mcan_set_rx_extended_filter (struct mcan_module *const module_inst, struct mcan_extended_message_filter_element *et_filter, uint32_t index) |
| set extended receive CAN ID. More...
|
|
enum status_code | mcan_set_rx_standard_filter (struct mcan_module *const module_inst, struct mcan_standard_message_filter_element *sd_filter, uint32_t index) |
| set standard receive CAN ID. More...
|
|
enum status_code | mcan_set_tx_buffer_element (struct mcan_module *const module_inst, struct mcan_tx_element *tx_element, uint32_t index) |
| set dedicated transmit buffer element . More...
|
|
void | mcan_start (struct mcan_module *const module_inst) |
| start can module after initialization. More...
|
|
void | mcan_stop (struct mcan_module *const module_inst) |
| stop mcan module when bus off occurs More...
|
|
static void _mcan_message_memory_init |
( |
Mcan * |
hw | ) |
|
|
static |
initialize MCAN memory .
- Parameters
-
hw | Base address of the MCAN |
The data size in conf_mcan.h should be 8/12/16/20/24/32/48/64, The corresponding setting value in register is 0/1//2/3/4/5/6/7. To simplify the calculation, seperate to two group 8/12/16/20/24 which increased with 4 and 32/48/64 which increased with 16.
References BIT_2_TO_15_MASK, mcan0_rx_buffer, mcan0_rx_extended_filter, mcan0_rx_fifo_0, mcan0_rx_fifo_1, mcan0_rx_standard_filter, mcan0_tx_buffer, mcan0_tx_event_fifo, mcan1_rx_buffer, mcan1_rx_extended_filter, mcan1_rx_fifo_0, mcan1_rx_fifo_1, mcan1_rx_standard_filter, mcan1_tx_buffer, and mcan1_tx_event_fifo.
Referenced by mcan_init().