hc32f448_driver_sys 0.1.1

Provide driver function binding for HDSC's HC32F448 MCU.
Documentation
/* automatically generated by rust-bindgen 0.72.1 */

pub const DAC_CH1: u32 = 0;
pub const DAC_CH2: u32 = 1;
pub const DAC_DATA_SRC_DATAREG: u32 = 0;
pub const DAC_DATA_SRC_DCU: u32 = 2048;
pub const DAC_DATA_ALIGN_LEFT: u32 = 256;
pub const DAC_DATA_ALIGN_RIGHT: u32 = 0;
pub const DAC_RESOLUTION_12BIT: u32 = 12;
pub const DAC_ADP_SEL_ADC1: u32 = 1;
pub const DAC_ADP_SEL_ADC2: u32 = 2;
pub const DAC_ADP_SEL_ADC3: u32 = 4;
pub const DAC_ADP_SEL_ALL: u32 = 7;
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;
#[doc = " @brief DAC"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_DAC_TypeDef {
    pub DADR1: u16,
    pub DADR2: u16,
    pub DACR: u16,
    pub DAADPCR: u16,
    pub RESERVED0: [u8; 20usize],
    pub DAOCR: u16,
}
#[doc = " @brief Structure definition of DAC initialization."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_dac_init_t {
    #[doc = "< Data source to be converted\nThis parameter can be a value of @ref DAC_DATA_SRC"]
    pub u16Src: u16,
    #[doc = "< Specify the data alignment\nThis parameter can be a value of @ref DAC_DATAREG_ALIGN_PATTERN"]
    pub u16Align: u16,
    #[doc = "< Enable or disable analog output\nThis parameter can be a value of @ref en_functional_state_t"]
    pub enOutput: en_functional_state_t,
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup DAC_Global_Functions\n @{"]
    pub fn DAC_StructInit(pstcDacInit: *mut stc_dac_init_t) -> i32;
    pub fn DAC_Init(
        DACx: *mut CM_DAC_TypeDef,
        u16Ch: u16,
        pstcDacInit: *const stc_dac_init_t,
    ) -> i32;
    pub fn DAC_DeInit(DACx: *mut CM_DAC_TypeDef) -> i32;
    pub fn DAC_SetDataSrc(DACx: *mut CM_DAC_TypeDef, u16Ch: u16, u16Src: u16);
    pub fn DAC_DataRegAlignConfig(DACx: *mut CM_DAC_TypeDef, u16Align: u16);
    pub fn DAC_OutputCmd(DACx: *mut CM_DAC_TypeDef, u16Ch: u16, enNewState: en_functional_state_t);
    pub fn DAC_AMPCmd(DACx: *mut CM_DAC_TypeDef, u16Ch: u16, enNewState: en_functional_state_t);
    pub fn DAC_ADCPrioCmd(DACx: *mut CM_DAC_TypeDef, enNewState: en_functional_state_t);
    pub fn DAC_ADCPrioConfig(
        DACx: *mut CM_DAC_TypeDef,
        u16ADCxPrio: u16,
        enNewState: en_functional_state_t,
    );
    pub fn DAC_Start(DACx: *mut CM_DAC_TypeDef, u16Ch: u16) -> i32;
    pub fn DAC_Stop(DACx: *mut CM_DAC_TypeDef, u16Ch: u16) -> i32;
    pub fn DAC_StartDualCh(DACx: *mut CM_DAC_TypeDef);
    pub fn DAC_StopDualCh(DACx: *mut CM_DAC_TypeDef);
    pub fn DAC_SetChData(DACx: *mut CM_DAC_TypeDef, u16Ch: u16, u16Data: u16);
    pub fn DAC_SetDualChData(DACx: *mut CM_DAC_TypeDef, u16Data1: u16, u16Data2: u16);
    pub fn DAC_GetChConvertState(DACx: *const CM_DAC_TypeDef, u16Ch: u16) -> i32;
}