/* automatically generated by rust-bindgen 0.72.1 */

pub const RTC_DATA_FMT_DEC: u32 = 0;
pub const RTC_DATA_FMT_BCD: u32 = 1;
pub const RTC_CLK_SRC_XTAL32: u32 = 0;
pub const RTC_CLK_SRC_LRC: u32 = 144;
pub const RTC_CLK_SRC_XTAL_DIV: u32 = 129;
pub const RTC_HOUR_FMT_12H: u32 = 0;
pub const RTC_HOUR_FMT_24H: u32 = 8;
pub const RTC_INT_PERIOD_INVD: u32 = 0;
pub const RTC_INT_PERIOD_PER_HALF_SEC: u32 = 1;
pub const RTC_INT_PERIOD_PER_SEC: u32 = 2;
pub const RTC_INT_PERIOD_PER_MINUTE: u32 = 3;
pub const RTC_INT_PERIOD_PER_HOUR: u32 = 4;
pub const RTC_INT_PERIOD_PER_DAY: u32 = 5;
pub const RTC_INT_PERIOD_PER_MONTH: u32 = 6;
pub const RTC_CLK_COMPEN_DISABLE: u32 = 0;
pub const RTC_CLK_COMPEN_ENABLE: u32 = 128;
pub const RTC_CLK_COMPEN_MD_DISTRIBUTED: u32 = 0;
pub const RTC_CLK_COMPEN_MD_UNIFORM: u32 = 64;
pub const RTC_HOUR_24H: u32 = 0;
pub const RTC_HOUR_12H_AM: u32 = 0;
pub const RTC_HOUR_12H_PM: u32 = 32;
pub const RTC_MONTH_JANUARY: u32 = 1;
pub const RTC_MONTH_FEBRUARY: u32 = 2;
pub const RTC_MONTH_MARCH: u32 = 3;
pub const RTC_MONTH_APRIL: u32 = 4;
pub const RTC_MONTH_MAY: u32 = 5;
pub const RTC_MONTH_JUNE: u32 = 6;
pub const RTC_MONTH_JULY: u32 = 7;
pub const RTC_MONTH_AUGUST: u32 = 8;
pub const RTC_MONTH_SEPTEMBER: u32 = 9;
pub const RTC_MONTH_OCTOBER: u32 = 10;
pub const RTC_MONTH_NOVEMBER: u32 = 11;
pub const RTC_MONTH_DECEMBER: u32 = 12;
pub const RTC_WEEKDAY_SUNDAY: u32 = 0;
pub const RTC_WEEKDAY_MONDAY: u32 = 1;
pub const RTC_WEEKDAY_TUESDAY: u32 = 2;
pub const RTC_WEEKDAY_WEDNESDAY: u32 = 3;
pub const RTC_WEEKDAY_THURSDAY: u32 = 4;
pub const RTC_WEEKDAY_FRIDAY: u32 = 5;
pub const RTC_WEEKDAY_SATURDAY: u32 = 6;
pub const RTC_ALARM_WEEKDAY_SUNDAY: u32 = 1;
pub const RTC_ALARM_WEEKDAY_MONDAY: u32 = 2;
pub const RTC_ALARM_WEEKDAY_TUESDAY: u32 = 4;
pub const RTC_ALARM_WEEKDAY_WEDNESDAY: u32 = 8;
pub const RTC_ALARM_WEEKDAY_THURSDAY: u32 = 16;
pub const RTC_ALARM_WEEKDAY_FRIDAY: u32 = 32;
pub const RTC_ALARM_WEEKDAY_SATURDAY: u32 = 64;
pub const RTC_ALARM_WEEKDAY_EVERYDAY: u32 = 127;
pub const RTC_FLAG_RD_WR: u32 = 2;
pub const RTC_FLAG_ALARM: u32 = 8;
pub const RTC_FLAG_PERIOD: u32 = 4;
pub const RTC_FLAG_ALL: u32 = 14;
pub const RTC_FLAG_CLR_ALL: u32 = 12;
pub const RTC_INT_PERIOD: u32 = 32;
pub const RTC_INT_ALARM: u32 = 64;
pub const RTC_INT_ALL: u32 = 96;
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 RTC Init structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_rtc_init_t {
    #[doc = "< Specifies the RTC clock source.\nThis parameter can be a value of @ref RTC_Clock_Source"]
    pub u8ClockSrc: u8,
    #[doc = "< Specifies the RTC hour format.\nThis parameter can be a value of @ref RTC_Hour_Format"]
    pub u8HourFormat: u8,
    #[doc = "< Specifies the RTC interrupt period.\nThis parameter can be a value of @ref RTC_Interrupt_Period"]
    pub u8IntPeriod: u8,
    #[doc = "< Specifies the validity of RTC clock compensation.\nThis parameter can be a value of @ref RTC_Clock_Compensation"]
    pub u8ClockCompen: u8,
    #[doc = "< Specifies the mode of RTC clock compensation.\nThis parameter can be a value of @ref RTC_Clock_Compensation_Mode"]
    pub u8CompenMode: u8,
    #[doc = "< Specifies the value of RTC clock compensation.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 0x1FF"]
    pub u16CompenValue: u16,
}
#[doc = " @brief RTC Date structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_rtc_date_t {
    #[doc = "< Specifies the RTC Year.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 99"]
    pub u8Year: u8,
    #[doc = "< Specifies the RTC Month (in Decimal format).\nThis parameter can be a value of @ref RTC_Month"]
    pub u8Month: u8,
    #[doc = "< Specifies the RTC Day.\nThis parameter can be a number between Min_Data = 1 and Max_Data = 31"]
    pub u8Day: u8,
    #[doc = "< Specifies the RTC Weekday.\nThis parameter can be a value of @ref RTC_Weekday"]
    pub u8Weekday: u8,
}
#[doc = " @brief RTC Time structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_rtc_time_t {
    #[doc = "< Specifies the RTC Hour.\nThis parameter can be a number between Min_Data = 1 and Max_Data = 12 if the RTC_HOUR_FMT_12H is selected.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HOUR_FMT_24H is selected"]
    pub u8Hour: u8,
    #[doc = "< Specifies the RTC Minute.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 59"]
    pub u8Minute: u8,
    #[doc = "< Specifies the RTC Second.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 59"]
    pub u8Second: u8,
    #[doc = "< Specifies the RTC Am/Pm Time (in RTC_HOUR_FMT_12H mode).\nThis parameter can be a value of @ref RTC_Hour12_AM_PM"]
    pub u8AmPm: u8,
}
#[doc = " @brief RTC Alarm structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_rtc_alarm_t {
    #[doc = "< Specifies the RTC Alarm Hour.\nThis parameter can be a number between Min_Data = 1 and Max_Data = 12 if the RTC_HOUR_FMT_12H is selected.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HOUR_FMT_24H is selected"]
    pub u8AlarmHour: u8,
    #[doc = "< Specifies the RTC Alarm Minute.\nThis parameter can be a number between Min_Data = 0 and Max_Data = 59"]
    pub u8AlarmMinute: u8,
    #[doc = "< Specifies the RTC Alarm Weekday.\nThis parameter can be a value of @ref RTC_Alarm_Weekday"]
    pub u8AlarmWeekday: u8,
    #[doc = "< Specifies the RTC Alarm Am/Pm Time (in RTC_HOUR_FMT_12H mode).\nThis parameter can be a value of @ref RTC_Hour12_AM_PM"]
    pub u8AlarmAmPm: u8,
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup RTC_Global_Functions\n @{"]
    pub fn RTC_DeInit() -> i32;
    pub fn RTC_Init(pstcRtcInit: *const stc_rtc_init_t) -> i32;
    pub fn RTC_StructInit(pstcRtcInit: *mut stc_rtc_init_t) -> i32;
    pub fn RTC_EnterRwMode() -> i32;
    pub fn RTC_ExitRwMode() -> i32;
    pub fn RTC_ConfirmLPMCond() -> i32;
    pub fn RTC_SetIntPeriod(u8Period: u8);
    pub fn RTC_SetClockSrc(u8Src: u8);
    pub fn RTC_SetClockCompenValue(u16Value: u16);
    pub fn RTC_GetCounterState() -> en_functional_state_t;
    pub fn RTC_Cmd(enNewState: en_functional_state_t);
    pub fn RTC_LrcCmd(enNewState: en_functional_state_t);
    pub fn RTC_OneHzOutputCmd(enNewState: en_functional_state_t);
    pub fn RTC_ClockCompenCmd(enNewState: en_functional_state_t);
    pub fn RTC_SetDate(u8Format: u8, pstcRtcDate: *mut stc_rtc_date_t) -> i32;
    pub fn RTC_GetDate(u8Format: u8, pstcRtcDate: *mut stc_rtc_date_t) -> i32;
    pub fn RTC_SetTime(u8Format: u8, pstcRtcTime: *mut stc_rtc_time_t) -> i32;
    pub fn RTC_GetTime(u8Format: u8, pstcRtcTime: *mut stc_rtc_time_t) -> i32;
    pub fn RTC_SetAlarm(u8Format: u8, pstcRtcAlarm: *mut stc_rtc_alarm_t) -> i32;
    pub fn RTC_GetAlarm(u8Format: u8, pstcRtcAlarm: *mut stc_rtc_alarm_t) -> i32;
    pub fn RTC_AlarmCmd(enNewState: en_functional_state_t);
    pub fn RTC_IntCmd(u32IntType: u32, enNewState: en_functional_state_t);
    pub fn RTC_GetStatus(u32Flag: u32) -> en_flag_status_t;
    pub fn RTC_ClearStatus(u32Flag: u32);
}
