libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
rtc_common_l1f024.h
Go to the documentation of this file.
1/** @addtogroup rtc_defines
2 * @author @htmlonly &copy; @endhtmlonly 2012 Karl Palsson <karlp@tweak.net.au>
3 *
4 * @brief This covers the "version 2" RTC peripheral.
5 *
6 * This is completely different
7 * to the v1 RTC periph on the F1 series devices. It has BCD counters, with
8 * automatic leapyear corrections and daylight savings support.
9 * This peripheral is used on the F0, F2, F3, F4 and L1 devices, though some
10 * only support a subset.
11 */
12/*
13 * This file is part of the libopencm3 project.
14 *
15 * Copyright (C) 2012 Karl Palsson <karlp@tweak.net.au>
16 *
17 * This library is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU Lesser General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public License
28 * along with this library. If not, see <http://www.gnu.org/licenses/>.
29 */
30
31/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA RTC.H
32The order of header inclusion is important. rtc.h includes the device
33specific memorymap.h header before including this header file.*/
34
35/** @cond */
36#ifdef LIBOPENCM3_RTC_H
37/** @endcond */
38#ifndef LIBOPENCM3_RTC2_H
39#define LIBOPENCM3_RTC2_H
40
41/**@{*/
42
43/** @defgroup rtc_registers RTC Registers
44 * @ingroup rtc_defines
45 * @brief Real Time Clock registers
46@{*/
47
48/** RTC time register (RTC_TR) */
49#define RTC_TR MMIO32(RTC_BASE + 0x00)
50
51/** RTC date register (RTC_DR) */
52#define RTC_DR MMIO32(RTC_BASE + 0x04)
53
54/** RTC control register (RTC_CR) */
55#define RTC_CR MMIO32(RTC_BASE + 0x08)
56
57/** RTC initialization and status register (RTC_ISR) */
58#define RTC_ISR MMIO32(RTC_BASE + 0x0c)
59
60/** RTC prescaler register (RTC_PRER) */
61#define RTC_PRER MMIO32(RTC_BASE + 0x10)
62
63/** RTC wakeup timer register (RTC_WUTR) */
64#define RTC_WUTR MMIO32(RTC_BASE + 0x14)
65
66/** RTC calibration register (RTC_CALIBR) NB: see also RTC_CALR */
67#define RTC_CALIBR MMIO32(RTC_BASE + 0x18)
68
69/** RTC alarm X register (RTC_ALRMxR) */
70#define RTC_ALRMAR MMIO32(RTC_BASE + 0x1c)
71#define RTC_ALRMBR MMIO32(RTC_BASE + 0x20)
72
73/** RTC write protection register (RTC_WPR)*/
74#define RTC_WPR MMIO32(RTC_BASE + 0x24)
75
76/** RTC sub second register (RTC_SSR) (high and med+ only) */
77#define RTC_SSR MMIO32(RTC_BASE + 0x28)
78
79/** RTC shift control register (RTC_SHIFTR) (high and med+ only) */
80#define RTC_SHIFTR MMIO32(RTC_BASE + 0x2c)
81
82/** RTC time stamp time register (RTC_TSTR) */
83#define RTC_TSTR MMIO32(RTC_BASE + 0x30)
84/** RTC time stamp date register (RTC_TSDR) */
85#define RTC_TSDR MMIO32(RTC_BASE + 0x34)
86/** RTC timestamp sub second register (RTC_TSSSR) (high and med+ only) */
87#define RTC_TSSSR MMIO32(RTC_BASE + 0x38)
88
89/** RTC calibration register (RTC_CALR) (high and med+ only) */
90#define RTC_CALR MMIO32(RTC_BASE + 0x3c)
91
92/** RTC tamper and alternate function configuration register (RTC_TAFCR) */
93#define RTC_TAFCR MMIO32(RTC_BASE + 0x40)
94
95/** RTC alarm X sub second register (RTC_ALRMxSSR) (high and med+ only) */
96#define RTC_ALRMASSR MMIO32(RTC_BASE + 0x44)
97#define RTC_ALRMBSSR MMIO32(RTC_BASE + 0x48)
98
99#define RTC_BKP_BASE (RTC_BASE + 0x50)
100/** RTC backup registers (RTC_BKPxR) */
101#define RTC_BKPXR(reg) MMIO32(RTC_BKP_BASE + (4 * (reg)))
102
103/**@}*/
104
105
106/** @defgroup rtc_tr_values RTC Time register (RTC_TR) values
107 * @ingroup rtc_registers
108 * Note: Bits [31:23], 15, and 7 are reserved, and must be kept at reset value.
109@{*/
110/** AM/PM notation */
111#define RTC_TR_PM (1 << 22)
112/** Hour tens in BCD format shift */
113#define RTC_TR_HT_SHIFT (20)
114/** Hour tens in BCD format mask */
115#define RTC_TR_HT_MASK (0x3)
116/** Hour units in BCD format shift */
117#define RTC_TR_HU_SHIFT (16)
118/** Hour units in BCD format mask */
119#define RTC_TR_HU_MASK (0xf)
120/** Minute tens in BCD format shift */
121#define RTC_TR_MNT_SHIFT (12)
122/** Minute tens in BCD format mask */
123#define RTC_TR_MNT_MASK (0x7)
124/** Minute units in BCD format shift */
125#define RTC_TR_MNU_SHIFT (8)
126/** Minute units in BCD format mask */
127#define RTC_TR_MNU_MASK (0xf)
128/** Second tens in BCD format shift */
129#define RTC_TR_ST_SHIFT (4)
130/** Second tens in BCD format mask */
131#define RTC_TR_ST_MASK (0x7)
132/** Second units in BCD format shift */
133#define RTC_TR_SU_SHIFT (0)
134/** Second units in BCD format mask */
135#define RTC_TR_SU_MASK (0xf)
136/**@}*/
137
138/** @defgroup rtc_dr_values RTC Date register (RTC_DR) values
139 * @ingroup rtc_registers
140 * Note: Bits [31:24] and [7:6] are reserved, and must be kept at reset value.
141@{*/
142/** Year tens in BCD format shift */
143#define RTC_DR_YT_SHIFT (20)
144/** Year tens in BCD format mask */
145#define RTC_DR_YT_MASK (0xf)
146/** Year units in BCD format shift */
147#define RTC_DR_YU_SHIFT (16)
148/** Year units in BCD format mask */
149#define RTC_DR_YU_MASK (0xf)
150/** Weekday units shift */
151#define RTC_DR_WDU_SHIFT (13)
152/** Weekday units mask */
153#define RTC_DR_WDU_MASK (0x7)
154/** Month tens in BCD format shift */
155#define RTC_DR_MT_SHIFT (12)
156/** Month tens in BCD format mask */
157#define RTC_DR_MT_MASK (1)
158/** Month units in BCD format shift */
159#define RTC_DR_MU_SHIFT (8)
160/** Month units in BCD format mask */
161#define RTC_DR_MU_MASK (0xf)
162/** Date tens in BCD format shift */
163#define RTC_DR_DT_SHIFT (4)
164/** Date tens in BCD format mask */
165#define RTC_DR_DT_MASK (0x3)
166/** Date units in BCD format shift */
167#define RTC_DR_DU_SHIFT (0)
168/** Date units in BCD format mask */
169#define RTC_DR_DU_MASK (0xf)
170/**@}*/
171
172/** @defgroup rtc_cr_values RTC control register (RTC_CR) values
173 * @ingroup rtc_registers
174 * Note: Bits [31:24] are reserved, and must be kept at reset value.
175 * Note: Bits 7, 6 and 4 of this register can be written in initialization mode
176 * only (RTC_ISR/INITF = 1).
177@{*/
178/* Note: Bits 2 to 0 of this register can be written only when RTC_CR WUTE bit
179 * = 0 and RTC_ISR WUTWF bit = 1.
180 */
181/** Calibration output enable */
182#define RTC_CR_COE (1<<23)
183
184#define RTC_CR_OSEL_SHIFT 21
185#define RTC_CR_OSEL_MASK (0x3)
186/** @defgroup rtc_cr_osel RTC_CR_OSEL: Output selection values
187 * @ingroup rtc_cr_values
188 * These bits are used to select the flag to be routed to AFO_ALARM RTC output
189@{*/
190#define RTC_CR_OSEL_DISABLED (0x0)
191#define RTC_CR_OSEL_ALARMA (0x1)
192#define RTC_CR_OSEL_ALARMB (0x2)
193#define RTC_CR_OSEL_WAKEUP (0x3)
194/**@}*/
195
196/** Output polarity */
197#define RTC_CR_POL (1<<20)
198/** Calibration output selection */
199#define RTC_CR_COSEL (1<<19)
200/** Backup */
201#define RTC_CR_BKP (1<<18)
202/** Subtract 1 hour (winter time change) */
203#define RTC_CR_SUB1H (1<<17)
204/** Add 1 hour (summer time change) */
205#define RTC_CR_ADD1H (1<<16)
206/** Timestamp interrupt enable */
207#define RTC_CR_TSIE (1<<15)
208/** Wakeup timer interrupt enable */
209#define RTC_CR_WUTIE (1<<14)
210/** Alarm B interrupt enable */
211#define RTC_CR_ALRBIE (1<<13)
212/** Alarm A interrupt enable */
213#define RTC_CR_ALRAIE (1<<12)
214/** Time stamp enable */
215#define RTC_CR_TSE (1<<11)
216/** Wakeup timer enable */
217#define RTC_CR_WUTE (1<<10)
218/** Alarm B enable */
219#define RTC_CR_ALRBE (1<<9)
220/** Alarm A enable */
221#define RTC_CR_ALRAE (1<<8)
222/** Course digital calibration enable */
223#define RTC_CR_DCE (1<<7)
224/** Hour format */
225#define RTC_CR_FMT (1<<6)
226/** Bypass the shadow registers */
227#define RTC_CR_BYPSHAD (1<<5)
228/** Reference clock detection enable */
229#define RTC_CR_REFCKON (1<<4)
230/** Timestamp event active edge */
231#define RTC_CR_TSEDGE (1<<3)
232
233/* RTC_CR_WUCKSEL: Wakeup clock selection */
234#define RTC_CR_WUCLKSEL_SHIFT (0)
235#define RTC_CR_WUCLKSEL_MASK (0x7)
236#define RTC_CR_WUCLKSEL_RTC_DIV16 (0x0)
237#define RTC_CR_WUCLKSEL_RTC_DIV8 (0x1)
238#define RTC_CR_WUCLKSEL_RTC_DIV4 (0x2)
239#define RTC_CR_WUCLKSEL_RTC_DIV2 (0x3)
240#define RTC_CR_WUCLKSEL_SPRE (0x4)
241#define RTC_CR_WUCLKSEL_SPRE_216 (0x6)
242/**@}*/
243
244/** @defgroup rtc_isr_values RTC initialization and status register (RTC_ISR) values
245 * @ingroup rtc_registers
246 * Note: Bits [31:17] and [15] are reserved, and must be kept at reset value.
247 * Note: This register is write protected (except for RTC_ISR[13:8] bits).
248@{*/
249/** RECALPF: Recalib pending flag */
250#define RTC_ISR_RECALPF (1<<16)
251/** TAMP3F: TAMPER3 detection flag (not on F4)*/
252#define RTC_ISR_TAMP3F (1<<15)
253/** TAMP2F: TAMPER2 detection flag */
254#define RTC_ISR_TAMP2F (1<<14)
255/** TAMP1F: TAMPER detection flag */
256#define RTC_ISR_TAMP1F (1<<13)
257/** TSOVF: Timestamp overflow flag */
258#define RTC_ISR_TSOVF (1<<12)
259/** TSF: Timestamp flag */
260#define RTC_ISR_TSF (1<<11)
261/** WUTF: Wakeup timer flag */
262#define RTC_ISR_WUTF (1<<10)
263/** ALRBF: Alarm B flag */
264#define RTC_ISR_ALRBF (1<<9)
265/** ALRAF: Alarm A flag */
266#define RTC_ISR_ALRAF (1<<8)
267/** INIT: Initialization mode */
268#define RTC_ISR_INIT (1<<7)
269/** INITF: Initialization flag */
270#define RTC_ISR_INITF (1<<6)
271/** RSF: Registers sync flag */
272#define RTC_ISR_RSF (1<<5)
273/** INITS: Init status flag */
274#define RTC_ISR_INITS (1<<4)
275/** SHPF: Shift operation pending */
276#define RTC_ISR_SHPF (1<<3)
277/** WUTWF: Wakeup timer write flag */
278#define RTC_ISR_WUTWF (1<<2)
279/** ALRBWF: Alarm B write flag */
280#define RTC_ISR_ALRBWF (1<<1)
281/** ALRAWF: Alarm A write flag */
282#define RTC_ISR_ALRAWF (1<<0)
283/**@}*/
284
285/** @defgroup rtc_prer_values RTC prescaler register (RTC_PRER) values
286 * @ingroup rtc_registers
287@{*/
288/** Async prescaler factor shift */
289#define RTC_PRER_PREDIV_A_SHIFT (16)
290/** Async prescaler factor mask */
291#define RTC_PRER_PREDIV_A_MASK (0x7f)
292/** Sync prescaler factor shift */
293#define RTC_PRER_PREDIV_S_SHIFT (0)
294/** Sync prescaler factor mask */
295#define RTC_PRER_PREDIV_S_MASK (0x7fff)
296/**@}*/
297
298/* RTC calibration register (RTC_CALIBR) ------------------------ */
299#define RTC_CALIBR_DCS (1 << 7)
300
301#define RTC_CALIBR_DC_SHIFT (0)
302#define RTC_CALIBR_DC_MASK (0x1f)
303
304/** @defgroup rtc_alarm_values RTC Alarm register values
305 * @ingroup rtc_registers
306 * Applies to RTC_ALRMAR and RTC_ALRMBR
307@{*/
308#define RTC_ALRMXR_MSK4 (1<<31)
309#define RTC_ALRMXR_WDSEL (1<<30)
310#define RTC_ALRMXR_DT_SHIFT (28)
311#define RTC_ALRMXR_DT_MASK (0x3)
312#define RTC_ALRMXR_DU_SHIFT (24)
313#define RTC_ALRMXR_DU_MASK (0xf)
314#define RTC_ALRMXR_MSK3 (1<<23)
315#define RTC_ALRMXR_PM (1<<22)
316#define RTC_ALRMXR_HT_SHIFT (20)
317#define RTC_ALRMXR_HT_MASK (0x3)
318#define RTC_ALRMXR_HU_SHIFT (16)
319#define RTC_ALRMXR_HU_MASK (0xf)
320#define RTC_ALRMXR_MSK2 (1<<15)
321#define RTC_ALRMXR_MNT_SHIFT (12)
322#define RTC_ALRMXR_MNT_MASK (0x7)
323#define RTC_ALRMXR_MNU_SHIFT (8)
324#define RTC_ALRMXR_MNU_MASK (0xf)
325#define RTC_ALRMXR_MSK1 (1<<7)
326#define RTC_ALRMXR_ST_SHIFT (4)
327#define RTC_ALRMXR_ST_MASK (0x7)
328#define RTC_ALRMXR_SU_SHIFT (0)
329#define RTC_ALRMXR_SU_MASK (0xf)
330/**@}*/
331
332/* RTC shift control register (RTC_SHIFTR) ---------------------- */
333#define RTC_SHIFTR_ADD1S (1<<31)
334
335#define RTC_SHIFTR_SUBFS_SHIFT (0)
336#define RTC_SHIFTR_SUBFS_MASK (0x7fff)
337
338/** @defgroup rtc_tstr_values RTC time stamp time register (RTC_TSTR) values
339 * @ingroup rtc_registers
340@{*/
341#define RTC_TSTR_PM (1<<22)
342#define RTC_TSTR_HT_SHIFT (20)
343#define RTC_TSTR_HT_MASK (0x3)
344#define RTC_TSTR_HU_SHIFT (16)
345#define RTC_TSTR_HU_MASK (0xf)
346#define RTC_TSTR_MNT_SHIFT (12)
347#define RTC_TSTR_MNT_MASK (0x7)
348#define RTC_TSTR_MNU_SHIFT (8)
349#define RTC_TSTR_MNU_MASK (0xf)
350#define RTC_TSTR_ST_SHIFT (4)
351#define RTC_TSTR_ST_MASK (0x7)
352#define RTC_TSTR_SU_SHIFT (0)
353#define RTC_TSTR_SU_MASK (0xf)
354/**@}*/
355
356/** @defgroup rtc_tsdr_values RTC time stamp date register (RTC_TSDR) values
357 * @ingroup rtc_registers
358@{*/
359#define RTC_TSDR_WDU_SHIFT (13)
360#define RTC_TSDR_WDU_MASK (0x7)
361#define RTC_TSDR_MT (1<<12)
362#define RTC_TSDR_MU_SHIFT (8)
363#define RTC_TSDR_MU_MASK (0xf)
364#define RTC_TSDR_DT_SHIFT (4)
365#define RTC_TSDR_DT_MASK (0x3)
366#define RTC_TSDR_DU_SHIFT (0)
367#define RTC_TSDR_DU_MASK (0xf)
368/**@}*/
369
370/** @defgroup rtc_calr_values RTC calibration register (RTC_CALR) values
371 * @ingroup rtc_registers
372@{*/
373#define RTC_CALR_CALP (1 << 15)
374#define RTC_CALR_CALW8 (1 << 14)
375#define RTC_CALR_CALW16 (1 << 13)
376#define RTC_CALR_CALM_SHIFT (0)
377#define RTC_CALR_CALM_MASK (0x1ff)
378/**@}*/
379
380/** @defgroup rtc_tafcr_values RTC tamper and alternate function configuration register (RTC_TAFCR) values
381 * @ingroup rtc_registers
382@{*/
383#define RTC_TAFCR_ALARMOUTTYPE (1<<18)
384#define RTC_TAFCR_TAMPPUDIS (1<<15)
385
386#define RTC_TAFCR_TAMPPRCH_SHIFT (13)
387#define RTC_TAFCR_TAMPPRCH_MASK (0x3)
388#define RTC_TAFCR_TAMPPRCH_1RTC (0x0)
389#define RTC_TAFCR_TAMPPRCH_2RTC (0x1)
390#define RTC_TAFCR_TAMPPRCH_4RTC (0x2)
391#define RTC_TAFCR_TAMPPRCH_8RTC (0x3)
392
393#define RTC_TAFCR_TAMPFLT_SHIFT (11)
394#define RTC_TAFCR_TAMPFLT_MASK (0x3)
395#define RTC_TAFCR_TAMPFLT_EDGE1 (0x0)
396#define RTC_TAFCR_TAMPFLT_EDGE2 (0x1)
397#define RTC_TAFCR_TAMPFLT_EDGE4 (0x2)
398#define RTC_TAFCR_TAMPFLT_EDGE8 (0x3)
399
400#define RTC_TAFCR_TAMPFREQ_SHIFT (8)
401#define RTC_TAFCR_TAMPFREQ_MASK (0x7)
402#define RTC_TAFCR_TAMPFREQ_RTCDIV32K (0x0)
403#define RTC_TAFCR_TAMPFREQ_RTCDIV16K (0x1)
404#define RTC_TAFCR_TAMPFREQ_RTCDIV8K (0x2)
405#define RTC_TAFCR_TAMPFREQ_RTCDIV4K (0x3)
406#define RTC_TAFCR_TAMPFREQ_RTCDIV2K (0x4)
407#define RTC_TAFCR_TAMPFREQ_RTCDIV1K (0x5)
408#define RTC_TAFCR_TAMPFREQ_RTCDIV512 (0x6)
409#define RTC_TAFCR_TAMPFREQ_RTCDIV256 (0x7)
410
411#define RTC_TAFCR_TAMPTS (1<<7)
412#define RTC_TAFCR_TAMP3TRG (1<<6)
413#define RTC_TAFCR_TAMP3E (1<<5)
414#define RTC_TAFCR_TAMP2TRG (1<<4)
415#define RTC_TAFCR_TAMP2E (1<<3)
416#define RTC_TAFCR_TAMPIE (1<<2)
417#define RTC_TAFCR_TAMP1TRG (1<<1)
418#define RTC_TAFCR_TAMP1E (1<<0)
419/**@}*/
420
421/* RTC alarm X sub second register ------------------------------ */
422/* Note: Applies to RTC_ALRMASSR and RTC_ALRMBSSR */
423#define RTC_ALRMXSSR_MASKSS_SHIFT (24)
424#define RTC_ALARXSSR_MASKSS_MASK (0xf)
425
426#define RTC_ALRMXSSR_SS_SHIFT (0)
427#define RTC_ALARXSSR_SS_MASK (0x7fff)
428
437};
438
440
441void rtc_set_prescaler(uint32_t sync, uint32_t async);
442void rtc_wait_for_synchro(void);
443void rtc_lock(void);
444void rtc_unlock(void);
445void rtc_set_wakeup_time(uint16_t wkup_time, uint8_t rtc_cr_wucksel);
446void rtc_clear_wakeup_flag(void);
447void rtc_set_init_flag(void);
448void rtc_clear_init_flag(void);
449bool rtc_init_flag_is_ready(void);
450void rtc_wait_for_init_ready(void);
454void rtc_set_am_format(void);
455void rtc_set_pm_format(void);
456void rtc_calendar_set_year(uint8_t year);
457void rtc_calendar_set_weekday(enum rtc_weekday rtc_dr_wdu);
458void rtc_calendar_set_month(uint8_t month);
459void rtc_calendar_set_day(uint8_t day);
460void rtc_calendar_set_date(uint8_t year, uint8_t month, uint8_t day, enum rtc_weekday rtc_dr_wdu);
461void rtc_time_set_hour(uint8_t hour, bool use_am_notation);
462void rtc_time_set_minute(uint8_t minute);
463void rtc_time_set_second(uint8_t second);
464void rtc_time_set_time(uint8_t hour, uint8_t minute, uint8_t second, bool use_am_notation);
465
467/**@}*/
468
469#endif /* RTC2_H */
470/** @cond */
471#else
472#warning "rtc_common_l1f024.h should not be included explicitly, only via rtc.h"
473#endif
474/** @endcond */
475
476
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
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_set_bypass_shadow_register(void)
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.
rtc_weekday
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.
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.
@ RTC_DR_WDU_THU
@ RTC_DR_WDU_SAT
@ RTC_DR_WDU_FRI
@ RTC_DR_WDU_WED
@ RTC_DR_WDU_SUN
@ RTC_DR_WDU_MON
@ RTC_DR_WDU_TUE