/* automatically generated by rust-bindgen 0.72.1 */

pub const DCU_DATA_WIDTH_8BIT: u32 = 0;
pub const DCU_DATA_WIDTH_16BIT: u32 = 16;
pub const DCU_DATA_WIDTH_32BIT: u32 = 32;
pub const DCU_CMP_TRIG_DATA0: u32 = 0;
pub const DCU_CMP_TRIG_DATA0_DATA1_DATA2: u32 = 256;
pub const DCU_MD_INVD: u32 = 0;
pub const DCU_MD_ADD: u32 = 1;
pub const DCU_MD_SUB: u32 = 2;
pub const DCU_MD_HW_ADD: u32 = 3;
pub const DCU_MD_HW_SUB: u32 = 4;
pub const DCU_MD_CMP: u32 = 5;
pub const DCU_MD_TRIANGLE_WAVE: u32 = 8;
pub const DCU_MD_SAWTOOTH_WAVE_INC: u32 = 9;
pub const DCU_MD_SAWTOOTH_WAVE_DEC: u32 = 10;
pub const DCU_FLAG_CARRY: u32 = 1;
pub const DCU_FLAG_DATA0_LT_DATA2: u32 = 2;
pub const DCU_FLAG_DATA0_EQ_DATA2: u32 = 4;
pub const DCU_FLAG_DATA0_GT_DATA2: u32 = 8;
pub const DCU_FLAG_DATA0_LT_DATA1: u32 = 16;
pub const DCU_FLAG_DATA0_EQ_DATA1: u32 = 32;
pub const DCU_FLAG_DATA0_GT_DATA1: u32 = 64;
pub const DCU_FLAG_SAWTOOTH_WAVE_RELOAD: u32 = 512;
pub const DCU_FLAG_TRIANGLE_WAVE_BOTTOM: u32 = 1024;
pub const DCU_FLAG_TRIANGLE_WAVE_TOP: u32 = 2048;
pub const DCU_FLAG_ALL: u32 = 3711;
pub const DCU_CATEGORY_OP: u32 = 0;
pub const DCU_CATEGORY_CMP_WIN: u32 = 1;
pub const DCU_CATEGORY_CMP_NON_WIN: u32 = 2;
pub const DCU_CATEGORY_WAVE: u32 = 3;
pub const DCU_INT_CMP_DATA0_LT_DATA2: u32 = 2;
pub const DCU_INT_CMP_DATA0_EQ_DATA2: u32 = 4;
pub const DCU_INT_CMP_DATA0_GT_DATA2: u32 = 8;
pub const DCU_INT_CMP_DATA0_LT_DATA1: u32 = 16;
pub const DCU_INT_CMP_DATA0_EQ_DATA1: u32 = 32;
pub const DCU_INT_CMP_DATA0_GT_DATA1: u32 = 64;
pub const DCU_INT_CMP_NON_WIN_ALL: u32 = 126;
pub const DCU_INT_CMP_WIN_INSIDE: u32 = 128;
pub const DCU_INT_CMP_WIN_OUTSIDE: u32 = 256;
pub const DCU_INT_CMP_WIN_ALL: u32 = 384;
pub const DCU_INT_OP_CARRY: u32 = 1;
pub const DCU_INT_TRIANGLE_WAVE_TOP: u32 = 2048;
pub const DCU_INT_TRIANGLE_WAVE_BOTTOM: u32 = 1024;
pub const DCU_INT_WAVE_MD_ALL: u32 = 3072;
pub const DCU_DATA0_IDX: u32 = 0;
pub const DCU_DATA1_IDX: u32 = 1;
pub const DCU_DATA2_IDX: 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 DCU"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_DCU_TypeDef {
    pub CTL: u32,
    pub FLAG: u32,
    pub DATA0: u32,
    pub DATA1: u32,
    pub DATA2: u32,
    pub FLAGCLR: u32,
    pub INTEVTSEL: u32,
}
#[doc = " @brief DCU initialization structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_dcu_init_t {
    #[doc = "< Specifies DCU operation.\nThis parameter can be a value of @ref DCU_Mode"]
    pub u32Mode: u32,
    #[doc = "< Specifies DCU data width.\nThis parameter can be a value of @ref DCU_Data_Width"]
    pub u32DataWidth: u32,
}
#[doc = " @brief DCU wave output configure structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_dcu_wave_config_t {
    #[doc = "< Defines the wave lower limit of the wave amplitude.\nThis parameter can be a value between Min_Data = 0 and Max_Data = 0xFFF"]
    pub u32LowerLimit: u32,
    #[doc = "< Defines the upper limit of the wave amplitude.\nThis parameter can be a value between Min_Data = 0 and Max_Data = 0xFFF"]
    pub u32UpperLimit: u32,
    #[doc = "< Defines the increasing/decreasing step.\nThis parameter can be a value between Min_Data = 0 and Max_Data = 0xFFF"]
    pub u32Step: u32,
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup DCU_Global_Functions\n @{"]
    pub fn DCU_Init(DCUx: *mut CM_DCU_TypeDef, pstcDcuInit: *const stc_dcu_init_t) -> i32;
    pub fn DCU_StructInit(pstcDcuInit: *mut stc_dcu_init_t) -> i32;
    pub fn DCU_DeInit(DCUx: *mut CM_DCU_TypeDef) -> i32;
    pub fn DCU_WaveConfig(
        DCUx: *mut CM_DCU_TypeDef,
        pstcWaveConfig: *const stc_dcu_wave_config_t,
    ) -> i32;
    pub fn DCU_SetMode(DCUx: *mut CM_DCU_TypeDef, u32Mode: u32);
    pub fn DCU_SetDataWidth(DCUx: *mut CM_DCU_TypeDef, u32DataWidth: u32);
    pub fn DCU_SetCompareCond(DCUx: *mut CM_DCU_TypeDef, u32Cond: u32);
    pub fn DCU_GetStatus(DCUx: *const CM_DCU_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn DCU_ClearStatus(DCUx: *mut CM_DCU_TypeDef, u32Flag: u32);
    pub fn DCU_GlobalIntCmd(DCUx: *mut CM_DCU_TypeDef, enNewState: en_functional_state_t);
    pub fn DCU_IntCmd(
        DCUx: *mut CM_DCU_TypeDef,
        u32IntCategory: u32,
        u32IntType: u32,
        enNewState: en_functional_state_t,
    );
    pub fn DCU_ReadData8(DCUx: *const CM_DCU_TypeDef, u32DataIndex: u32) -> u8;
    pub fn DCU_WriteData8(DCUx: *mut CM_DCU_TypeDef, u32DataIndex: u32, u8Data: u8);
    pub fn DCU_ReadData16(DCUx: *const CM_DCU_TypeDef, u32DataIndex: u32) -> u16;
    pub fn DCU_WriteData16(DCUx: *mut CM_DCU_TypeDef, u32DataIndex: u32, u16Data: u16);
    pub fn DCU_ReadData32(DCUx: *const CM_DCU_TypeDef, u32DataIndex: u32) -> u32;
    pub fn DCU_WriteData32(DCUx: *mut CM_DCU_TypeDef, u32DataIndex: u32, u32Data: u32);
}
