6 #include "twr_common.h"
14 #define TWR_RTC_PREDIV_S 256
15 #define TWR_RTC_PREDIV_A 128
21 void twr_rtc_init(
void);
110 static inline void twr_rtc_disable_write()
120 static inline void twr_rtc_enable_write()
137 static inline void twr_rtc_wait()
139 while(!(RTC->ISR & RTC_ISR_RSF));
uint32_t twr_rtc_datetime_to_timestamp(struct tm *tm)
Convert date and time to UNIX timestamp.
int _twr_rtc_writable_semaphore
Initialize real-time clock.
void twr_rtc_get_timestamp(struct timespec *tv)
void twr_rtc_get_datetime(struct tm *tm)
int twr_rtc_set_datetime(struct tm *tm, int ms)
void twr_rtc_set_init(bool state)
Enable or disable RTC initialization mode.