最近使用GD32L233xxxx开发项目,使用RTC的方法,以类的形式总结如下:
RTC basic functions as follow:
#define BKP_VALUE 0x32F0
rtc_parameter_struct rtc_initpara;
rtc_alarm_struct rtc_alarm;
void WakeupConfig() {
rtc_wakeup_disable();
rtc_flag_clear(RTC_FLAG_WT);
exti_flag_clear(RTC_dev.RTC_wk_extiLine);
exti_interrupt_flag_clear(RTC_dev.RTC_wk_extiLine);
nvic_irq_enable(RTC_WKUP_IRQn, RTC_dev.RTC_wk_priority);
exti_init(RTC_dev.RTC_wk_extiLine, EXTI_INTERRUPT, EXTI_TRIG_RISING);
rtc_wakeup_clock_set(RTC_dev.RTC_wk_clkDiv);
rtc_wakeup_timer_set(RTC_dev.RTC_wk_timCnt);
rtc_wakeup_enable();
rtc_interrupt_enable(RTC_INT_WAKEUP);
}
static void rtc_pre_config(void) {
rcu_osci_on(RTC_dev.RTC_wk_osci);
rcu_osci_stab_wait(