33 return ((dec / 10) << 4) | (dec % 10);
187 RTC_CR &= ~RTC_CR_BYPSHAD;
289 if (use_am_notation) {
#define RTC_CR_WUTE
Wakeup timer enable.
#define RTC_CR_WUCLKSEL_MASK
#define RTC_CR_BYPSHAD
Bypass the shadow registers.
#define RTC_CR_WUCLKSEL_SHIFT
#define RTC_CR_FMT
Hour format.
#define RTC_DR_WDU_MASK
Weekday units mask.
#define RTC_DR_MT_SHIFT
Month tens in BCD format shift.
#define RTC_DR_YT_SHIFT
Year tens in BCD format shift.
#define RTC_DR_MU_SHIFT
Month units in BCD format shift.
#define RTC_DR_MU_MASK
Month units in BCD format mask.
#define RTC_DR_YT_MASK
Year tens in BCD format mask.
#define RTC_DR_DT_SHIFT
Date tens in BCD format shift.
#define RTC_DR_DU_MASK
Date units in BCD format mask.
#define RTC_DR_MT_MASK
Month tens in BCD format mask.
#define RTC_DR_DT_MASK
Date tens in BCD format mask.
#define RTC_DR_DU_SHIFT
Date units in BCD format shift.
#define RTC_DR_WDU_SHIFT
Weekday units shift.
#define RTC_DR_YU_MASK
Year units in BCD format mask.
#define RTC_DR_YU_SHIFT
Year units in BCD format shift.
void rtc_calendar_set_weekday(enum rtc_weekday rtc_dr_wdu)
Sets the RTC BCD calendar weekday.
void rtc_disable_bypass_shadow_register(void)
Clears the bypass shadow bit in RTC_CR.
void rtc_unlock(void)
Unlock write access to the RTC registers.
void rtc_wait_for_synchro(void)
Wait for RTC registers to be synchronised with the APB1 bus.
void rtc_time_set_hour(uint8_t hour, bool use_am_notation)
Sets the RTC BCD time hour value.
void rtc_set_init_flag(void)
Sets the initialization flag.
void rtc_lock(void)
Lock write access to the RTC registers.
void rtc_time_set_minute(uint8_t minute)
Sets the RTC BCD time minute value.
void rtc_calendar_set_date(uint8_t year, uint8_t month, uint8_t day, enum rtc_weekday rtc_dr_wdu)
Sets the RTC BCD calendar value.
void rtc_calendar_set_month(uint8_t month)
Sets the RTC BCD calendar month value.
void rtc_clear_init_flag(void)
Clears (resets) the initialization flag.
void rtc_set_am_format(void)
Sets the RTC control register hour format to AM (24h)
bool rtc_init_flag_is_ready(void)
Returns if the RTC_ISR init flag RTC_ISR_INITF is set.
void rtc_time_set_time(uint8_t hour, uint8_t minute, uint8_t second, bool use_am_notation)
Sets the RTC BCD time.
void rtc_set_prescaler(uint32_t sync, uint32_t async)
Set RTC prescalars.
void rtc_wait_for_init_ready(void)
Waits infinitely for initialization flag to be set in RTC_ISR.
void rtc_calendar_set_year(uint8_t year)
Sets the RTC BCD calendar year value.
void rtc_enable_bypass_shadow_register(void)
Sets the bypass shadow bit in RTC_CR.
void rtc_time_set_second(uint8_t second)
Sets the RTC BCD time second value.
void rtc_set_wakeup_time(uint16_t wkup_time, uint8_t rtc_cr_wucksel)
Sets the wakeup time auto-reload value.
static uint8_t _rtc_dec_to_bcd(uint8_t dec)
void rtc_set_pm_format(void)
Sets the RTC control register hour format to PM (12h)
void rtc_clear_wakeup_flag(void)
Clears the wakeup flag.
void rtc_calendar_set_day(uint8_t day)
Sets the RTC BCD calendar day value.
#define RTC_ISR_WUTWF
WUTWF: Wakeup timer write flag.
#define RTC_ISR_RSF
RSF: Registers sync flag.
#define RTC_ISR_INITF
INITF: Initialization flag.
#define RTC_ISR_INIT
INIT: Initialization mode.
#define RTC_PRER_PREDIV_S_MASK
Sync prescaler factor mask.
#define RTC_PRER_PREDIV_A_SHIFT
Async prescaler factor shift.
#define RTC_WUTR
RTC wakeup timer register (RTC_WUTR)
#define RTC_PRER
RTC prescaler register (RTC_PRER)
#define RTC_DR
RTC date register (RTC_DR)
#define RTC_CR
RTC control register (RTC_CR)
#define RTC_WPR
RTC write protection register (RTC_WPR)
#define RTC_TR
RTC time register (RTC_TR)
#define RTC_ISR
RTC initialization and status register (RTC_ISR)
#define RTC_TR_ST_SHIFT
Second tens in BCD format shift.
#define RTC_TR_HU_MASK
Hour units in BCD format mask.
#define RTC_TR_MNU_SHIFT
Minute units in BCD format shift.
#define RTC_TR_MNU_MASK
Minute units in BCD format mask.
#define RTC_TR_PM
AM/PM notation.
#define RTC_TR_HU_SHIFT
Hour units in BCD format shift.
#define RTC_TR_SU_MASK
Second units in BCD format mask.
#define RTC_TR_ST_MASK
Second tens in BCD format mask.
#define RTC_TR_SU_SHIFT
Second units in BCD format shift.
#define RTC_TR_MNT_MASK
Minute tens in BCD format mask.
#define RTC_TR_HT_SHIFT
Hour tens in BCD format shift.
#define RTC_TR_MNT_SHIFT
Minute tens in BCD format shift.
#define RTC_TR_HT_MASK
Hour tens in BCD format mask.