libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Data Structures | |
struct | fdcan_standard_filter |
Structure describing standard ID filter. More... | |
struct | fdcan_extended_filter |
Structure describing extended ID filters. More... | |
struct | fdcan_rx_fifo_element |
Structure describing receive FIFO element. More... | |
struct | fdcan_tx_event_element |
Structure describing transmit event element. More... | |
struct | fdcan_tx_buffer_element |
Structure describing transmit buffer element. More... | |
Macros | |
#define | CAN_MSG_SIZE 0x2800 |
#define | FDCAN_GFC(can_base) MMIO32(can_base + 0x0080) |
#define | FDCAN_SIDFC(can_base) MMIO32(can_base + 0x0084) |
#define | FDCAN_XIDFC(can_base) MMIO32(can_base + 0x0088) |
#define | FDCAN_XIDAM(can_base) MMIO32(can_base + 0x0090) |
#define | FDCAN_HPMS(can_base) MMIO32(can_base + 0x0094) |
#define | FDCAN_NDAT1(can_base) MMIO32(can_base + 0x0098) |
#define | FDCAN_HDAT2(can_base) MMIO32(can_base + 0x009C) |
#define | FDCAN_RXFIC_BASE 0x00A0 |
#define | FDCAN_RXFI_OFFSET 0x0010 |
#define | FDCAN_RXFIC(can_base, fifo_id) MMIO32((can_base) + FDCAN_RXFIC_BASE + (FDCAN_RXFI_OFFSET * (fifo_id))) |
#define | FDCAN_RXF0C(can_base) FDCAN_RXFIC(can_base, 0) |
#define | FDCAN_RXF1C(can_base) FDCAN_RXFIC(can_base, 1) |
#define | FDCAN_RXFIS_BASE 0x00A4 |
#define | FDCAN_RXFIA_BASE 0x00A8 |
#define | FDCAN_RXBC(can_base) MMIO32(can_base + 0x00AC) |
#define | FDCAN_RXESC(can_base) MMIO32(can_base + 0x00BC) |
#define | FDCAN_TXESC(can_base) MMIO32(can_base + 0x00C8) |
#define | FDCAN_TXBRP(can_base) MMIO32(can_base + 0x00CC) |
#define | FDCAN_TXBAR(can_base) MMIO32(can_base + 0x00D0) |
#define | FDCAN_TXBCR(can_base) MMIO32(can_base + 0x00D4) |
#define | FDCAN_TXBTO(can_base) MMIO32(can_base + 0x00D8) |
#define | FDCAN_TXBCF(can_base) MMIO32(can_base + 0x00DC) |
#define | FDCAN_TXBTIE(can_base) MMIO32(can_base + 0x00E0) |
#define | FDCAN_TXBCIE(can_base) MMIO32(can_base + 0x00E4) |
#define | FDCAN_TXEFC(can_base) MMIO32(can_base + 0x00F0) |
#define | FDCAN_TXEFS(can_base) MMIO32(can_base + 0x00F4) |
#define | FDCAN_TXEFA(can_base) MMIO32(can_base + 0x00F8) |
#define | FDCAN_TTTMC(can_base) MMIO32(can_base + 0x0100) |
#define | FDCAN_TTRMC(can_base) MMIO32(can_base + 0x0104) |
#define | FDCAN_TTOCF(can_base) MMIO32(can_base + 0x0108) |
#define | FDCAN_TTMLM(can_base) MMIO32(can_base + 0x010C) |
#define | FDCAN_TURCF(can_base) MMIO32(can_base + 0x0110) |
#define | FDCAN_TTOCN(can_base) MMIO32(can_base + 0x0114) |
#define | FDCAN_TTGTP(can_base) MMIO32(can_base + 0x0118) |
#define | FDCAN_TTTMK(can_base) MMIO32(can_base + 0x011C) |
#define | FDCAN_TTTIR(can_base) MMIO32(can_base + 0x0120) |
#define | FDCAN_TTIE(can_base) MMIO32(can_base + 0x0124) |
#define | FDCAN_TTILS(can_base) MMIO32(can_base + 0x0128) |
#define | FDCAN_TTOST(can_base) MMIO32(can_base + 0x012C) |
#define | FDCAN_TURNA(can_base) MMIO32(can_base + 0x0130) |
#define | FDCAN_TTLGT(can_base) MMIO32(can_base + 0x0134) |
#define | FDCAN_TTCTC(can_base) MMIO32(can_base + 0x0138) |
#define | FDCAN_TTCPT(can_base) MMIO32(can_base + 0x013C) |
#define | FDCAN_TTCSM(can_base) MMIO32(can_base + 0x0140) |
#define | FDCAN_TTTS(can_base) MMIO32(can_base + 0x0300) |
#define | FDCAN_CCU_CCFG MMIO32(CAN_CCU_BASE + 0x0004) |
#define | FDCAN_CCU_CREL MMIO32(CAN_CCU_BASE + 0x0000) |
#define | FDCAN_GFC_RRFE (1 << 0) |
#define | FDCAN_GFC_RRFS (1 << 1) |
#define | FDCAN_GFC_ANFE_SHIFT 2 |
ANFE[1:0]: Accept non-matching frames w/ extended ID. More... | |
#define | FDCAN_GFC_ANFE_MASK 0x3 |
#define | FDCAN_GFC_ANFS_SHIFT 4 |
ANFS[1:0]: Accept non-matching frames w/ standard ID. More... | |
#define | FDCAN_GFC_ANFS_MASK 0x3 |
#define | FDCAN_FXS_MASK 0xFF |
#define | FDCAN_FXS_SHIFT 16 |
#define | FDCAN_FXSA_MASK 0x3FFF |
Position of start address of relocatable object within register. More... | |
#define | FDCAN_FXSA_SHIFT 2 |
#define | FDCAN_SIDFC_LSS_MASK FDCAN_FXS_MASK |
LSS[7:0]: List size of standard ID filters. More... | |
#define | FDCAN_SIDFC_LSS_SHIFT FDCAN_FXS_SHIFT |
#define | FDCAN_SIDFC_FLSSA_MASK FDCAN_FXSA_MASK |
LFSSA[13:0]: Filter List standard start address. More... | |
#define | FDCAN_SIDFC_FLSSA_SHIFT FDCAN_FXSA_SHIFT |
#define | FDCAN_XIDFC_LSE_MASK FDCAN_FXS_MASK |
LSE[7:0]: List size of extended ID filters. More... | |
#define | FDCAN_XIDFC_LSE_SHIFT FDCAN_FXS_SHIFT |
#define | FDCAN_XIDFC_FLESA_MASK FDCAN_FXSA_MASK |
LFSSA[7:0]: Filter List extended start address. More... | |
#define | FDCAN_XIDFC_FLESA_SHIFT FDCAN_FXSA_SHIFT |
#define | FDCAN_TXBC_TFQS_MASK 0x3F |
TFQS[5:0]: Tx FIFO/Queue size. More... | |
#define | FDCAN_TXBC_TFQS_SHIFT 24 |
#define | FDCAN_TXBC_TBSA_MASK FDCAN_FXSA_MASK |
TBSA[7:0]: Transmit buffer start address. More... | |
#define | FDCAN_TXBC_TBSA_SHIFT FDCAN_FXSA_SHIFT |
#define | FDCAN_TXEFC_EFS_MASK 0x3F |
#define | FDCAN_TXEFC_EFS_SHIFT 16 |
#define | FDCAN_TXEFC_EFSA_MASK FDCAN_FXSA_MASK |
EFSA[7:0]: (Transmit) event FIFO start address. More... | |
#define | FDCAN_TXEFC_EFSA_SHIFT FDCAN_FXSA_SHIFT |
#define | FDCAN_RXFIC_FIOM (1 << 31) |
#define | FDCAN_RXFIC_FIWM_MASK 0x7F |
#define | FDCAN_RXFIC_FIWM_SHIFT 24 |
#define | FDCAN_RXFIC_FIS_MASK 0x7F |
#define | FDCAN_RXFIC_FIS_SHIFT 16 |
#define | FDCAN_RXFIC_FISA_MASK FDCAN_FXSA_MASK |
#define | FDCAN_RXFIC_FISA_SHIFT FDCAN_FXSA_SHIFT |
#define | FDCAN_RXF0C_F0OM FDCAN_RXFIC_FIOM |
#define | FDCAN_RXF0C_F0WM_MASK FDCAN_RXFIC_FIWM_MASK |
F0WM[6:0]: FIFO0 watermark mode. More... | |
#define | FDCAN_RXF0C_F0WM_SHIFT FDCAN_RXFIC_FIWM_SHIFT |
#define | FDCAN_RXF0C_F0S_MASK FDCAN_RXFIC_FIS_MASK |
F0S[6:0]: FIFO0 size. More... | |
#define | FDCAN_RXF0C_F0S_SHIFT FDCAN_RXFIC_FIS_SHIFT |
#define | FDCAN_RXF0C_F0SA_MASK FDCAN_RXFIC_FISA_MASK |
F0SA[13:0]: FIFO0 start address. More... | |
#define | FDCAN_RXF0C_F0SA_SHIFT FDCAN_RXFIC_FISA_SHIFT |
#define | FDCAN_RXF1C_F1OM FDCAN_RXFIC_FIOM |
#define | FDCAN_RXF1C_F1WM_MASK FDCAN_RXFIC_FIWM_MASK |
F1WM[6:0]: FIFO1 watermark mode. More... | |
#define | FDCAN_RXF1C_F1WM_SHIFT FDCAN_RXFIC_FIWM_SHIFT |
#define | FDCAN_RXF1C_F1S_MASK FDCAN_RXFIC_FIS_MASK |
F1S[6:0]: FIFO1 size. More... | |
#define | FDCAN_RXF1C_F1S_SHIFT FDCAN_RXFIC_FIS_SHIFT |
#define | FDCAN_RXF1C_F1SA_MASK FDCAN_RXFIC_FISA_MASK |
F1SA[13:0]: FIFO1 start address. More... | |
#define | FDCAN_RXF1C_F1SA_SHIFT FDCAN_RXFIC_FISA_SHIFT |
#define | FDCAN_RXESC_RBDS_MASK 0x7 |
RBDS[3:0]: RX buffer data field size. More... | |
#define | FDCAN_RXESC_RBDS_SHIFT 8 |
#define | FDCAN_RXESC_F0DS_MASK 0x7 |
F0DS[3:0]: FIFO0 data field size. More... | |
#define | FDCAN_RXESC_F0DS_SHIFT 0 |
#define | FDCAN_RXESC_F1DS_MASK 0x7 |
F1DS[3:0]: FIFO1 data field size. More... | |
#define | FDCAN_RXESC_F1DS_SHIFT 4 |
#define | FDCAN_TXESC_TBDS_MASK 0x7 |
TBDS[3:0]: TX buffer data field size. More... | |
#define | FDCAN_TXESC_TBDS_SHIFT 0 |
#define | FDCAN_RXFIFO_FL_MASK 0x7F |
#define | FDCAN_RXFIFO_GI_MASK 0x3F |
#define | FDCAN_RXFIFO_PI_MASK 0x3F |
#define | FDCAN_RXFIFO_AI_MASK 0x3F |
#define | FDCAN_TXFQS_TFFL_MASK 0x3F |
#define | FDCAN_TXFQS_TFGI_MASK 0x1F |
#define | FDCAN_TXFQS_TFQPI_MASK 0x1F |
#define | FDCAN_TXEFS_EFFL_MASK 0x3F |
#define | FDCAN_TXEFS_EFGI_MASK 0x1F |
#define | FDCAN_TXEFS_EFPI_MASK 0x1F |
#define | FDCAN_CCU_CCFG_CDIV_SHIFT 16 |
CDIV[3:0]: Input clock divider. More... | |
#define | FDCAN_CCU_CCFG_CDIV_MASK 0xF |
#define | FDCAN_LFSSA_OFFSET(can_base) (FDCAN_SIDFC(can_base) & (FDCAN_SIDFC_FLSSA_MASK << FDCAN_SIDFC_FLSSA_SHIFT)) |
#define | FDCAN_LFESA_OFFSET(can_base) (FDCAN_XIDFC(can_base) & (FDCAN_XIDFC_FLESA_MASK << FDCAN_XIDFC_FLESA_SHIFT)) |
#define | FDCAN_RXFIFO_OFFSET(can_base, fifo_id) (FDCAN_RXFIC(can_base, fifo_id) & (FDCAN_FXSA_MASK << FDCAN_FXSA_SHIFT)) |
#define | FDCAN_TXBUF_OFFSET(can_base) (FDCAN_TXBC(can_base) & (FDCAN_TXBC_TBSA_MASK << FDCAN_TXBC_TBSA_SHIFT)) |
#define | FDCAN_TXEVT_OFFSET(can_base) (FDCAN_TXEFC(can_base) & (FDCAN_TXEFC_EFSA_MASK << FDCAN_TXEFC_EFSA_SHIFT)) |
#define | FDCAN_BLOCK_ID(can_base) (((can_base) - CAN1)/(CAN2 - CAN1)) |
#define | FDCAN_CREL(can_base) MMIO32(can_base + 0x0000) |
#define | FDCAN_ENDN(can_base) MMIO32(can_base + 0x0004) |
#define | FDCAN_DBTP(can_base) MMIO32(can_base + 0x000C) |
#define | FDCAN_TEST(can_base) MMIO32(can_base + 0x0010) |
#define | FDCAN_RWD(can_base) MMIO32(can_base + 0x0014) |
#define | FDCAN_CCCR(can_base) MMIO32(can_base + 0x0018) |
#define | FDCAN_NBTP(can_base) MMIO32(can_base + 0x001C) |
#define | FDCAN_TSCC(can_base) MMIO32(can_base + 0x0020) |
#define | FDCAN_TSCV(can_base) MMIO32(can_base + 0x0024) |
#define | FDCAN_TOCC(can_base) MMIO32(can_base + 0x0028) |
#define | FDCAN_TOCV(can_base) MMIO32(can_base + 0x002C) |
#define | FDCAN_ECR(can_base) MMIO32(can_base + 0x0040) |
#define | FDCAN_PSR(can_base) MMIO32(can_base + 0x0044) |
#define | FDCAN_TDCR(can_base) MMIO32(can_base + 0x0048) |
#define | FDCAN_IR(can_base) MMIO32(can_base + 0x0050) |
#define | FDCAN_IE(can_base) MMIO32(can_base + 0x0054) |
#define | FDCAN_ILS(can_base) MMIO32(can_base + 0x0058) |
#define | FDCAN_ILE(can_base) MMIO32(can_base + 0x005C) |
#define | FDCAN_RXFIS(can_base, fifo_id) MMIO32(can_base + FDCAN_RXFIS_BASE + (FDCAN_RXFI_OFFSET * fifo_id)) |
Generic access to Rx FIFO status registers. More... | |
#define | FDCAN_RXF0S(can_base) FDCAN_RXFIS(can_base, 0) |
#define | FDCAN_RXF1S(can_base) FDCAN_RXFIS(can_base, 1) |
#define | FDCAN_RXFIA(can_base, fifo_id) MMIO32(can_base + FDCAN_RXFIA_BASE + (FDCAN_RXFI_OFFSET * fifo_id)) |
Generic access to Rx FIFO acknowledge registers. More... | |
#define | FDCAN_RXF0A(can_base) FDCAN_RXFIA(can_base, 0) |
#define | FDCAN_RXF1A(can_base) FDCAN_RXFIA(can_base, 1) |
#define | FDCAN_TXBC(can_base) MMIO32(can_base + 0x00C0) |
#define | FDCAN_TXFQS(can_base) MMIO32(can_base + 0x00C4) |
#define | FDCAN_CREL_DAY_SHIFT 0 |
DAY[7:0]: FDCAN core revision date. More... | |
#define | FDCAN_CREL_DAY_MASK 0xFF |
#define | FDCAN_CREL_MON_SHIFT 8 |
MON[7:0]: FDCAN core revision month. More... | |
#define | FDCAN_CREL_MON_MASK 0xFF |
#define | FDCAN_CREL_YEAR_SHIFT 16 |
YEAR[3:0]: FDCAN core revision year. More... | |
#define | FDCAN_CREL_YEAR_MASK 0xF |
#define | FDCAN_CREL_SUBSTEP_SHIFT 20 |
SUBSTEP[3:0]: FDCAN core release sub stepping. More... | |
#define | FDCAN_CREL_SUBSTEP_MASK 0xF |
#define | FDCAN_CREL_STEP_SHIFT 24 |
STEP[3:0]: FDCAN core release stepping. More... | |
#define | FDCAN_CREL_STEP_MASK 0xF |
#define | FDCAN_CREL_REL_SHIFT 28 |
REL[3:0]: FDCAN core release number. More... | |
#define | FDCAN_CREL_REL_MASK 0xF |
#define | FDCAN_DBTP_DSJW_SHIFT 0 |
DSJW[3:0]: Synchronization jump width. More... | |
#define | FDCAN_DBTP_DSJW_MASK 0xF |
#define | FDCAN_DBTP_DTSEG2_SHIFT 4 |
DTSEG2[3:0]: Data time segment after sample point. More... | |
#define | FDCAN_DBTP_DTSEG2_MASK 0xF |
#define | FDCAN_DBTP_DTSEG1_SHIFT 8 |
DTSEG1[4:0]: Data time segment before sample point. More... | |
#define | FDCAN_DBTP_DTSEG1_MASK 0x1F |
#define | FDCAN_DBTP_DBRP_SHIFT 16 |
DBRP[4:0]: Data bit rate prescaler. More... | |
#define | FDCAN_DBTP_DBRP_MASK 0x1F |
#define | FDCAN_DBTP_TDC (1 << 23) |
#define | FDCAN_TEST_LBCK (1 << 4) |
#define | FDCAN_TEST_TX_SHIFT 5 |
TX[1:0]: Control of transmit pin. More... | |
#define | FDCAN_TEST_TX_MASK 0x3 |
#define | FDCAN_TEST_RX (1 << 7) |
#define | FDCAN_RWD_WDC_SHIFT 0 |
WDC[7:0]: RAM watchdog configuration. More... | |
#define | FDCAN_RWD_WDC_MASK 0xFF |
#define | FDCAN_RWD_WDV_SHIFT 7 |
WDV[7:0]: RAM watchdog actual value. More... | |
#define | FDCAN_RWD_WDV_MASK 0xFF |
#define | FDCAN_CCCR_INIT_TIMEOUT 0x0000FFFF |
Timeout for FDCAN_CCCR register INIT bit to accept set value. More... | |
#define | FDCAN_NBTP_NTSEG2_SHIFT 0 |
NTSEG2[6:0]: Nominal timing segment after sample point length. More... | |
#define | FDCAN_NBTP_NTSEG2_MASK 0x7F |
#define | FDCAN_NBTP_NTSEG1_SHIFT 8 |
NTSEG1[7:0]: Nominal timing segment before sample point length. More... | |
#define | FDCAN_NBTP_NTSEG1_MASK 0xFF |
#define | FDCAN_NBTP_NBRP_SHIFT 16 |
NBRP[8:0]: Norminal timing bit rate prescaler. More... | |
#define | FDCAN_NBTP_NBRP_MASK 0x1FF |
#define | FDCAN_NBTP_NSJW_SHIFT 25 |
NSJW[6:0]: Norminal timing resynchronization jumb width. More... | |
#define | FDCAN_NBTP_NSJW_MASK 0x7F |
#define | FDCAN_TSCC_TSS_SHIFT 0 |
TSS[1:0]: Timestamp select. More... | |
#define | FDCAN_TSCC_TSS_MASK 0x3 |
#define | FDCAN_TSCC_TCP_SHIFT 16 |
TCP[3:0]: Timestamp counter prescaler. More... | |
#define | FDCAN_TSCC_TCP_MASK 0xF |
#define | FDCAN_TSCV_TSC_SHIFT 0 |
TSC[15:0]: Timestamp counter value. More... | |
#define | FDCAN_TSCV_TSC_MASK 0xFFFF |
#define | FDCAN_TOCC_ETOC (1 << 0) |
#define | FDCAN_TOCC_TOS_SHIFT 1 |
TOS[1:0]: Timeout select. More... | |
#define | FDCAN_TOCC_TOS_MASK 0x3 |
#define | FDCAN_TOCC_TOP_SHIFT 16 |
TOP[15:0]: Timeout period. More... | |
#define | FDCAN_TOCC_TOP_MASK 0xFFFF |
#define | FDCAN_TOCV_TOC_SHIFT 0 |
TOC[15:0]: Timeout counter. More... | |
#define | FDCAN_TOCV_TOC_MASK 0xFFFF |
#define | FDCAN_ECR_TEC_SHIFT 0 |
TEC[7:0]: Transmit error counter. More... | |
#define | FDCAN_ECR_TEC_MASK 0xFF |
#define | FDCAN_ECR_REC_SHIFT 8 |
REC[6:0]: Receive error counter. More... | |
#define | FDCAN_ECR_REC_MASK 0x7F |
#define | FDCAN_ECR_RP (1 << 15) |
#define | FDCAN_ECR_CEL_SHIFT 16 |
CEL[7:0]: CAN error logging. More... | |
#define | FDCAN_ECR_CEL_MASK 0xFF |
#define | FDCAN_PSR_LEC_SHIFT 0 |
LEC[2:0]: Last error code. More... | |
#define | FDCAN_PSR_LEC_MASK 0x7 |
#define | FDCAN_PSR_ACT_SHIFT 3 |
ACT[1:0]: CAN block activity. More... | |
#define | FDCAN_PSR_ACT_MASK 0x3 |
#define | FDCAN_PSR_EP (1 << 5) |
#define | FDCAN_PSR_EW (1 << 6) |
#define | FDCAN_PSR_BO (1 << 7) |
#define | FDCAN_PSR_DLEC_SHIFT 8 |
DLEC[2:0]: Last error code in data section. More... | |
#define | FDCAN_PSR_DLEC_MASK 0x7 |
#define | FDCAN_PSR_RESI (1 << 11) |
#define | FDCAN_PSR_RBRSRESI1 (1 << 12) |
#define | FDCAN_PSR_REDL (1 << 13) |
#define | FDCAN_PSR_PXE (1 << 14) |
#define | FDCAN_PSR_TDCV_SHIFT 16 |
TDCV[6:0]: Transmitter delay compensation value. More... | |
#define | FDCAN_PSR_TDCV_MASK 0x7F |
#define | FDCAN_TDCR_TDCF_SHIFT 0 |
TDCF[6:0]: Transmitter delay compensation filter window length. More... | |
#define | FDCAN_TDCR_TDCF_MASK 0x7F |
#define | FDCAN_TDCR_TDCO_SHIFT 8 |
TDCO[6:0]: Transmitter delay compensation offset. More... | |
#define | FDCAN_TDCR_TDCO_MASK 0x7F |
#define | FDCAN_ILE_INT0 (1 << 0) |
#define | FDCAN_ILE_INT1 (1 << 1) |
#define | FDCAN_XIDAM_EIDM_SHIFT 0 |
EIDM[28:0]: Extended ID mask for filtering. More... | |
#define | FDCAN_XIDAM_EIDM_MASK 0x1FFFFFFF |
#define | FDCAN_HPMS_BIDX_SHIFT 0 |
BIDX[2:0]: Buffer index. More... | |
#define | FDCAN_HPMS_BIDX_MASK 0x7 |
#define | FDCAN_HPMS_MSI_SHIFT 6 |
MSI[1:0]: Message storage indicator. More... | |
#define | FDCAN_HPMS_MSI_MASK 0x3 |
#define | FDCAN_HPMS_FIDX_SHIFT 8 |
FIDX[4:0]: Filter index. More... | |
#define | FDCAN_HPMS_FIDX_MASK 0x1F |
#define | FDCAN_HPMS_FLS (1 << 15) |
#define | FDCAN_RXFIFO_FL_SHIFT 0 |
Fill level of Rx FIFOs. More... | |
#define | FDCAN_RXFIFO_GI_SHIFT 8 |
Get index of Rx FIFOs. More... | |
#define | FDCAN_RXFIFO_PI_SHIFT 16 |
Put index of Rx FIFOs. More... | |
#define | FDCAN_RXFIFO_FF (1 << 24) |
#define | FDCAN_RXFIFO_RFL (1 << 25) |
#define | FDCAN_RXF0S_F0FL_SHIFT FDCAN_RXFIFO_FL_SHIFT |
F0FL[3:0]: Fill level of Rx FIFO 0. More... | |
#define | FDCAN_RXF0S_F0FL_MASK FDCAN_RXFIFO_FL_MASK |
#define | FDCAN_RXF0S_F0GI_SHIFT FDCAN_RXFIFO_GI_SHIFT |
F0GI[1:0]: Get index of Rx FIFO 0. More... | |
#define | FDCAN_RXF0S_F0GI_MASK FDCAN_RXFIFO_GI_MASK |
#define | FDCAN_RXF0S_F0PI_SHIFT FDCAN_RXFIFO_PI_SHIFT |
F0PI[1:0]: Put index of Rx FIFO 0. More... | |
#define | FDCAN_RXF0S_F0PI_MASK FDCAN_RXFIFO_PI_MASK |
#define | FDCAN_RXF0S_F0F FDCAN_RXFIFO_FF |
#define | FDCAN_RXF0S_RF0L FDCAN_RXFIFO_RFL |
#define | FDCAN_RXFIFO_AI_SHIFT 0 |
Rx FIFOs acknowledge index. More... | |
#define | FDCAN_RXF0A_R0AI_SHIFT FDCAN_RXFIFO_AI_SHIFT |
R0AI[2:0]: Rx FIFO 0 acknowledge index. More... | |
#define | FDCAN_RXF0A_R0AI_MASK FDCAN_RXFIFO_AI_MASK |
#define | FDCAN_RXF1S_F1FL_SHIFT FDCAN_RXFIFO_FL_SHIFT |
F1FL[3:1]: Fill level of Rx FIFO 1. More... | |
#define | FDCAN_RXF1S_F1FL_MASK FDCAN_RXFIFO_FL_MASK |
#define | FDCAN_RXF1S_F1GI_SHIFT FDCAN_RXFIFO_GI_SHIFT |
F1GI[1:1]: Get index of Rx FIFO 1. More... | |
#define | FDCAN_RXF1S_F1GI_MASK FDCAN_RXFIFO_GI_MASK |
#define | FDCAN_RXF1S_F1PI_SHIFT FDCAN_RXFIFO_PI_SHIFT |
F1PI[1:1]: Put index of Rx FIFO 1. More... | |
#define | FDCAN_RXF1S_F1PI_MASK FDCAN_RXFIFO_PI_MASK |
#define | FDCAN_RXF1S_F1F FDCAN_RXFIFO_FF |
#define | FDCAN_RXF1S_RF1L FDCAN_RXFIFO_RFL |
#define | FDCAN_RXF1A_R1AI_SHIFT FDCAN_RXFIFO_AI_SHIFT |
R1AI[2:0]: Rx FIFO 1 acknowledge index. More... | |
#define | FDCAN_RXF1A_R1AI_MASK FDCAN_RXFIFO_AI_MASK |
#define | FDCAN_TXBC_TFQM (1 << 24) |
#define | FDCAN_TXFQS_TFFL_SHIFT 0 |
TFFL[2:0]: Tx FIFO free level. More... | |
#define | FDCAN_TXFQS_TFGI_SHIFT 8 |
TFGI[1:0]: Tx FIFO get index. More... | |
#define | FDCAN_TXFQS_TFQPI_SHIFT 16 |
TFQPI[1:0]: Tx FIFO put index. More... | |
#define | FDCAN_TXFQS_TFQF (1 << 21) |
#define | FDCAN_TXEFS_EFFL_SHIFT 0 |
EFFL[2:0]: Event FIFO fill level. More... | |
#define | FDCAN_TXEFS_EFGI_SHIFT 8 |
EFG[1:0]: Event FIFO get index. More... | |
#define | FDCAN_TXEFS_EFPI_SHIFT 16 |
EFPI[1:0]: Event FIFO put index. More... | |
#define | FDCAN_TXEFS_EFF (1 << 24) |
#define | FDCAN_TXEFS_TEF (1 << 25) |
#define | FDCAN_TXEFA_EFAI_SHIFT 0 |
EFAI[1:0]: Event FIFO acknowledge index. More... | |
#define | FDCAN_TXEFA_EFAI_MASK 0x3 |
#define | FDCAN_SFT_SHIFT 30 |
#define | FDCAN_SFT_MASK 0x3 |
#define | FDCAN_SFEC_SHIFT 27 |
#define | FDCAN_SFEC_MASK 0x7 |
#define | FDCAN_SFID1_SHIFT 16 |
#define | FDCAN_SFID1_MASK 0x7FF |
#define | FDCAN_SFID2_SHIFT 0 |
#define | FDCAN_SFID2_MASK 0x7FF |
#define | FDCAN_EFEC_SHIFT 29 |
#define | FDCAN_EFEC_MASK 0x7 |
#define | FDCAN_EFID1_SHIFT 0 |
#define | FDCAN_EFID1_MASK 0x1FFFFFFF |
#define | FDCAN_EFT_SHIFT 30 |
#define | FDCAN_EFT_MASK 0x3 |
#define | FDCAN_EFID2_SHIFT 0 |
#define | FDCAN_EFID2_MASK 0x1FFFFFFF |
#define | FDCAN_FIFO_EID_SHIFT 0 |
#define | FDCAN_FIFO_EID_MASK 0x1FFFFFFF |
#define | FDCAN_FIFO_SID_SHIFT 18 |
#define | FDCAN_FIFO_SID_MASK 0x7FF |
#define | FDCAN_FIFO_DLC_SHIFT 16 |
#define | FDCAN_FIFO_DLC_MASK 0xF |
#define | FDCAN_FIFO_MM_SHIFT 24 |
#define | FDCAN_FIFO_MM_MASK 0xFF |
#define | FDCAN_FIFO_ANMF (1 << 31) |
#define | FDCAN_FIFO_FIDX_SHIFT 24 |
#define | FDCAN_FIFO_FIDX_MASK 0x7F |
#define | FDCAN_FIFO_RXTS_SHIFT 0 |
#define | FDCAN_FIFO_RXTS_MASK 0xFFFF |
Functions | |
void | fdcan_init_std_filter_ram (uint32_t canport, uint32_t flssa, uint8_t lss) |
Initialize allocation of standard filter block in CAN message RAM. More... | |
void | fdcan_init_ext_filter_ram (uint32_t canport, uint32_t flesa, uint8_t lse) |
Initialize allocation of extended filter block in CAN message RAM. More... | |
void | fdcan_init_fifo_ram (uint32_t canport, unsigned fifo_id, uint32_t fxsa, uint8_t fxs) |
Initialize allocation of FIFO block in CAN message RAM. More... | |
void | fdcan_init_tx_event_ram (uint32_t canport, uint32_t tesa, uint8_t tes) |
Initialize allocation of transmit event block in CAN message RAM. More... | |
void | fdcan_init_tx_buffer_ram (uint32_t canport, uint32_t tbsa, uint8_t tbs) |
Initialize allocation of transmit queue block in CAN message RAM. More... | |
int | fdcan_set_rx_element_size (uint32_t canport, uint8_t rxbuf, uint8_t rxfifo0, uint8_t rxfifo1) |
Initialize size of data fields in reception buffers. More... | |
int | fdcan_set_tx_element_size (uint32_t canport, uint8_t txbuf) |
Initialize size of data fields in transmit buffers. More... | |
LGPL License Terms libopencm3 License
#define CAN_MSG_SIZE 0x2800 |
Definition at line 43 of file h7/fdcan.h.
#define FDCAN_CCCR_INIT_TIMEOUT 0x0000FFFF |
Timeout for FDCAN_CCCR register INIT bit to accept set value.
This timeout is required because FDCAN uses two different clocks feeding two different portions of block. There can be slight delay based on how clocks are set up. While amount of FDCAN_clk / FDCAN_pclk combinations is high and clock speeds may vary a lot, following value has been choosen as sane default. You are free to use any timeout value you want.
#define FDCAN_CCU_CCFG MMIO32(CAN_CCU_BASE + 0x0004) |
Definition at line 101 of file h7/fdcan.h.
#define FDCAN_CCU_CCFG_CDIV_MASK 0xF |
Definition at line 225 of file h7/fdcan.h.
#define FDCAN_CCU_CCFG_CDIV_SHIFT 16 |
CDIV[3:0]: Input clock divider.
Definition at line 224 of file h7/fdcan.h.
#define FDCAN_CCU_CREL MMIO32(CAN_CCU_BASE + 0x0000) |
Definition at line 102 of file h7/fdcan.h.
#define FDCAN_CREL_DAY_SHIFT 0 |
#define FDCAN_CREL_MON_SHIFT 8 |
#define FDCAN_CREL_REL_SHIFT 28 |
#define FDCAN_CREL_STEP_SHIFT 24 |
#define FDCAN_CREL_SUBSTEP_SHIFT 20 |
#define FDCAN_CREL_YEAR_SHIFT 16 |
#define FDCAN_DBTP_DBRP_SHIFT 16 |
#define FDCAN_DBTP_DSJW_SHIFT 0 |
#define FDCAN_DBTP_DTSEG1_SHIFT 8 |
#define FDCAN_DBTP_DTSEG2_SHIFT 4 |
#define FDCAN_ECR_REC_SHIFT 8 |
#define FDCAN_ECR_TEC_SHIFT 0 |
#define FDCAN_FXS_MASK 0xFF |
Definition at line 115 of file h7/fdcan.h.
#define FDCAN_FXS_SHIFT 16 |
Definition at line 116 of file h7/fdcan.h.
#define FDCAN_FXSA_MASK 0x3FFF |
Position of start address of relocatable object within register.
Definition at line 119 of file h7/fdcan.h.
#define FDCAN_FXSA_SHIFT 2 |
Definition at line 120 of file h7/fdcan.h.
#define FDCAN_GFC | ( | can_base | ) | MMIO32(can_base + 0x0080) |
Definition at line 45 of file h7/fdcan.h.
#define FDCAN_GFC_ANFE_MASK 0x3 |
Definition at line 109 of file h7/fdcan.h.
#define FDCAN_GFC_ANFE_SHIFT 2 |
ANFE[1:0]: Accept non-matching frames w/ extended ID.
Definition at line 108 of file h7/fdcan.h.
#define FDCAN_GFC_ANFS_MASK 0x3 |
Definition at line 113 of file h7/fdcan.h.
#define FDCAN_GFC_ANFS_SHIFT 4 |
ANFS[1:0]: Accept non-matching frames w/ standard ID.
Definition at line 112 of file h7/fdcan.h.
#define FDCAN_GFC_RRFE (1 << 0) |
Definition at line 104 of file h7/fdcan.h.
#define FDCAN_GFC_RRFS (1 << 1) |
Definition at line 105 of file h7/fdcan.h.
#define FDCAN_HDAT2 | ( | can_base | ) | MMIO32(can_base + 0x009C) |
Definition at line 53 of file h7/fdcan.h.
#define FDCAN_HPMS | ( | can_base | ) | MMIO32(can_base + 0x0094) |
Definition at line 51 of file h7/fdcan.h.
#define FDCAN_HPMS_MSI_SHIFT 6 |
#define FDCAN_LFESA_OFFSET | ( | can_base | ) | (FDCAN_XIDFC(can_base) & (FDCAN_XIDFC_FLESA_MASK << FDCAN_XIDFC_FLESA_SHIFT)) |
Definition at line 232 of file h7/fdcan.h.
#define FDCAN_LFSSA_OFFSET | ( | can_base | ) | (FDCAN_SIDFC(can_base) & (FDCAN_SIDFC_FLSSA_MASK << FDCAN_SIDFC_FLSSA_SHIFT)) |
Definition at line 229 of file h7/fdcan.h.
#define FDCAN_NBTP_NBRP_SHIFT 16 |
#define FDCAN_NBTP_NSJW_SHIFT 25 |
#define FDCAN_NBTP_NTSEG1_SHIFT 8 |
#define FDCAN_NBTP_NTSEG2_SHIFT 0 |
#define FDCAN_NDAT1 | ( | can_base | ) | MMIO32(can_base + 0x0098) |
Definition at line 52 of file h7/fdcan.h.
#define FDCAN_PSR_DLEC_SHIFT 8 |
#define FDCAN_PSR_TDCV_SHIFT 16 |
#define FDCAN_RWD_WDC_SHIFT 0 |
#define FDCAN_RWD_WDV_SHIFT 7 |
#define FDCAN_RXBC | ( | can_base | ) | MMIO32(can_base + 0x00AC) |
Definition at line 67 of file h7/fdcan.h.
#define FDCAN_RXESC | ( | can_base | ) | MMIO32(can_base + 0x00BC) |
Definition at line 69 of file h7/fdcan.h.
#define FDCAN_RXESC_F0DS_MASK 0x7 |
F0DS[3:0]: FIFO0 data field size.
Definition at line 198 of file h7/fdcan.h.
#define FDCAN_RXESC_F0DS_SHIFT 0 |
Definition at line 199 of file h7/fdcan.h.
#define FDCAN_RXESC_F1DS_MASK 0x7 |
F1DS[3:0]: FIFO1 data field size.
Definition at line 202 of file h7/fdcan.h.
#define FDCAN_RXESC_F1DS_SHIFT 4 |
Definition at line 203 of file h7/fdcan.h.
#define FDCAN_RXESC_RBDS_MASK 0x7 |
RBDS[3:0]: RX buffer data field size.
Definition at line 194 of file h7/fdcan.h.
#define FDCAN_RXESC_RBDS_SHIFT 8 |
Definition at line 195 of file h7/fdcan.h.
#define FDCAN_RXF0A | ( | can_base | ) | FDCAN_RXFIA(can_base, 0) |
#define FDCAN_RXF0A_R0AI_MASK FDCAN_RXFIFO_AI_MASK |
#define FDCAN_RXF0A_R0AI_SHIFT FDCAN_RXFIFO_AI_SHIFT |
#define FDCAN_RXF0C | ( | can_base | ) | FDCAN_RXFIC(can_base, 0) |
Definition at line 61 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0OM FDCAN_RXFIC_FIOM |
Definition at line 165 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0S_MASK FDCAN_RXFIC_FIS_MASK |
F0S[6:0]: FIFO0 size.
Definition at line 172 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0S_SHIFT FDCAN_RXFIC_FIS_SHIFT |
Definition at line 173 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0SA_MASK FDCAN_RXFIC_FISA_MASK |
F0SA[13:0]: FIFO0 start address.
Definition at line 176 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0SA_SHIFT FDCAN_RXFIC_FISA_SHIFT |
Definition at line 177 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0WM_MASK FDCAN_RXFIC_FIWM_MASK |
F0WM[6:0]: FIFO0 watermark mode.
Definition at line 168 of file h7/fdcan.h.
#define FDCAN_RXF0C_F0WM_SHIFT FDCAN_RXFIC_FIWM_SHIFT |
Definition at line 169 of file h7/fdcan.h.
#define FDCAN_RXF0S | ( | can_base | ) | FDCAN_RXFIS(can_base, 0) |
#define FDCAN_RXF0S_F0F FDCAN_RXFIFO_FF |
#define FDCAN_RXF0S_F0FL_MASK FDCAN_RXFIFO_FL_MASK |
#define FDCAN_RXF0S_F0FL_SHIFT FDCAN_RXFIFO_FL_SHIFT |
#define FDCAN_RXF0S_F0GI_MASK FDCAN_RXFIFO_GI_MASK |
#define FDCAN_RXF0S_F0GI_SHIFT FDCAN_RXFIFO_GI_SHIFT |
#define FDCAN_RXF0S_F0PI_MASK FDCAN_RXFIFO_PI_MASK |
#define FDCAN_RXF0S_F0PI_SHIFT FDCAN_RXFIFO_PI_SHIFT |
#define FDCAN_RXF0S_RF0L FDCAN_RXFIFO_RFL |
#define FDCAN_RXF1A | ( | can_base | ) | FDCAN_RXFIA(can_base, 1) |
#define FDCAN_RXF1A_R1AI_MASK FDCAN_RXFIFO_AI_MASK |
#define FDCAN_RXF1A_R1AI_SHIFT FDCAN_RXFIFO_AI_SHIFT |
#define FDCAN_RXF1C | ( | can_base | ) | FDCAN_RXFIC(can_base, 1) |
Definition at line 62 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1OM FDCAN_RXFIC_FIOM |
Definition at line 179 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1S_MASK FDCAN_RXFIC_FIS_MASK |
F1S[6:0]: FIFO1 size.
Definition at line 186 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1S_SHIFT FDCAN_RXFIC_FIS_SHIFT |
Definition at line 187 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1SA_MASK FDCAN_RXFIC_FISA_MASK |
F1SA[13:0]: FIFO1 start address.
Definition at line 190 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1SA_SHIFT FDCAN_RXFIC_FISA_SHIFT |
Definition at line 191 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1WM_MASK FDCAN_RXFIC_FIWM_MASK |
F1WM[6:0]: FIFO1 watermark mode.
Definition at line 182 of file h7/fdcan.h.
#define FDCAN_RXF1C_F1WM_SHIFT FDCAN_RXFIC_FIWM_SHIFT |
Definition at line 183 of file h7/fdcan.h.
#define FDCAN_RXF1S | ( | can_base | ) | FDCAN_RXFIS(can_base, 1) |
#define FDCAN_RXF1S_F1F FDCAN_RXFIFO_FF |
#define FDCAN_RXF1S_F1FL_MASK FDCAN_RXFIFO_FL_MASK |
#define FDCAN_RXF1S_F1FL_SHIFT FDCAN_RXFIFO_FL_SHIFT |
#define FDCAN_RXF1S_F1GI_MASK FDCAN_RXFIFO_GI_MASK |
#define FDCAN_RXF1S_F1GI_SHIFT FDCAN_RXFIFO_GI_SHIFT |
#define FDCAN_RXF1S_F1PI_MASK FDCAN_RXFIFO_PI_MASK |
#define FDCAN_RXF1S_F1PI_SHIFT FDCAN_RXFIFO_PI_SHIFT |
#define FDCAN_RXF1S_RF1L FDCAN_RXFIFO_RFL |
#define FDCAN_RXFI_OFFSET 0x0010 |
Definition at line 56 of file h7/fdcan.h.
#define FDCAN_RXFIA | ( | can_base, | |
fifo_id | |||
) | MMIO32(can_base + FDCAN_RXFIA_BASE + (FDCAN_RXFI_OFFSET * fifo_id)) |
Generic access to Rx FIFO acknowledge registers.
can_base | FDCAN block base address FDCAN block base addresses |
fifo_id | ID of FIFO, 0 or 1 |
#define FDCAN_RXFIA_BASE 0x00A8 |
Definition at line 65 of file h7/fdcan.h.
#define FDCAN_RXFIC | ( | can_base, | |
fifo_id | |||
) | MMIO32((can_base) + FDCAN_RXFIC_BASE + (FDCAN_RXFI_OFFSET * (fifo_id))) |
Definition at line 58 of file h7/fdcan.h.
#define FDCAN_RXFIC_BASE 0x00A0 |
Definition at line 55 of file h7/fdcan.h.
#define FDCAN_RXFIC_FIOM (1 << 31) |
Definition at line 153 of file h7/fdcan.h.
#define FDCAN_RXFIC_FIS_MASK 0x7F |
Definition at line 158 of file h7/fdcan.h.
#define FDCAN_RXFIC_FIS_SHIFT 16 |
Definition at line 159 of file h7/fdcan.h.
#define FDCAN_RXFIC_FISA_MASK FDCAN_FXSA_MASK |
Definition at line 162 of file h7/fdcan.h.
#define FDCAN_RXFIC_FISA_SHIFT FDCAN_FXSA_SHIFT |
Definition at line 163 of file h7/fdcan.h.
#define FDCAN_RXFIC_FIWM_MASK 0x7F |
Definition at line 155 of file h7/fdcan.h.
#define FDCAN_RXFIC_FIWM_SHIFT 24 |
Definition at line 156 of file h7/fdcan.h.
#define FDCAN_RXFIFO_AI_MASK 0x3F |
Definition at line 213 of file h7/fdcan.h.
#define FDCAN_RXFIFO_FL_MASK 0x7F |
Definition at line 209 of file h7/fdcan.h.
#define FDCAN_RXFIFO_GI_MASK 0x3F |
Definition at line 210 of file h7/fdcan.h.
#define FDCAN_RXFIFO_OFFSET | ( | can_base, | |
fifo_id | |||
) | (FDCAN_RXFIC(can_base, fifo_id) & (FDCAN_FXSA_MASK << FDCAN_FXSA_SHIFT)) |
Definition at line 235 of file h7/fdcan.h.
#define FDCAN_RXFIFO_PI_MASK 0x3F |
Definition at line 211 of file h7/fdcan.h.
#define FDCAN_RXFIS | ( | can_base, | |
fifo_id | |||
) | MMIO32(can_base + FDCAN_RXFIS_BASE + (FDCAN_RXFI_OFFSET * fifo_id)) |
Generic access to Rx FIFO status registers.
can_base | FDCAN block base address FDCAN block base addresses |
fifo_id | ID of FIFO, 0 or 1 |
#define FDCAN_RXFIS_BASE 0x00A4 |
Definition at line 64 of file h7/fdcan.h.
#define FDCAN_SIDFC | ( | can_base | ) | MMIO32(can_base + 0x0084) |
Definition at line 47 of file h7/fdcan.h.
#define FDCAN_SIDFC_FLSSA_MASK FDCAN_FXSA_MASK |
LFSSA[13:0]: Filter List standard start address.
Definition at line 127 of file h7/fdcan.h.
#define FDCAN_SIDFC_FLSSA_SHIFT FDCAN_FXSA_SHIFT |
Definition at line 128 of file h7/fdcan.h.
#define FDCAN_SIDFC_LSS_MASK FDCAN_FXS_MASK |
LSS[7:0]: List size of standard ID filters.
Definition at line 123 of file h7/fdcan.h.
#define FDCAN_SIDFC_LSS_SHIFT FDCAN_FXS_SHIFT |
Definition at line 124 of file h7/fdcan.h.
#define FDCAN_TDCR_TDCF_SHIFT 0 |
#define FDCAN_TDCR_TDCO_SHIFT 8 |
#define FDCAN_TEST_TX_SHIFT 5 |
#define FDCAN_TSCC_TCP_SHIFT 16 |
#define FDCAN_TSCV_TSC_SHIFT 0 |
#define FDCAN_TTCPT | ( | can_base | ) | MMIO32(can_base + 0x013C) |
Definition at line 97 of file h7/fdcan.h.
#define FDCAN_TTCSM | ( | can_base | ) | MMIO32(can_base + 0x0140) |
Definition at line 98 of file h7/fdcan.h.
#define FDCAN_TTCTC | ( | can_base | ) | MMIO32(can_base + 0x0138) |
Definition at line 96 of file h7/fdcan.h.
#define FDCAN_TTGTP | ( | can_base | ) | MMIO32(can_base + 0x0118) |
Definition at line 88 of file h7/fdcan.h.
#define FDCAN_TTIE | ( | can_base | ) | MMIO32(can_base + 0x0124) |
Definition at line 91 of file h7/fdcan.h.
#define FDCAN_TTILS | ( | can_base | ) | MMIO32(can_base + 0x0128) |
Definition at line 92 of file h7/fdcan.h.
#define FDCAN_TTLGT | ( | can_base | ) | MMIO32(can_base + 0x0134) |
Definition at line 95 of file h7/fdcan.h.
#define FDCAN_TTMLM | ( | can_base | ) | MMIO32(can_base + 0x010C) |
Definition at line 85 of file h7/fdcan.h.
#define FDCAN_TTOCF | ( | can_base | ) | MMIO32(can_base + 0x0108) |
Definition at line 84 of file h7/fdcan.h.
#define FDCAN_TTOCN | ( | can_base | ) | MMIO32(can_base + 0x0114) |
Definition at line 87 of file h7/fdcan.h.
#define FDCAN_TTOST | ( | can_base | ) | MMIO32(can_base + 0x012C) |
Definition at line 93 of file h7/fdcan.h.
#define FDCAN_TTRMC | ( | can_base | ) | MMIO32(can_base + 0x0104) |
Definition at line 83 of file h7/fdcan.h.
#define FDCAN_TTTIR | ( | can_base | ) | MMIO32(can_base + 0x0120) |
Definition at line 90 of file h7/fdcan.h.
#define FDCAN_TTTMC | ( | can_base | ) | MMIO32(can_base + 0x0100) |
Definition at line 82 of file h7/fdcan.h.
#define FDCAN_TTTMK | ( | can_base | ) | MMIO32(can_base + 0x011C) |
Definition at line 89 of file h7/fdcan.h.
#define FDCAN_TTTS | ( | can_base | ) | MMIO32(can_base + 0x0300) |
Definition at line 99 of file h7/fdcan.h.
#define FDCAN_TURCF | ( | can_base | ) | MMIO32(can_base + 0x0110) |
Definition at line 86 of file h7/fdcan.h.
#define FDCAN_TURNA | ( | can_base | ) | MMIO32(can_base + 0x0130) |
Definition at line 94 of file h7/fdcan.h.
#define FDCAN_TXBAR | ( | can_base | ) | MMIO32(can_base + 0x00D0) |
Definition at line 72 of file h7/fdcan.h.
#define FDCAN_TXBC_TBSA_MASK FDCAN_FXSA_MASK |
TBSA[7:0]: Transmit buffer start address.
Definition at line 143 of file h7/fdcan.h.
#define FDCAN_TXBC_TBSA_SHIFT FDCAN_FXSA_SHIFT |
Definition at line 144 of file h7/fdcan.h.
#define FDCAN_TXBC_TFQS_MASK 0x3F |
TFQS[5:0]: Tx FIFO/Queue size.
Definition at line 139 of file h7/fdcan.h.
#define FDCAN_TXBC_TFQS_SHIFT 24 |
Definition at line 140 of file h7/fdcan.h.
#define FDCAN_TXBCF | ( | can_base | ) | MMIO32(can_base + 0x00DC) |
Definition at line 75 of file h7/fdcan.h.
#define FDCAN_TXBCIE | ( | can_base | ) | MMIO32(can_base + 0x00E4) |
Definition at line 77 of file h7/fdcan.h.
#define FDCAN_TXBCR | ( | can_base | ) | MMIO32(can_base + 0x00D4) |
Definition at line 73 of file h7/fdcan.h.
#define FDCAN_TXBRP | ( | can_base | ) | MMIO32(can_base + 0x00CC) |
Definition at line 71 of file h7/fdcan.h.
#define FDCAN_TXBTIE | ( | can_base | ) | MMIO32(can_base + 0x00E0) |
Definition at line 76 of file h7/fdcan.h.
#define FDCAN_TXBTO | ( | can_base | ) | MMIO32(can_base + 0x00D8) |
Definition at line 74 of file h7/fdcan.h.
#define FDCAN_TXBUF_OFFSET | ( | can_base | ) | (FDCAN_TXBC(can_base) & (FDCAN_TXBC_TBSA_MASK << FDCAN_TXBC_TBSA_SHIFT)) |
Definition at line 238 of file h7/fdcan.h.
#define FDCAN_TXEFA | ( | can_base | ) | MMIO32(can_base + 0x00F8) |
Definition at line 80 of file h7/fdcan.h.
#define FDCAN_TXEFA_EFAI_SHIFT 0 |
#define FDCAN_TXEFC | ( | can_base | ) | MMIO32(can_base + 0x00F0) |
Definition at line 78 of file h7/fdcan.h.
#define FDCAN_TXEFC_EFS_MASK 0x3F |
Definition at line 146 of file h7/fdcan.h.
#define FDCAN_TXEFC_EFS_SHIFT 16 |
Definition at line 147 of file h7/fdcan.h.
#define FDCAN_TXEFC_EFSA_MASK FDCAN_FXSA_MASK |
EFSA[7:0]: (Transmit) event FIFO start address.
Definition at line 150 of file h7/fdcan.h.
#define FDCAN_TXEFC_EFSA_SHIFT FDCAN_FXSA_SHIFT |
Definition at line 151 of file h7/fdcan.h.
#define FDCAN_TXEFS | ( | can_base | ) | MMIO32(can_base + 0x00F4) |
Definition at line 79 of file h7/fdcan.h.
#define FDCAN_TXEFS_EFFL_MASK 0x3F |
Definition at line 219 of file h7/fdcan.h.
#define FDCAN_TXEFS_EFFL_SHIFT 0 |
#define FDCAN_TXEFS_EFGI_MASK 0x1F |
Definition at line 220 of file h7/fdcan.h.
#define FDCAN_TXEFS_EFGI_SHIFT 8 |
#define FDCAN_TXEFS_EFPI_MASK 0x1F |
Definition at line 221 of file h7/fdcan.h.
#define FDCAN_TXEFS_EFPI_SHIFT 16 |
#define FDCAN_TXESC | ( | can_base | ) | MMIO32(can_base + 0x00C8) |
Definition at line 70 of file h7/fdcan.h.
#define FDCAN_TXESC_TBDS_MASK 0x7 |
TBDS[3:0]: TX buffer data field size.
Definition at line 206 of file h7/fdcan.h.
#define FDCAN_TXESC_TBDS_SHIFT 0 |
Definition at line 207 of file h7/fdcan.h.
#define FDCAN_TXEVT_OFFSET | ( | can_base | ) | (FDCAN_TXEFC(can_base) & (FDCAN_TXEFC_EFSA_MASK << FDCAN_TXEFC_EFSA_SHIFT)) |
Definition at line 241 of file h7/fdcan.h.
#define FDCAN_TXFQS_TFFL_MASK 0x3F |
Definition at line 215 of file h7/fdcan.h.
#define FDCAN_TXFQS_TFFL_SHIFT 0 |
#define FDCAN_TXFQS_TFGI_MASK 0x1F |
Definition at line 216 of file h7/fdcan.h.
#define FDCAN_TXFQS_TFGI_SHIFT 8 |
#define FDCAN_TXFQS_TFQPI_MASK 0x1F |
Definition at line 217 of file h7/fdcan.h.
#define FDCAN_TXFQS_TFQPI_SHIFT 16 |
#define FDCAN_XIDAM | ( | can_base | ) | MMIO32(can_base + 0x0090) |
Definition at line 49 of file h7/fdcan.h.
#define FDCAN_XIDAM_EIDM_SHIFT 0 |
#define FDCAN_XIDFC | ( | can_base | ) | MMIO32(can_base + 0x0088) |
Definition at line 48 of file h7/fdcan.h.
#define FDCAN_XIDFC_FLESA_MASK FDCAN_FXSA_MASK |
LFSSA[7:0]: Filter List extended start address.
Definition at line 135 of file h7/fdcan.h.
#define FDCAN_XIDFC_FLESA_SHIFT FDCAN_FXSA_SHIFT |
Definition at line 136 of file h7/fdcan.h.
#define FDCAN_XIDFC_LSE_MASK FDCAN_FXS_MASK |
LSE[7:0]: List size of extended ID filters.
Definition at line 131 of file h7/fdcan.h.
#define FDCAN_XIDFC_LSE_SHIFT FDCAN_FXS_SHIFT |
Definition at line 132 of file h7/fdcan.h.
void fdcan_init_ext_filter_ram | ( | uint32_t | canport, |
uint32_t | flesa, | ||
uint8_t | lse | ||
) |
Initialize allocation of extended filter block in CAN message RAM.
Allows specifying size of extended filtering block (in term of available filtering rules and filter base address within CAN message RAM. Note, that there are no limitations nor checking on address provided. It is possible to share whole filtering block or portion of it between multiple CAN interfaces.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | flesa | extended filtering block start address offset in message RAM |
[in] | lse | amount of extended filters |
Definition at line 127 of file fdcan.c.
References FDCAN_XIDFC, FDCAN_XIDFC_FLESA_SHIFT, and FDCAN_XIDFC_LSE_SHIFT.
Referenced by fdcan_init_filter().
void fdcan_init_fifo_ram | ( | uint32_t | canport, |
unsigned | fifo_id, | ||
uint32_t | fxsa, | ||
uint8_t | fxs | ||
) |
Initialize allocation of FIFO block in CAN message RAM.
Allows specifying size of FIFO block (in term of available messages in FIFO and FIFO base address within CAN message RAM. Note, that there are no limitations nor checking on address provided.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | fifo_id | ID of fifo being configured |
[in] | fxsa | FIFO block start address offset in message RAM |
[in] | fxs | number of elements to assign |
Definition at line 143 of file fdcan.c.
References FDCAN_RXFIC, FDCAN_RXFIC_FIS_MASK, FDCAN_RXFIC_FIS_SHIFT, FDCAN_RXFIC_FISA_MASK, and FDCAN_RXFIC_FISA_SHIFT.
Referenced by fdcan_start().
void fdcan_init_std_filter_ram | ( | uint32_t | canport, |
uint32_t | flssa, | ||
uint8_t | lss | ||
) |
Initialize allocation of standard filter block in CAN message RAM.
Allows specifying size of standard filtering block (in term of available filtering rules and filter base address within CAN message RAM. Note, that there are no limitations nor checking on address provided. It is possible to share whole filtering block or portion of it between multiple CAN interfaces.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | flssa | standard filtering block start address offset in message RAM |
[in] | lss | amount of standard filters |
Definition at line 111 of file fdcan.c.
References FDCAN_SIDFC, FDCAN_SIDFC_FLSSA_SHIFT, and FDCAN_SIDFC_LSS_SHIFT.
Referenced by fdcan_init_filter().
void fdcan_init_tx_buffer_ram | ( | uint32_t | canport, |
uint32_t | tbsa, | ||
uint8_t | tbs | ||
) |
Initialize allocation of transmit queue block in CAN message RAM.
Allows specifying size of transmit queue block (in term of allocated buffers and block base address within CAN message RAM. Note, that there are no limitations nor checking on address provided.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | tbsa | block start address offset in message RAM |
[in] | tbs | number of elements to assign |
Definition at line 183 of file fdcan.c.
References FDCAN_TXBC, FDCAN_TXBC_TBSA_MASK, FDCAN_TXBC_TBSA_SHIFT, FDCAN_TXBC_TFQS_MASK, and FDCAN_TXBC_TFQS_SHIFT.
Referenced by fdcan_start().
void fdcan_init_tx_event_ram | ( | uint32_t | canport, |
uint32_t | tesa, | ||
uint8_t | tes | ||
) |
Initialize allocation of transmit event block in CAN message RAM.
Allows specifying size of transmit event block (in term of allocated events and block base address within CAN message RAM. Note, that there are no limitations nor checking on address provided.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | tesa | block start address offset in message RAM |
[in] | tes | number of elements to assign |
Definition at line 163 of file fdcan.c.
References FDCAN_TXEFC, FDCAN_TXEFC_EFS_MASK, FDCAN_TXEFC_EFS_SHIFT, FDCAN_TXEFC_EFSA_MASK, and FDCAN_TXEFC_EFSA_SHIFT.
Referenced by fdcan_start().
int fdcan_set_rx_element_size | ( | uint32_t | canport, |
uint8_t | rxbuf, | ||
uint8_t | rxfifo0, | ||
uint8_t | rxfifo1 | ||
) |
Initialize size of data fields in reception buffers.
Configures maximum size of message payload, which can be stored in different reception buffers. Each buffer can have maximum payload size configured independently. Buffers can only be configured to sizes which are valid sizes of FDCAN payload. Sizes smaller than 8 are automatically padded to 8.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | rxbuf | maximum storable payload size of dedicated RX buffer |
[in] | rxfifo0 | maximum storable payload size of RX FIFO 0 |
[in] | rxfifo1 | maximum storable payload size of RX FIFO 1 |
Definition at line 209 of file fdcan.c.
References FDCAN_E_INVALID, FDCAN_E_OK, fdcan_length_to_dlc(), FDCAN_RXESC, FDCAN_RXESC_F0DS_SHIFT, FDCAN_RXESC_F1DS_SHIFT, and FDCAN_RXESC_RBDS_SHIFT.
Referenced by fdcan_start().
int fdcan_set_tx_element_size | ( | uint32_t | canport, |
uint8_t | txbuf | ||
) |
Initialize size of data fields in transmit buffers.
Configures maximum size of message payload, which can be stored either in dedicated transmit buffer or into transmit queue/FIFO. One size is applied both to transmit buffer and transmit queue / FIFO. Buffers can only be configured to sizes which are valid sizes of FDCAN payload. Sizes smaller than 8 are automatically padded to 8 bytes.
[in] | canport | FDCAN block base address. See FDCAN block base addresses. |
[in] | txbuf | maximum storable payload size of TX buffer / FIFO / queue |
Definition at line 261 of file fdcan.c.
References FDCAN_E_INVALID, FDCAN_E_OK, fdcan_length_to_dlc(), FDCAN_TXESC, and FDCAN_TXESC_TBDS_SHIFT.
Referenced by fdcan_start().