/* automatically generated by rust-bindgen 0.72.1 */

pub const FCM_TARGET_CLK_XTAL: u32 = 0;
pub const FCM_TARGET_CLK_XTAL32: u32 = 16;
pub const FCM_TARGET_CLK_HRC: u32 = 32;
pub const FCM_TARGET_CLK_LRC: u32 = 48;
pub const FCM_TARGET_CLK_SWDTLRC: u32 = 64;
pub const FCM_TARGET_CLK_PCLK1: u32 = 80;
pub const FCM_TARGET_CLK_MRC: u32 = 112;
pub const FCM_TARGET_CLK_PLLHP: u32 = 128;
pub const FCM_TARGET_CLK_DIV1: u32 = 0;
pub const FCM_TARGET_CLK_DIV4: u32 = 1;
pub const FCM_TARGET_CLK_DIV8: u32 = 2;
pub const FCM_TARGET_CLK_DIV32: u32 = 3;
pub const FCM_EXT_REF_OFF: u32 = 0;
pub const FCM_EXT_REF_ON: u32 = 32768;
pub const FCM_REF_CLK_RISING: u32 = 0;
pub const FCM_REF_CLK_FALLING: u32 = 4096;
pub const FCM_REF_CLK_BOTH: u32 = 8192;
pub const FCM_DIG_FILTER_OFF: u32 = 0;
pub const FCM_DIG_FILTER_DIV1: u32 = 256;
pub const FCM_DIG_FILTER_DIV4: u32 = 512;
pub const FCM_DIG_FILTER_DIV16: u32 = 768;
pub const FCM_REF_CLK_EXTCLK: u32 = 0;
pub const FCM_REF_CLK_XTAL: u32 = 128;
pub const FCM_REF_CLK_XTAL32: u32 = 136;
pub const FCM_REF_CLK_HRC: u32 = 144;
pub const FCM_REF_CLK_LRC: u32 = 152;
pub const FCM_REF_CLK_SWDTLRC: u32 = 160;
pub const FCM_REF_CLK_PCLK1: u32 = 168;
pub const FCM_REF_CLK_MRC: u32 = 184;
pub const FCM_REF_CLK_PLLHP: u32 = 192;
pub const FCM_REF_CLK_DIV32: u32 = 0;
pub const FCM_REF_CLK_DIV128: u32 = 1;
pub const FCM_REF_CLK_DIV1024: u32 = 2;
pub const FCM_REF_CLK_DIV8192: u32 = 3;
pub const FCM_ERR_RST_OFF: u32 = 0;
pub const FCM_ERR_RST_ON: u32 = 128;
pub const FCM_EXP_TYPE_INT: u32 = 0;
pub const FCM_EXP_TYPE_RST: u32 = 16;
pub const FCM_INT_OVF: u32 = 4;
pub const FCM_INT_END: u32 = 2;
pub const FCM_INT_ERR: u32 = 1;
pub const FCM_FLAG_ERR: u32 = 1;
pub const FCM_FLAG_END: u32 = 2;
pub const FCM_FLAG_OVF: u32 = 4;
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 FCM"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_FCM_TypeDef {
    pub LVR: u32,
    pub UVR: u32,
    pub CNTR: u32,
    pub STR: u32,
    pub MCCR: u32,
    pub RCCR: u32,
    pub RIER: u32,
    pub SR: u32,
    pub CLR: u32,
}
#[doc = " Global type definitions ('typedef')\n/\n/**\n @defgroup FCM_Global_Types FCM Global Types\n @{\n/\n/**\n @brief  FCM Init structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_fcm_init_t {
    #[doc = "< FCM lower limit value"]
    pub u16LowerLimit: u16,
    #[doc = "< FCM upper limit value"]
    pub u16UpperLimit: u16,
    #[doc = "< FCM target clock source selection, @ref FCM_Target_Clock_Src"]
    pub u32TargetClock: u32,
    #[doc = "< FCM target clock source division selection, @ref FCM_Target_Clock_Div"]
    pub u32TargetClockDiv: u32,
    #[doc = "< FCM external reference clock function config, @ref FCM_Ext_Ref_Clock_Config"]
    pub u32ExtRefClockEnable: u32,
    #[doc = "< FCM reference clock trigger edge selection, @ref FCM_Ref_Clock_Edge"]
    pub u32RefClockEdge: u32,
    #[doc = "< FCM digital filter function config, @ref FCM_Digital_Filter_Config"]
    pub u32DigitalFilter: u32,
    #[doc = "< FCM reference clock source selection, @ref FCM_Ref_Clock_Src"]
    pub u32RefClock: u32,
    #[doc = "< FCM reference clock source division selection, @ref FCM_Ref_Clock_Div"]
    pub u32RefClockDiv: u32,
    #[doc = "< FCM exception type select,  @ref FCM_Exception_Type"]
    pub u32ExceptionType: u32,
}
unsafe extern "C" {
    pub fn FCM_Init(FCMx: *mut CM_FCM_TypeDef, pstcFcmInit: *const stc_fcm_init_t) -> i32;
    pub fn FCM_StructInit(pstcFcmInit: *mut stc_fcm_init_t) -> i32;
    pub fn FCM_DeInit(FCMx: *mut CM_FCM_TypeDef) -> i32;
    pub fn FCM_GetCountValue(FCMx: *mut CM_FCM_TypeDef) -> u16;
    pub fn FCM_SetTargetClock(FCMx: *mut CM_FCM_TypeDef, u32ClockSrc: u32, u32Div: u32);
    pub fn FCM_SetRefClock(FCMx: *mut CM_FCM_TypeDef, u32ClockSrc: u32, u32Div: u32);
    pub fn FCM_GetStatus(FCMx: *mut CM_FCM_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn FCM_ClearStatus(FCMx: *mut CM_FCM_TypeDef, u32Flag: u32);
    pub fn FCM_ResetCmd(FCMx: *mut CM_FCM_TypeDef, enNewState: en_functional_state_t);
    pub fn FCM_IntCmd(
        FCMx: *mut CM_FCM_TypeDef,
        u32IntType: u32,
        enNewState: en_functional_state_t,
    );
    pub fn FCM_Cmd(FCMx: *mut CM_FCM_TypeDef, enNewState: en_functional_state_t);
}
