/* automatically generated by rust-bindgen 0.72.1 */

pub const CTC_REF_CLK_SRC_CTCREF: u32 = 0;
pub const CTC_REF_CLK_SRC_XTAL: u32 = 48;
pub const CTC_REF_CLK_SRC_XTAL32: u32 = 32;
pub const CTC_FLAG_TRIM_OK: u32 = 1;
pub const CTC_FLAG_TRIM_OVF: u32 = 2;
pub const CTC_FLAG_TRIM_UDF: u32 = 4;
pub const CTC_FLAG_BUSY: u32 = 8;
pub const CTC_FLAG_ALL: u32 = 15;
pub const CTC_REF_CLK_DIV2: u32 = 0;
pub const CTC_REF_CLK_DIV4: u32 = 1;
pub const CTC_REF_CLK_DIV8: u32 = 2;
pub const CTC_REF_CLK_DIV16: u32 = 3;
pub const CTC_REF_CLK_DIV64: u32 = 4;
pub const CTC_REF_CLK_DIV256: u32 = 5;
pub const CTC_REF_CLK_DIV1024: u32 = 6;
pub const CTC_REF_CLK_DIV4096: u32 = 7;
pub const CTC_HRC_CLK_DIV1: u32 = 0;
pub const CTC_HRC_CLK_DIV2: u32 = 1;
pub const CTC_HRC_CLK_DIV4: u32 = 2;
pub const CTC_HRC_CLK_DIV8: u32 = 3;
pub const CTC_HRC_CLK_DIV32: u32 = 4;
pub const CTC_HRC_CLK_DIV128: u32 = 5;
pub const CTC_HRC_CLK_DIV512: u32 = 6;
pub const CTC_HRC_CLK_DIV2048: u32 = 7;
pub const CTC_CTCREF_RISING_RISING: u32 = 0;
pub const CTC_CTCREF_RISING_FALLING: u32 = 4096;
pub const CTC_CTCREF_FALLING_RISING: u32 = 8192;
pub const CTC_CTCREF_FALLING_FALLING: u32 = 12288;
#[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;
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 CTC continuous trim initialization structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_ctc_ct_init_t {
    #[doc = "< HRC clock division\nThis parameter can be a value of @ref CTC_HRC_Clock_Division"]
    pub u32HrcClockDiv: u32,
    #[doc = "< Reference clock frequency\nThis parameter should refer user manual recommended values"]
    pub u32RefClockFreq: u32,
    #[doc = "< Reference clock source selection\nThis parameter can be a value of @ref CTC_Continuous_Trim_Reference_Clock_Source"]
    pub u32RefClockSrc: u32,
    #[doc = "< Reference clock division\nThis parameter can be a value of @ref CTC_Reference_Clock_Division"]
    pub u32RefClockDiv: u32,
    #[doc = "< CTC tolerance deviation\nThis parameter can be a value between Min_Data=0.0 and Max_Data=1.0(100%)"]
    pub f32TolerantErrRate: float32_t,
    #[doc = "< CTC TRMVAL value\nThis parameter can be a value between Min_Data=0 and Max_Data=0x3F"]
    pub u8TrimValue: u8,
}
#[doc = " @brief CTC single trim initialization structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_ctc_st_init_t {
    #[doc = "< HRC clock division\nThis parameter can be a value of @ref CTC_HRC_Clock_Division"]
    pub u32HrcClockDiv: u32,
    #[doc = "< CTCREF edge\nThis parameter can be a value of @ref CTC_Single_Trim_CTCREF_Edge"]
    pub u32CtcRefEdge: u32,
    #[doc = "< CTCREF edge time(unit:S)\nThis parameter should refer user actual CTCREF edge time"]
    pub f32CtcRefEdgeTime: float32_t,
    #[doc = "< CTC tolerance deviation\nThis parameter can be a value between Min_Data=0.0 and Max_Data=1.0(100%)"]
    pub f32TolerantErrRate: float32_t,
    #[doc = "< CTC TRMVAL value\nThis parameter can be a value between Min_Data=0 and Max_Data=0x3F"]
    pub u8TrimValue: u8,
}
unsafe extern "C" {
    pub fn CTC_CT_StructInit(pstcCtcInit: *mut stc_ctc_ct_init_t) -> i32;
    pub fn CTC_CT_Init(pstcCtcInit: *const stc_ctc_ct_init_t) -> i32;
    pub fn CTC_ST_StructInit(pstcCtcInit: *mut stc_ctc_st_init_t) -> i32;
    pub fn CTC_ST_Init(pstcCtcInit: *const stc_ctc_st_init_t) -> i32;
    pub fn CTC_DeInit() -> i32;
    pub fn CTC_IntCmd(enNewState: en_functional_state_t);
    pub fn CTC_GetStatus(u32Flag: u32) -> en_flag_status_t;
    pub fn CTC_SetTrimValue(u8TrimValue: u8);
    pub fn CTC_GetTrimValue() -> u8;
    pub fn CTC_SetReloadValue(u16ReloadValue: u16);
    pub fn CTC_GetReloadValue() -> u16;
    pub fn CTC_SetOffsetValue(u8OffsetValue: u8);
    pub fn CTC_GetOffsetValue() -> u8;
    pub fn CTC_GetCountValue() -> u16;
}
