/* automatically generated by rust-bindgen 0.72.1 */

pub const ADC_SEQ_A: u32 = 0;
pub const ADC_SEQ_B: u32 = 1;
pub const ADC_CH0: u32 = 0;
pub const ADC_CH1: u32 = 1;
pub const ADC_CH2: u32 = 2;
pub const ADC_CH3: u32 = 3;
pub const ADC_CH4: u32 = 4;
pub const ADC_CH5: u32 = 5;
pub const ADC_CH6: u32 = 6;
pub const ADC_CH7: u32 = 7;
pub const ADC_CH8: u32 = 8;
pub const ADC_CH9: u32 = 9;
pub const ADC_CH10: u32 = 10;
pub const ADC_CH11: u32 = 11;
pub const ADC_CH12: u32 = 12;
pub const ADC_CH13: u32 = 13;
pub const ADC_CH14: u32 = 14;
pub const ADC_CH15: u32 = 15;
pub const ADC1_EXT_CH: u32 = 15;
pub const ADC2_EXT_CH: u32 = 7;
pub const ADC3_EXT_CH: u32 = 11;
pub const ADC_MX_CH0: u32 = 1;
pub const ADC_MX_CH1: u32 = 2;
pub const ADC_MX_CH2: u32 = 4;
pub const ADC_MX_CH3: u32 = 8;
pub const ADC_MX_CH4: u32 = 16;
pub const ADC_MX_CH5: u32 = 32;
pub const ADC_MX_CH6: u32 = 64;
pub const ADC_MX_CH7: u32 = 128;
pub const ADC_MX_CH8: u32 = 256;
pub const ADC_MX_CH9: u32 = 512;
pub const ADC_MX_CH10: u32 = 1024;
pub const ADC_MX_CH11: u32 = 2048;
pub const ADC_MX_CH12: u32 = 4096;
pub const ADC_MX_CH13: u32 = 8192;
pub const ADC_MX_CH14: u32 = 16384;
pub const ADC_MX_CH15: u32 = 32768;
pub const ADC1_MX_CH_ALL: u32 = 65535;
pub const ADC2_MX_CH_ALL: u32 = 255;
pub const ADC3_MX_CH_ALL: u32 = 4095;
pub const ADC_MD_SEQA_SINGLESHOT: u32 = 0;
pub const ADC_MD_SEQA_CONT: u32 = 1;
pub const ADC_MD_SEQA_SEQB_SINGLESHOT: u32 = 2;
pub const ADC_MD_SEQA_CONT_SEQB_SINGLESHOT: u32 = 3;
pub const ADC_MD_SEQA_BUF: u32 = 4;
pub const ADC_MD_SEQA_BUF_SEQB_SINGLESHOT: u32 = 6;
pub const ADC_RESOLUTION_12BIT: u32 = 0;
pub const ADC_RESOLUTION_10BIT: u32 = 16;
pub const ADC_RESOLUTION_8BIT: u32 = 32;
pub const ADC_DATAALIGN_RIGHT: u32 = 0;
pub const ADC_DATAALIGN_LEFT: u32 = 128;
pub const ADC_AVG_CNT2: u32 = 0;
pub const ADC_AVG_CNT4: u32 = 256;
pub const ADC_AVG_CNT8: u32 = 512;
pub const ADC_AVG_CNT16: u32 = 768;
pub const ADC_AVG_CNT32: u32 = 1024;
pub const ADC_AVG_CNT64: u32 = 1280;
pub const ADC_AVG_CNT128: u32 = 1536;
pub const ADC_AVG_CNT256: u32 = 1792;
pub const ADC_RESUME_SCAN_CONT: u32 = 0;
pub const ADC_RESUME_SCAN_RESTART: u32 = 4;
pub const ADC_SAMPLE_MD_NORMAL: u32 = 0;
pub const ADC_SAMPLE_MD_OVER: u32 = 4096;
pub const ADC_OVER_SAMPLE_SHIFT_0BIT: u32 = 0;
pub const ADC_OVER_SAMPLE_SHIFT_1BIT: u32 = 256;
pub const ADC_OVER_SAMPLE_SHIFT_2BIT: u32 = 512;
pub const ADC_OVER_SAMPLE_SHIFT_3BIT: u32 = 768;
pub const ADC_OVER_SAMPLE_SHIFT_4BIT: u32 = 1024;
pub const ADC_OVER_SAMPLE_SHIFT_5BIT: u32 = 1280;
pub const ADC_OVER_SAMPLE_SHIFT_6BIT: u32 = 1536;
pub const ADC_OVER_SAMPLE_SHIFT_7BIT: u32 = 1792;
pub const ADC_OVER_SAMPLE_SHIFT_8BIT: u32 = 2048;
pub const ADC_HARDTRIG_ADTRG_PIN: u32 = 0;
pub const ADC_HARDTRIG_EVT0: u32 = 1;
pub const ADC_HARDTRIG_EVT1: u32 = 2;
pub const ADC_HARDTRIG_EVT0_EVT1: u32 = 3;
pub const ADC_HARDTRIG_EDGE_RISING: u32 = 0;
pub const ADC_INT_EOCA: u32 = 1;
pub const ADC_INT_EOCB: u32 = 2;
pub const ADC_INT_ALL: u32 = 3;
pub const ADC_EXTCH_EXTERN_ANALOG_PIN: u32 = 0;
pub const ADC_EXTCH_INTERN_ANALOG_SRC: u32 = 1;
pub const ADC_FLAG_EOCA: u32 = 1;
pub const ADC_FLAG_EOCB: u32 = 2;
pub const ADC_FLAG_NESTED: u32 = 16;
pub const ADC_FLAG_ALL: u32 = 19;
pub const ADC_SYNC_ADC1_ADC2: u32 = 0;
pub const ADC_SYNC_ADC1_ADC2_ADC3: u32 = 16;
pub const ADC_SYNC_SINGLE_DELAY_TRIG: u32 = 0;
pub const ADC_SYNC_SINGLE_PARALLEL_TRIG: u32 = 32;
pub const ADC_SYNC_CYCLIC_DELAY_TRIG: u32 = 64;
pub const ADC_SYNC_CYCLIC_PARALLEL_TRIG: u32 = 96;
pub const ADC_AWD0: u32 = 0;
pub const ADC_AWD1: u32 = 1;
pub const ADC_AWD_INT_AWD0: u32 = 2;
pub const ADC_AWD_INT_AWD1: u32 = 32;
pub const ADC_AWD_INT_ALL: u32 = 34;
pub const ADC_AWD_MD_CMP_OUT: u32 = 0;
pub const ADC_AWD_MD_CMP_IN: u32 = 1;
pub const ADC_AWD_COMB_INVD: u32 = 0;
pub const ADC_AWD_COMB_OR: u32 = 256;
pub const ADC_AWD_COMB_AND: u32 = 512;
pub const ADC_AWD_COMB_XOR: u32 = 768;
pub const ADC_AWD_FLAG_AWD0: u32 = 1;
pub const ADC_AWD_FLAG_AWD1: u32 = 2;
pub const ADC_AWD_FLAG_COMB: u32 = 16;
pub const ADC_AWD_FLAG_ALL: u32 = 19;
pub const ADC1_PIN_PA0: u32 = 0;
pub const ADC1_PIN_PA1: u32 = 1;
pub const ADC1_PIN_PA2: u32 = 2;
pub const ADC1_PIN_PA3: u32 = 3;
pub const ADC1_PIN_PA4: u32 = 4;
pub const ADC1_PIN_PA5: u32 = 5;
pub const ADC1_PIN_PA6: u32 = 6;
pub const ADC1_PIN_PA7: u32 = 7;
pub const ADC1_PIN_PB0: u32 = 8;
pub const ADC1_PIN_PB1: u32 = 9;
pub const ADC1_PIN_PC0: u32 = 10;
pub const ADC1_PIN_PC1: u32 = 11;
pub const ADC1_PIN_PC2: u32 = 12;
pub const ADC1_PIN_PC3: u32 = 13;
pub const ADC1_PIN_PC4: u32 = 14;
pub const ADC1_PIN_PC5: u32 = 15;
pub const ADC2_PIN_PA4: u32 = 0;
pub const ADC2_PIN_PA5: u32 = 1;
pub const ADC2_PIN_PA6: u32 = 2;
pub const ADC2_PIN_PA7: u32 = 3;
pub const ADC2_PIN_PB0: u32 = 4;
pub const ADC2_PIN_PB1: u32 = 5;
pub const ADC2_PIN_PC0: u32 = 6;
pub const ADC2_PIN_PC1: u32 = 7;
pub const ADC3_PIN_PE2: u32 = 0;
pub const ADC3_PIN_PE3: u32 = 1;
pub const ADC3_PIN_PE4: u32 = 2;
pub const ADC3_PIN_PE12: u32 = 3;
pub const ADC3_PIN_PE13: u32 = 4;
pub const ADC3_PIN_PE14: u32 = 5;
pub const ADC3_PIN_PA6: u32 = 6;
pub const ADC3_PIN_PA7: u32 = 7;
pub const ADC3_PIN_PB0: u32 = 8;
pub const ADC3_PIN_PB1: u32 = 9;
pub const ADC3_PIN_PE15: u32 = 10;
pub const ADC3_PIN_PB10: u32 = 11;
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 ADC"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_ADC_TypeDef {
    pub STR: u8,
    pub RESERVED0: [u8; 1usize],
    pub CR0: u16,
    pub CR1: u16,
    pub CR2: u16,
    pub RESERVED1: [u8; 2usize],
    pub TRGSR: u16,
    pub CHSELRA: u32,
    pub CHSELRB: u32,
    pub AVCHSELR: u32,
    pub EXCHSELR: u8,
    pub RESERVED2: [u8; 7usize],
    pub SSTR0: u8,
    pub SSTR1: u8,
    pub SSTR2: u8,
    pub SSTR3: u8,
    pub SSTR4: u8,
    pub SSTR5: u8,
    pub SSTR6: u8,
    pub SSTR7: u8,
    pub SSTR8: u8,
    pub SSTR9: u8,
    pub SSTR10: u8,
    pub SSTR11: u8,
    pub SSTR12: u8,
    pub SSTR13: u8,
    pub SSTR14: u8,
    pub SSTR15: u8,
    pub RESERVED3: [u8; 8usize],
    pub CHMUXR0: u16,
    pub CHMUXR1: u16,
    pub CHMUXR2: u16,
    pub CHMUXR3: u16,
    pub RESERVED4: [u8; 4usize],
    pub ISR: u8,
    pub ICR: u8,
    pub ISCLRR: u8,
    pub RESERVED5: [u8; 5usize],
    pub SYNCCR: u16,
    pub RESERVED6: [u8; 2usize],
    pub DR0: u16,
    pub DR1: u16,
    pub DR2: u16,
    pub DR3: u16,
    pub DR4: u16,
    pub DR5: u16,
    pub DR6: u16,
    pub DR7: u16,
    pub DR8: u16,
    pub DR9: u16,
    pub DR10: u16,
    pub DR11: u16,
    pub DR12: u16,
    pub DR13: u16,
    pub DR14: u16,
    pub DR15: u16,
    pub RESERVED7: [u8; 48usize],
    pub AWDCR: u16,
    pub AWDSR: u8,
    pub AWDSCLRR: u8,
    pub AWD0DR0: u16,
    pub AWD0DR1: u16,
    pub AWD0CHSR: u8,
    pub RESERVED8: [u8; 3usize],
    pub AWD1DR0: u16,
    pub AWD1DR1: u16,
    pub AWD1CHSR: u8,
}
#[doc = " Global type definitions ('typedef')\n/\n/**\n @defgroup ADC_Global_Types ADC Global Types\n @{\n/\n/**\n @brief Structure definition of analog watchdog(AWD) configuration."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_adc_awd_config_t {
    #[doc = "< Specifies the ADC analog watchdog mode.\nThis parameter can be a value of @ref ADC_AWD_Mode"]
    pub u16WatchdogMode: u16,
    #[doc = "< Specifies the ADC analog watchdog Low threshold value."]
    pub u16LowThreshold: u16,
    #[doc = "< Specifies the ADC analog watchdog High threshold value."]
    pub u16HighThreshold: u16,
}
#[doc = " @brief Structure definition of ADC initialization."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_adc_init_t {
    #[doc = "< Specifies the ADC scan convert mode.\nThis parameter can be a value of @ref ADC_Scan_Mode"]
    pub u16ScanMode: u16,
    #[doc = "< Specifies the ADC resolution.\nThis parameter can be a value of @ref ADC_Resolution"]
    pub u16Resolution: u16,
    #[doc = "< Specifies ADC data alignment.\nThis parameter can be a value of @ref ADC_Data_Align"]
    pub u16DataAlign: u16,
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup ADC_Global_Functions\n @{\n/\n/*******************************************************************************\nBasic features"]
    pub fn ADC_Init(ADCx: *mut CM_ADC_TypeDef, pstcAdcInit: *const stc_adc_init_t) -> i32;
    pub fn ADC_DeInit(ADCx: *mut CM_ADC_TypeDef) -> i32;
    pub fn ADC_StructInit(pstcAdcInit: *mut stc_adc_init_t) -> i32;
    pub fn ADC_ChCmd(
        ADCx: *mut CM_ADC_TypeDef,
        u8Seq: u8,
        u8Ch: u8,
        enNewState: en_functional_state_t,
    );
    pub fn ADC_MxChCmd(
        ADCx: *mut CM_ADC_TypeDef,
        u8Seq: u8,
        u32MxCh: u32,
        enNewState: en_functional_state_t,
    );
    pub fn ADC_SetSampleTime(ADCx: *mut CM_ADC_TypeDef, u8Ch: u8, u8SampleTime: u8);
    pub fn ADC_ConvDataAverageConfig(ADCx: *mut CM_ADC_TypeDef, u16AverageCount: u16);
    pub fn ADC_ConvDataAverageChCmd(
        ADCx: *mut CM_ADC_TypeDef,
        u8Ch: u8,
        enNewState: en_functional_state_t,
    );
    pub fn ADC_ConvDataAverageMxChCmd(
        ADCx: *mut CM_ADC_TypeDef,
        u32MxCh: u32,
        enNewState: en_functional_state_t,
    );
    pub fn ADC_SetExtChSrc(ADCx: *mut CM_ADC_TypeDef, u8ExtChSrc: u8);
    pub fn ADC_SetSampleMode(ADCx: *mut CM_ADC_TypeDef, u16Mode: u16);
    pub fn ADC_SetOverSampleShift(ADCx: *mut CM_ADC_TypeDef, u16ShiftValue: u16);
    pub fn ADC_TriggerConfig(ADCx: *mut CM_ADC_TypeDef, u8Seq: u8, u8TriggerSel: u8);
    pub fn ADC_TriggerCmd(ADCx: *mut CM_ADC_TypeDef, u8Seq: u8, enNewState: en_functional_state_t);
    pub fn ADC_IntCmd(ADCx: *mut CM_ADC_TypeDef, u8IntType: u8, enNewState: en_functional_state_t);
    pub fn ADC_Start(ADCx: *mut CM_ADC_TypeDef) -> i32;
    pub fn ADC_Stop(ADCx: *mut CM_ADC_TypeDef);
    pub fn ADC_GetValue(ADCx: *const CM_ADC_TypeDef, u8Ch: u8) -> u16;
    pub fn ADC_GetResolution(ADCx: *const CM_ADC_TypeDef) -> u16;
    pub fn ADC_GetStatus(ADCx: *const CM_ADC_TypeDef, u8Flag: u8) -> en_flag_status_t;
    pub fn ADC_ClearStatus(ADCx: *mut CM_ADC_TypeDef, u8Flag: u8);
    #[doc = "Advanced features"]
    pub fn ADC_ChRemap(ADCx: *mut CM_ADC_TypeDef, u8Ch: u8, u8AdcPin: u8);
    pub fn ADC_GetChPin(ADCx: *const CM_ADC_TypeDef, u8Ch: u8) -> u8;
    pub fn ADC_ResetChMapping(ADCx: *mut CM_ADC_TypeDef);
    pub fn ADC_SyncModeConfig(u16SyncUnit: u16, u16SyncMode: u16, u8TriggerDelay: u8);
    pub fn ADC_SyncModeCmd(enNewState: en_functional_state_t);
    pub fn ADC_AWD_Config(
        ADCx: *mut CM_ADC_TypeDef,
        u8AwdUnit: u8,
        u8Ch: u8,
        pstcAwd: *const stc_adc_awd_config_t,
    ) -> i32;
    pub fn ADC_AWD_SetCombMode(ADCx: *mut CM_ADC_TypeDef, u16CombMode: u16);
    pub fn ADC_AWD_SetMode(ADCx: *mut CM_ADC_TypeDef, u8AwdUnit: u8, u16WatchdogMode: u16);
    pub fn ADC_AWD_GetMode(ADCx: *mut CM_ADC_TypeDef, u8AwdUnit: u8) -> u16;
    pub fn ADC_AWD_SetThreshold(
        ADCx: *mut CM_ADC_TypeDef,
        u8AwdUnit: u8,
        u16LowThreshold: u16,
        u16HighThreshold: u16,
    );
    pub fn ADC_AWD_SelectCh(ADCx: *mut CM_ADC_TypeDef, u8AwdUnit: u8, u8Ch: u8);
    pub fn ADC_AWD_Cmd(ADCx: *mut CM_ADC_TypeDef, u8AwdUnit: u8, enNewState: en_functional_state_t);
    pub fn ADC_AWD_IntCmd(
        ADCx: *mut CM_ADC_TypeDef,
        u16IntType: u16,
        enNewState: en_functional_state_t,
    );
    pub fn ADC_AWD_GetStatus(ADCx: *const CM_ADC_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn ADC_AWD_ClearStatus(ADCx: *mut CM_ADC_TypeDef, u32Flag: u32);
    pub fn ADC_DataRegAutoClearCmd(ADCx: *mut CM_ADC_TypeDef, enNewState: en_functional_state_t);
    pub fn ADC_SetSeqResumeMode(ADCx: *mut CM_ADC_TypeDef, u16SeqResumeMode: u16);
}
