/* automatically generated by rust-bindgen 0.72.1 */

pub const MCAN_MD_NORMAL: u32 = 0;
pub const MCAN_MD_RESTRICTED_OP: u32 = 1;
pub const MCAN_MD_BUS_MON: u32 = 2;
pub const MCAN_MD_INTERN_LOOPBACK: u32 = 3;
pub const MCAN_MD_EXTERN_LOOPBACK: u32 = 4;
pub const MCAN_MSG_RAM_BASE: u32 = 1073917952;
pub const MCAN_MSG_RAM_SIZE: u32 = 2048;
pub const MCAN_MSG_RAM_END: u32 = 1073920000;
pub const MCAN_STD_ID: u32 = 0;
pub const MCAN_EXT_ID: u32 = 1;
pub const MCAN_STD_ID_MASK: u32 = 2047;
pub const MCAN_EXT_ID_MASK: u32 = 536870911;
pub const MCAN_FRAME_CLASSIC: u32 = 0;
pub const MCAN_FRAME_ISO_FD_NO_BRS: u32 = 256;
pub const MCAN_FRAME_ISO_FD_BRS: u32 = 768;
pub const MCAN_FRAME_NON_ISO_FD_NO_BRS: u32 = 33024;
pub const MCAN_FRAME_NON_ISO_FD_BRS: u32 = 33536;
pub const MCAN_AUTO_RETX_DISABLE: u32 = 64;
pub const MCAN_AUTO_RETX_ENABLE: u32 = 0;
pub const MCAN_TX_PAUSE_DISABLE: u32 = 0;
pub const MCAN_TX_PAUSE_ENABLE: u32 = 16384;
pub const MCAN_MSG_MARKER_8BIT: u32 = 0;
pub const MCAN_MSG_MARKER_16BIT: u32 = 2048;
pub const MCAN_PROTOCOL_EXP_DISABLE: u32 = 4096;
pub const MCAN_PROTOCOL_EXP_ENABLE: u32 = 0;
pub const MCAN_FD_TDC_DISABLE: u32 = 0;
pub const MCAN_FD_TDC_ENABLE: u32 = 8388608;
pub const MCAN_TX_PIN_NORMAL: u32 = 0;
pub const MCAN_TX_PIN_MONITOR: u32 = 32;
pub const MCAN_TX_PIN_DOMINANT: u32 = 64;
pub const MCAN_TX_PIN_RECESSIVE: u32 = 96;
pub const MCAN_DLC0: u32 = 0;
pub const MCAN_DLC1: u32 = 1;
pub const MCAN_DLC2: u32 = 2;
pub const MCAN_DLC3: u32 = 3;
pub const MCAN_DLC4: u32 = 4;
pub const MCAN_DLC5: u32 = 5;
pub const MCAN_DLC6: u32 = 6;
pub const MCAN_DLC7: u32 = 7;
pub const MCAN_DLC8: u32 = 8;
pub const MCAN_DLC12: u32 = 9;
pub const MCAN_DLC16: u32 = 10;
pub const MCAN_DLC20: u32 = 11;
pub const MCAN_DLC24: u32 = 12;
pub const MCAN_DLC32: u32 = 13;
pub const MCAN_DLC48: u32 = 14;
pub const MCAN_DLC64: u32 = 15;
pub const MCAN_DATA_SIZE_8BYTE: u32 = 0;
pub const MCAN_DATA_SIZE_12BYTE: u32 = 1;
pub const MCAN_DATA_SIZE_16BYTE: u32 = 2;
pub const MCAN_DATA_SIZE_20BYTE: u32 = 3;
pub const MCAN_DATA_SIZE_24BYTE: u32 = 4;
pub const MCAN_DATA_SIZE_32BYTE: u32 = 5;
pub const MCAN_DATA_SIZE_48BYTE: u32 = 6;
pub const MCAN_DATA_SIZE_64BYTE: u32 = 7;
pub const MCAN_TX_FIFO_MD: u32 = 0;
pub const MCAN_TX_QUEUE_MD: u32 = 1073741824;
pub const MCAN_FILTER_RANGE: u32 = 0;
pub const MCAN_FILTER_DUAL: u32 = 1;
pub const MCAN_FILTER_MASK: u32 = 2;
pub const MCAN_FILTER_RANGE_NO_EIDM: u32 = 3;
pub const MCAN_FILTER_DISABLE: u32 = 0;
pub const MCAN_FILTER_TO_RX_FIFO0: u32 = 1;
pub const MCAN_FILTER_TO_RX_FIFO1: u32 = 2;
pub const MCAN_FILTER_REJECT: u32 = 3;
pub const MCAN_FILTER_HP_NO_STORAGE: u32 = 4;
pub const MCAN_FILTER_HP_TO_RX_FIFO0: u32 = 5;
pub const MCAN_FILTER_HP_TO_RX_FIFO1: u32 = 6;
pub const MCAN_FILTER_TO_RX_BUF: u32 = 7;
pub const MCAN_TX_BUF0: u32 = 1;
pub const MCAN_TX_BUF1: u32 = 2;
pub const MCAN_TX_BUF2: u32 = 4;
pub const MCAN_TX_BUF3: u32 = 8;
pub const MCAN_TX_BUF4: u32 = 16;
pub const MCAN_TX_BUF5: u32 = 32;
pub const MCAN_TX_BUF6: u32 = 64;
pub const MCAN_TX_BUF7: u32 = 128;
pub const MCAN_TX_BUF8: u32 = 256;
pub const MCAN_TX_BUF9: u32 = 512;
pub const MCAN_TX_BUF10: u32 = 1024;
pub const MCAN_TX_BUF11: u32 = 2048;
pub const MCAN_TX_BUF12: u32 = 4096;
pub const MCAN_TX_BUF13: u32 = 8192;
pub const MCAN_TX_BUF14: u32 = 16384;
pub const MCAN_TX_BUF15: u32 = 32768;
pub const MCAN_TX_BUF16: u32 = 65536;
pub const MCAN_TX_BUF17: u32 = 131072;
pub const MCAN_TX_BUF18: u32 = 262144;
pub const MCAN_TX_BUF19: u32 = 524288;
pub const MCAN_TX_BUF20: u32 = 1048576;
pub const MCAN_TX_BUF21: u32 = 2097152;
pub const MCAN_TX_BUF22: u32 = 4194304;
pub const MCAN_TX_BUF23: u32 = 8388608;
pub const MCAN_TX_BUF24: u32 = 16777216;
pub const MCAN_TX_BUF25: u32 = 33554432;
pub const MCAN_TX_BUF26: u32 = 67108864;
pub const MCAN_TX_BUF27: u32 = 134217728;
pub const MCAN_TX_BUF28: u32 = 268435456;
pub const MCAN_TX_BUF29: u32 = 536870912;
pub const MCAN_TX_BUF30: u32 = 1073741824;
pub const MCAN_TX_BUF31: u32 = 2147483648;
pub const MCAN_TX_BUF_ALL: u32 = 4294967295;
pub const MCAN_RX_FIFO0: u32 = 64;
pub const MCAN_RX_FIFO1: u32 = 65;
pub const MCAN_RX_BUF0: u32 = 0;
pub const MCAN_RX_BUF1: u32 = 1;
pub const MCAN_RX_BUF2: u32 = 2;
pub const MCAN_RX_BUF3: u32 = 3;
pub const MCAN_RX_BUF4: u32 = 4;
pub const MCAN_RX_BUF5: u32 = 5;
pub const MCAN_RX_BUF6: u32 = 6;
pub const MCAN_RX_BUF7: u32 = 7;
pub const MCAN_RX_BUF8: u32 = 8;
pub const MCAN_RX_BUF9: u32 = 9;
pub const MCAN_RX_BUF10: u32 = 10;
pub const MCAN_RX_BUF11: u32 = 11;
pub const MCAN_RX_BUF12: u32 = 12;
pub const MCAN_RX_BUF13: u32 = 13;
pub const MCAN_RX_BUF14: u32 = 14;
pub const MCAN_RX_BUF15: u32 = 15;
pub const MCAN_RX_BUF16: u32 = 16;
pub const MCAN_RX_BUF17: u32 = 17;
pub const MCAN_RX_BUF18: u32 = 18;
pub const MCAN_RX_BUF19: u32 = 19;
pub const MCAN_RX_BUF20: u32 = 20;
pub const MCAN_RX_BUF21: u32 = 21;
pub const MCAN_RX_BUF22: u32 = 22;
pub const MCAN_RX_BUF23: u32 = 23;
pub const MCAN_RX_BUF24: u32 = 24;
pub const MCAN_RX_BUF25: u32 = 25;
pub const MCAN_RX_BUF26: u32 = 26;
pub const MCAN_RX_BUF27: u32 = 27;
pub const MCAN_RX_BUF28: u32 = 28;
pub const MCAN_RX_BUF29: u32 = 29;
pub const MCAN_RX_BUF30: u32 = 30;
pub const MCAN_RX_BUF31: u32 = 31;
pub const MCAN_RX_BUF32: u32 = 32;
pub const MCAN_RX_BUF33: u32 = 33;
pub const MCAN_RX_BUF34: u32 = 34;
pub const MCAN_RX_BUF35: u32 = 35;
pub const MCAN_RX_BUF36: u32 = 36;
pub const MCAN_RX_BUF37: u32 = 37;
pub const MCAN_RX_BUF38: u32 = 38;
pub const MCAN_RX_BUF39: u32 = 39;
pub const MCAN_RX_BUF40: u32 = 40;
pub const MCAN_RX_BUF41: u32 = 41;
pub const MCAN_RX_BUF42: u32 = 42;
pub const MCAN_RX_BUF43: u32 = 43;
pub const MCAN_RX_BUF44: u32 = 44;
pub const MCAN_RX_BUF45: u32 = 45;
pub const MCAN_RX_BUF46: u32 = 46;
pub const MCAN_RX_BUF47: u32 = 47;
pub const MCAN_RX_BUF48: u32 = 48;
pub const MCAN_RX_BUF49: u32 = 49;
pub const MCAN_RX_BUF50: u32 = 50;
pub const MCAN_RX_BUF51: u32 = 51;
pub const MCAN_RX_BUF52: u32 = 52;
pub const MCAN_RX_BUF53: u32 = 53;
pub const MCAN_RX_BUF54: u32 = 54;
pub const MCAN_RX_BUF55: u32 = 55;
pub const MCAN_RX_BUF56: u32 = 56;
pub const MCAN_RX_BUF57: u32 = 57;
pub const MCAN_RX_BUF58: u32 = 58;
pub const MCAN_RX_BUF59: u32 = 59;
pub const MCAN_RX_BUF60: u32 = 60;
pub const MCAN_RX_BUF61: u32 = 61;
pub const MCAN_RX_BUF62: u32 = 62;
pub const MCAN_RX_BUF63: u32 = 63;
pub const MCAN_RX_BUF_MAX: u32 = 63;
pub const MCAN_HPM_NO_STORAGE: u32 = 0;
pub const MCAN_HPM_LOST: u32 = 1;
pub const MCAN_HPM_STORED_IN_RX_FIFO0: u32 = 2;
pub const MCAN_HPM_STORED_IN_RX_FIFO1: u32 = 3;
pub const MCAN_PROTOCOL_NONE_ERR: u32 = 0;
pub const MCAN_PROTOCOL_STUFF_ERR: u32 = 1;
pub const MCAN_PROTOCOL_FORM_ERR: u32 = 2;
pub const MCAN_PROTOCOL_ACK_ERR: u32 = 3;
pub const MCAN_PROTOCOL_BIT1_ERR: u32 = 4;
pub const MCAN_PROTOCOL_BIT0_ERR: u32 = 5;
pub const MCAN_PROTOCOL_CRC_ERR: u32 = 6;
pub const MCAN_PROTOCOL_ERR_NO_CHANGE: u32 = 7;
pub const MCAN_COM_STATE_SYNC: u32 = 0;
pub const MCAN_COM_STATE_IDLE: u32 = 1;
pub const MCAN_COM_STATE_RX: u32 = 2;
pub const MCAN_COM_STATE_TX: u32 = 3;
pub const MCAN_PROTOCOL_FLAG_PROTOCOL_EXCEPTION: u32 = 16384;
pub const MCAN_PROTOCOL_FLAG_RX_FDF: u32 = 8192;
pub const MCAN_PROTOCOL_FLAG_RX_BRS: u32 = 4096;
pub const MCAN_PROTOCOL_FLAG_RX_ESI: u32 = 2048;
pub const MCAN_PROTOCOL_FLAG_BUS_OFF: u32 = 128;
pub const MCAN_PROTOCOL_FLAG_ERR_WARNING: u32 = 64;
pub const MCAN_PROTOCOL_FLAG_ERR_PASSIVE: u32 = 32;
pub const MCAN_PROTOCOL_FLAG_ALL: u32 = 30944;
pub const MCAN_WATERMARK_RX_FIFO0: u32 = 0;
pub const MCAN_WATERMARK_RX_FIFO1: u32 = 1;
pub const MCAN_WATERMARK_TX_EVT_FIFO: u32 = 2;
pub const MCAN_RX_FIFO_BLOCKING: u32 = 0;
pub const MCAN_RX_FIFO_OVERWRITE: u32 = 2147483648;
pub const MCAN_NMF_ACCEPT_IN_RX_FIFO0: u32 = 0;
pub const MCAN_NMF_ACCEPT_IN_RX_FIFO1: u32 = 1;
pub const MCAN_NMF_REJECT: u32 = 2;
pub const MCAN_REMOTE_FRAME_FILTER: u32 = 0;
pub const MCAN_REMOTE_FRAME_REJECT: u32 = 1;
pub const MCAN_INT_LINE0: u32 = 1;
pub const MCAN_INT_LINE1: u32 = 2;
pub const MCAN_TIMEOUT_CONT: u32 = 0;
pub const MCAN_TIMEOUT_TX_EVT_FIFO: u32 = 2;
pub const MCAN_TIMEOUT_RX_FIFO0: u32 = 4;
pub const MCAN_TIMEOUT_RX_FIFO1: u32 = 6;
pub const MCAN_INT_RX_FIFO0_NEW_MSG: u32 = 1;
pub const MCAN_INT_RX_FIFO0_WATERMARK: u32 = 2;
pub const MCAN_INT_RX_FIFO0_FULL: u32 = 4;
pub const MCAN_INT_RX_FIFO0_MSG_LOST: u32 = 8;
pub const MCAN_INT_RX_FIFO1_NEW_MSG: u32 = 16;
pub const MCAN_INT_RX_FIFO1_WATERMARK: u32 = 32;
pub const MCAN_INT_RX_FIFO1_FULL: u32 = 64;
pub const MCAN_INT_RX_FIFO1_MSG_LOST: u32 = 128;
pub const MCAN_INT_RX_HPM: u32 = 256;
pub const MCAN_INT_TX_CPLT: u32 = 512;
pub const MCAN_INT_TX_ABORT_CPLT: u32 = 1024;
pub const MCAN_INT_TX_FIFO_EMPTY: u32 = 2048;
pub const MCAN_INT_TX_EVT_FIFO_NEW_DATA: u32 = 4096;
pub const MCAN_INT_TX_EVT_FIFO_WATERMARK: u32 = 8192;
pub const MCAN_INT_TX_EVT_FIFO_FULL: u32 = 16384;
pub const MCAN_INT_TX_EVT_FIFO_LOST: u32 = 32768;
pub const MCAN_INT_TIMESTAMP_WRAPAROUND: u32 = 65536;
pub const MCAN_INT_RAM_ACCESS_FAILURE: u32 = 131072;
pub const MCAN_INT_TIMEOUT: u32 = 262144;
pub const MCAN_INT_RX_BUF_NEW_MSG: u32 = 524288;
pub const MCAN_INT_ERR_LOG_OVF: u32 = 4194304;
pub const MCAN_INT_ERR_PASSIVE: u32 = 8388608;
pub const MCAN_INT_ERR_WARNING: u32 = 16777216;
pub const MCAN_INT_BUS_OFF: u32 = 33554432;
pub const MCAN_INT_RAM_WDT: u32 = 67108864;
pub const MCAN_INT_ARB_PHASE_ERROR: u32 = 134217728;
pub const MCAN_INT_DATA_PHASE_ERROR: u32 = 268435456;
pub const MCAN_INT_RSVD_ADDR_ACCESS: u32 = 536870912;
pub const MCAN_INT_ALL: u32 = 1070596095;
pub const MCAN_FLAG_RX_FIFO0_NEW_MSG: u32 = 1;
pub const MCAN_FLAG_RX_FIFO0_WATERMARK: u32 = 2;
pub const MCAN_FLAG_RX_FIFO0_FULL: u32 = 4;
pub const MCAN_FLAG_RX_FIFO0_MSG_LOST: u32 = 8;
pub const MCAN_FLAG_RX_FIFO1_NEW_MSG: u32 = 16;
pub const MCAN_FLAG_RX_FIFO1_WATERMARK: u32 = 32;
pub const MCAN_FLAG_RX_FIFO1_FULL: u32 = 64;
pub const MCAN_FLAG_RX_FIFO1_MSG_LOST: u32 = 128;
pub const MCAN_FLAG_RX_HPM: u32 = 256;
pub const MCAN_FLAG_TX_CPLT: u32 = 512;
pub const MCAN_FLAG_TX_ABORT_CPLT: u32 = 1024;
pub const MCAN_FLAG_TX_FIFO_EMPTY: u32 = 2048;
pub const MCAN_FLAG_TX_EVT_FIFO_NEW_DATA: u32 = 4096;
pub const MCAN_FLAG_TX_EVT_FIFO_WATERMARK: u32 = 8192;
pub const MCAN_FLAG_TX_EVT_FIFO_FULL: u32 = 16384;
pub const MCAN_FLAG_TX_EVT_FIFO_LOST: u32 = 32768;
pub const MCAN_FLAG_TIMESTAMP_WRAPAROUND: u32 = 65536;
pub const MCAN_FLAG_RAM_ACCESS_FAILURE: u32 = 131072;
pub const MCAN_FLAG_TIMEOUT: u32 = 262144;
pub const MCAN_FLAG_RX_BUF_NEW_MSG: u32 = 524288;
pub const MCAN_FLAG_ERR_LOG_OVF: u32 = 4194304;
pub const MCAN_FLAG_ERR_PASSIVE: u32 = 8388608;
pub const MCAN_FLAG_ERR_WARNING: u32 = 16777216;
pub const MCAN_FLAG_BUS_OFF: u32 = 33554432;
pub const MCAN_FLAG_RAM_WDT: u32 = 67108864;
pub const MCAN_FLAG_ARB_PHASE_ERROR: u32 = 134217728;
pub const MCAN_FLAG_DATA_PHASE_ERROR: u32 = 268435456;
pub const MCAN_FLAG_RSVD_ADDR_ACCESS: u32 = 536870912;
pub const MCAN_FLAG_ALL: u32 = 1070596095;
pub const MCAN_EVT_TX_EVT: u32 = 1;
pub const MCAN_EVT_TX_WHEN_ABORTED: u32 = 2;
pub const en_functional_state_t_DISABLE: en_functional_state_t = 0;
pub const en_functional_state_t_ENABLE: en_functional_state_t = 1;
#[doc = " @brief Functional state"]
pub type en_functional_state_t = ::core::ffi::c_uint;
pub const en_flag_status_t_RESET: en_flag_status_t = 0;
pub const en_flag_status_t_SET: en_flag_status_t = 1;
#[doc = " @brief Flag status"]
pub type en_flag_status_t = ::core::ffi::c_uint;
#[doc = " @brief MCAN"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_MCAN_TypeDef {
    pub RESERVED0: [u8; 4usize],
    pub ENDN: u32,
    pub RESERVED1: [u8; 4usize],
    pub DBTP: u32,
    pub TEST: u32,
    pub RWD: u32,
    pub CCCR: u32,
    pub NBTP: u32,
    pub TSCC: u32,
    pub TSCV: u32,
    pub TOCC: u32,
    pub TOCV: u32,
    pub RESERVED2: [u8; 16usize],
    pub ECR: u32,
    pub PSR: u32,
    pub TDCR: u32,
    pub RESERVED3: [u8; 4usize],
    pub IR: u32,
    pub IE: u32,
    pub ILS: u32,
    pub ILE: u32,
    pub RESERVED4: [u8; 32usize],
    pub GFC: u32,
    pub SIDFC: u32,
    pub XIDFC: u32,
    pub RESERVED5: [u8; 4usize],
    pub XIDAM: u32,
    pub HPMS: u32,
    pub NDAT1: u32,
    pub NDAT2: u32,
    pub RXF0C: u32,
    pub RXF0S: u32,
    pub RXF0A: u32,
    pub RXBC: u32,
    pub RXF1C: u32,
    pub RXF1S: u32,
    pub RXF1A: u32,
    pub RXESC: u32,
    pub TXBC: u32,
    pub TXFQS: u32,
    pub TXESC: u32,
    pub TXBRP: u32,
    pub TXBAR: u32,
    pub TXBCR: u32,
    pub TXBTO: u32,
    pub TXBCF: u32,
    pub TXBTIE: u32,
    pub TXBCIE: u32,
    pub RESERVED6: [u8; 8usize],
    pub TXEFC: u32,
    pub TXEFS: u32,
    pub TXEFA: u32,
}
#[doc = " Global type definitions ('typedef')\n/\n/**\n @defgroup MCAN_Global_Types MCAN Global Types\n @{\n/\n/**\n @brief MCAN bit time configuration structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_bit_time_config_t {
    #[doc = "< Specifies the nominal bit rate prescaler.\nThis parameter must be a number between 1 and 512"]
    pub u32NominalPrescaler: u32,
    #[doc = "< Specifies the nominal time segment before sample point(the sum of Sync_Seg,\nProp_Seg and Phase_Seg1).\nThis parameter must be a number between 3 and 257"]
    pub u32NominalTimeSeg1: u32,
    #[doc = "< Specifies the nominal time segment after sample point(Phase_Seg2).\nThis parameter must be a number between 2 and 128"]
    pub u32NominalTimeSeg2: u32,
    #[doc = "< Specifies the nominal (re)synchronization jump width(SJW).\nThis parameter must be a number between 1 and 128"]
    pub u32NominalSyncJumpWidth: u32,
    #[doc = "< Specifies the data bit rate prescaler.\nThis parameter must be a number between 1 and 32\nNOTE: when u32TDC is MCAN_FD_TDC_ENABLE, the range is limited to 1, 2"]
    pub u32DataPrescaler: u32,
    #[doc = "< Specifies the data time segment before sample point(the sum of Sync_Seg,\nProp_Seg and Phase_Seg1).\nThis parameter must be a number between 2 and 33"]
    pub u32DataTimeSeg1: u32,
    #[doc = "< Specifies the data time segment after sample point(Phase_Seg2).\nThis parameter must be a number between 2 and 16"]
    pub u32DataTimeSeg2: u32,
    #[doc = "< Specifies the data (re)synchronization jump width(SJW).\nThis parameter must be a number between 1 and 16"]
    pub u32DataSyncJumpWidth: u32,
    #[doc = "< Enable or disable TDC(Transmitter Delay Compensation).\nThis parameter can be a value of @ref MCAN_TDC_Enable"]
    pub u32TDC: u32,
    #[doc = "< Specifies the transmitter delay compensation SSP offset.\nThis parameter must be a number between 0 and 127(MCAN clock)"]
    pub u32SspOffset: u32,
    #[doc = "< Specifies the transmitter delay compensation filter window length.\nThis parameter defines the minimum value for the SSP position.\nThe feature is enabled when this parameter is configured to a value\ngreater than u32SspOffset.\nThis parameter must be a number between 0 and 127(MCAN clock)"]
    pub u32TdcFilter: u32,
}
#[doc = " @brief MCAN message RAM address blocks"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_msg_ram_addr_t {
    #[doc = "< Output parameter. Indicates the standard filter list start address."]
    pub u32StdFilterStartAddr: u32,
    #[doc = "< Output parameter. Indicates the extended filter list start address."]
    pub u32ExtFilterStartAddr: u32,
    #[doc = "< Output parameter. Indicates the Rx FIFO 0 start address."]
    pub u32RxFifo0StartAddr: u32,
    #[doc = "< Output parameter. Indicates the Rx FIFO 1 start address."]
    pub u32RxFifo1StartAddr: u32,
    #[doc = "< Output parameter. Indicates the Rx buffer start address."]
    pub u32RxBufferStartAddr: u32,
    #[doc = "< Output parameter. Indicates the Tx event FIFO start address."]
    pub u32TxEventStartAddr: u32,
    #[doc = "< Output parameter. Indicates the Tx buffers start address."]
    pub u32TxBufferStartAddr: u32,
    #[doc = "< Output parameter. Indicates the Tx FIFO/Queue start address."]
    pub u32TxFifoQueueStartAddr: u32,
    #[doc = "< Output parameter. Indicates the end address of the allocated RAM."]
    pub u32EndAddr: u32,
    #[doc = "< Pointer to an address that used to store each standard ID filter element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32StdFilterAddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each extended ID filter element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32ExtFilterAddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each Rx FIFO0 element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32RxFifo0AddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each Rx FIFO1 element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32RxFifo1AddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each Rx buffer element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32RxBufferAddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each Tx event FIFO element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32TxEventAddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each dedicated Tx buffer element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32TxBufferAddrList: *mut u32,
    #[doc = "< Pointer to an address that used to store each Tx FIFO/queue element address.\nSet it to NULL if you do not need the element address information."]
    pub pu32TxFifoQueueAddrList: *mut u32,
}
#[doc = " @brief MCAN message RAM configuration structure definition\n @note The message RAM is 2K bytes and shared by MCAN1 and MCAN2."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_msg_ram_config_t {
    #[doc = "< Specifies the message RAM start address, word alignment."]
    pub u32AddrOffset: u32,
    #[doc = "< Specifies the number of standard message ID filters.\nThis parameter is used to allocate RAM to standard ID filters.\nThis parameter must be a number between 0 and 128"]
    pub u32StdFilterNum: u32,
    #[doc = "< Specifies the number of extended message ID filters.\nThis parameter is used to allocate RAM to extended ID filters.\nThis parameter must be a number between 0 and 64"]
    pub u32ExtFilterNum: u32,
    #[doc = "< Specifies the number of Rx FIFO0 elements.\nu32RxFifo0Num and u32RxFifo0DataSize are used to allocate RAM to Rx FIFO0.\nThis parameter must be a number between 0 and 64"]
    pub u32RxFifo0Num: u32,
    #[doc = "< Specifies the data field size in an Rx FIFO 0 element.\nThis parameter can be a value of @ref MCAN_Data_Field_Size"]
    pub u32RxFifo0DataSize: u32,
    #[doc = "< Specifies the number of Rx FIFO 1 elements.\nu32RxFifo1Num and u32RxFifo1DataSize are used to allocate RAM to Rx FIFO1.\nThis parameter must be a number between 0 and 64"]
    pub u32RxFifo1Num: u32,
    #[doc = "< Specifies the data field size in an Rx FIFO 1 element.\nThis parameter can be a value of @ref MCAN_Data_Field_Size"]
    pub u32RxFifo1DataSize: u32,
    #[doc = "< Specifies the number of dedicated Rx buffer elements.\nu32RxBufferNum and u32RxBufferDataSize are used to allocate RAM to Rx buffer.\nThis parameter must be a number between 0 and 64"]
    pub u32RxBufferNum: u32,
    #[doc = "< Specifies the data field size in an Rx buffer element.\nThis parameter can be a value of @ref MCAN_Data_Field_Size"]
    pub u32RxBufferDataSize: u32,
    #[doc = "< Specifies the number of Tx event FIFO elements.\nThis parameter is used to allocate RAM to Tx event FIFO.\nThis parameter must be a number between 0 and 32"]
    pub u32TxEventNum: u32,
    #[doc = "< Specifies the number of dedicated Tx buffers.\nu32TxBufferNum and u32TxFifoQueueNum and u32TxDataSize are used to allocate RAM for Tx messages.\nThe sum of u32TxBufferNum and u32TxFifoQueueNum must be a number between 0 and 32"]
    pub u32TxBufferNum: u32,
    #[doc = "< Specifies the number of Tx buffers used for Tx FIFO/queue.\nThe sum of u32TxFifoQueueNum and u32TxBufferNum must be a number between 0 and 32"]
    pub u32TxFifoQueueNum: u32,
    #[doc = "< Specifies Tx FIFO/Queue operation mode.\nThis parameter can be a value of @ref MCAN_Tx_FIFO_Queue_Mode"]
    pub u32TxFifoQueueMode: u32,
    #[doc = "< Specifies the data field size in a Tx element.\nThis parameter can be a value of @ref MCAN_Data_Field_Size"]
    pub u32TxDataSize: u32,
    #[doc = "< Output parameter. Indicates the message RAM size that allocated to the configured MCAN.\nThe \"u32AddrOffset+u32AllocatedSize\" of the current configured MCAN is the minimum start\naddress(u32AddrOffset) of the next MCAN(shares message RAM with the configured MCAN before) to be configured."]
    pub u32AllocatedSize: u32,
}
#[doc = " @brief MCAN filter structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_filter_t {
    #[doc = "< Specifies the ID type.\nThis parameter can be a value of @ref MCAN_ID_Type"]
    pub u32IdType: u32,
    #[doc = "< Specifies the filter which will be initialized.\nThis parameter must be a number between:\n- 0 and stc_mcan_msg_ram_config_t.u32StdFilterNum-1(@ref stc_mcan_msg_ram_config_t), if u32IdType is MCAN_STD_ID.\n- 0 and stc_mcan_msg_ram_config_t.u32ExtFilterNum-1(@ref stc_mcan_msg_ram_config_t), if u32IdType is MCAN_EXT_ID.\nNOTE: When configuring filter elements sequence by calling API MCAN_Init(), this parameter can be ignored. The local function\nwill handle this parameter.\nWhen configuring filter element one by one by calling API MCAN_FilterConfig(), it is required to specify\nthe index of the target filter through this parameter."]
    pub u32FilterIndex: u32,
    #[doc = "< Specifies the filter type.\nThis parameter can be a value of @ref MCAN_Filter_Type\nThe value MCAN_FILTER_RANGE_NO_EIDM is permitted only when u32IdType is MCAN_EXT_ID.\nThis parameter is ignored if u32FilterConfig is set to MCAN_FILTER_TO_RX_BUF"]
    pub u32FilterType: u32,
    #[doc = "< Specifies the filter configuration.\nThis parameter can be a value of @ref MCAN_Filter_Config"]
    pub u32FilterConfig: u32,
    #[doc = "< Specifies the filter ID1.\nThis parameter must be a number between:\n- 0 and 0x7FF, if u32IdType is MCAN_STD_ID\n- 0 and 0x1FFFFFFF, if u32IdType is MCAN_EXT_ID"]
    pub u32FilterId1: u32,
    #[doc = "< Specifies the filter ID2.\nThis parameter is ignored if u32FilterConfig is set to MCAN_FILTER_TO_RX_BUF.\nThis parameter must be a number between:\n- 0 and 0x7FF, if u32IdType is MCAN_STD_ID\n- 0 and 0x1FFFFFFF, if u32IdType is MCAN_EXT_ID"]
    pub u32FilterId2: u32,
    #[doc = "< Specifies the dedicated Rx buffer in which the matching message will be stored.\nThis parameter must be a number between 0 and 63, and less than or equal to\nu32RxBufferNum of @ref stc_mcan_msg_ram_config_t\nThis parameter is ignored if u32FilterConfig is different from MCAN_FILTER_TO_RX_BUF"]
    pub u32RxBufferIndex: u32,
}
#[doc = " @brief MCAN filter initialization structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_filter_config_t {
    #[doc = "< Pointer to the standard ID filter elements list.\nThese filter elements can be configured only when:\npstcStdFilterList != NULL and\nu32StdFilterConfigNum > 0 and\nu32StdFilterConfigNum <= u32StdFilterNum of @ref stc_mcan_msg_ram_config_t"]
    pub pstcStdFilterList: *mut stc_mcan_filter_t,
    #[doc = "< Pointer to the extended ID filter elements list.\nThese filter elements can be configured only when:\npstcExtFilterList != NULL and\nu32ExtFilterConfigNum > 0 and\nu32ExtFilterConfigNum <= u32ExtFilterNum of @ref stc_mcan_msg_ram_config_t"]
    pub pstcExtFilterList: *mut stc_mcan_filter_t,
    #[doc = "< Number of the standard ID filter elements which to be configured.\nThis parameter must less than or equal to u32StdFilterNum\nof @ref stc_mcan_msg_ram_config_t"]
    pub u32StdFilterConfigNum: u32,
    #[doc = "< Number of the extended ID filter elements which to be configured.\nThis parameter must less than or equal to u32ExtFilterNum\nof @ref stc_mcan_msg_ram_config_t"]
    pub u32ExtFilterConfigNum: u32,
}
#[doc = " @brief MCAN initialization structure"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_init_t {
    #[doc = "< Specifies MCAN operating mode.\nThis parameter can be a value of @ref MCAN_Operating_Mode"]
    pub u32Mode: u32,
    #[doc = "< Specifies the frame format supported by MCAN hardware.\nThis parameter can be a value of @ref MCAN_Frame_Format"]
    pub u32FrameFormat: u32,
    #[doc = "< Enable or disable automatic retransmission.\nThis parameter can be a value of @ref MCAN_Auto_Retx_Enable"]
    pub u32AutoRetx: u32,
    #[doc = "< Enable or disable transmit pause.\nIf transmit pause is enabled, MCAN pauses for two CAN bit times before starting\nthe next transmission after itself has successfully transmitted a frame.\nThis parameter can be a value of @ref MCAN_Tx_Pause_Enable"]
    pub u32TxPause: u32,
    #[doc = "< Enable or disable protocol exception handling.\nWhen this function is disabled, MCAN will transmit an error frame\nwhen it detects a protocol exception condition.\nThis parameter can be a value of @ref MCAN_Protocol_Exception_Enable"]
    pub u32ProtocolException: u32,
    #[doc = "< MCAN bit time configuration structure"]
    pub stcBitTime: stc_mcan_bit_time_config_t,
    #[doc = "< Message RAM configuration structure."]
    pub stcMsgRam: stc_mcan_msg_ram_config_t,
    #[doc = "< Acceptance filter configuration structure."]
    pub stcFilter: stc_mcan_filter_config_t,
}
#[doc = " @brief MCAN Tx message structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_tx_msg_t {
    #[doc = "< Specifies the ID.\nThis parameter must be a number between:\n- 0 and 0x7FF, if IDE is 0\n- 0 and 0x1FFFFFFF, if IDE is 1"]
    pub ID: u32,
    #[doc = "< IDentifier Extension bit. Specifies the ID type for the transmitted message.\nThis parameter can be a value of:\n- 0: 11-bit standard ID\n- 1: 29-bit extended ID"]
    pub IDE: u32,
    #[doc = "< Remote Transmission Request. Specifies the frame type of the transmitted message.\nThis parameter can be a value of:\n- 0: Data frame to be transmitted\n- 1: Remote frame to be transmitted"]
    pub RTR: u32,
    #[doc = "< Data Length Code. Specifies the length of the data field of the transmitted frame.\nThis parameter can be a value of @ref MCAN_Data_Length_Code"]
    pub DLC: u32,
    #[doc = "< Error State Indicator. Specifies the error state indicator.\nThis parameter can be a value of:\n- 0: Transmitting node is error active\n- 1: Transmitting node is error passive"]
    pub ESI: u32,
    #[doc = "< Bit Rate Switch. Specifies whether the Tx frame is transmitted with or without bit rate switching.\nThis parameter can be a value of:\n- 0: Frame transmitted without bit rate switching\n- 1: Frame transmitted with bit rate switching"]
    pub BRS: u32,
    #[doc = "< FD Format indicator. Specifies whether the Tx frame is transmitted in classic or FD format.\nThis parameter can be a value of:\n- 0: Classical CAN frame format\n- 1: CAN FD frame format (new DLC-coding and CRC)"]
    pub FDF: u32,
    #[doc = "< Specifies the event FIFO control.\nThis parameter can be a value of:\n- 0: DO NOT store tx event\n- 1: Store tx event into TX event FIFO"]
    pub u32StoreTxEvent: u32,
    #[doc = "< Specifies the message marker to be copied into Tx event FIFO\nelement for identification of Tx message status.\nThis parameter must be a number between:\n- 0 and 0xFF if 8-bit message marker used(CCCR.WMM == 0)\n- 0 and 0xFFFF if 16-bit-width message marker used(CCCR.WMM == 1)"]
    pub u32MsgMarker: u32,
    #[doc = "< Specifies the dedicated Tx buffer that used to transmit the message.\nThis parameter can be a value of @ref MCAN_Tx_Location\nThis parameter valid when Tx via dedicated Tx buffer."]
    pub u32TxBuffer: u32,
    #[doc = "< Data payload of the message that to be transmitted."]
    pub au8Data: [u8; 64usize],
    #[doc = "< Output parameter of Tx buffer index of last Tx FIFO/queue request.\nThis parameter valid when Tx via FIFO or queue."]
    pub u32LastTxFifoQueueRequest: u32,
}
#[doc = " @brief MCAN Rx message structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_rx_msg_t {
    #[doc = "< Specifies the ID.\nThis parameter must be a number between:\n- 0 and 0x7FF, if IDE is 0\n- 0 and 0x1FFFFFFF, if IDE is 1"]
    pub ID: u32,
    #[doc = "< IDentifier Extension bit. Specifies the ID type for the received message.\nThis parameter can be a value of:\n- 0: 11-bit standard ID\n- 1: 29-bit extended ID"]
    pub IDE: u32,
    #[doc = "< Remote Transmission Request. Specifies the frame type of the received message.\nThis parameter can be a value of:\n- 0: Data frame received\n- 1: Remote frame received"]
    pub RTR: u32,
    #[doc = "< Data Length Code. Specifies the length of data filed of the received frame.\nThis parameter can be a value of @ref MCAN_Data_Length_Code"]
    pub DLC: u32,
    #[doc = "< Error State Indicator. Specifies the error state indicator.\nThis parameter can be a value of:\n- 0: Transmitting node is error active\n- 1: Transmitting node is error passive"]
    pub ESI: u32,
    #[doc = "< Bit Rate Switch. Specifies whether the Tx frame is received with or without bit rate switching.\nThis parameter can be a value of:\n- 0: Frame received without bit rate switching\n- 1: Frame received with bit rate switching"]
    pub BRS: u32,
    #[doc = "< FD Format indicator. Specifies whether the Tx frame is received in classic or FD format.\nThis parameter can be a value of:\n- 0: Classical CAN frame format\n- 1: CAN FD frame format (new DLC-coding and CRC)"]
    pub FDF: u32,
    #[doc = "< Specifies the timestamp counter value captured on start of frame reception.\nThis parameter must be a number between 0 and 0xFFFF"]
    pub u32RxTimestamp: u32,
    #[doc = "< Specifies the index of matching Rx acceptance filter element.\nThis parameter must be a number between:\n- 0 and 127, if IDE is 0\n- 0 and 63, if IDE is 1"]
    pub u32FilterIndex: u32,
    #[doc = "< Specifies whether the accepted frame did not match any Rx filter.\nAcceptance of non-matching frames may be configured via @ref MCAN_GlobalFilterConfig()\nThis parameter can be:\n- 0: Received frame matching filter index u32FilterIndex\n- 1: Received frame did not match any Rx filter element"]
    pub u32NmfFlag: u32,
    #[doc = "< Data payload of the received message"]
    pub au8Data: [u8; 64usize],
    #[doc = "< Size of Rx data payload"]
    pub u32DataSize: u32,
}
#[doc = " @brief MCAN Tx event structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_tx_event_t {
    #[doc = "< Specifies the ID.\nThis parameter must be a number between:\n- 0 and 0x7FF, if IDE is 0\n- 0 and 0x1FFFFFFF, if IDE is 1"]
    pub ID: u32,
    #[doc = "< IDentifier Extension bit. Specifies the ID type for the transmitted message.\nThis parameter can be a value of:\n- 0: 11-bit standard ID\n- 1: 29-bit extended ID"]
    pub IDE: u32,
    #[doc = "< Remote Transmission Request. Specifies the frame type of the transmitted message.\nThis parameter can be a value of:\n- 0: Data frame transmitted\n- 1: Remote frame transmitted"]
    pub RTR: u32,
    #[doc = "< Data Length Code. Specifies the length of the transmitted frame.\nThis parameter can be a value of @ref MCAN_Data_Length_Code"]
    pub DLC: u32,
    #[doc = "< Error State Indicator. Specifies the error state indicator.\nThis parameter can be a value of:\n- 0: Transmitting node is error active\n- 1: Transmitting node is error passive"]
    pub ESI: u32,
    #[doc = "< Bit Rate Switch. Specifies whether the Tx frame is transmitted with or without bit rate switching.\nThis parameter can be a value of:\n- 0: Frame transmitted without bit rate switching\n- 1: Frame transmitted with bit rate switching"]
    pub BRS: u32,
    #[doc = "< FD Format indicator. Specifies whether the Tx frame is transmitted in classic or FD format.\nThis parameter can be a value of:\n- 0: Classical CAN frame format\n- 1: CAN FD frame format (new DLC-coding and CRC)"]
    pub FDF: u32,
    #[doc = "< Specifies the timestamp counter value captured on start of frame transmission.\nThis parameter is valid only when 8-bit message marker used.\nThis parameter must be a number between 0 and 0xFFFF."]
    pub u32TxTimestamp: u32,
    #[doc = "< Specifies the message marker copied into Tx Event FIFO element for identification of Tx message status.\nThis parameter must be a number between:\n- 0 and 0xFF if 8-bit message marker used(CCCR.WMM == 0)\n- 0 and 0xFFFF if 16-bit-width message marker used(CCCR.WMM == 1)"]
    pub u32MsgMarker: u32,
    #[doc = "< Specifies the event type.\nThis parameter can be a value of @ref MCAN_Evt_Type"]
    pub u32EventType: u32,
}
#[doc = " @brief MCAN high priority message status structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_hpm_status_t {
    #[doc = "< Specifies the filter list of the matching filter element.\nThis parameter can be:\n- 0: Standard filter list\n- 1: Extended filter list"]
    pub u8FilterListType: u8,
    #[doc = "< Specifies the index of matching filter element.\nThis parameter can be a number between:\n- 0 and 127, if u8FilterListType is 0 (Standard)\n- 0 and 63, if u8FilterListType is 1 (Extended)"]
    pub u8FilterIndex: u8,
    #[doc = "< Specifies the high priority message storage.\nThis parameter can be a value of @ref MCAN_HPM_Storage"]
    pub u8MsgStorage: u8,
    #[doc = "< Specifies the index of Rx FIFO element to which the message was stored.\nThis parameter is valid only when u8MsgStorage is:\nMCAN_HPM_STORED_IN_RX_FIFO0 or MCAN_HPM_STORED_IN_RX_FIFO1"]
    pub u8MsgIndex: u8,
}
#[doc = " @brief MCAN protocol status structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_protocol_status_t {
    #[doc = "< Specifies the type of the last error that occurred on the CAN bus.\nThis parameter can be a value of @ref MCAN_Protocol_Error_Code"]
    pub u8LastErrorCode: u8,
    #[doc = "< Specifies the type of the last error that occurred in the data phase of a CAN FD format\nframe with its BRS flag set.\nThis parameter can be a value of @ref MCAN_Protocol_Error_Code"]
    pub u8DataLastErrorCode: u8,
    #[doc = "< Specifies the CAN module communication state.\nThis parameter can be a value of @ref MCAN_Com_State"]
    pub u8ComState: u8,
    #[doc = "< Specifies the CAN module error status.\nThis parameter can be:\n- 0: The CAN is in the Error_Active state\n- 1: The CAN is in the Error_Passive state"]
    pub u8ErrorPassiveFlag: u8,
    #[doc = "< Specifies the CAN module warning status.\nThis parameter can be:\n- 0: Both error counters are below the Error_Warning limit of 96\n- 1: At least one of error counter has reached the Error_Warning limit of 96"]
    pub u8WarningFlag: u8,
    #[doc = "< Specifies the CAN module Bus_Off status.\nThis parameter can be:\n- 0: The CAN is not in Bus_Off state\n- 1: The CAN is in Bus_Off state"]
    pub u8BusOffFlag: u8,
    #[doc = "< Specifies ESI flag of last received CAN FD message.\nThis parameter can be:\n- 0: Last received CAN FD message did not have its ESI flag set\n- 1: Last received CAN FD message had its ESI flag set"]
    pub u8RxESIFlag: u8,
    #[doc = "< Specifies BRS flag of last received CAN FD message.\nThis parameter can be:\n- 0: Last received CAN FD message did not have its BRS flag set\n- 1: Last received CAN FD message had its BRS flag set"]
    pub u8RxBRSFlag: u8,
    #[doc = "< Specifies if CAN FD message (FDF flag set) has been received since last protocol status.\nThis parameter can be:\n- 0: Since this bit was reset by the CPU, no CAN FD message has been received\n- 1: Message in CAN FD format with FDF flag set has been received"]
    pub u8RxFDFFlag: u8,
    #[doc = "< Specifies the CAN module protocol exception status.\nThis parameter can be:\n- 0: No protocol exception event occurred since last read access\n- 1: Protocol exception event occurred"]
    pub u8ProtocolExceptionFlag: u8,
    #[doc = "< Specifies the Transmitter Delay Compensation Value.\nThis parameter can be a number between 0 and 127"]
    pub u8TdcValue: u8,
}
#[doc = " @brief MCAN error counters structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_mcan_error_counter_t {
    #[doc = "< Specifies the Transmit Error Counter Value.\nThis parameter can be a number between 0 and 255"]
    pub u8TxErrorCount: u8,
    #[doc = "< Specifies the Receive Error Counter Value.\nThis parameter can be a number between 0 and 127"]
    pub u8RxErrorCount: u8,
    #[doc = "< Specifies the Receive Error Passive status.\nThis parameter can be:\n- 0: The Receive Error Counter (u8RxErrorCount) is below the error passive level of 128\n- 1: The Receive Error Counter (u8RxErrorCount) has reached the error passive level of 128"]
    pub u8RxErrorPassive: u8,
    #[doc = "< Specifies the Transmit/Receive error logging counter value.\nThis parameter can be a number between 0 and 255.\nThis counter is incremented each time when a CAN protocol error causes the u8TxErrorCount\nor the u8RxErrorCount to be incremented. The counter stops at 255; the next increment of\nu8TxErrorCount or u8RxErrorCount sets interrupt flag MCAN_FLAG_ERR_LOG_OVF"]
    pub u8ErrorLogging: u8,
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup MCAN_Global_Functions\n @{"]
    pub fn MCAN_Init(MCANx: *mut CM_MCAN_TypeDef, pstcMcanInit: *mut stc_mcan_init_t) -> i32;
    pub fn MCAN_StructInit(pstcMcanInit: *mut stc_mcan_init_t) -> i32;
    pub fn MCAN_DeInit(MCANx: *mut CM_MCAN_TypeDef) -> i32;
    pub fn MCAN_Start(MCANx: *mut CM_MCAN_TypeDef);
    pub fn MCAN_Stop(MCANx: *mut CM_MCAN_TypeDef) -> i32;
    pub fn MCAN_EnterSleepMode(MCANx: *mut CM_MCAN_TypeDef) -> i32;
    pub fn MCAN_ExitSleepMode(MCANx: *mut CM_MCAN_TypeDef) -> i32;
    pub fn MCAN_GetMsgRamAddr(
        MCANx: *const CM_MCAN_TypeDef,
        pstcAddr: *mut stc_mcan_msg_ram_addr_t,
    ) -> i32;
    pub fn MCAN_FilterConfig(
        MCANx: *const CM_MCAN_TypeDef,
        pstcFilter: *const stc_mcan_filter_t,
    ) -> i32;
    pub fn MCAN_GlobalFilterConfig(
        MCANx: *mut CM_MCAN_TypeDef,
        u32StdNmfOperation: u32,
        u32ExtNmfOperation: u32,
        u32StdRemoteOperation: u32,
        u32ExtRemoteOperation: u32,
    );
    pub fn MCAN_SetExtIDMask(MCANx: *mut CM_MCAN_TypeDef, u32Mask: u32);
    pub fn MCAN_RxFifoOperationModeConfig(
        MCANx: *mut CM_MCAN_TypeDef,
        u32RxFifo: u32,
        u32OperationMode: u32,
    );
    pub fn MCAN_SetFifoWatermark(MCANx: *mut CM_MCAN_TypeDef, u32Fifo: u32, u32Watermark: u32);
    pub fn MCAN_RamWatchdogConfig(MCANx: *mut CM_MCAN_TypeDef, u32StartValue: u32);
    pub fn MCAN_GetRamWatchdogCountValue(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_TimestampCounterConfig(MCANx: *mut CM_MCAN_TypeDef, u32TsPrescaler: u32);
    pub fn MCAN_TimestampCounterCmd(MCANx: *mut CM_MCAN_TypeDef, enNewState: en_functional_state_t);
    pub fn MCAN_GetTimestampCounter(MCANx: *const CM_MCAN_TypeDef) -> u16;
    pub fn MCAN_ResetTimestampCounter(MCANx: *mut CM_MCAN_TypeDef);
    pub fn MCAN_TimeoutCounterConfig(
        MCANx: *mut CM_MCAN_TypeDef,
        u32ToSelect: u32,
        u32ToPeriod: u32,
    );
    pub fn MCAN_TimeoutCounterCmd(MCANx: *mut CM_MCAN_TypeDef, enNewState: en_functional_state_t);
    pub fn MCAN_GetTimeoutCounter(MCANx: *const CM_MCAN_TypeDef) -> u16;
    pub fn MCAN_ResetTimeoutCounter(MCANx: *mut CM_MCAN_TypeDef);
    pub fn MCAN_TxDelayCompensationConfig(
        MCANx: *mut CM_MCAN_TypeDef,
        u32SspOffset: u32,
        u32TdcFilter: u32,
    );
    pub fn MCAN_TxDelayCompensationCmd(
        MCANx: *mut CM_MCAN_TypeDef,
        enNewState: en_functional_state_t,
    );
    pub fn MCAN_SetFrameFormat(MCANx: *mut CM_MCAN_TypeDef, u32FrameFormat: u32);
    pub fn MCAN_EdgeFilteringCmd(MCANx: *mut CM_MCAN_TypeDef, enNewState: en_functional_state_t);
    pub fn MCAN_TxEventMsgMarkerConfig(MCANx: *mut CM_MCAN_TypeDef, u32MsgMarker: u32);
    pub fn MCAN_AddMsgToTxFifoQueue(
        MCANx: *mut CM_MCAN_TypeDef,
        pTxMsg: *mut stc_mcan_tx_msg_t,
    ) -> i32;
    pub fn MCAN_AddMsgToTxBuffer(
        MCANx: *mut CM_MCAN_TypeDef,
        pTxMsg: *mut stc_mcan_tx_msg_t,
    ) -> i32;
    pub fn MCAN_EnableTxBufferRequest(MCANx: *mut CM_MCAN_TypeDef, u32TxBuffer: u32);
    pub fn MCAN_AbortTxRequest(MCANx: *mut CM_MCAN_TypeDef, u32TxBuffer: u32);
    pub fn MCAN_GetRxMsg(
        MCANx: *mut CM_MCAN_TypeDef,
        u32RxLocation: u32,
        pRxMsg: *mut stc_mcan_rx_msg_t,
    ) -> i32;
    pub fn MCAN_GetTxEvent(MCANx: *mut CM_MCAN_TypeDef, pTxEvent: *mut stc_mcan_tx_event_t) -> i32;
    pub fn MCAN_GetHighPriorityMsgStatus(
        MCANx: *const CM_MCAN_TypeDef,
        pHpmStatus: *mut stc_mcan_hpm_status_t,
    ) -> i32;
    pub fn MCAN_GetProtocolStatus(
        MCANx: *const CM_MCAN_TypeDef,
        pProtocolStatus: *mut stc_mcan_protocol_status_t,
    ) -> i32;
    pub fn MCAN_GetTdcValue(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_GetDataLastErrorCode(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_GetLastErrorCode(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_GetComState(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_GetProtocolFlagStatus(
        MCANx: *const CM_MCAN_TypeDef,
        u32PsFlag: u32,
    ) -> en_flag_status_t;
    pub fn MCAN_GetErrorCounter(
        MCANx: *const CM_MCAN_TypeDef,
        pErrorCounter: *mut stc_mcan_error_counter_t,
    ) -> i32;
    pub fn MCAN_GetStatus(MCANx: *const CM_MCAN_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn MCAN_ClearStatus(MCANx: *mut CM_MCAN_TypeDef, u32Flag: u32);
    pub fn MCAN_GetTxOccurredList(MCANx: *const CM_MCAN_TypeDef) -> u32;
    pub fn MCAN_GetTxAbortedList(MCANx: *const CM_MCAN_TypeDef) -> u32;
    pub fn MCAN_CheckTxOccurred(MCANx: *const CM_MCAN_TypeDef, u32TxBuffer: u32) -> i32;
    pub fn MCAN_CheckTxAborted(MCANx: *const CM_MCAN_TypeDef, u32TxBuffer: u32) -> i32;
    pub fn MCAN_CheckRxBufferMsgAvailable(
        MCANx: *mut CM_MCAN_TypeDef,
        u32RxBufferIndex: u32,
    ) -> i32;
    pub fn MCAN_CheckTxBufferPending(MCANx: *const CM_MCAN_TypeDef, u32TxBuffer: u32) -> i32;
    pub fn MCAN_GetRxFifoFillLevel(MCANx: *const CM_MCAN_TypeDef, u32RxFifo: u32) -> u32;
    pub fn MCAN_GetTxFifoFreeLevel(MCANx: *const CM_MCAN_TypeDef) -> u32;
    pub fn MCAN_CheckRestrictedOperationMode(MCANx: *const CM_MCAN_TypeDef) -> i32;
    pub fn MCAN_ExitRestrictedOperationMode(MCANx: *mut CM_MCAN_TypeDef);
    pub fn MCAN_GetStartedTxBufferNum(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_GetPreparedTxBufferNum(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_GetBusLogicalState(MCANx: *const CM_MCAN_TypeDef) -> u8;
    pub fn MCAN_TxPinControl(MCANx: *mut CM_MCAN_TypeDef, u32PinCtrl: u32);
    pub fn MCAN_IntCmd(
        MCANx: *mut CM_MCAN_TypeDef,
        u32IntType: u32,
        u32IntLine: u32,
        enNewState: en_functional_state_t,
    );
    pub fn MCAN_TxBufferNotificationCmd(
        MCANx: *mut CM_MCAN_TypeDef,
        u32TxBuffer: u32,
        u32Notification: u32,
        enNewState: en_functional_state_t,
    );
}
