Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
can_mcan.h File Reference
#include <zephyr/cache.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/can.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>

Go to the source code of this file.

Data Structures

struct  can_mcan_rx_fifo_hdr
 Bosch M_CAN Rx Buffer and FIFO Element header. More...
 
struct  can_mcan_rx_fifo
 Bosch M_CAN Rx Buffer and FIFO Element. More...
 
struct  can_mcan_tx_buffer_hdr
 Bosch M_CAN Tx Buffer Element header. More...
 
struct  can_mcan_tx_buffer
 Bosch M_CAN Tx Buffer Element. More...
 
struct  can_mcan_tx_event_fifo
 Bosch M_CAN Tx Event FIFO Element. More...
 
struct  can_mcan_std_filter
 Bosch M_CAN Standard Message ID Filter Element. More...
 
struct  can_mcan_ext_filter
 Bosch M_CAN Extended Message ID Filter Element. More...
 
struct  can_mcan_data
 Bosch M_CAN driver internal data structure. More...
 
struct  can_mcan_ops
 Bosch M_CAN driver front-end operations. More...
 
struct  can_mcan_tx_callback
 Bosch M_CAN driver internal Tx callback structure. More...
 
struct  can_mcan_rx_callback
 Bosch M_CAN driver internal Rx callback structure. More...
 
struct  can_mcan_callbacks
 Bosch M_CAN driver internal Tx + Rx callbacks structure. More...
 
struct  can_mcan_config
 Bosch M_CAN driver internal configuration structure. More...
 

Macros

#define CAN_MCAN_CREL   0x000
 
#define CAN_MCAN_CREL_REL   GENMASK(31, 28)
 
#define CAN_MCAN_CREL_STEP   GENMASK(27, 24)
 
#define CAN_MCAN_CREL_SUBSTEP   GENMASK(23, 20)
 
#define CAN_MCAN_CREL_YEAR   GENMASK(19, 16)
 
#define CAN_MCAN_CREL_MON   GENMASK(15, 8)
 
#define CAN_MCAN_CREL_DAY   GENMASK(7, 0)
 
#define CAN_MCAN_ENDN   0x004
 
#define CAN_MCAN_ENDN_ETV   GENMASK(31, 0)
 
#define CAN_MCAN_CUST   0x008
 
#define CAN_MCAN_CUST_CUST   GENMASK(31, 0)
 
#define CAN_MCAN_DBTP   0x00C
 
#define CAN_MCAN_DBTP_TDC   BIT(23)
 
#define CAN_MCAN_DBTP_DBRP   GENMASK(20, 16)
 
#define CAN_MCAN_DBTP_DTSEG1   GENMASK(12, 8)
 
#define CAN_MCAN_DBTP_DTSEG2   GENMASK(7, 4)
 
#define CAN_MCAN_DBTP_DSJW   GENMASK(3, 0)
 
#define CAN_MCAN_TEST   0x010
 
#define CAN_MCAN_TEST_SVAL   BIT(21)
 
#define CAN_MCAN_TEST_TXBNS   GENMASK(20, 16)
 
#define CAN_MCAN_TEST_PVAL   BIT(13)
 
#define CAN_MCAN_TEST_TXBNP   GENMASK(12, 8)
 
#define CAN_MCAN_TEST_RX   BIT(7)
 
#define CAN_MCAN_TEST_TX   GENMASK(6, 5)
 
#define CAN_MCAN_TEST_LBCK   BIT(4)
 
#define CAN_MCAN_RWD   0x014
 
#define CAN_MCAN_RWD_WDV   GENMASK(15, 8)
 
#define CAN_MCAN_RWD_WDC   GENMASK(7, 0)
 
#define CAN_MCAN_CCCR   0x018
 
#define CAN_MCAN_CCCR_NISO   BIT(15)
 
#define CAN_MCAN_CCCR_TXP   BIT(14)
 
#define CAN_MCAN_CCCR_EFBI   BIT(13)
 
#define CAN_MCAN_CCCR_PXHD   BIT(12)
 
#define CAN_MCAN_CCCR_WMM   BIT(11)
 
#define CAN_MCAN_CCCR_UTSU   BIT(10)
 
#define CAN_MCAN_CCCR_BRSE   BIT(9)
 
#define CAN_MCAN_CCCR_FDOE   BIT(8)
 
#define CAN_MCAN_CCCR_TEST   BIT(7)
 
#define CAN_MCAN_CCCR_DAR   BIT(6)
 
#define CAN_MCAN_CCCR_MON   BIT(5)
 
#define CAN_MCAN_CCCR_CSR   BIT(4)
 
#define CAN_MCAN_CCCR_CSA   BIT(3)
 
#define CAN_MCAN_CCCR_ASM   BIT(2)
 
#define CAN_MCAN_CCCR_CCE   BIT(1)
 
#define CAN_MCAN_CCCR_INIT   BIT(0)
 
#define CAN_MCAN_NBTP   0x01C
 
#define CAN_MCAN_NBTP_NSJW   GENMASK(31, 25)
 
#define CAN_MCAN_NBTP_NBRP   GENMASK(24, 16)
 
#define CAN_MCAN_NBTP_NTSEG1   GENMASK(15, 8)
 
#define CAN_MCAN_NBTP_NTSEG2   GENMASK(6, 0)
 
#define CAN_MCAN_TSCC   0x020
 
#define CAN_MCAN_TSCC_TCP   GENMASK(19, 16)
 
#define CAN_MCAN_TSCC_TSS   GENMASK(1, 0)
 
#define CAN_MCAN_TSCV   0x024
 
#define CAN_MCAN_TSCV_TSC   GENMASK(15, 0)
 
#define CAN_MCAN_TOCC   0x028
 
#define CAN_MCAN_TOCC_TOP   GENMASK(31, 16)
 
#define CAN_MCAN_TOCC_TOS   GENMASK(2, 1)
 
#define CAN_MCAN_TOCC_ETOC   BIT(1)
 
#define CAN_MCAN_TOCV   0x02C
 
#define CAN_MCAN_TOCV_TOC   GENMASK(15, 0)
 
#define CAN_MCAN_ECR   0x040
 
#define CAN_MCAN_ECR_CEL   GENMASK(23, 16)
 
#define CAN_MCAN_ECR_RP   BIT(15)
 
#define CAN_MCAN_ECR_REC   GENMASK(14, 8)
 
#define CAN_MCAN_ECR_TEC   GENMASK(7, 0)
 
#define CAN_MCAN_PSR   0x044
 
#define CAN_MCAN_PSR_TDCV   GENMASK(22, 16)
 
#define CAN_MCAN_PSR_PXE   BIT(14)
 
#define CAN_MCAN_PSR_RFDF   BIT(13)
 
#define CAN_MCAN_PSR_RBRS   BIT(12)
 
#define CAN_MCAN_PSR_RESI   BIT(11)
 
#define CAN_MCAN_PSR_DLEC   GENMASK(10, 8)
 
#define CAN_MCAN_PSR_BO   BIT(7)
 
#define CAN_MCAN_PSR_EW   BIT(6)
 
#define CAN_MCAN_PSR_EP   BIT(5)
 
#define CAN_MCAN_PSR_ACT   GENMASK(4, 3)
 
#define CAN_MCAN_PSR_LEC   GENMASK(2, 0)
 
#define CAN_MCAN_TDCR   0x048
 
#define CAN_MCAN_TDCR_TDCO   GENMASK(14, 8)
 
#define CAN_MCAN_TDCR_TDCF   GENMASK(6, 0)
 
#define CAN_MCAN_IR   0x050
 
#define CAN_MCAN_IR_ARA   BIT(29)
 
#define CAN_MCAN_IR_PED   BIT(28)
 
#define CAN_MCAN_IR_PEA   BIT(27)
 
#define CAN_MCAN_IR_WDI   BIT(26)
 
#define CAN_MCAN_IR_BO   BIT(25)
 
#define CAN_MCAN_IR_EW   BIT(24)
 
#define CAN_MCAN_IR_EP   BIT(23)
 
#define CAN_MCAN_IR_ELO   BIT(22)
 
#define CAN_MCAN_IR_BEU   BIT(21)
 
#define CAN_MCAN_IR_BEC   BIT(20)
 
#define CAN_MCAN_IR_DRX   BIT(19)
 
#define CAN_MCAN_IR_TOO   BIT(18)
 
#define CAN_MCAN_IR_MRAF   BIT(17)
 
#define CAN_MCAN_IR_TSW   BIT(16)
 
#define CAN_MCAN_IR_TEFL   BIT(15)
 
#define CAN_MCAN_IR_TEFF   BIT(14)
 
#define CAN_MCAN_IR_TEFW   BIT(13)
 
#define CAN_MCAN_IR_TEFN   BIT(12)
 
#define CAN_MCAN_IR_TFE   BIT(11)
 
#define CAN_MCAN_IR_TCF   BIT(10)
 
#define CAN_MCAN_IR_TC   BIT(9)
 
#define CAN_MCAN_IR_HPM   BIT(8)
 
#define CAN_MCAN_IR_RF1L   BIT(7)
 
#define CAN_MCAN_IR_RF1F   BIT(6)
 
#define CAN_MCAN_IR_RF1W   BIT(5)
 
#define CAN_MCAN_IR_RF1N   BIT(4)
 
#define CAN_MCAN_IR_RF0L   BIT(3)
 
#define CAN_MCAN_IR_RF0F   BIT(2)
 
#define CAN_MCAN_IR_RF0W   BIT(1)
 
#define CAN_MCAN_IR_RF0N   BIT(0)
 
#define CAN_MCAN_IE   0x054
 
#define CAN_MCAN_IE_ARAE   BIT(29)
 
#define CAN_MCAN_IE_PEDE   BIT(28)
 
#define CAN_MCAN_IE_PEAE   BIT(27)
 
#define CAN_MCAN_IE_WDIE   BIT(26)
 
#define CAN_MCAN_IE_BOE   BIT(25)
 
#define CAN_MCAN_IE_EWE   BIT(24)
 
#define CAN_MCAN_IE_EPE   BIT(23)
 
#define CAN_MCAN_IE_ELOE   BIT(22)
 
#define CAN_MCAN_IE_BEUE   BIT(21)
 
#define CAN_MCAN_IE_BECE   BIT(20)
 
#define CAN_MCAN_IE_DRXE   BIT(19)
 
#define CAN_MCAN_IE_TOOE   BIT(18)
 
#define CAN_MCAN_IE_MRAFE   BIT(17)
 
#define CAN_MCAN_IE_TSWE   BIT(16)
 
#define CAN_MCAN_IE_TEFLE   BIT(15)
 
#define CAN_MCAN_IE_TEFFE   BIT(14)
 
#define CAN_MCAN_IE_TEFWE   BIT(13)
 
#define CAN_MCAN_IE_TEFNE   BIT(12)
 
#define CAN_MCAN_IE_TFEE   BIT(11)
 
#define CAN_MCAN_IE_TCFE   BIT(10)
 
#define CAN_MCAN_IE_TCE   BIT(9)
 
#define CAN_MCAN_IE_HPME   BIT(8)
 
#define CAN_MCAN_IE_RF1LE   BIT(7)
 
#define CAN_MCAN_IE_RF1FE   BIT(6)
 
#define CAN_MCAN_IE_RF1WE   BIT(5)
 
#define CAN_MCAN_IE_RF1NE   BIT(4)
 
#define CAN_MCAN_IE_RF0LE   BIT(3)
 
#define CAN_MCAN_IE_RF0FE   BIT(2)
 
#define CAN_MCAN_IE_RF0WE   BIT(1)
 
#define CAN_MCAN_IE_RF0NE   BIT(0)
 
#define CAN_MCAN_ILS   0x058
 
#define CAN_MCAN_ILS_ARAL   BIT(29)
 
#define CAN_MCAN_ILS_PEDL   BIT(28)
 
#define CAN_MCAN_ILS_PEAL   BIT(27)
 
#define CAN_MCAN_ILS_WDIL   BIT(26)
 
#define CAN_MCAN_ILS_BOL   BIT(25)
 
#define CAN_MCAN_ILS_EWL   BIT(24)
 
#define CAN_MCAN_ILS_EPL   BIT(23)
 
#define CAN_MCAN_ILS_ELOL   BIT(22)
 
#define CAN_MCAN_ILS_BEUL   BIT(21)
 
#define CAN_MCAN_ILS_BECL   BIT(20)
 
#define CAN_MCAN_ILS_DRXL   BIT(19)
 
#define CAN_MCAN_ILS_TOOL   BIT(18)
 
#define CAN_MCAN_ILS_MRAFL   BIT(17)
 
#define CAN_MCAN_ILS_TSWL   BIT(16)
 
#define CAN_MCAN_ILS_TEFLL   BIT(15)
 
#define CAN_MCAN_ILS_TEFFL   BIT(14)
 
#define CAN_MCAN_ILS_TEFWL   BIT(13)
 
#define CAN_MCAN_ILS_TEFNL   BIT(12)
 
#define CAN_MCAN_ILS_TFEL   BIT(11)
 
#define CAN_MCAN_ILS_TCFL   BIT(10)
 
#define CAN_MCAN_ILS_TCL   BIT(9)
 
#define CAN_MCAN_ILS_HPML   BIT(8)
 
#define CAN_MCAN_ILS_RF1LL   BIT(7)
 
#define CAN_MCAN_ILS_RF1FL   BIT(6)
 
#define CAN_MCAN_ILS_RF1WL   BIT(5)
 
#define CAN_MCAN_ILS_RF1NL   BIT(4)
 
#define CAN_MCAN_ILS_RF0LL   BIT(3)
 
#define CAN_MCAN_ILS_RF0FL   BIT(2)
 
#define CAN_MCAN_ILS_RF0WL   BIT(1)
 
#define CAN_MCAN_ILS_RF0NL   BIT(0)
 
#define CAN_MCAN_ILE   0x05C
 
#define CAN_MCAN_ILE_EINT1   BIT(1)
 
#define CAN_MCAN_ILE_EINT0   BIT(0)
 
#define CAN_MCAN_GFC   0x080
 
#define CAN_MCAN_GFC_ANFS   GENMASK(5, 4)
 
#define CAN_MCAN_GFC_ANFE   GENMASK(3, 2)
 
#define CAN_MCAN_GFC_RRFS   BIT(1)
 
#define CAN_MCAN_GFC_RRFE   BIT(0)
 
#define CAN_MCAN_SIDFC   0x084
 
#define CAN_MCAN_SIDFC_LSS   GENMASK(23, 16)
 
#define CAN_MCAN_SIDFC_FLSSA   GENMASK(15, 2)
 
#define CAN_MCAN_XIDFC   0x088
 
#define CAN_MCAN_XIDFC_LSS   GENMASK(22, 16)
 
#define CAN_MCAN_XIDFC_FLESA   GENMASK(15, 2)
 
#define CAN_MCAN_XIDAM   0x090
 
#define CAN_MCAN_XIDAM_EIDM   GENMASK(28, 0)
 
#define CAN_MCAN_HPMS   0x094
 
#define CAN_MCAN_HPMS_FLST   BIT(15)
 
#define CAN_MCAN_HPMS_FIDX   GENMASK(14, 8)
 
#define CAN_MCAN_HPMS_MSI   GENMASK(7, 6)
 
#define CAN_MCAN_HPMS_BIDX   GENMASK(5, 0)
 
#define CAN_MCAN_NDAT1   0x098
 
#define CAN_MCAN_NDAT1_ND   GENMASK(31, 0)
 
#define CAN_MCAN_NDAT2   0x09C
 
#define CAN_MCAN_NDAT2_ND   GENMASK(31, 0)
 
#define CAN_MCAN_RXF0C   0x0A0
 
#define CAN_MCAN_RXF0C_F0OM   BIT(31)
 
#define CAN_MCAN_RXF0C_F0WM   GENMASK(30, 24)
 
#define CAN_MCAN_RXF0C_F0S   GENMASK(22, 16)
 
#define CAN_MCAN_RXF0C_F0SA   GENMASK(15, 2)
 
#define CAN_MCAN_RXF0S   0x0A4
 
#define CAN_MCAN_RXF0S_RF0L   BIT(25)
 
#define CAN_MCAN_RXF0S_F0F   BIT(24)
 
#define CAN_MCAN_RXF0S_F0PI   GENMASK(21, 16)
 
#define CAN_MCAN_RXF0S_F0GI   GENMASK(13, 8)
 
#define CAN_MCAN_RXF0S_F0FL   GENMASK(6, 0)
 
#define CAN_MCAN_RXF0A   0x0A8
 
#define CAN_MCAN_RXF0A_F0AI   GENMASK(5, 0)
 
#define CAN_MCAN_RXBC   0x0AC
 
#define CAN_MCAN_RXBC_RBSA   GENMASK(15, 2)
 
#define CAN_MCAN_RXF1C   0x0B0
 
#define CAN_MCAN_RXF1C_F1OM   BIT(31)
 
#define CAN_MCAN_RXF1C_F1WM   GENMASK(30, 24)
 
#define CAN_MCAN_RXF1C_F1S   GENMASK(22, 16)
 
#define CAN_MCAN_RXF1C_F1SA   GENMASK(15, 2)
 
#define CAN_MCAN_RXF1S   0x0B4
 
#define CAN_MCAN_RXF1S_RF1L   BIT(25)
 
#define CAN_MCAN_RXF1S_F1F   BIT(24)
 
#define CAN_MCAN_RXF1S_F1PI   GENMASK(21, 16)
 
#define CAN_MCAN_RXF1S_F1GI   GENMASK(13, 8)
 
#define CAN_MCAN_RXF1S_F1FL   GENMASK(6, 0)
 
#define CAN_MCAN_RXF1A   0x0B8
 
#define CAN_MCAN_RXF1A_F1AI   GENMASK(5, 0)
 
#define CAN_MCAN_RXESC   0x0BC
 
#define CAN_MCAN_RXESC_RBDS   GENMASK(10, 8)
 
#define CAN_MCAN_RXESC_F1DS   GENMASK(6, 4)
 
#define CAN_MCAN_RXESC_F0DS   GENMASK(2, 0)
 
#define CAN_MCAN_TXBC   0x0C0
 
#define CAN_MCAN_TXBC_TFQM   BIT(30)
 
#define CAN_MCAN_TXBC_TFQS   GENMASK(29, 24)
 
#define CAN_MCAN_TXBC_NDTB   GENMASK(21, 16)
 
#define CAN_MCAN_TXBC_TBSA   GENMASK(15, 2)
 
#define CAN_MCAN_TXFQS   0x0C4
 
#define CAN_MCAN_TXFQS_TFQF   BIT(21)
 
#define CAN_MCAN_TXFQS_TFQPI   GENMASK(20, 16)
 
#define CAN_MCAN_TXFQS_TFGI   GENMASK(12, 8)
 
#define CAN_MCAN_TXFQS_TFFL   GENMASK(5, 0)
 
#define CAN_MCAN_TXESC   0x0C8
 
#define CAN_MCAN_TXESC_TBDS   GENMASK(2, 0)
 
#define CAN_MCAN_TXBRP   0x0CC
 
#define CAN_MCAN_TXBRP_TRP   GENMASK(31, 0)
 
#define CAN_MCAN_TXBAR   0x0D0
 
#define CAN_MCAN_TXBAR_AR   GENMASK(31, 0)
 
#define CAN_MCAN_TXBCR   0x0D4
 
#define CAN_MCAN_TXBCR_CR   GENMASK(31, 0)
 
#define CAN_MCAN_TXBTO   0x0D8
 
#define CAN_MCAN_TXBTO_TO   GENMASK(31, 0)
 
#define CAN_MCAN_TXBCF   0x0DC
 
#define CAN_MCAN_TXBCF_CF   GENMASK(31, 0)
 
#define CAN_MCAN_TXBTIE   0x0E0
 
#define CAN_MCAN_TXBTIE_TIE   GENMASK(31, 0)
 
#define CAN_MCAN_TXBCIE   0x0E4
 
#define CAN_MCAN_TXBCIE_CFIE   GENMASK(31, 0)
 
#define CAN_MCAN_TXEFC   0x0F0
 
#define CAN_MCAN_TXEFC_EFWM   GENMASK(29, 24)
 
#define CAN_MCAN_TXEFC_EFS   GENMASK(21, 16)
 
#define CAN_MCAN_TXEFC_EFSA   GENMASK(15, 2)
 
#define CAN_MCAN_TXEFS   0x0F4
 
#define CAN_MCAN_TXEFS_TEFL   BIT(25)
 
#define CAN_MCAN_TXEFS_EFF   BIT(24)
 
#define CAN_MCAN_TXEFS_EFPI   GENMASK(20, 16)
 
#define CAN_MCAN_TXEFS_EFGI   GENMASK(12, 8)
 
#define CAN_MCAN_TXEFS_EFFL   GENMASK(5, 0)
 
#define CAN_MCAN_TXEFA   0x0F8
 
#define CAN_MCAN_TXEFA_EFAI   GENMASK(4, 0)
 
#define CAN_MCAN_DT_MRAM_OFFSET(node_id)
 Get the Bosch M_CAN Message RAM offset.
 
#define CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(node_id)
 Get the number of standard (11-bit) filter elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(node_id)
 Get the number of extended (29-bit) filter elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(node_id)
 Get the number of Rx FIFO 0 elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(node_id)
 Get the number of Rx FIFO 1 elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(node_id)
 Get the number of Rx Buffer elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(node_id)
 Get the number of Tx Event FIFO elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(node_id)
 Get the number of Tx Buffer elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET(node_id)
 Get the base offset of standard (11-bit) filter elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET(node_id)
 Get the base offset of extended (29-bit) filter elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET(node_id)
 Get the base offset of Rx FIFO 0 elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET(node_id)
 Get the base offset of Rx FIFO 1 elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET(node_id)
 Get the base offset of Rx Buffer elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET(node_id)
 Get the base offset of Tx Event FIFO elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET(node_id)
 Get the base offset of Tx Buffer elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MCAN_ADDR(node_id)
 Get the Bosch M_CAN register base address.
 
#define CAN_MCAN_DT_MRBA(node_id)
 Get the Bosch M_CAN Message RAM base address.
 
#define CAN_MCAN_DT_MRAM_ADDR(node_id)
 Get the Bosch M_CAN Message RAM address.
 
#define CAN_MCAN_DT_MRAM_SIZE(node_id)
 Get the Bosch M_CAN Message RAM size.
 
#define CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(node_id)
 Get the total size of all Bosch M_CAN Message RAM elements.
 
#define CAN_MCAN_DT_MRAM_DEFINE(node_id, _name)
 Define a RAM buffer for Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG(node_id)
 Assert that the Message RAM configuration meets the Bosch M_CAN IP core restrictions.
 
#define CAN_MCAN_DT_INST_MRAM_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_STD_FILTER_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_EXT_FILTER_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_RX_FIFO0_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_RX_FIFO1_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_RX_BUFFER_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_TX_EVENT_FIFO_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_TX_BUFFER_ELEMENTS(inst)
 Equivalent to CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_STD_FILTER_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_EXT_FILTER_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_RX_FIFO0_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_RX_FIFO1_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_RX_BUFFER_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_TX_EVENT_FIFO_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_TX_BUFFER_OFFSET(inst)
 Equivalent to CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MCAN_ADDR(inst)
 Equivalent to CAN_MCAN_DT_MCAN_ADDR(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRBA(inst)
 Equivalent to CAN_MCAN_DT_MRBA(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_ADDR(inst)
 Equivalent to CAN_MCAN_DT_MRAM_ADDR(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_SIZE(inst)
 Equivalent to CAN_MCAN_DT_MRAM_SIZE(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_ELEMENTS_SIZE(inst)
 Equivalent to CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_INST_MRAM_DEFINE(inst, _name)
 Equivalent to CAN_MCAN_DT_MRAM_DEFINE(DT_DRV_INST(inst))
 
#define CAN_MCAN_TIMING_MIN_INITIALIZER
 Bosch M_CAN specific static initializer for a minimum nominal can_timing struct.
 
#define CAN_MCAN_TIMING_MAX_INITIALIZER
 Bosch M_CAN specific static initializer for a maximum nominal can_timing struct.
 
#define CAN_MCAN_TIMING_DATA_MIN_INITIALIZER
 Bosch M_CAN specific static initializer for a minimum data phase can_timing struct.
 
#define CAN_MCAN_TIMING_DATA_MAX_INITIALIZER
 Bosch M_CAN specific static initializer for a maximum data phase can_timing struct.
 
#define CAN_MCAN_DT_INST_BUILD_ASSERT_MRAM_CFG(inst)
 Equivalent to CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG(DT_DRV_INST(inst))
 
#define CAN_MCAN_XFEC_DISABLE   0x0
 
#define CAN_MCAN_XFEC_FIFO0   0x1
 
#define CAN_MCAN_XFEC_FIFO1   0x2
 
#define CAN_MCAN_XFEC_REJECT   0x3
 
#define CAN_MCAN_XFEC_PRIO   0x4
 
#define CAN_MCAN_XFEC_PRIO_FIFO0   0x5
 
#define CAN_MCAN_XFEC_PRIO_FIFO1   0x7
 
#define CAN_MCAN_SFT_RANGE   0x0
 
#define CAN_MCAN_SFT_DUAL   0x1
 
#define CAN_MCAN_SFT_CLASSIC   0x2
 
#define CAN_MCAN_SFT_DISABLED   0x3
 
#define CAN_MCAN_EFT_RANGE_XIDAM   0x0
 
#define CAN_MCAN_EFT_DUAL   0x1
 
#define CAN_MCAN_EFT_CLASSIC   0x2
 
#define CAN_MCAN_EFT_RANGE   0x3
 
#define CAN_MCAN_CALLBACKS_DEFINE(_name, _tx, _std, _ext)
 Define Bosch M_CAN TX and RX callbacks.
 
#define CAN_MCAN_DT_CALLBACKS_DEFINE(node_id, _name)
 Define Bosch M_CAN TX and RX callbacks.
 
#define CAN_MCAN_DT_INST_CALLBACKS_DEFINE(inst, _name)
 Equivalent to CAN_MCAN_DT_CALLBACKS_DEFINE(DT_DRV_INST(inst))
 
#define CAN_MCAN_DT_MRAM_ELEMENTS_GET(node_id)
 Get an array containing the number of elements in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_MRAM_OFFSETS_GET(node_id)
 Get an array containing the base offsets for element in Bosch M_CAN Message RAM.
 
#define CAN_MCAN_DT_CONFIG_GET(node_id, _custom, _ops, _cbs)
 Static initializer for can_mcan_config struct.
 
#define CAN_MCAN_DT_CONFIG_INST_GET(inst, _custom, _ops, _cbs)
 Static initializer for can_mcan_config struct from DT_DRV_COMPAT instance.
 
#define CAN_MCAN_DATA_INITIALIZER(_custom)
 Initializer for a can_mcan_data struct.
 
Indexes for the cells in the devicetree bosch,mram-cfg property

These match the description of the cells in the bosch,m_can-base devicetree binding.

#define CAN_MCAN_MRAM_CFG_OFFSET   0
 offset cell index
 
#define CAN_MCAN_MRAM_CFG_STD_FILTER   1
 std-filter-elements cell index
 
#define CAN_MCAN_MRAM_CFG_EXT_FILTER   2
 ext-filter-elements cell index
 
#define CAN_MCAN_MRAM_CFG_RX_FIFO0   3
 rx-fifo0-elements cell index
 
#define CAN_MCAN_MRAM_CFG_RX_FIFO1   4
 rx-fifo1-elements cell index
 
#define CAN_MCAN_MRAM_CFG_RX_BUFFER   5
 rx-buffer-elements cell index
 
#define CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO   6
 tx-event-fifo-elements cell index
 
#define CAN_MCAN_MRAM_CFG_TX_BUFFER   7
 tx-buffer-elements cell index
 
#define CAN_MCAN_MRAM_CFG_NUM_CELLS   8
 Total number of cells in bosch,mram-cfg property.
 

Typedefs

typedef int(* can_mcan_read_reg_t) (const struct device *dev, uint16_t reg, uint32_t *val)
 Bosch M_CAN driver front-end callback for reading a register value.
 
typedef int(* can_mcan_write_reg_t) (const struct device *dev, uint16_t reg, uint32_t val)
 Bosch M_CAN driver front-end callback for writing a register value.
 
typedef int(* can_mcan_read_mram_t) (const struct device *dev, uint16_t offset, void *dst, size_t len)
 Bosch M_CAN driver front-end callback for reading from Message RAM.
 
typedef int(* can_mcan_write_mram_t) (const struct device *dev, uint16_t offset, const void *src, size_t len)
 Bosch M_CAN driver front-end callback for writing to Message RAM.
 
typedef int(* can_mcan_clear_mram_t) (const struct device *dev, uint16_t offset, size_t len)
 Bosch M_CAN driver front-end callback for clearing Message RAM.
 

Enumerations

enum  can_mcan_psr_lec {
  CAN_MCAN_PSR_LEC_NO_ERROR = 0 , CAN_MCAN_PSR_LEC_STUFF_ERROR = 1 , CAN_MCAN_PSR_LEC_FORM_ERROR = 2 , CAN_MCAN_PSR_LEC_ACK_ERROR = 3 ,
  CAN_MCAN_PSR_LEC_BIT1_ERROR = 4 , CAN_MCAN_PSR_LEC_BIT0_ERROR = 5 , CAN_MCAN_PSR_LEC_CRC_ERROR = 6 , CAN_MCAN_PSR_LEC_NO_CHANGE = 7
}
 

Functions

static int can_mcan_sys_read_reg (mm_reg_t base, uint16_t reg, uint32_t *val)
 Bosch M_CAN driver front-end callback helper for reading a memory mapped register.
 
static int can_mcan_sys_write_reg (mm_reg_t base, uint16_t reg, uint32_t val)
 Bosch M_CAN driver front-end callback helper for writing a memory mapped register.
 
static int can_mcan_sys_read_mram (mem_addr_t base, uint16_t offset, void *dst, size_t len)
 Bosch M_CAN driver front-end callback helper for reading from memory mapped Message RAM.
 
static int can_mcan_sys_write_mram (mem_addr_t base, uint16_t offset, const void *src, size_t len)
 Bosch M_CAN driver front-end callback helper for writing to memory mapped Message RAM.
 
static int can_mcan_sys_clear_mram (mem_addr_t base, uint16_t offset, size_t len)
 Bosch M_CAN driver front-end callback helper for clearing memory mapped Message RAM.
 
int can_mcan_read_reg (const struct device *dev, uint16_t reg, uint32_t *val)
 Read a Bosch M_CAN register.
 
int can_mcan_write_reg (const struct device *dev, uint16_t reg, uint32_t val)
 Write a Bosch M_CAN register.
 
static int can_mcan_read_mram (const struct device *dev, uint16_t offset, void *dst, size_t len)
 Read from Bosch M_CAN Message RAM.
 
static int can_mcan_write_mram (const struct device *dev, uint16_t offset, const void *src, size_t len)
 Write to Bosch M_CAN Message RAM.
 
static int can_mcan_clear_mram (const struct device *dev, uint16_t offset, size_t len)
 Clear Bosch M_CAN Message RAM.
 
int can_mcan_configure_mram (const struct device *dev, uintptr_t mrba, uintptr_t mram)
 Configure Bosch M_MCAN Message RAM start addresses.
 
int can_mcan_init (const struct device *dev)
 Bosch M_CAN driver initialization callback.
 
void can_mcan_line_0_isr (const struct device *dev)
 Bosch M_CAN driver m_can_int0 IRQ handler.
 
void can_mcan_line_1_isr (const struct device *dev)
 Bosch M_CAN driver m_can_int1 IRQ handler.
 
void can_mcan_enable_configuration_change (const struct device *dev)
 Enable Bosch M_CAN configuration change.
 
int can_mcan_get_capabilities (const struct device *dev, can_mode_t *cap)
 Bosch M_CAN driver callback API upon getting CAN controller capabilities See can_get_capabilities() for argument description.
 
int can_mcan_start (const struct device *dev)
 Bosch M_CAN driver callback API upon starting CAN controller See can_start() for argument description.
 
int can_mcan_stop (const struct device *dev)
 Bosch M_CAN driver callback API upon stopping CAN controller See can_stop() for argument description.
 
int can_mcan_set_mode (const struct device *dev, can_mode_t mode)
 Bosch M_CAN driver callback API upon setting CAN controller mode See can_set_mode() for argument description.
 
int can_mcan_set_timing (const struct device *dev, const struct can_timing *timing)
 Bosch M_CAN driver callback API upon setting CAN bus timing See can_set_timing() for argument description.
 
int can_mcan_set_timing_data (const struct device *dev, const struct can_timing *timing_data)
 Bosch M_CAN driver callback API upon setting CAN bus data phase timing See can_set_timing_data() for argument description.
 
int can_mcan_send (const struct device *dev, const struct can_frame *frame, k_timeout_t timeout, can_tx_callback_t callback, void *user_data)
 
int can_mcan_get_max_filters (const struct device *dev, bool ide)
 
int can_mcan_add_rx_filter (const struct device *dev, can_rx_callback_t callback, void *user_data, const struct can_filter *filter)
 Bosch M_CAN driver callback API upon adding an RX filter See can_add_rx_callback() for argument description.
 
void can_mcan_remove_rx_filter (const struct device *dev, int filter_id)
 Bosch M_CAN driver callback API upon removing an RX filter See can_remove_rx_filter() for argument description.
 
int can_mcan_get_state (const struct device *dev, enum can_state *state, struct can_bus_err_cnt *err_cnt)
 Bosch M_CAN driver callback API upon getting the CAN controller state See can_get_state() for argument description.
 
void can_mcan_set_state_change_callback (const struct device *dev, can_state_change_callback_t callback, void *user_data)
 Bosch M_CAN driver callback API upon setting a state change callback See can_set_state_change_callback() for argument description.
 

Macro Definition Documentation

◆ CAN_MCAN_CALLBACKS_DEFINE

#define CAN_MCAN_CALLBACKS_DEFINE ( _name,
_tx,
_std,
_ext )
Value:
static struct can_mcan_tx_callback _name##_tx_cbs[_tx]; \
static struct can_mcan_rx_callback _name##_std_cbs[_std]; \
static struct can_mcan_rx_callback _name##_ext_cbs[_ext]; \
static const struct can_mcan_callbacks _name = { \
.tx = _name##_tx_cbs, \
.std = _name##_std_cbs, \
.ext = _name##_ext_cbs, \
.num_tx = _tx, \
.num_std = _std, \
.num_ext = _ext, \
}
Bosch M_CAN driver internal Tx + Rx callbacks structure.
Definition can_mcan.h:1172
uint8_t num_tx
Definition can_mcan.h:1176
struct can_mcan_rx_callback * ext
Definition can_mcan.h:1175
struct can_mcan_rx_callback * std
Definition can_mcan.h:1174
Bosch M_CAN driver internal Rx callback structure.
Definition can_mcan.h:1164
Bosch M_CAN driver internal Tx callback structure.
Definition can_mcan.h:1156

Define Bosch M_CAN TX and RX callbacks.

This macro allows a Bosch M_CAN driver frontend using a fixed Message RAM configuration to limit the required software resources (e.g. limit the number of the standard (11-bit) or extended (29-bit) filters in use).

Frontend drivers supporting dynamic Message RAM configuration should use CAN_MCAN_DT_CALLBACKS_DEFINE() or CAN_MCAN_DT_INST_CALLBACKS_DEFINE() instead.

Parameters
_namecallbacks variable name
_txNumber of Tx callbacks
_stdNumber of standard (11-bit) filter callbacks
_extNumber of extended (29-bit) filter callbacks
See also
CAN_MCAN_DT_CALLBACKS_DEFINE()

◆ CAN_MCAN_CCCR

#define CAN_MCAN_CCCR   0x018

◆ CAN_MCAN_CCCR_ASM

#define CAN_MCAN_CCCR_ASM   BIT(2)

◆ CAN_MCAN_CCCR_BRSE

#define CAN_MCAN_CCCR_BRSE   BIT(9)

◆ CAN_MCAN_CCCR_CCE

#define CAN_MCAN_CCCR_CCE   BIT(1)

◆ CAN_MCAN_CCCR_CSA

#define CAN_MCAN_CCCR_CSA   BIT(3)

◆ CAN_MCAN_CCCR_CSR

#define CAN_MCAN_CCCR_CSR   BIT(4)

◆ CAN_MCAN_CCCR_DAR

#define CAN_MCAN_CCCR_DAR   BIT(6)

◆ CAN_MCAN_CCCR_EFBI

#define CAN_MCAN_CCCR_EFBI   BIT(13)

◆ CAN_MCAN_CCCR_FDOE

#define CAN_MCAN_CCCR_FDOE   BIT(8)

◆ CAN_MCAN_CCCR_INIT

#define CAN_MCAN_CCCR_INIT   BIT(0)

◆ CAN_MCAN_CCCR_MON

#define CAN_MCAN_CCCR_MON   BIT(5)

◆ CAN_MCAN_CCCR_NISO

#define CAN_MCAN_CCCR_NISO   BIT(15)

◆ CAN_MCAN_CCCR_PXHD

#define CAN_MCAN_CCCR_PXHD   BIT(12)

◆ CAN_MCAN_CCCR_TEST

#define CAN_MCAN_CCCR_TEST   BIT(7)

◆ CAN_MCAN_CCCR_TXP

#define CAN_MCAN_CCCR_TXP   BIT(14)

◆ CAN_MCAN_CCCR_UTSU

#define CAN_MCAN_CCCR_UTSU   BIT(10)

◆ CAN_MCAN_CCCR_WMM

#define CAN_MCAN_CCCR_WMM   BIT(11)

◆ CAN_MCAN_CREL

#define CAN_MCAN_CREL   0x000

◆ CAN_MCAN_CREL_DAY

#define CAN_MCAN_CREL_DAY   GENMASK(7, 0)

◆ CAN_MCAN_CREL_MON

#define CAN_MCAN_CREL_MON   GENMASK(15, 8)

◆ CAN_MCAN_CREL_REL

#define CAN_MCAN_CREL_REL   GENMASK(31, 28)

◆ CAN_MCAN_CREL_STEP

#define CAN_MCAN_CREL_STEP   GENMASK(27, 24)

◆ CAN_MCAN_CREL_SUBSTEP

#define CAN_MCAN_CREL_SUBSTEP   GENMASK(23, 20)

◆ CAN_MCAN_CREL_YEAR

#define CAN_MCAN_CREL_YEAR   GENMASK(19, 16)

◆ CAN_MCAN_CUST

#define CAN_MCAN_CUST   0x008

◆ CAN_MCAN_CUST_CUST

#define CAN_MCAN_CUST_CUST   GENMASK(31, 0)

◆ CAN_MCAN_DATA_INITIALIZER

#define CAN_MCAN_DATA_INITIALIZER ( _custom)
Value:
{ \
.custom = _custom, \
}

Initializer for a can_mcan_data struct.

Parameters
_customPointer to custom driver frontend data structure

◆ CAN_MCAN_DBTP

#define CAN_MCAN_DBTP   0x00C

◆ CAN_MCAN_DBTP_DBRP

#define CAN_MCAN_DBTP_DBRP   GENMASK(20, 16)

◆ CAN_MCAN_DBTP_DSJW

#define CAN_MCAN_DBTP_DSJW   GENMASK(3, 0)

◆ CAN_MCAN_DBTP_DTSEG1

#define CAN_MCAN_DBTP_DTSEG1   GENMASK(12, 8)

◆ CAN_MCAN_DBTP_DTSEG2

#define CAN_MCAN_DBTP_DTSEG2   GENMASK(7, 4)

◆ CAN_MCAN_DBTP_TDC

#define CAN_MCAN_DBTP_TDC   BIT(23)

◆ CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG

#define CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG ( node_id)
Value:
BUILD_ASSERT(CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(node_id) <= 128, \
"Maximum Standard filter elements exceeded"); \
BUILD_ASSERT(CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(node_id) <= 64, \
"Maximum Extended filter elements exceeded"); \
BUILD_ASSERT(CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(node_id) <= 64, \
"Maximum Rx FIFO 0 elements exceeded"); \
BUILD_ASSERT(CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(node_id) <= 64, \
"Maximum Rx FIFO 1 elements exceeded"); \
BUILD_ASSERT(CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(node_id) <= 64, \
"Maximum Rx Buffer elements exceeded"); \
BUILD_ASSERT(CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(node_id) <= 32, \
"Maximum Tx Buffer elements exceeded"); \
BUILD_ASSERT(CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(node_id) <= 32, \
"Maximum Tx Buffer elements exceeded");
#define CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(node_id)
Get the number of Rx FIFO 0 elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:460
#define CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(node_id)
Get the number of Rx FIFO 1 elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:469
#define CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(node_id)
Get the number of Tx Buffer elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:496
#define CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(node_id)
Get the number of standard (11-bit) filter elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:442
#define CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(node_id)
Get the number of extended (29-bit) filter elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:451
#define CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(node_id)
Get the number of Tx Event FIFO elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:487
#define CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(node_id)
Get the number of Rx Buffer elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:478

Assert that the Message RAM configuration meets the Bosch M_CAN IP core restrictions.

Parameters
node_idnode identifier

◆ CAN_MCAN_DT_CALLBACKS_DEFINE

#define CAN_MCAN_DT_CALLBACKS_DEFINE ( node_id,
_name )
Value:
#define CAN_MCAN_CALLBACKS_DEFINE(_name, _tx, _std, _ext)
Define Bosch M_CAN TX and RX callbacks.
Definition can_mcan.h:1197

Define Bosch M_CAN TX and RX callbacks.

Parameters
node_idnode identifier
_namecallbacks variable name
See also
CAN_MCAN_CALLBACKS_DEFINE()

◆ CAN_MCAN_DT_CONFIG_GET

#define CAN_MCAN_DT_CONFIG_GET ( node_id,
_custom,
_ops,
_cbs )
Value:
{ \
.common = CAN_DT_DRIVER_CONFIG_GET(node_id, 0, 1000000), \
.ops = _ops, \
.callbacks = _cbs, \
.mram_elements = CAN_MCAN_DT_MRAM_ELEMENTS_GET(node_id), \
.mram_offsets = CAN_MCAN_DT_MRAM_OFFSETS_GET(node_id), \
.mram_size = CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(node_id), \
.custom = _custom, \
}
#define CAN_MCAN_DT_MRAM_ELEMENTS_GET(node_id)
Get an array containing the number of elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:1251
#define CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(node_id)
Get the total size of all Bosch M_CAN Message RAM elements.
Definition can_mcan.h:627
#define CAN_MCAN_DT_MRAM_OFFSETS_GET(node_id)
Get an array containing the base offsets for element in Bosch M_CAN Message RAM.
Definition can_mcan.h:1271

Static initializer for can_mcan_config struct.

Parameters
node_idDevicetree node identifier
_customPointer to custom driver frontend configuration structure
_opsPointer to front-end can_mcan_ops
_cbsPointer to front-end can_mcan_callbacks

◆ CAN_MCAN_DT_CONFIG_INST_GET

#define CAN_MCAN_DT_CONFIG_INST_GET ( inst,
_custom,
_ops,
_cbs )
Value:
CAN_MCAN_DT_CONFIG_GET(DT_DRV_INST(inst), _custom, _ops, _cbs)
#define CAN_MCAN_DT_CONFIG_GET(node_id, _custom, _ops, _cbs)
Static initializer for can_mcan_config struct.
Definition can_mcan.h:1303
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:3806

Static initializer for can_mcan_config struct from DT_DRV_COMPAT instance.

Parameters
instDT_DRV_COMPAT instance number
_customPointer to custom driver frontend configuration structure
_opsPointer to front-end can_mcan_ops
_cbsPointer to front-end can_mcan_callbacks
See also
CAN_MCAN_DT_CONFIG_GET()

◆ CAN_MCAN_DT_INST_BUILD_ASSERT_MRAM_CFG

#define CAN_MCAN_DT_INST_BUILD_ASSERT_MRAM_CFG ( inst)
Value:
#define CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG(node_id)
Assert that the Message RAM configuration meets the Bosch M_CAN IP core restrictions.
Definition can_mcan.h:650

Equivalent to CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
See also
CAN_MCAN_DT_BUILD_ASSERT_MRAM_CFG()

◆ CAN_MCAN_DT_INST_CALLBACKS_DEFINE

#define CAN_MCAN_DT_INST_CALLBACKS_DEFINE ( inst,
_name )
Value:
#define CAN_MCAN_DT_CALLBACKS_DEFINE(node_id, _name)
Define Bosch M_CAN TX and RX callbacks.
Definition can_mcan.h:1216

Equivalent to CAN_MCAN_DT_CALLBACKS_DEFINE(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
_namecallbacks variable name
See also
CAN_MCAN_DT_CALLBACKS_DEFINE()

◆ CAN_MCAN_DT_INST_MCAN_ADDR

#define CAN_MCAN_DT_INST_MCAN_ADDR ( inst)
Value:
#define CAN_MCAN_DT_MCAN_ADDR(node_id)
Get the Bosch M_CAN register base address.
Definition can_mcan.h:579

Equivalent to CAN_MCAN_DT_MCAN_ADDR(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the Bosch M_CAN register base address
See also
CAN_MCAN_DT_MRAM_ADDR()

◆ CAN_MCAN_DT_INST_MRAM_ADDR

#define CAN_MCAN_DT_INST_MRAM_ADDR ( inst)
Value:
#define CAN_MCAN_DT_MRAM_ADDR(node_id)
Get the Bosch M_CAN Message RAM address.
Definition can_mcan.h:604

Equivalent to CAN_MCAN_DT_MRAM_ADDR(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the Bosch M_CAN Message RAM address
See also
CAN_MCAN_DT_MRAM_ADDR()

◆ CAN_MCAN_DT_INST_MRAM_DEFINE

#define CAN_MCAN_DT_INST_MRAM_DEFINE ( inst,
_name )
Value:
#define CAN_MCAN_DT_MRAM_DEFINE(node_id, _name)
Define a RAM buffer for Bosch M_CAN Message RAM.
Definition can_mcan.h:641

Equivalent to CAN_MCAN_DT_MRAM_DEFINE(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
_namebuffer variable name
See also
CAN_MCAN_DT_MRAM_DEFINE()

◆ CAN_MCAN_DT_INST_MRAM_ELEMENTS_SIZE

#define CAN_MCAN_DT_INST_MRAM_ELEMENTS_SIZE ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the total size of all Message RAM elements in bytes
See also
CAN_MCAN_DT_MRAM_ELEMENTS_SIZE()

◆ CAN_MCAN_DT_INST_MRAM_EXT_FILTER_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_EXT_FILTER_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of extended (29-bit) elements
See also
CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_EXT_FILTER_OFFSET

#define CAN_MCAN_DT_INST_MRAM_EXT_FILTER_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET(node_id)
Get the base offset of extended (29-bit) filter elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:513

Equivalent to CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of extended (29-bit) filter elements in bytes
See also
CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_OFFSET

#define CAN_MCAN_DT_INST_MRAM_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_OFFSET(node_id)
Get the Bosch M_CAN Message RAM offset.
Definition can_mcan.h:433

Equivalent to CAN_MCAN_DT_MRAM_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the Message RAM offset in bytes
See also
CAN_MCAN_DT_MRAM_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_RX_BUFFER_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_RX_BUFFER_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of Rx Buffer elements
See also
CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_RX_BUFFER_OFFSET

#define CAN_MCAN_DT_INST_MRAM_RX_BUFFER_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET(node_id)
Get the base offset of Rx Buffer elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:543

Equivalent to CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of Rx Buffer elements in bytes
See also
CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_RX_FIFO0_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_RX_FIFO0_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of Rx FIFO 0 elements
See also
CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_RX_FIFO0_OFFSET

#define CAN_MCAN_DT_INST_MRAM_RX_FIFO0_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET(node_id)
Get the base offset of Rx FIFO 0 elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:523

Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of Rx FIFO 0 elements in bytes
See also
CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_RX_FIFO1_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_RX_FIFO1_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of Rx FIFO 1 elements
See also
CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_RX_FIFO1_OFFSET

#define CAN_MCAN_DT_INST_MRAM_RX_FIFO1_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET(node_id)
Get the base offset of Rx FIFO 1 elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:533

Equivalent to CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of Rx FIFO 1 elements in bytes
See also
CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_SIZE

#define CAN_MCAN_DT_INST_MRAM_SIZE ( inst)
Value:
#define CAN_MCAN_DT_MRAM_SIZE(node_id)
Get the Bosch M_CAN Message RAM size.
Definition can_mcan.h:617

Equivalent to CAN_MCAN_DT_MRAM_SIZE(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the Bosch M_CAN Message RAM size in bytes
See also
CAN_MCAN_DT_MRAM_SIZE()

◆ CAN_MCAN_DT_INST_MRAM_STD_FILTER_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_STD_FILTER_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of standard (11-bit) elements
See also
CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_STD_FILTER_OFFSET

#define CAN_MCAN_DT_INST_MRAM_STD_FILTER_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET(node_id)
Get the base offset of standard (11-bit) filter elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:505

Equivalent to CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of standard (11-bit) filter elements in bytes
See also
CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_TX_BUFFER_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_TX_BUFFER_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of Tx Buffer elements
See also
CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_TX_BUFFER_OFFSET

#define CAN_MCAN_DT_INST_MRAM_TX_BUFFER_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET(node_id)
Get the base offset of Tx Buffer elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:563

Equivalent to CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of Tx Buffer elements in bytes
See also
CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET()

◆ CAN_MCAN_DT_INST_MRAM_TX_EVENT_FIFO_ELEMENTS

#define CAN_MCAN_DT_INST_MRAM_TX_EVENT_FIFO_ELEMENTS ( inst)
Value:

Equivalent to CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the number of Tx Event FIFO elements
See also
CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS()

◆ CAN_MCAN_DT_INST_MRAM_TX_EVENT_FIFO_OFFSET

#define CAN_MCAN_DT_INST_MRAM_TX_EVENT_FIFO_OFFSET ( inst)
Value:
#define CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET(node_id)
Get the base offset of Tx Event FIFO elements in Bosch M_CAN Message RAM.
Definition can_mcan.h:553

Equivalent to CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the base offset of Tx Event FIFO elements in bytes
See also
CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET()

◆ CAN_MCAN_DT_INST_MRBA

#define CAN_MCAN_DT_INST_MRBA ( inst)
Value:
#define CAN_MCAN_DT_MRBA(node_id)
Get the Bosch M_CAN Message RAM base address.
Definition can_mcan.h:592

Equivalent to CAN_MCAN_DT_MRBA(DT_DRV_INST(inst))

Parameters
instDT_DRV_COMPAT instance number
Returns
the Bosch M_CAN Message RAM Base Address (MRBA)
See also
CAN_MCAN_DT_MRBA()

◆ CAN_MCAN_DT_MCAN_ADDR

#define CAN_MCAN_DT_MCAN_ADDR ( node_id)
Value:
COND_CODE_1(DT_NUM_REGS(node_id), ((mm_reg_t)DT_REG_ADDR(node_id)), \
((mm_reg_t)DT_REG_ADDR_BY_NAME(node_id, m_can)))
#define DT_NUM_REGS(node_id)
Get the number of register blocks in the reg property.
Definition devicetree.h:2349
#define DT_REG_ADDR(node_id)
Get a node's (only) register block address.
Definition devicetree.h:2437
#define DT_REG_ADDR_BY_NAME(node_id, name)
Get a register block's base address by name.
Definition devicetree.h:2466
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:195
uintptr_t mm_reg_t
Definition sys_io.h:20

Get the Bosch M_CAN register base address.

For devicetree nodes with just one register block, this macro returns the base address of that register block.

If a devicetree node has more than one register block, this macros returns the base address of the register block named "m_can".

Parameters
node_idnode identifier
Returns
the Bosch M_CAN register base address

◆ CAN_MCAN_DT_MRAM_ADDR

#define CAN_MCAN_DT_MRAM_ADDR ( node_id)
Value:
uintptr_t mem_addr_t
Definition sys_io.h:21

Get the Bosch M_CAN Message RAM address.

For devicetree nodes with dedicated Message RAM area defined via devicetree, this macro returns the address of the Message RAM, taking in the Message RAM offset into account.

Parameters
node_idnode identifier
Returns
the Bosch M_CAN Message RAM address

◆ CAN_MCAN_DT_MRAM_DEFINE

#define CAN_MCAN_DT_MRAM_DEFINE ( node_id,
_name )
Value:
BUILD_ASSERT(CAN_MCAN_DT_MRAM_OFFSET(node_id) == 0, "offset must be 0"); \
static char __nocache_noinit __aligned(4) _name[CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(node_id)];

Define a RAM buffer for Bosch M_CAN Message RAM.

For devicetree nodes without dedicated Message RAM area, this macro defines a suitable RAM buffer to hold the Message RAM elements. Since this buffer cannot be shared between multiple Bosch M_CAN instances, the Message RAM offset must be set to 0x0.

Parameters
node_idnode identifier
_namebuffer variable name

◆ CAN_MCAN_DT_MRAM_ELEMENTS_GET

#define CAN_MCAN_DT_MRAM_ELEMENTS_GET ( node_id)
Value:
{ \
0, /* offset cell */ \
CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(node_id), \
CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(node_id), \
CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(node_id), \
CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(node_id), \
CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(node_id), \
CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(node_id), \
CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(node_id) \
}

Get an array containing the number of elements in Bosch M_CAN Message RAM.

The order of the array entries is given by the CAN_MCAN_MRAM_CFG definitions.

Parameters
node_idnode identifier
Returns
array of number of elements

◆ CAN_MCAN_DT_MRAM_ELEMENTS_SIZE

#define CAN_MCAN_DT_MRAM_ELEMENTS_SIZE ( node_id)
Value:
CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS(node_id) * sizeof(struct can_mcan_tx_buffer))
Bosch M_CAN Tx Buffer Element.
Definition can_mcan.h:978

Get the total size of all Bosch M_CAN Message RAM elements.

Parameters
node_idnode identifier
Returns
the total size of all Message RAM elements in bytes
See also
CAN_MCAN_DT_MRAM_SIZE()

◆ CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS

#define CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_EXT_FILTER)
#define CAN_MCAN_MRAM_CFG_EXT_FILTER
ext-filter-elements cell index
Definition can_mcan.h:411
#define DT_PROP_BY_IDX(node_id, prop, idx)
Get the value at index idx in an array type property.
Definition devicetree.h:895

Get the number of extended (29-bit) filter elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of extended (29-bit) filter elements

◆ CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET

#define CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET ( node_id)
Value:
CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS(node_id) * sizeof(struct can_mcan_std_filter))
Bosch M_CAN Standard Message ID Filter Element.
Definition can_mcan.h:1033

Get the base offset of extended (29-bit) filter elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of extended (29-bit) filter elements in bytes

◆ CAN_MCAN_DT_MRAM_OFFSET

#define CAN_MCAN_DT_MRAM_OFFSET ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_OFFSET)
#define CAN_MCAN_MRAM_CFG_OFFSET
offset cell index
Definition can_mcan.h:407

Get the Bosch M_CAN Message RAM offset.

Parameters
node_idnode identifier
Returns
the Message RAM offset in bytes

◆ CAN_MCAN_DT_MRAM_OFFSETS_GET

#define CAN_MCAN_DT_MRAM_OFFSETS_GET ( node_id)
Value:
{ \
0, /* offset cell */ \
CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET(node_id), \
CAN_MCAN_DT_MRAM_EXT_FILTER_OFFSET(node_id), \
CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET(node_id), \
CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET(node_id), \
CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET(node_id), \
CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET(node_id), \
CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET(node_id) \
}

Get an array containing the base offsets for element in Bosch M_CAN Message RAM.

The order of the array entries is given by the CAN_MCAN_MRAM_CFG definitions.

Parameters
node_idnode identifier
Returns
array of base offsets for elements

◆ CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS

#define CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_RX_BUFFER)
#define CAN_MCAN_MRAM_CFG_RX_BUFFER
rx-buffer-elements cell index
Definition can_mcan.h:417

Get the number of Rx Buffer elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of Rx Buffer elements

◆ CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET

#define CAN_MCAN_DT_MRAM_RX_BUFFER_OFFSET ( node_id)
Value:
CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS(node_id) * sizeof(struct can_mcan_rx_fifo))
Bosch M_CAN Rx Buffer and FIFO Element.
Definition can_mcan.h:937

Get the base offset of Rx Buffer elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of Rx Buffer elements in bytes

◆ CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS

#define CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_RX_FIFO0)
#define CAN_MCAN_MRAM_CFG_RX_FIFO0
rx-fifo0-elements cell index
Definition can_mcan.h:413

Get the number of Rx FIFO 0 elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of Rx FIFO 0 elements

◆ CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET

#define CAN_MCAN_DT_MRAM_RX_FIFO0_OFFSET ( node_id)
Value:
CAN_MCAN_DT_MRAM_EXT_FILTER_ELEMENTS(node_id) * sizeof(struct can_mcan_ext_filter))
Bosch M_CAN Extended Message ID Filter Element.
Definition can_mcan.h:1052

Get the base offset of Rx FIFO 0 elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of Rx FIFO 0 elements in bytes

◆ CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS

#define CAN_MCAN_DT_MRAM_RX_FIFO1_ELEMENTS ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_RX_FIFO1)
#define CAN_MCAN_MRAM_CFG_RX_FIFO1
rx-fifo1-elements cell index
Definition can_mcan.h:415

Get the number of Rx FIFO 1 elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of Rx FIFO 1 elements

◆ CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET

#define CAN_MCAN_DT_MRAM_RX_FIFO1_OFFSET ( node_id)
Value:
CAN_MCAN_DT_MRAM_RX_FIFO0_ELEMENTS(node_id) * sizeof(struct can_mcan_rx_fifo))

Get the base offset of Rx FIFO 1 elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of Rx FIFO 1 elements in bytes

◆ CAN_MCAN_DT_MRAM_SIZE

#define CAN_MCAN_DT_MRAM_SIZE ( node_id)
Value:
(mem_addr_t)(DT_REG_SIZE_BY_NAME(node_id, message_ram) - CAN_MCAN_DT_MRAM_OFFSET(node_id))
#define DT_REG_SIZE_BY_NAME(node_id, name)
Get a register block's size by name.
Definition devicetree.h:2502

Get the Bosch M_CAN Message RAM size.

For devicetree nodes with dedicated Message RAM area defined via devicetree, this macro returns the size of the Message RAM, taking in the Message RAM offset into account.

Parameters
node_idnode identifier
Returns
the Bosch M_CAN Message RAM base address
See also
CAN_MCAN_DT_MRAM_ELEMENTS_SIZE()

◆ CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS

#define CAN_MCAN_DT_MRAM_STD_FILTER_ELEMENTS ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_STD_FILTER)
#define CAN_MCAN_MRAM_CFG_STD_FILTER
std-filter-elements cell index
Definition can_mcan.h:409

Get the number of standard (11-bit) filter elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of standard (11-bit) filter elements

◆ CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET

#define CAN_MCAN_DT_MRAM_STD_FILTER_OFFSET ( node_id)
Value:
(0U)

Get the base offset of standard (11-bit) filter elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of standard (11-bit) filter elements in bytes

◆ CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS

#define CAN_MCAN_DT_MRAM_TX_BUFFER_ELEMENTS ( node_id)
Value:
DT_PROP_BY_IDX(node_id, bosch_mram_cfg, CAN_MCAN_MRAM_CFG_TX_BUFFER)
#define CAN_MCAN_MRAM_CFG_TX_BUFFER
tx-buffer-elements cell index
Definition can_mcan.h:421

Get the number of Tx Buffer elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of Tx Buffer elements

◆ CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET

#define CAN_MCAN_DT_MRAM_TX_BUFFER_OFFSET ( node_id)
Value:
CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS(node_id) * sizeof(struct can_mcan_tx_event_fifo))
Bosch M_CAN Tx Event FIFO Element.
Definition can_mcan.h:991

Get the base offset of Tx Buffer elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of Tx Buffer elements in bytes

◆ CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS

#define CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_ELEMENTS ( node_id)
Value:
#define CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO
tx-event-fifo-elements cell index
Definition can_mcan.h:419

Get the number of Tx Event FIFO elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the number of Tx Event FIFO elements

◆ CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET

#define CAN_MCAN_DT_MRAM_TX_EVENT_FIFO_OFFSET ( node_id)
Value:
CAN_MCAN_DT_MRAM_RX_BUFFER_ELEMENTS(node_id) * sizeof(struct can_mcan_rx_fifo))

Get the base offset of Tx Event FIFO elements in Bosch M_CAN Message RAM.

Parameters
node_idnode identifier
Returns
the base offset of Tx Event FIFO elements in bytes

◆ CAN_MCAN_DT_MRBA

#define CAN_MCAN_DT_MRBA ( node_id)
Value:
(mem_addr_t)DT_REG_ADDR_BY_NAME(node_id, message_ram)

Get the Bosch M_CAN Message RAM base address.

For devicetree nodes with dedicated Message RAM area defined via devicetree, this macro returns the base address of the Message RAM.

Parameters
node_idnode identifier
Returns
the Bosch M_CAN Message RAM base address (MRBA)

◆ CAN_MCAN_ECR

#define CAN_MCAN_ECR   0x040

◆ CAN_MCAN_ECR_CEL

#define CAN_MCAN_ECR_CEL   GENMASK(23, 16)

◆ CAN_MCAN_ECR_REC

#define CAN_MCAN_ECR_REC   GENMASK(14, 8)

◆ CAN_MCAN_ECR_RP

#define CAN_MCAN_ECR_RP   BIT(15)

◆ CAN_MCAN_ECR_TEC

#define CAN_MCAN_ECR_TEC   GENMASK(7, 0)

◆ CAN_MCAN_EFT_CLASSIC

#define CAN_MCAN_EFT_CLASSIC   0x2

◆ CAN_MCAN_EFT_DUAL

#define CAN_MCAN_EFT_DUAL   0x1

◆ CAN_MCAN_EFT_RANGE

#define CAN_MCAN_EFT_RANGE   0x3

◆ CAN_MCAN_EFT_RANGE_XIDAM

#define CAN_MCAN_EFT_RANGE_XIDAM   0x0

◆ CAN_MCAN_ENDN

#define CAN_MCAN_ENDN   0x004

◆ CAN_MCAN_ENDN_ETV

#define CAN_MCAN_ENDN_ETV   GENMASK(31, 0)

◆ CAN_MCAN_GFC

#define CAN_MCAN_GFC   0x080

◆ CAN_MCAN_GFC_ANFE

#define CAN_MCAN_GFC_ANFE   GENMASK(3, 2)

◆ CAN_MCAN_GFC_ANFS

#define CAN_MCAN_GFC_ANFS   GENMASK(5, 4)

◆ CAN_MCAN_GFC_RRFE

#define CAN_MCAN_GFC_RRFE   BIT(0)

◆ CAN_MCAN_GFC_RRFS

#define CAN_MCAN_GFC_RRFS   BIT(1)

◆ CAN_MCAN_HPMS

#define CAN_MCAN_HPMS   0x094

◆ CAN_MCAN_HPMS_BIDX

#define CAN_MCAN_HPMS_BIDX   GENMASK(5, 0)

◆ CAN_MCAN_HPMS_FIDX

#define CAN_MCAN_HPMS_FIDX   GENMASK(14, 8)

◆ CAN_MCAN_HPMS_FLST

#define CAN_MCAN_HPMS_FLST   BIT(15)

◆ CAN_MCAN_HPMS_MSI

#define CAN_MCAN_HPMS_MSI   GENMASK(7, 6)

◆ CAN_MCAN_IE

#define CAN_MCAN_IE   0x054

◆ CAN_MCAN_IE_ARAE

#define CAN_MCAN_IE_ARAE   BIT(29)

◆ CAN_MCAN_IE_BECE

#define CAN_MCAN_IE_BECE   BIT(20)

◆ CAN_MCAN_IE_BEUE

#define CAN_MCAN_IE_BEUE   BIT(21)

◆ CAN_MCAN_IE_BOE

#define CAN_MCAN_IE_BOE   BIT(25)

◆ CAN_MCAN_IE_DRXE

#define CAN_MCAN_IE_DRXE   BIT(19)

◆ CAN_MCAN_IE_ELOE

#define CAN_MCAN_IE_ELOE   BIT(22)

◆ CAN_MCAN_IE_EPE

#define CAN_MCAN_IE_EPE   BIT(23)

◆ CAN_MCAN_IE_EWE

#define CAN_MCAN_IE_EWE   BIT(24)

◆ CAN_MCAN_IE_HPME

#define CAN_MCAN_IE_HPME   BIT(8)

◆ CAN_MCAN_IE_MRAFE

#define CAN_MCAN_IE_MRAFE   BIT(17)

◆ CAN_MCAN_IE_PEAE

#define CAN_MCAN_IE_PEAE   BIT(27)

◆ CAN_MCAN_IE_PEDE

#define CAN_MCAN_IE_PEDE   BIT(28)

◆ CAN_MCAN_IE_RF0FE

#define CAN_MCAN_IE_RF0FE   BIT(2)

◆ CAN_MCAN_IE_RF0LE

#define CAN_MCAN_IE_RF0LE   BIT(3)

◆ CAN_MCAN_IE_RF0NE

#define CAN_MCAN_IE_RF0NE   BIT(0)

◆ CAN_MCAN_IE_RF0WE

#define CAN_MCAN_IE_RF0WE   BIT(1)

◆ CAN_MCAN_IE_RF1FE

#define CAN_MCAN_IE_RF1FE   BIT(6)

◆ CAN_MCAN_IE_RF1LE

#define CAN_MCAN_IE_RF1LE   BIT(7)

◆ CAN_MCAN_IE_RF1NE

#define CAN_MCAN_IE_RF1NE   BIT(4)

◆ CAN_MCAN_IE_RF1WE

#define CAN_MCAN_IE_RF1WE   BIT(5)

◆ CAN_MCAN_IE_TCE

#define CAN_MCAN_IE_TCE   BIT(9)

◆ CAN_MCAN_IE_TCFE

#define CAN_MCAN_IE_TCFE   BIT(10)

◆ CAN_MCAN_IE_TEFFE

#define CAN_MCAN_IE_TEFFE   BIT(14)

◆ CAN_MCAN_IE_TEFLE

#define CAN_MCAN_IE_TEFLE   BIT(15)

◆ CAN_MCAN_IE_TEFNE

#define CAN_MCAN_IE_TEFNE   BIT(12)

◆ CAN_MCAN_IE_TEFWE

#define CAN_MCAN_IE_TEFWE   BIT(13)

◆ CAN_MCAN_IE_TFEE

#define CAN_MCAN_IE_TFEE   BIT(11)

◆ CAN_MCAN_IE_TOOE

#define CAN_MCAN_IE_TOOE   BIT(18)

◆ CAN_MCAN_IE_TSWE

#define CAN_MCAN_IE_TSWE   BIT(16)

◆ CAN_MCAN_IE_WDIE

#define CAN_MCAN_IE_WDIE   BIT(26)

◆ CAN_MCAN_ILE

#define CAN_MCAN_ILE   0x05C

◆ CAN_MCAN_ILE_EINT0

#define CAN_MCAN_ILE_EINT0   BIT(0)

◆ CAN_MCAN_ILE_EINT1

#define CAN_MCAN_ILE_EINT1   BIT(1)

◆ CAN_MCAN_ILS

#define CAN_MCAN_ILS   0x058

◆ CAN_MCAN_ILS_ARAL

#define CAN_MCAN_ILS_ARAL   BIT(29)

◆ CAN_MCAN_ILS_BECL

#define CAN_MCAN_ILS_BECL   BIT(20)

◆ CAN_MCAN_ILS_BEUL

#define CAN_MCAN_ILS_BEUL   BIT(21)

◆ CAN_MCAN_ILS_BOL

#define CAN_MCAN_ILS_BOL   BIT(25)

◆ CAN_MCAN_ILS_DRXL

#define CAN_MCAN_ILS_DRXL   BIT(19)

◆ CAN_MCAN_ILS_ELOL

#define CAN_MCAN_ILS_ELOL   BIT(22)

◆ CAN_MCAN_ILS_EPL

#define CAN_MCAN_ILS_EPL   BIT(23)

◆ CAN_MCAN_ILS_EWL

#define CAN_MCAN_ILS_EWL   BIT(24)

◆ CAN_MCAN_ILS_HPML

#define CAN_MCAN_ILS_HPML   BIT(8)

◆ CAN_MCAN_ILS_MRAFL

#define CAN_MCAN_ILS_MRAFL   BIT(17)

◆ CAN_MCAN_ILS_PEAL

#define CAN_MCAN_ILS_PEAL   BIT(27)

◆ CAN_MCAN_ILS_PEDL

#define CAN_MCAN_ILS_PEDL   BIT(28)

◆ CAN_MCAN_ILS_RF0FL

#define CAN_MCAN_ILS_RF0FL   BIT(2)

◆ CAN_MCAN_ILS_RF0LL

#define CAN_MCAN_ILS_RF0LL   BIT(3)

◆ CAN_MCAN_ILS_RF0NL

#define CAN_MCAN_ILS_RF0NL   BIT(0)

◆ CAN_MCAN_ILS_RF0WL

#define CAN_MCAN_ILS_RF0WL   BIT(1)

◆ CAN_MCAN_ILS_RF1FL

#define CAN_MCAN_ILS_RF1FL   BIT(6)

◆ CAN_MCAN_ILS_RF1LL

#define CAN_MCAN_ILS_RF1LL   BIT(7)

◆ CAN_MCAN_ILS_RF1NL

#define CAN_MCAN_ILS_RF1NL   BIT(4)

◆ CAN_MCAN_ILS_RF1WL

#define CAN_MCAN_ILS_RF1WL   BIT(5)

◆ CAN_MCAN_ILS_TCFL

#define CAN_MCAN_ILS_TCFL   BIT(10)

◆ CAN_MCAN_ILS_TCL

#define CAN_MCAN_ILS_TCL   BIT(9)

◆ CAN_MCAN_ILS_TEFFL

#define CAN_MCAN_ILS_TEFFL   BIT(14)

◆ CAN_MCAN_ILS_TEFLL

#define CAN_MCAN_ILS_TEFLL   BIT(15)

◆ CAN_MCAN_ILS_TEFNL

#define CAN_MCAN_ILS_TEFNL   BIT(12)

◆ CAN_MCAN_ILS_TEFWL

#define CAN_MCAN_ILS_TEFWL   BIT(13)

◆ CAN_MCAN_ILS_TFEL

#define CAN_MCAN_ILS_TFEL   BIT(11)

◆ CAN_MCAN_ILS_TOOL

#define CAN_MCAN_ILS_TOOL   BIT(18)

◆ CAN_MCAN_ILS_TSWL

#define CAN_MCAN_ILS_TSWL   BIT(16)

◆ CAN_MCAN_ILS_WDIL

#define CAN_MCAN_ILS_WDIL   BIT(26)

◆ CAN_MCAN_IR

#define CAN_MCAN_IR   0x050

◆ CAN_MCAN_IR_ARA

#define CAN_MCAN_IR_ARA   BIT(29)

◆ CAN_MCAN_IR_BEC

#define CAN_MCAN_IR_BEC   BIT(20)

◆ CAN_MCAN_IR_BEU

#define CAN_MCAN_IR_BEU   BIT(21)

◆ CAN_MCAN_IR_BO

#define CAN_MCAN_IR_BO   BIT(25)

◆ CAN_MCAN_IR_DRX

#define CAN_MCAN_IR_DRX   BIT(19)

◆ CAN_MCAN_IR_ELO

#define CAN_MCAN_IR_ELO   BIT(22)

◆ CAN_MCAN_IR_EP

#define CAN_MCAN_IR_EP   BIT(23)

◆ CAN_MCAN_IR_EW

#define CAN_MCAN_IR_EW   BIT(24)

◆ CAN_MCAN_IR_HPM

#define CAN_MCAN_IR_HPM   BIT(8)

◆ CAN_MCAN_IR_MRAF

#define CAN_MCAN_IR_MRAF   BIT(17)

◆ CAN_MCAN_IR_PEA

#define CAN_MCAN_IR_PEA   BIT(27)

◆ CAN_MCAN_IR_PED

#define CAN_MCAN_IR_PED   BIT(28)

◆ CAN_MCAN_IR_RF0F

#define CAN_MCAN_IR_RF0F   BIT(2)

◆ CAN_MCAN_IR_RF0L

#define CAN_MCAN_IR_RF0L   BIT(3)

◆ CAN_MCAN_IR_RF0N

#define CAN_MCAN_IR_RF0N   BIT(0)

◆ CAN_MCAN_IR_RF0W

#define CAN_MCAN_IR_RF0W   BIT(1)

◆ CAN_MCAN_IR_RF1F

#define CAN_MCAN_IR_RF1F   BIT(6)

◆ CAN_MCAN_IR_RF1L

#define CAN_MCAN_IR_RF1L   BIT(7)

◆ CAN_MCAN_IR_RF1N

#define CAN_MCAN_IR_RF1N   BIT(4)

◆ CAN_MCAN_IR_RF1W

#define CAN_MCAN_IR_RF1W   BIT(5)

◆ CAN_MCAN_IR_TC

#define CAN_MCAN_IR_TC   BIT(9)

◆ CAN_MCAN_IR_TCF

#define CAN_MCAN_IR_TCF   BIT(10)

◆ CAN_MCAN_IR_TEFF

#define CAN_MCAN_IR_TEFF   BIT(14)

◆ CAN_MCAN_IR_TEFL

#define CAN_MCAN_IR_TEFL   BIT(15)

◆ CAN_MCAN_IR_TEFN

#define CAN_MCAN_IR_TEFN   BIT(12)

◆ CAN_MCAN_IR_TEFW

#define CAN_MCAN_IR_TEFW   BIT(13)

◆ CAN_MCAN_IR_TFE

#define CAN_MCAN_IR_TFE   BIT(11)

◆ CAN_MCAN_IR_TOO

#define CAN_MCAN_IR_TOO   BIT(18)

◆ CAN_MCAN_IR_TSW

#define CAN_MCAN_IR_TSW   BIT(16)

◆ CAN_MCAN_IR_WDI

#define CAN_MCAN_IR_WDI   BIT(26)

◆ CAN_MCAN_MRAM_CFG_EXT_FILTER

#define CAN_MCAN_MRAM_CFG_EXT_FILTER   2

ext-filter-elements cell index

◆ CAN_MCAN_MRAM_CFG_NUM_CELLS

#define CAN_MCAN_MRAM_CFG_NUM_CELLS   8

Total number of cells in bosch,mram-cfg property.

◆ CAN_MCAN_MRAM_CFG_OFFSET

#define CAN_MCAN_MRAM_CFG_OFFSET   0

offset cell index

◆ CAN_MCAN_MRAM_CFG_RX_BUFFER

#define CAN_MCAN_MRAM_CFG_RX_BUFFER   5

rx-buffer-elements cell index

◆ CAN_MCAN_MRAM_CFG_RX_FIFO0

#define CAN_MCAN_MRAM_CFG_RX_FIFO0   3

rx-fifo0-elements cell index

◆ CAN_MCAN_MRAM_CFG_RX_FIFO1

#define CAN_MCAN_MRAM_CFG_RX_FIFO1   4

rx-fifo1-elements cell index

◆ CAN_MCAN_MRAM_CFG_STD_FILTER

#define CAN_MCAN_MRAM_CFG_STD_FILTER   1

std-filter-elements cell index

◆ CAN_MCAN_MRAM_CFG_TX_BUFFER

#define CAN_MCAN_MRAM_CFG_TX_BUFFER   7

tx-buffer-elements cell index

◆ CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO

#define CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO   6

tx-event-fifo-elements cell index

◆ CAN_MCAN_NBTP

#define CAN_MCAN_NBTP   0x01C

◆ CAN_MCAN_NBTP_NBRP

#define CAN_MCAN_NBTP_NBRP   GENMASK(24, 16)

◆ CAN_MCAN_NBTP_NSJW

#define CAN_MCAN_NBTP_NSJW   GENMASK(31, 25)

◆ CAN_MCAN_NBTP_NTSEG1

#define CAN_MCAN_NBTP_NTSEG1   GENMASK(15, 8)

◆ CAN_MCAN_NBTP_NTSEG2

#define CAN_MCAN_NBTP_NTSEG2   GENMASK(6, 0)

◆ CAN_MCAN_NDAT1

#define CAN_MCAN_NDAT1   0x098

◆ CAN_MCAN_NDAT1_ND

#define CAN_MCAN_NDAT1_ND   GENMASK(31, 0)

◆ CAN_MCAN_NDAT2

#define CAN_MCAN_NDAT2   0x09C

◆ CAN_MCAN_NDAT2_ND

#define CAN_MCAN_NDAT2_ND   GENMASK(31, 0)

◆ CAN_MCAN_PSR

#define CAN_MCAN_PSR   0x044

◆ CAN_MCAN_PSR_ACT

#define CAN_MCAN_PSR_ACT   GENMASK(4, 3)

◆ CAN_MCAN_PSR_BO

#define CAN_MCAN_PSR_BO   BIT(7)

◆ CAN_MCAN_PSR_DLEC

#define CAN_MCAN_PSR_DLEC   GENMASK(10, 8)

◆ CAN_MCAN_PSR_EP

#define CAN_MCAN_PSR_EP   BIT(5)

◆ CAN_MCAN_PSR_EW

#define CAN_MCAN_PSR_EW   BIT(6)

◆ CAN_MCAN_PSR_LEC

#define CAN_MCAN_PSR_LEC   GENMASK(2, 0)

◆ CAN_MCAN_PSR_PXE

#define CAN_MCAN_PSR_PXE   BIT(14)

◆ CAN_MCAN_PSR_RBRS

#define CAN_MCAN_PSR_RBRS   BIT(12)

◆ CAN_MCAN_PSR_RESI

#define CAN_MCAN_PSR_RESI   BIT(11)

◆ CAN_MCAN_PSR_RFDF

#define CAN_MCAN_PSR_RFDF   BIT(13)

◆ CAN_MCAN_PSR_TDCV

#define CAN_MCAN_PSR_TDCV   GENMASK(22, 16)

◆ CAN_MCAN_RWD

#define CAN_MCAN_RWD   0x014

◆ CAN_MCAN_RWD_WDC

#define CAN_MCAN_RWD_WDC   GENMASK(7, 0)

◆ CAN_MCAN_RWD_WDV

#define CAN_MCAN_RWD_WDV   GENMASK(15, 8)

◆ CAN_MCAN_RXBC

#define CAN_MCAN_RXBC   0x0AC

◆ CAN_MCAN_RXBC_RBSA

#define CAN_MCAN_RXBC_RBSA   GENMASK(15, 2)

◆ CAN_MCAN_RXESC

#define CAN_MCAN_RXESC   0x0BC

◆ CAN_MCAN_RXESC_F0DS

#define CAN_MCAN_RXESC_F0DS   GENMASK(2, 0)

◆ CAN_MCAN_RXESC_F1DS

#define CAN_MCAN_RXESC_F1DS   GENMASK(6, 4)

◆ CAN_MCAN_RXESC_RBDS

#define CAN_MCAN_RXESC_RBDS   GENMASK(10, 8)

◆ CAN_MCAN_RXF0A

#define CAN_MCAN_RXF0A   0x0A8

◆ CAN_MCAN_RXF0A_F0AI

#define CAN_MCAN_RXF0A_F0AI   GENMASK(5, 0)

◆ CAN_MCAN_RXF0C

#define CAN_MCAN_RXF0C   0x0A0

◆ CAN_MCAN_RXF0C_F0OM

#define CAN_MCAN_RXF0C_F0OM   BIT(31)

◆ CAN_MCAN_RXF0C_F0S

#define CAN_MCAN_RXF0C_F0S   GENMASK(22, 16)

◆ CAN_MCAN_RXF0C_F0SA

#define CAN_MCAN_RXF0C_F0SA   GENMASK(15, 2)

◆ CAN_MCAN_RXF0C_F0WM

#define CAN_MCAN_RXF0C_F0WM   GENMASK(30, 24)

◆ CAN_MCAN_RXF0S

#define CAN_MCAN_RXF0S   0x0A4

◆ CAN_MCAN_RXF0S_F0F

#define CAN_MCAN_RXF0S_F0F   BIT(24)

◆ CAN_MCAN_RXF0S_F0FL

#define CAN_MCAN_RXF0S_F0FL   GENMASK(6, 0)

◆ CAN_MCAN_RXF0S_F0GI

#define CAN_MCAN_RXF0S_F0GI   GENMASK(13, 8)

◆ CAN_MCAN_RXF0S_F0PI

#define CAN_MCAN_RXF0S_F0PI   GENMASK(21, 16)

◆ CAN_MCAN_RXF0S_RF0L

#define CAN_MCAN_RXF0S_RF0L   BIT(25)

◆ CAN_MCAN_RXF1A

#define CAN_MCAN_RXF1A   0x0B8

◆ CAN_MCAN_RXF1A_F1AI

#define CAN_MCAN_RXF1A_F1AI   GENMASK(5, 0)

◆ CAN_MCAN_RXF1C

#define CAN_MCAN_RXF1C   0x0B0

◆ CAN_MCAN_RXF1C_F1OM

#define CAN_MCAN_RXF1C_F1OM   BIT(31)

◆ CAN_MCAN_RXF1C_F1S

#define CAN_MCAN_RXF1C_F1S   GENMASK(22, 16)

◆ CAN_MCAN_RXF1C_F1SA

#define CAN_MCAN_RXF1C_F1SA   GENMASK(15, 2)

◆ CAN_MCAN_RXF1C_F1WM

#define CAN_MCAN_RXF1C_F1WM   GENMASK(30, 24)

◆ CAN_MCAN_RXF1S

#define CAN_MCAN_RXF1S   0x0B4

◆ CAN_MCAN_RXF1S_F1F

#define CAN_MCAN_RXF1S_F1F   BIT(24)

◆ CAN_MCAN_RXF1S_F1FL

#define CAN_MCAN_RXF1S_F1FL   GENMASK(6, 0)

◆ CAN_MCAN_RXF1S_F1GI

#define CAN_MCAN_RXF1S_F1GI   GENMASK(13, 8)

◆ CAN_MCAN_RXF1S_F1PI

#define CAN_MCAN_RXF1S_F1PI   GENMASK(21, 16)

◆ CAN_MCAN_RXF1S_RF1L

#define CAN_MCAN_RXF1S_RF1L   BIT(25)

◆ CAN_MCAN_SFT_CLASSIC

#define CAN_MCAN_SFT_CLASSIC   0x2

◆ CAN_MCAN_SFT_DISABLED

#define CAN_MCAN_SFT_DISABLED   0x3

◆ CAN_MCAN_SFT_DUAL

#define CAN_MCAN_SFT_DUAL   0x1

◆ CAN_MCAN_SFT_RANGE

#define CAN_MCAN_SFT_RANGE   0x0

◆ CAN_MCAN_SIDFC

#define CAN_MCAN_SIDFC   0x084

◆ CAN_MCAN_SIDFC_FLSSA

#define CAN_MCAN_SIDFC_FLSSA   GENMASK(15, 2)

◆ CAN_MCAN_SIDFC_LSS

#define CAN_MCAN_SIDFC_LSS   GENMASK(23, 16)

◆ CAN_MCAN_TDCR

#define CAN_MCAN_TDCR   0x048

◆ CAN_MCAN_TDCR_TDCF

#define CAN_MCAN_TDCR_TDCF   GENMASK(6, 0)

◆ CAN_MCAN_TDCR_TDCO

#define CAN_MCAN_TDCR_TDCO   GENMASK(14, 8)

◆ CAN_MCAN_TEST

#define CAN_MCAN_TEST   0x010

◆ CAN_MCAN_TEST_LBCK

#define CAN_MCAN_TEST_LBCK   BIT(4)

◆ CAN_MCAN_TEST_PVAL

#define CAN_MCAN_TEST_PVAL   BIT(13)

◆ CAN_MCAN_TEST_RX

#define CAN_MCAN_TEST_RX   BIT(7)

◆ CAN_MCAN_TEST_SVAL

#define CAN_MCAN_TEST_SVAL   BIT(21)

◆ CAN_MCAN_TEST_TX

#define CAN_MCAN_TEST_TX   GENMASK(6, 5)

◆ CAN_MCAN_TEST_TXBNP

#define CAN_MCAN_TEST_TXBNP   GENMASK(12, 8)

◆ CAN_MCAN_TEST_TXBNS

#define CAN_MCAN_TEST_TXBNS   GENMASK(20, 16)

◆ CAN_MCAN_TIMING_DATA_MAX_INITIALIZER

#define CAN_MCAN_TIMING_DATA_MAX_INITIALIZER
Value:
{ \
.sjw = 16, \
.prop_seg = 0, \
.phase_seg1 = 32, \
.phase_seg2 = 16, \
.prescaler = 32 \
}

Bosch M_CAN specific static initializer for a maximum data phase can_timing struct.

◆ CAN_MCAN_TIMING_DATA_MIN_INITIALIZER

#define CAN_MCAN_TIMING_DATA_MIN_INITIALIZER
Value:
{ \
.sjw = 1, \
.prop_seg = 0, \
.phase_seg1 = 1, \
.phase_seg2 = 1, \
.prescaler = 1 \
}

Bosch M_CAN specific static initializer for a minimum data phase can_timing struct.

◆ CAN_MCAN_TIMING_MAX_INITIALIZER

#define CAN_MCAN_TIMING_MAX_INITIALIZER
Value:
{ \
.sjw = 128, \
.prop_seg = 0, \
.phase_seg1 = 256, \
.phase_seg2 = 128, \
.prescaler = 512 \
}

Bosch M_CAN specific static initializer for a maximum nominal can_timing struct.

◆ CAN_MCAN_TIMING_MIN_INITIALIZER

#define CAN_MCAN_TIMING_MIN_INITIALIZER
Value:
{ \
.sjw = 1, \
.prop_seg = 0, \
.phase_seg1 = 2, \
.phase_seg2 = 2, \
.prescaler = 1 \
}

Bosch M_CAN specific static initializer for a minimum nominal can_timing struct.

◆ CAN_MCAN_TOCC

#define CAN_MCAN_TOCC   0x028

◆ CAN_MCAN_TOCC_ETOC

#define CAN_MCAN_TOCC_ETOC   BIT(1)

◆ CAN_MCAN_TOCC_TOP

#define CAN_MCAN_TOCC_TOP   GENMASK(31, 16)

◆ CAN_MCAN_TOCC_TOS

#define CAN_MCAN_TOCC_TOS   GENMASK(2, 1)

◆ CAN_MCAN_TOCV

#define CAN_MCAN_TOCV   0x02C

◆ CAN_MCAN_TOCV_TOC

#define CAN_MCAN_TOCV_TOC   GENMASK(15, 0)

◆ CAN_MCAN_TSCC

#define CAN_MCAN_TSCC   0x020

◆ CAN_MCAN_TSCC_TCP

#define CAN_MCAN_TSCC_TCP   GENMASK(19, 16)

◆ CAN_MCAN_TSCC_TSS

#define CAN_MCAN_TSCC_TSS   GENMASK(1, 0)

◆ CAN_MCAN_TSCV

#define CAN_MCAN_TSCV   0x024

◆ CAN_MCAN_TSCV_TSC

#define CAN_MCAN_TSCV_TSC   GENMASK(15, 0)

◆ CAN_MCAN_TXBAR

#define CAN_MCAN_TXBAR   0x0D0

◆ CAN_MCAN_TXBAR_AR

#define CAN_MCAN_TXBAR_AR   GENMASK(31, 0)

◆ CAN_MCAN_TXBC

#define CAN_MCAN_TXBC   0x0C0

◆ CAN_MCAN_TXBC_NDTB

#define CAN_MCAN_TXBC_NDTB   GENMASK(21, 16)

◆ CAN_MCAN_TXBC_TBSA

#define CAN_MCAN_TXBC_TBSA   GENMASK(15, 2)

◆ CAN_MCAN_TXBC_TFQM

#define CAN_MCAN_TXBC_TFQM   BIT(30)

◆ CAN_MCAN_TXBC_TFQS

#define CAN_MCAN_TXBC_TFQS   GENMASK(29, 24)

◆ CAN_MCAN_TXBCF

#define CAN_MCAN_TXBCF   0x0DC

◆ CAN_MCAN_TXBCF_CF

#define CAN_MCAN_TXBCF_CF   GENMASK(31, 0)

◆ CAN_MCAN_TXBCIE

#define CAN_MCAN_TXBCIE   0x0E4

◆ CAN_MCAN_TXBCIE_CFIE

#define CAN_MCAN_TXBCIE_CFIE   GENMASK(31, 0)

◆ CAN_MCAN_TXBCR

#define CAN_MCAN_TXBCR   0x0D4

◆ CAN_MCAN_TXBCR_CR

#define CAN_MCAN_TXBCR_CR   GENMASK(31, 0)

◆ CAN_MCAN_TXBRP

#define CAN_MCAN_TXBRP   0x0CC

◆ CAN_MCAN_TXBRP_TRP

#define CAN_MCAN_TXBRP_TRP   GENMASK(31, 0)

◆ CAN_MCAN_TXBTIE

#define CAN_MCAN_TXBTIE   0x0E0

◆ CAN_MCAN_TXBTIE_TIE

#define CAN_MCAN_TXBTIE_TIE   GENMASK(31, 0)

◆ CAN_MCAN_TXBTO

#define CAN_MCAN_TXBTO   0x0D8

◆ CAN_MCAN_TXBTO_TO

#define CAN_MCAN_TXBTO_TO   GENMASK(31, 0)

◆ CAN_MCAN_TXEFA

#define CAN_MCAN_TXEFA   0x0F8

◆ CAN_MCAN_TXEFA_EFAI

#define CAN_MCAN_TXEFA_EFAI   GENMASK(4, 0)

◆ CAN_MCAN_TXEFC

#define CAN_MCAN_TXEFC   0x0F0

◆ CAN_MCAN_TXEFC_EFS

#define CAN_MCAN_TXEFC_EFS   GENMASK(21, 16)

◆ CAN_MCAN_TXEFC_EFSA

#define CAN_MCAN_TXEFC_EFSA   GENMASK(15, 2)

◆ CAN_MCAN_TXEFC_EFWM

#define CAN_MCAN_TXEFC_EFWM   GENMASK(29, 24)

◆ CAN_MCAN_TXEFS

#define CAN_MCAN_TXEFS   0x0F4

◆ CAN_MCAN_TXEFS_EFF

#define CAN_MCAN_TXEFS_EFF   BIT(24)

◆ CAN_MCAN_TXEFS_EFFL

#define CAN_MCAN_TXEFS_EFFL   GENMASK(5, 0)

◆ CAN_MCAN_TXEFS_EFGI

#define CAN_MCAN_TXEFS_EFGI   GENMASK(12, 8)

◆ CAN_MCAN_TXEFS_EFPI

#define CAN_MCAN_TXEFS_EFPI   GENMASK(20, 16)

◆ CAN_MCAN_TXEFS_TEFL

#define CAN_MCAN_TXEFS_TEFL   BIT(25)

◆ CAN_MCAN_TXESC

#define CAN_MCAN_TXESC   0x0C8

◆ CAN_MCAN_TXESC_TBDS

#define CAN_MCAN_TXESC_TBDS   GENMASK(2, 0)

◆ CAN_MCAN_TXFQS

#define CAN_MCAN_TXFQS   0x0C4

◆ CAN_MCAN_TXFQS_TFFL

#define CAN_MCAN_TXFQS_TFFL   GENMASK(5, 0)

◆ CAN_MCAN_TXFQS_TFGI

#define CAN_MCAN_TXFQS_TFGI   GENMASK(12, 8)

◆ CAN_MCAN_TXFQS_TFQF

#define CAN_MCAN_TXFQS_TFQF   BIT(21)

◆ CAN_MCAN_TXFQS_TFQPI

#define CAN_MCAN_TXFQS_TFQPI   GENMASK(20, 16)

◆ CAN_MCAN_XFEC_DISABLE

#define CAN_MCAN_XFEC_DISABLE   0x0

◆ CAN_MCAN_XFEC_FIFO0

#define CAN_MCAN_XFEC_FIFO0   0x1

◆ CAN_MCAN_XFEC_FIFO1

#define CAN_MCAN_XFEC_FIFO1   0x2

◆ CAN_MCAN_XFEC_PRIO

#define CAN_MCAN_XFEC_PRIO   0x4

◆ CAN_MCAN_XFEC_PRIO_FIFO0

#define CAN_MCAN_XFEC_PRIO_FIFO0   0x5

◆ CAN_MCAN_XFEC_PRIO_FIFO1

#define CAN_MCAN_XFEC_PRIO_FIFO1   0x7

◆ CAN_MCAN_XFEC_REJECT

#define CAN_MCAN_XFEC_REJECT   0x3

◆ CAN_MCAN_XIDAM

#define CAN_MCAN_XIDAM   0x090

◆ CAN_MCAN_XIDAM_EIDM

#define CAN_MCAN_XIDAM_EIDM   GENMASK(28, 0)

◆ CAN_MCAN_XIDFC

#define CAN_MCAN_XIDFC   0x088

◆ CAN_MCAN_XIDFC_FLESA

#define CAN_MCAN_XIDFC_FLESA   GENMASK(15, 2)

◆ CAN_MCAN_XIDFC_LSS

#define CAN_MCAN_XIDFC_LSS   GENMASK(22, 16)

Typedef Documentation

◆ can_mcan_clear_mram_t

typedef int(* can_mcan_clear_mram_t) (const struct device *dev, uint16_t offset, size_t len)

Bosch M_CAN driver front-end callback for clearing Message RAM.

Clear Message RAM by writing 0 to all words.

Parameters
devPointer to the device structure for the driver instance.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
lenNumber of bytes to clear. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_read_mram_t

typedef int(* can_mcan_read_mram_t) (const struct device *dev, uint16_t offset, void *dst, size_t len)

Bosch M_CAN driver front-end callback for reading from Message RAM.

Parameters
devPointer to the device structure for the driver instance.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
[out]dstDestination for the data read. The destination address must be 32-bit aligned.
lenNumber of bytes to read. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_read_reg_t

typedef int(* can_mcan_read_reg_t) (const struct device *dev, uint16_t reg, uint32_t *val)

Bosch M_CAN driver front-end callback for reading a register value.

Parameters
devPointer to the device structure for the driver instance.
regRegister offset
[out]valRegister value
Return values
0If successful.
-ENOTSUPRegister not supported.
-EIOGeneral input/output error.

◆ can_mcan_write_mram_t

typedef int(* can_mcan_write_mram_t) (const struct device *dev, uint16_t offset, const void *src, size_t len)

Bosch M_CAN driver front-end callback for writing to Message RAM.

Parameters
devPointer to the device structure for the driver instance.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
srcSource for the data to be written. The source address must be 32-bit aligned.
lenNumber of bytes to write. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_write_reg_t

typedef int(* can_mcan_write_reg_t) (const struct device *dev, uint16_t reg, uint32_t val)

Bosch M_CAN driver front-end callback for writing a register value.

Parameters
devPointer to the device structure for the driver instance.
regRegister offset
valRegister value
Return values
0If successful.
-ENOTSUPRegister not supported.
-EIOGeneral input/output error.

Enumeration Type Documentation

◆ can_mcan_psr_lec

Enumerator
CAN_MCAN_PSR_LEC_NO_ERROR 
CAN_MCAN_PSR_LEC_STUFF_ERROR 
CAN_MCAN_PSR_LEC_FORM_ERROR 
CAN_MCAN_PSR_LEC_ACK_ERROR 
CAN_MCAN_PSR_LEC_BIT1_ERROR 
CAN_MCAN_PSR_LEC_BIT0_ERROR 
CAN_MCAN_PSR_LEC_CRC_ERROR 
CAN_MCAN_PSR_LEC_NO_CHANGE 

Function Documentation

◆ can_mcan_add_rx_filter()

int can_mcan_add_rx_filter ( const struct device * dev,
can_rx_callback_t callback,
void * user_data,
const struct can_filter * filter )

Bosch M_CAN driver callback API upon adding an RX filter See can_add_rx_callback() for argument description.

◆ can_mcan_clear_mram()

static int can_mcan_clear_mram ( const struct device * dev,
uint16_t offset,
size_t len )
inlinestatic

Clear Bosch M_CAN Message RAM.

Clear Message RAM by writing 0 to all words.

Parameters
devPointer to the device structure for the driver instance.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
lenNumber of bytes to clear. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_configure_mram()

int can_mcan_configure_mram ( const struct device * dev,
uintptr_t mrba,
uintptr_t mram )

Configure Bosch M_MCAN Message RAM start addresses.

Bosch M_CAN driver front-end callback helper function for configuring the start addresses of the Bosch M_CAN Rx FIFO0 (RXFOC), Rx FIFO1 (RXF1C), Rx Buffer (RXBCC), Tx Buffer (TXBC), and Tx Event FIFO (TXEFC) in Message RAM.

The start addresses (containing bits 15:2 since Bosch M_CAN message RAM is accessed as 32 bit words) are calculated relative to the provided Message RAM Base Address (mrba).

Some Bosch M_CAN implementations use a fixed Message RAM configuration, other use a fixed memory area and relative addressing, others again have custom registers for configuring the Message RAM. It is the responsibility of the front-end driver to call this function during driver initialization as needed.

Parameters
devPointer to the device structure for the driver instance.
mrbaMessage RAM Base Address.
mramMessage RAM Address.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_enable_configuration_change()

void can_mcan_enable_configuration_change ( const struct device * dev)

Enable Bosch M_CAN configuration change.

Parameters
devPointer to the device structure for the driver instance.

◆ can_mcan_get_capabilities()

int can_mcan_get_capabilities ( const struct device * dev,
can_mode_t * cap )

Bosch M_CAN driver callback API upon getting CAN controller capabilities See can_get_capabilities() for argument description.

◆ can_mcan_get_max_filters()

int can_mcan_get_max_filters ( const struct device * dev,
bool ide )

◆ can_mcan_get_state()

int can_mcan_get_state ( const struct device * dev,
enum can_state * state,
struct can_bus_err_cnt * err_cnt )

Bosch M_CAN driver callback API upon getting the CAN controller state See can_get_state() for argument description.

◆ can_mcan_init()

int can_mcan_init ( const struct device * dev)

Bosch M_CAN driver initialization callback.

Parameters
devPointer to the device structure for the driver instance.

◆ can_mcan_line_0_isr()

void can_mcan_line_0_isr ( const struct device * dev)

Bosch M_CAN driver m_can_int0 IRQ handler.

Parameters
devPointer to the device structure for the driver instance.

◆ can_mcan_line_1_isr()

void can_mcan_line_1_isr ( const struct device * dev)

Bosch M_CAN driver m_can_int1 IRQ handler.

Parameters
devPointer to the device structure for the driver instance.

◆ can_mcan_read_mram()

static int can_mcan_read_mram ( const struct device * dev,
uint16_t offset,
void * dst,
size_t len )
inlinestatic

Read from Bosch M_CAN Message RAM.

Parameters
devPointer to the device structure for the driver instance.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
[out]dstDestination for the data read.
lenNumber of bytes to read. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_read_reg()

int can_mcan_read_reg ( const struct device * dev,
uint16_t reg,
uint32_t * val )

Read a Bosch M_CAN register.

Parameters
devPointer to the device structure for the driver instance.
regRegister offset
[out]valRegister value
Return values
0If successful.
-ENOTSUPRegister not supported.
-EIOGeneral input/output error.

◆ can_mcan_remove_rx_filter()

void can_mcan_remove_rx_filter ( const struct device * dev,
int filter_id )

Bosch M_CAN driver callback API upon removing an RX filter See can_remove_rx_filter() for argument description.

◆ can_mcan_send()

int can_mcan_send ( const struct device * dev,
const struct can_frame * frame,
k_timeout_t timeout,
can_tx_callback_t callback,
void * user_data )

◆ can_mcan_set_mode()

int can_mcan_set_mode ( const struct device * dev,
can_mode_t mode )

Bosch M_CAN driver callback API upon setting CAN controller mode See can_set_mode() for argument description.

◆ can_mcan_set_state_change_callback()

void can_mcan_set_state_change_callback ( const struct device * dev,
can_state_change_callback_t callback,
void * user_data )

Bosch M_CAN driver callback API upon setting a state change callback See can_set_state_change_callback() for argument description.

◆ can_mcan_set_timing()

int can_mcan_set_timing ( const struct device * dev,
const struct can_timing * timing )

Bosch M_CAN driver callback API upon setting CAN bus timing See can_set_timing() for argument description.

◆ can_mcan_set_timing_data()

int can_mcan_set_timing_data ( const struct device * dev,
const struct can_timing * timing_data )

Bosch M_CAN driver callback API upon setting CAN bus data phase timing See can_set_timing_data() for argument description.

◆ can_mcan_start()

int can_mcan_start ( const struct device * dev)

Bosch M_CAN driver callback API upon starting CAN controller See can_start() for argument description.

◆ can_mcan_stop()

int can_mcan_stop ( const struct device * dev)

Bosch M_CAN driver callback API upon stopping CAN controller See can_stop() for argument description.

◆ can_mcan_sys_clear_mram()

static int can_mcan_sys_clear_mram ( mem_addr_t base,
uint16_t offset,
size_t len )
inlinestatic

Bosch M_CAN driver front-end callback helper for clearing memory mapped Message RAM.

Clear Message RAM by writing 0 to all words.

Parameters
baseBase address of the Message RAM for the given Bosch M_CAN instance. The base address must be 32-bit aligned.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
lenNumber of bytes to clear. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_sys_read_mram()

static int can_mcan_sys_read_mram ( mem_addr_t base,
uint16_t offset,
void * dst,
size_t len )
inlinestatic

Bosch M_CAN driver front-end callback helper for reading from memory mapped Message RAM.

Parameters
baseBase address of the Message RAM for the given Bosch M_CAN instance. The base address must be 32-bit aligned.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
[out]dstDestination for the data read. The destination address must be 32-bit aligned.
lenNumber of bytes to read. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_sys_read_reg()

static int can_mcan_sys_read_reg ( mm_reg_t base,
uint16_t reg,
uint32_t * val )
inlinestatic

Bosch M_CAN driver front-end callback helper for reading a memory mapped register.

Parameters
baseRegister base address
regRegister offset
[out]valRegister value
Return values
0Memory mapped register read always succeeds.

◆ can_mcan_sys_write_mram()

static int can_mcan_sys_write_mram ( mem_addr_t base,
uint16_t offset,
const void * src,
size_t len )
inlinestatic

Bosch M_CAN driver front-end callback helper for writing to memory mapped Message RAM.

Parameters
baseBase address of the Message RAM for the given Bosch M_CAN instance. The base address must be 32-bit aligned.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
srcSource for the data to be written. The source address must be 32-bit aligned.
lenNumber of bytes to write. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_sys_write_reg()

static int can_mcan_sys_write_reg ( mm_reg_t base,
uint16_t reg,
uint32_t val )
inlinestatic

Bosch M_CAN driver front-end callback helper for writing a memory mapped register.

Parameters
baseRegister base address
regRegister offset
valRegister value
Return values
0Memory mapped register write always succeeds.

◆ can_mcan_write_mram()

static int can_mcan_write_mram ( const struct device * dev,
uint16_t offset,
const void * src,
size_t len )
inlinestatic

Write to Bosch M_CAN Message RAM.

Parameters
devPointer to the device structure for the driver instance.
offsetOffset from the start of the Message RAM for the given Bosch M_CAN instance. The offset must be 32-bit aligned.
srcSource for the data to be written
lenNumber of bytes to write. Must be a multiple of 4.
Return values
0If successful.
-EIOGeneral input/output error.

◆ can_mcan_write_reg()

int can_mcan_write_reg ( const struct device * dev,
uint16_t reg,
uint32_t val )

Write a Bosch M_CAN register.

Parameters
devPointer to the device structure for the driver instance.
regRegister offset
valRegister value
Return values
0If successful.
-ENOTSUPRegister not supported.
-EIOGeneral input/output error.