hc32f460_driver_sys 0.1.0

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

pub const OTS_CLK_XTAL: u32 = 0;
pub const OTS_CLK_HRC: u32 = 2;
pub const OTS_AUTO_OFF_DISABLE: u32 = 0;
pub const OTS_AUTO_OFF_ENABLE: u32 = 8;
pub const OTS_PARAM_TEMP_COND_TN40: u32 = 0;
pub const OTS_PARAM_TEMP_COND_T25: u32 = 1;
pub const OTS_PARAM_TEMP_COND_T125: u32 = 2;
#[doc = " @brief Single precision floating point number (4 byte)"]
pub type float32_t = f32;
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 OTS initialization structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_ots_init_t {
    #[doc = "< Specifies clock source for OTS.\nThis parameter can be a value of @ref OTS_Clock_Source"]
    pub u16ClockSrc: u16,
    #[doc = "< Enable or disable OTS automatic-off(after sampled temperature).\nThis parameter can be a value of @ref OTS_Auto_Off_En"]
    pub u16AutoOffEn: u16,
    #[doc = "< K: Temperature slope (calculated by calibration experiment).\nIf you want to use the default parameters(slope K and offset M),\nspecify both 'f32SlopeK' and 'f32OffsetM' as ZERO."]
    pub f32SlopeK: float32_t,
    #[doc = "< M: Temperature offset (calculated by calibration experiment).\nIf you want to use the default parameters(slope K and offset M),\nspecify both 'f32SlopeK' and 'f32OffsetM' as ZERO."]
    pub f32OffsetM: float32_t,
}
unsafe extern "C" {
    pub fn OTS_Init(pstcOTSInit: *const stc_ots_init_t) -> i32;
    pub fn OTS_StructInit(pstcOTSInit: *mut stc_ots_init_t) -> i32;
    pub fn OTS_DeInit() -> i32;
    pub fn OTS_Polling(pf32Temp: *mut float32_t, u32Timeout: u32) -> i32;
    pub fn OTS_IntCmd(enNewState: en_functional_state_t);
    pub fn OTS_ScalingExperiment(
        pu16Dr1: *mut u16,
        pu16Dr2: *mut u16,
        pu16Ecr: *mut u16,
        pf32A: *mut float32_t,
        u32Timeout: u32,
    ) -> i32;
    pub fn OTS_CalculateTemp() -> float32_t;
}