stm32 added better RTC periph API functions
Originally tracked at https://github.com/libopencm3/libopencm3/pull/1319
This commit is contained in:
committed by
Karl Palsson
parent
dc6ebac841
commit
0d72e6739c
@@ -426,6 +426,15 @@ specific memorymap.h header before including this header file.*/
|
||||
#define RTC_ALRMXSSR_SS_SHIFT (0)
|
||||
#define RTC_ALARXSSR_SS_MASK (0x7fff)
|
||||
|
||||
enum rtc_weekday {
|
||||
RTC_DR_WDU_MON = 0x01,
|
||||
RTC_DR_WDU_TUE,
|
||||
RTC_DR_WDU_WED,
|
||||
RTC_DR_WDU_THU,
|
||||
RTC_DR_WDU_FRI,
|
||||
RTC_DR_WDU_SAT,
|
||||
RTC_DR_WDU_SUN,
|
||||
};
|
||||
|
||||
BEGIN_DECLS
|
||||
|
||||
@@ -435,6 +444,24 @@ void rtc_lock(void);
|
||||
void rtc_unlock(void);
|
||||
void rtc_set_wakeup_time(uint16_t wkup_time, uint8_t rtc_cr_wucksel);
|
||||
void rtc_clear_wakeup_flag(void);
|
||||
void rtc_set_init_flag(void);
|
||||
void rtc_clear_init_flag(void);
|
||||
bool rtc_init_flag_is_ready(void);
|
||||
void rtc_wait_for_init_ready(void);
|
||||
void rtc_set_bypass_shadow_register(void);
|
||||
void rtc_enable_bypass_shadow_register(void);
|
||||
void rtc_disable_bypass_shadow_register(void);
|
||||
void rtc_set_am_format(void);
|
||||
void rtc_set_pm_format(void);
|
||||
void rtc_calendar_set_year(uint8_t year);
|
||||
void rtc_calendar_set_weekday(enum rtc_weekday rtc_dr_wdu);
|
||||
void rtc_calendar_set_month(uint8_t month);
|
||||
void rtc_calendar_set_day(uint8_t day);
|
||||
void rtc_calendar_set_date(uint8_t year, uint8_t month, uint8_t day, enum rtc_weekday rtc_dr_wdu);
|
||||
void rtc_time_set_hour(uint8_t hour, bool use_am_notation);
|
||||
void rtc_time_set_minute(uint8_t minute);
|
||||
void rtc_time_set_second(uint8_t second);
|
||||
void rtc_time_set_time(uint8_t hour, uint8_t minute, uint8_t second, bool use_am_notation);
|
||||
|
||||
END_DECLS
|
||||
/**@}*/
|
||||
|
||||
@@ -538,8 +538,8 @@ enum rcc_periph_rst {
|
||||
RST_DAC1 = _REG_BIT(0x10, 29), /* Compatibility alias */
|
||||
RST_CEC = _REG_BIT(0x10, 30),
|
||||
|
||||
/* Advanced peripherals */
|
||||
RST_BACKUPDOMAIN = _REG_BIT(0x20, 16),/* BDCR[16] */
|
||||
/* Backup domain control */
|
||||
RST_BDCR = _REG_BIT(0x20, 16),/* BDCR[16] */
|
||||
|
||||
/* AHB peripherals */
|
||||
RST_GPIOA = _REG_BIT(0x28, 17),
|
||||
|
||||
@@ -1092,6 +1092,9 @@ enum rcc_periph_rst {
|
||||
RST_SAI1RST = _REG_BIT(0x24, 22),/* F42x, F43x */
|
||||
RST_LTDC = _REG_BIT(0x24, 26),/* F42x, F43x */
|
||||
RST_DSI = _REG_BIT(0x24, 27),/* F42x, F43x */
|
||||
|
||||
/* Backup domain control */
|
||||
RST_BDCR = _REG_BIT(0x70, 16),/* BDCR[16] */
|
||||
};
|
||||
|
||||
#undef _REG_BIT
|
||||
|
||||
Reference in New Issue
Block a user