/** @file bkp.h * Module handling the Backup (BKP) domain functionalities. * */ #ifndef _BKP_H_ #define _BKP_H_ //--includes-------------------------------------------------------------------- #include "stdint.h" //--type definitions------------------------------------------------------------ enum BkpRtcClockSrc { BKP_RTC_CLOCK_SRC_LSE = 0x0, BKP_RTC_CLOCK_SRC_LSI = 0x1, BKP_RTC_CLOCK_SRC_HSE = 0x2, }; enum BkpRtcIrq { BKP_RTC_IRQ_NONE = 0, BKP_RTC_IRQ_SECOND = 0x1 << 0, BKP_RTC_IRQ_ALARM = 0x1 << 1, BKP_RTC_IRQ_OVERFLOW = 0x1 << 2, }; typedef void (*BkpRtcCallback)(enum BkpRtcIrq src); //--functions------------------------------------------------------------------- void bkp_configure_rtc(uint32_t period_ms, enum BkpRtcClockSrc clock_src, enum BkpRtcIrq irq_mask, uint32_t alarm_tick, BkpRtcCallback callback); uint32_t bkp_read_rtc(void); void bkp_reset(void); //unimplemented functions void bkp_configure_tamper(); void bkp_calibrate_lsi(void); void bkp_configure_lse(bool enable); #endif //_BKP_H_