2 ******************************************************************************
3 * @file stm32f7xx_ll_rtc.h
4 * @author MCD Application Team
5 * @brief Header file of RTC LL module.
6 ******************************************************************************
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __STM32F7xx_LL_RTC_H
22 #define __STM32F7xx_LL_RTC_H
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f7xx.h"
31 /** @addtogroup STM32F7xx_LL_Driver
37 /** @defgroup RTC_LL RTC
41 /* Private types -------------------------------------------------------------*/
42 /* Private variables ---------------------------------------------------------*/
43 /* Private constants ---------------------------------------------------------*/
44 /** @defgroup RTC_LL_Private_Constants RTC Private Constants
47 /* Masks Definition */
48 #define RTC_INIT_MASK 0xFFFFFFFFU
49 #define RTC_RSF_MASK 0xFFFFFF5FU
51 /* Write protection defines */
52 #define RTC_WRITE_PROTECTION_DISABLE ((uint8_t)0xFFU)
53 #define RTC_WRITE_PROTECTION_ENABLE_1 ((uint8_t)0xCAU)
54 #define RTC_WRITE_PROTECTION_ENABLE_2 ((uint8_t)0x53U)
56 /* Defines used to combine date & time */
57 #define RTC_OFFSET_WEEKDAY 24U
58 #define RTC_OFFSET_DAY 16U
59 #define RTC_OFFSET_MONTH 8U
60 #define RTC_OFFSET_HOUR 16U
61 #define RTC_OFFSET_MINUTE 8U
67 /* Private macros ------------------------------------------------------------*/
68 #if defined(USE_FULL_LL_DRIVER)
69 /** @defgroup RTC_LL_Private_Macros RTC Private Macros
75 #endif /*USE_FULL_LL_DRIVER*/
77 /* Exported types ------------------------------------------------------------*/
78 #if defined(USE_FULL_LL_DRIVER)
79 /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure
84 * @brief RTC Init structures definition
88 uint32_t HourFormat
; /*!< Specifies the RTC Hours Format.
89 This parameter can be a value of @ref RTC_LL_EC_HOURFORMAT
91 This feature can be modified afterwards using unitary function
92 @ref LL_RTC_SetHourFormat(). */
94 uint32_t AsynchPrescaler
; /*!< Specifies the RTC Asynchronous Predivider value.
95 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F
97 This feature can be modified afterwards using unitary function
98 @ref LL_RTC_SetAsynchPrescaler(). */
100 uint32_t SynchPrescaler
; /*!< Specifies the RTC Synchronous Predivider value.
101 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF
103 This feature can be modified afterwards using unitary function
104 @ref LL_RTC_SetSynchPrescaler(). */
105 } LL_RTC_InitTypeDef
;
108 * @brief RTC Time structure definition
112 uint32_t TimeFormat
; /*!< Specifies the RTC AM/PM Time.
113 This parameter can be a value of @ref RTC_LL_EC_TIME_FORMAT
115 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetFormat(). */
117 uint8_t Hours
; /*!< Specifies the RTC Time Hours.
118 This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the @ref LL_RTC_TIME_FORMAT_PM is selected.
119 This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the @ref LL_RTC_TIME_FORMAT_AM_OR_24 is selected.
121 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetHour(). */
123 uint8_t Minutes
; /*!< Specifies the RTC Time Minutes.
124 This parameter must be a number between Min_Data = 0 and Max_Data = 59
126 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetMinute(). */
128 uint8_t Seconds
; /*!< Specifies the RTC Time Seconds.
129 This parameter must be a number between Min_Data = 0 and Max_Data = 59
131 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetSecond(). */
132 } LL_RTC_TimeTypeDef
;
135 * @brief RTC Date structure definition
139 uint8_t WeekDay
; /*!< Specifies the RTC Date WeekDay.
140 This parameter can be a value of @ref RTC_LL_EC_WEEKDAY
142 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetWeekDay(). */
144 uint8_t Month
; /*!< Specifies the RTC Date Month.
145 This parameter can be a value of @ref RTC_LL_EC_MONTH
147 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetMonth(). */
149 uint8_t Day
; /*!< Specifies the RTC Date Day.
150 This parameter must be a number between Min_Data = 1 and Max_Data = 31
152 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetDay(). */
154 uint8_t Year
; /*!< Specifies the RTC Date Year.
155 This parameter must be a number between Min_Data = 0 and Max_Data = 99
157 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetYear(). */
158 } LL_RTC_DateTypeDef
;
161 * @brief RTC Alarm structure definition
165 LL_RTC_TimeTypeDef AlarmTime
; /*!< Specifies the RTC Alarm Time members. */
167 uint32_t AlarmMask
; /*!< Specifies the RTC Alarm Masks.
168 This parameter can be a value of @ref RTC_LL_EC_ALMA_MASK for ALARM A or @ref RTC_LL_EC_ALMB_MASK for ALARM B.
170 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetMask() for ALARM A
171 or @ref LL_RTC_ALMB_SetMask() for ALARM B
174 uint32_t AlarmDateWeekDaySel
; /*!< Specifies the RTC Alarm is on day or WeekDay.
175 This parameter can be a value of @ref RTC_LL_EC_ALMA_WEEKDAY_SELECTION for ALARM A or @ref RTC_LL_EC_ALMB_WEEKDAY_SELECTION for ALARM B
177 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_EnableWeekday() or @ref LL_RTC_ALMA_DisableWeekday()
178 for ALARM A or @ref LL_RTC_ALMB_EnableWeekday() or @ref LL_RTC_ALMB_DisableWeekday() for ALARM B
181 uint8_t AlarmDateWeekDay
; /*!< Specifies the RTC Alarm Day/WeekDay.
182 If AlarmDateWeekDaySel set to day, this parameter must be a number between Min_Data = 1 and Max_Data = 31.
184 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetDay()
185 for ALARM A or @ref LL_RTC_ALMB_SetDay() for ALARM B.
187 If AlarmDateWeekDaySel set to Weekday, this parameter can be a value of @ref RTC_LL_EC_WEEKDAY.
189 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetWeekDay()
190 for ALARM A or @ref LL_RTC_ALMB_SetWeekDay() for ALARM B.
192 } LL_RTC_AlarmTypeDef
;
197 #endif /* USE_FULL_LL_DRIVER */
199 /* Exported constants --------------------------------------------------------*/
200 /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants
204 #if defined(USE_FULL_LL_DRIVER)
205 /** @defgroup RTC_LL_EC_FORMAT FORMAT
208 #define LL_RTC_FORMAT_BIN 0x000000000U /*!< Binary data format */
209 #define LL_RTC_FORMAT_BCD 0x000000001U /*!< BCD data format */
214 /** @defgroup RTC_LL_EC_ALMA_WEEKDAY_SELECTION RTC Alarm A Date WeekDay
217 #define LL_RTC_ALMA_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm A Date is selected */
218 #define LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL /*!< Alarm A WeekDay is selected */
223 /** @defgroup RTC_LL_EC_ALMB_WEEKDAY_SELECTION RTC Alarm B Date WeekDay
226 #define LL_RTC_ALMB_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm B Date is selected */
227 #define LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMBR_WDSEL /*!< Alarm B WeekDay is selected */
232 #endif /* USE_FULL_LL_DRIVER */
234 /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines
235 * @brief Flags defines which can be used with LL_RTC_ReadReg function
238 #define LL_RTC_ISR_ITSF RTC_ISR_ITSF
239 #define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF
240 #define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F
241 #define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F
242 #define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F
243 #define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF
244 #define LL_RTC_ISR_TSF RTC_ISR_TSF
245 #define LL_RTC_ISR_WUTF RTC_ISR_WUTF
246 #define LL_RTC_ISR_ALRBF RTC_ISR_ALRBF
247 #define LL_RTC_ISR_ALRAF RTC_ISR_ALRAF
248 #define LL_RTC_ISR_INITF RTC_ISR_INITF
249 #define LL_RTC_ISR_RSF RTC_ISR_RSF
250 #define LL_RTC_ISR_INITS RTC_ISR_INITS
251 #define LL_RTC_ISR_SHPF RTC_ISR_SHPF
252 #define LL_RTC_ISR_WUTWF RTC_ISR_WUTWF
253 #define LL_RTC_ISR_ALRBWF RTC_ISR_ALRBWF
254 #define LL_RTC_ISR_ALRAWF RTC_ISR_ALRAWF
259 /** @defgroup RTC_LL_EC_IT IT Defines
260 * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions
263 #define LL_RTC_CR_TSIE RTC_CR_TSIE
264 #define LL_RTC_CR_WUTIE RTC_CR_WUTIE
265 #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE
266 #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE
267 #define LL_RTC_TAMPCR_TAMP3IE RTC_TAMPCR_TAMP3IE
268 #define LL_RTC_TAMPCR_TAMP2IE RTC_TAMPCR_TAMP2IE
269 #define LL_RTC_TAMPCR_TAMP1IE RTC_TAMPCR_TAMP1IE
270 #define LL_RTC_TAMPCR_TAMPIE RTC_TAMPCR_TAMPIE
275 /** @defgroup RTC_LL_EC_WEEKDAY WEEK DAY
278 #define LL_RTC_WEEKDAY_MONDAY ((uint8_t)0x01U) /*!< Monday */
279 #define LL_RTC_WEEKDAY_TUESDAY ((uint8_t)0x02U) /*!< Tuesday */
280 #define LL_RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03U) /*!< Wednesday */
281 #define LL_RTC_WEEKDAY_THURSDAY ((uint8_t)0x04U) /*!< Thrusday */
282 #define LL_RTC_WEEKDAY_FRIDAY ((uint8_t)0x05U) /*!< Friday */
283 #define LL_RTC_WEEKDAY_SATURDAY ((uint8_t)0x06U) /*!< Saturday */
284 #define LL_RTC_WEEKDAY_SUNDAY ((uint8_t)0x07U) /*!< Sunday */
289 /** @defgroup RTC_LL_EC_MONTH MONTH
292 #define LL_RTC_MONTH_JANUARY ((uint8_t)0x01U) /*!< January */
293 #define LL_RTC_MONTH_FEBRUARY ((uint8_t)0x02U) /*!< February */
294 #define LL_RTC_MONTH_MARCH ((uint8_t)0x03U) /*!< March */
295 #define LL_RTC_MONTH_APRIL ((uint8_t)0x04U) /*!< April */
296 #define LL_RTC_MONTH_MAY ((uint8_t)0x05U) /*!< May */
297 #define LL_RTC_MONTH_JUNE ((uint8_t)0x06U) /*!< June */
298 #define LL_RTC_MONTH_JULY ((uint8_t)0x07U) /*!< July */
299 #define LL_RTC_MONTH_AUGUST ((uint8_t)0x08U) /*!< August */
300 #define LL_RTC_MONTH_SEPTEMBER ((uint8_t)0x09U) /*!< September */
301 #define LL_RTC_MONTH_OCTOBER ((uint8_t)0x10U) /*!< October */
302 #define LL_RTC_MONTH_NOVEMBER ((uint8_t)0x11U) /*!< November */
303 #define LL_RTC_MONTH_DECEMBER ((uint8_t)0x12U) /*!< December */
308 /** @defgroup RTC_LL_EC_HOURFORMAT HOUR FORMAT
311 #define LL_RTC_HOURFORMAT_24HOUR 0x00000000U /*!< 24 hour/day format */
312 #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */
317 /** @defgroup RTC_LL_EC_ALARMOUT ALARM OUTPUT
320 #define LL_RTC_ALARMOUT_DISABLE 0x00000000U /*!< Output disabled */
321 #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */
322 #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */
323 #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */
328 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUT TYPE
331 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 0x00000000U /*!< RTC_ALARM, when mapped on PC13, is open-drain output */
332 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_OR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */
337 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUT POLARITY PIN
340 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH 0x00000000U /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/
341 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */
346 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT
349 #define LL_RTC_TIME_FORMAT_AM_OR_24 0x00000000U /*!< AM or 24-hour format */
350 #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */
355 /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND
358 #define LL_RTC_SHIFT_SECOND_DELAY 0x00000000U /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */
359 #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */
364 /** @defgroup RTC_LL_EC_ALMA_MASK ALARMA MASK
367 #define LL_RTC_ALMA_MASK_NONE 0x00000000U /*!< No masks applied on Alarm A*/
368 #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */
369 #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */
370 #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */
371 #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */
372 #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */
377 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALARMA TIME FORMAT
380 #define LL_RTC_ALMA_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
381 #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */
386 /** @defgroup RTC_LL_EC_ALMB_MASK ALARMB MASK
389 #define LL_RTC_ALMB_MASK_NONE 0x00000000U /*!< No masks applied on Alarm B*/
390 #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */
391 #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */
392 #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */
393 #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */
394 #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */
399 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALARMB TIME FORMAT
402 #define LL_RTC_ALMB_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
403 #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */
408 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE
411 #define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
412 #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */
417 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TIMESTAMP TIME FORMAT
420 #define LL_RTC_TS_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
421 #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */
426 /** @defgroup RTC_LL_EC_TAMPER TAMPER
429 #define LL_RTC_TAMPER_1 RTC_TAMPCR_TAMP1E /*!< RTC_TAMP1 input detection */
430 #define LL_RTC_TAMPER_2 RTC_TAMPCR_TAMP2E /*!< RTC_TAMP2 input detection */
431 #define LL_RTC_TAMPER_3 RTC_TAMPCR_TAMP3E /*!< RTC_TAMP3 input detection */
436 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK
439 #define LL_RTC_TAMPER_MASK_TAMPER1 RTC_TAMPCR_TAMP1MF /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
440 #define LL_RTC_TAMPER_MASK_TAMPER2 RTC_TAMPCR_TAMP2MF /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
441 #define LL_RTC_TAMPER_MASK_TAMPER3 RTC_TAMPCR_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased */
446 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE
449 #define LL_RTC_TAMPER_NOERASE_TAMPER1 RTC_TAMPCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
450 #define LL_RTC_TAMPER_NOERASE_TAMPER2 RTC_TAMPCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
451 #define LL_RTC_TAMPER_NOERASE_TAMPER3 RTC_TAMPCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
456 #if defined(RTC_TAMPCR_TAMPPRCH)
457 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION
460 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */
461 #define LL_RTC_TAMPER_DURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
462 #define LL_RTC_TAMPER_DURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
463 #define LL_RTC_TAMPER_DURATION_8RTCCLK RTC_TAMPCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
467 #endif /* RTC_TAMPCR_TAMPPRCH */
469 #if defined(RTC_TAMPCR_TAMPFLT)
470 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER
473 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */
474 #define LL_RTC_TAMPER_FILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */
475 #define LL_RTC_TAMPER_FILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */
476 #define LL_RTC_TAMPER_FILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */
480 #endif /* RTC_TAMPCR_TAMPFLT */
482 #if defined(RTC_TAMPCR_TAMPFREQ)
483 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER
486 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */
487 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */
488 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */
489 #define LL_RTC_TAMPER_SAMPLFREQDIV_4096 (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */
490 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */
491 #define LL_RTC_TAMPER_SAMPLFREQDIV_1024 (RTC_TAMPCR_TAMPFREQ_2 | RTC_TAMPCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */
492 #define LL_RTC_TAMPER_SAMPLFREQDIV_512 (RTC_TAMPCR_TAMPFREQ_2 | RTC_TAMPCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */
493 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 RTC_TAMPCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */
497 #endif /* RTC_TAMPCR_TAMPFREQ */
499 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL
502 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 RTC_TAMPCR_TAMP1TRG /*!< RTC_TAMP1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
503 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 RTC_TAMPCR_TAMP2TRG /*!< RTC_TAMP2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
504 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 RTC_TAMPCR_TAMP3TRG /*!< RTC_TAMP3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
509 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUP CLOCK DIV
512 #define LL_RTC_WAKEUPCLOCK_DIV_16 0x00000000U /*!< RTC/16 clock is selected */
513 #define LL_RTC_WAKEUPCLOCK_DIV_8 (RTC_CR_WUCKSEL_0) /*!< RTC/8 clock is selected */
514 #define LL_RTC_WAKEUPCLOCK_DIV_4 (RTC_CR_WUCKSEL_1) /*!< RTC/4 clock is selected */
515 #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */
516 #define LL_RTC_WAKEUPCLOCK_CKSPRE (RTC_CR_WUCKSEL_2) /*!< ck_spre (usually 1 Hz) clock is selected */
517 #define LL_RTC_WAKEUPCLOCK_CKSPRE_WUT (RTC_CR_WUCKSEL_2 | RTC_CR_WUCKSEL_1) /*!< ck_spre (usually 1 Hz) clock is selected and 2exp16 is added to the WUT counter value*/
522 /** @defgroup RTC_LL_EC_BKP BACKUP
525 #define LL_RTC_BKP_DR0 0x00000000U
526 #define LL_RTC_BKP_DR1 0x00000001U
527 #define LL_RTC_BKP_DR2 0x00000002U
528 #define LL_RTC_BKP_DR3 0x00000003U
529 #define LL_RTC_BKP_DR4 0x00000004U
530 #if RTC_BKP_NUMBER > 5
531 #define LL_RTC_BKP_DR5 0x00000005U
532 #define LL_RTC_BKP_DR6 0x00000006U
533 #define LL_RTC_BKP_DR7 0x00000007U
534 #define LL_RTC_BKP_DR8 0x00000008U
535 #define LL_RTC_BKP_DR9 0x00000009U
536 #define LL_RTC_BKP_DR10 0x0000000AU
537 #define LL_RTC_BKP_DR11 0x0000000BU
538 #define LL_RTC_BKP_DR12 0x0000000CU
539 #define LL_RTC_BKP_DR13 0x0000000DU
540 #define LL_RTC_BKP_DR14 0x0000000EU
541 #define LL_RTC_BKP_DR15 0x0000000FU
542 #endif /* RTC_BKP_NUMBER > 5 */
544 #if RTC_BKP_NUMBER > 16
545 #define LL_RTC_BKP_DR16 0x00000010U
546 #define LL_RTC_BKP_DR17 0x00000011U
547 #define LL_RTC_BKP_DR18 0x00000012U
548 #define LL_RTC_BKP_DR19 0x00000013U
549 #endif /* RTC_BKP_NUMBER > 16 */
551 #if RTC_BKP_NUMBER > 20
552 #define LL_RTC_BKP_DR20 0x00000014U
553 #define LL_RTC_BKP_DR21 0x00000015U
554 #define LL_RTC_BKP_DR22 0x00000016U
555 #define LL_RTC_BKP_DR23 0x00000017U
556 #define LL_RTC_BKP_DR24 0x00000018U
557 #define LL_RTC_BKP_DR25 0x00000019U
558 #define LL_RTC_BKP_DR26 0x0000001AU
559 #define LL_RTC_BKP_DR27 0x0000001BU
560 #define LL_RTC_BKP_DR28 0x0000001CU
561 #define LL_RTC_BKP_DR29 0x0000001DU
562 #define LL_RTC_BKP_DR30 0x0000001EU
563 #define LL_RTC_BKP_DR31 0x0000001FU
564 #endif /* RTC_BKP_NUMBER > 20 */
569 /** @defgroup RTC_LL_EC_CALIB_OUTPUT Calibration output
572 #define LL_RTC_CALIB_OUTPUT_NONE 0x00000000U /*!< Calibration output disabled */
573 #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */
574 #define LL_RTC_CALIB_OUTPUT_512HZ (RTC_CR_COE) /*!< Calibration output is 512 Hz */
579 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE Calibration pulse insertion
582 #define LL_RTC_CALIB_INSERTPULSE_NONE 0x00000000U /*!< No RTCCLK pulses are added */
583 #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */
588 /** @defgroup RTC_LL_EC_CALIB_PERIOD Calibration period
591 #define LL_RTC_CALIB_PERIOD_32SEC 0x00000000U /*!< Use a 32-second calibration cycle period */
592 #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */
593 #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */
602 /* Exported macro ------------------------------------------------------------*/
603 /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros
607 /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros
612 * @brief Write a value in RTC register
613 * @param __INSTANCE__ RTC Instance
614 * @param __REG__ Register to be written
615 * @param __VALUE__ Value to be written in the register
618 #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
621 * @brief Read a value in RTC register
622 * @param __INSTANCE__ RTC Instance
623 * @param __REG__ Register to be read
624 * @retval Register value
626 #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
631 /** @defgroup RTC_LL_EM_Convert Convert helper Macros
636 * @brief Helper macro to convert a value from 2 digit decimal format to BCD format
637 * @param __VALUE__ Byte to be converted
638 * @retval Converted byte
640 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
643 * @brief Helper macro to convert a value from BCD format to 2 digit decimal format
644 * @param __VALUE__ BCD value to be converted
645 * @retval Converted byte
647 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U + ((__VALUE__) & (uint8_t)0x0FU))
653 /** @defgroup RTC_LL_EM_Date Date helper Macros
658 * @brief Helper macro to retrieve weekday.
659 * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function.
660 * @retval Returned value can be one of the following values:
661 * @arg @ref LL_RTC_WEEKDAY_MONDAY
662 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
663 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
664 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
665 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
666 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
667 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
669 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU)
672 * @brief Helper macro to retrieve Year in BCD format
673 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
674 * @retval Year in BCD format (0x00 . . . 0x99)
676 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU)
679 * @brief Helper macro to retrieve Month in BCD format
680 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
681 * @retval Returned value can be one of the following values:
682 * @arg @ref LL_RTC_MONTH_JANUARY
683 * @arg @ref LL_RTC_MONTH_FEBRUARY
684 * @arg @ref LL_RTC_MONTH_MARCH
685 * @arg @ref LL_RTC_MONTH_APRIL
686 * @arg @ref LL_RTC_MONTH_MAY
687 * @arg @ref LL_RTC_MONTH_JUNE
688 * @arg @ref LL_RTC_MONTH_JULY
689 * @arg @ref LL_RTC_MONTH_AUGUST
690 * @arg @ref LL_RTC_MONTH_SEPTEMBER
691 * @arg @ref LL_RTC_MONTH_OCTOBER
692 * @arg @ref LL_RTC_MONTH_NOVEMBER
693 * @arg @ref LL_RTC_MONTH_DECEMBER
695 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU)
698 * @brief Helper macro to retrieve Day in BCD format
699 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
700 * @retval Day in BCD format (0x01 . . . 0x31)
702 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU)
708 /** @defgroup RTC_LL_EM_Time Time helper Macros
713 * @brief Helper macro to retrieve hour in BCD format
714 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
715 * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23)
717 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU)
720 * @brief Helper macro to retrieve minute in BCD format
721 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
722 * @retval Minutes in BCD format (0x00. . .0x59)
724 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU)
727 * @brief Helper macro to retrieve second in BCD format
728 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
729 * @retval Seconds in format (0x00. . .0x59)
731 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU)
741 /* Exported functions --------------------------------------------------------*/
742 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
746 /** @defgroup RTC_LL_EF_Configuration Configuration
751 * @brief Set Hours format (24 hour/day or AM/PM hour format)
752 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
753 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
754 * @rmtoll CR FMT LL_RTC_SetHourFormat
755 * @param RTCx RTC Instance
756 * @param HourFormat This parameter can be one of the following values:
757 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
758 * @arg @ref LL_RTC_HOURFORMAT_AMPM
761 __STATIC_INLINE
void LL_RTC_SetHourFormat(RTC_TypeDef
*RTCx
, uint32_t HourFormat
)
763 MODIFY_REG(RTCx
->CR
, RTC_CR_FMT
, HourFormat
);
767 * @brief Get Hours format (24 hour/day or AM/PM hour format)
768 * @rmtoll CR FMT LL_RTC_GetHourFormat
769 * @param RTCx RTC Instance
770 * @retval Returned value can be one of the following values:
771 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
772 * @arg @ref LL_RTC_HOURFORMAT_AMPM
774 __STATIC_INLINE
uint32_t LL_RTC_GetHourFormat(RTC_TypeDef
*RTCx
)
776 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_FMT
));
780 * @brief Select the flag to be routed to RTC_ALARM output
781 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
782 * @rmtoll CR OSEL LL_RTC_SetAlarmOutEvent
783 * @param RTCx RTC Instance
784 * @param AlarmOutput This parameter can be one of the following values:
785 * @arg @ref LL_RTC_ALARMOUT_DISABLE
786 * @arg @ref LL_RTC_ALARMOUT_ALMA
787 * @arg @ref LL_RTC_ALARMOUT_ALMB
788 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
791 __STATIC_INLINE
void LL_RTC_SetAlarmOutEvent(RTC_TypeDef
*RTCx
, uint32_t AlarmOutput
)
793 MODIFY_REG(RTCx
->CR
, RTC_CR_OSEL
, AlarmOutput
);
797 * @brief Get the flag to be routed to RTC_ALARM output
798 * @rmtoll CR OSEL LL_RTC_GetAlarmOutEvent
799 * @param RTCx RTC Instance
800 * @retval Returned value can be one of the following values:
801 * @arg @ref LL_RTC_ALARMOUT_DISABLE
802 * @arg @ref LL_RTC_ALARMOUT_ALMA
803 * @arg @ref LL_RTC_ALARMOUT_ALMB
804 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
806 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef
*RTCx
)
808 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_OSEL
));
812 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
813 * @note Used only when RTC_ALARM is mapped on PC13
814 * @rmtoll OR ALARMOUTTYPE LL_RTC_SetAlarmOutputType
815 * @param RTCx RTC Instance
816 * @param Output This parameter can be one of the following values:
817 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
818 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
821 __STATIC_INLINE
void LL_RTC_SetAlarmOutputType(RTC_TypeDef
*RTCx
, uint32_t Output
)
823 MODIFY_REG(RTCx
->OR
, RTC_OR_ALARMOUTTYPE
, Output
);
827 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
828 * @note used only when RTC_ALARM is mapped on PC13
829 * @rmtoll OR ALARMOUTTYPE LL_RTC_GetAlarmOutputType
830 * @param RTCx RTC Instance
831 * @retval Returned value can be one of the following values:
832 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
833 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
835 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef
*RTCx
)
837 return (uint32_t)(READ_BIT(RTCx
->OR
, RTC_OR_ALARMOUTTYPE
));
841 * @brief Enable initialization mode
842 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
843 * and prescaler register (RTC_PRER).
844 * Counters are stopped and start counting from the new value when INIT is reset.
845 * @rmtoll ISR INIT LL_RTC_EnableInitMode
846 * @param RTCx RTC Instance
849 __STATIC_INLINE
void LL_RTC_EnableInitMode(RTC_TypeDef
*RTCx
)
851 /* Set the Initialization mode */
852 WRITE_REG(RTCx
->ISR
, RTC_INIT_MASK
);
856 * @brief Disable initialization mode (Free running mode)
857 * @rmtoll ISR INIT LL_RTC_DisableInitMode
858 * @param RTCx RTC Instance
861 __STATIC_INLINE
void LL_RTC_DisableInitMode(RTC_TypeDef
*RTCx
)
863 /* Exit Initialization mode */
864 WRITE_REG(RTCx
->ISR
, (uint32_t)~RTC_ISR_INIT
);
868 * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted)
869 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
870 * @rmtoll CR POL LL_RTC_SetOutputPolarity
871 * @param RTCx RTC Instance
872 * @param Polarity This parameter can be one of the following values:
873 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
874 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
877 __STATIC_INLINE
void LL_RTC_SetOutputPolarity(RTC_TypeDef
*RTCx
, uint32_t Polarity
)
879 MODIFY_REG(RTCx
->CR
, RTC_CR_POL
, Polarity
);
883 * @brief Get Output polarity
884 * @rmtoll CR POL LL_RTC_GetOutputPolarity
885 * @param RTCx RTC Instance
886 * @retval Returned value can be one of the following values:
887 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
888 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
890 __STATIC_INLINE
uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef
*RTCx
)
892 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_POL
));
896 * @brief Enable Bypass the shadow registers
897 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
898 * @rmtoll CR BYPSHAD LL_RTC_EnableShadowRegBypass
899 * @param RTCx RTC Instance
902 __STATIC_INLINE
void LL_RTC_EnableShadowRegBypass(RTC_TypeDef
*RTCx
)
904 SET_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
);
908 * @brief Disable Bypass the shadow registers
909 * @rmtoll CR BYPSHAD LL_RTC_DisableShadowRegBypass
910 * @param RTCx RTC Instance
913 __STATIC_INLINE
void LL_RTC_DisableShadowRegBypass(RTC_TypeDef
*RTCx
)
915 CLEAR_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
);
919 * @brief Check if Shadow registers bypass is enabled or not.
920 * @rmtoll CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled
921 * @param RTCx RTC Instance
922 * @retval State of bit (1 or 0).
924 __STATIC_INLINE
uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef
*RTCx
)
926 return (READ_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
) == (RTC_CR_BYPSHAD
));
930 * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz)
931 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
932 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
933 * @rmtoll CR REFCKON LL_RTC_EnableRefClock
934 * @param RTCx RTC Instance
937 __STATIC_INLINE
void LL_RTC_EnableRefClock(RTC_TypeDef
*RTCx
)
939 SET_BIT(RTCx
->CR
, RTC_CR_REFCKON
);
943 * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz)
944 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
945 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
946 * @rmtoll CR REFCKON LL_RTC_DisableRefClock
947 * @param RTCx RTC Instance
950 __STATIC_INLINE
void LL_RTC_DisableRefClock(RTC_TypeDef
*RTCx
)
952 CLEAR_BIT(RTCx
->CR
, RTC_CR_REFCKON
);
956 * @brief Set Asynchronous prescaler factor
957 * @rmtoll PRER PREDIV_A LL_RTC_SetAsynchPrescaler
958 * @param RTCx RTC Instance
959 * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F
962 __STATIC_INLINE
void LL_RTC_SetAsynchPrescaler(RTC_TypeDef
*RTCx
, uint32_t AsynchPrescaler
)
964 MODIFY_REG(RTCx
->PRER
, RTC_PRER_PREDIV_A
, AsynchPrescaler
<< RTC_PRER_PREDIV_A_Pos
);
968 * @brief Set Synchronous prescaler factor
969 * @rmtoll PRER PREDIV_S LL_RTC_SetSynchPrescaler
970 * @param RTCx RTC Instance
971 * @param SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF
974 __STATIC_INLINE
void LL_RTC_SetSynchPrescaler(RTC_TypeDef
*RTCx
, uint32_t SynchPrescaler
)
976 MODIFY_REG(RTCx
->PRER
, RTC_PRER_PREDIV_S
, SynchPrescaler
);
980 * @brief Get Asynchronous prescaler factor
981 * @rmtoll PRER PREDIV_A LL_RTC_GetAsynchPrescaler
982 * @param RTCx RTC Instance
983 * @retval Value between Min_Data = 0 and Max_Data = 0x7F
985 __STATIC_INLINE
uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef
*RTCx
)
987 return (uint32_t)(READ_BIT(RTCx
->PRER
, RTC_PRER_PREDIV_A
) >> RTC_PRER_PREDIV_A_Pos
);
991 * @brief Get Synchronous prescaler factor
992 * @rmtoll PRER PREDIV_S LL_RTC_GetSynchPrescaler
993 * @param RTCx RTC Instance
994 * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF
996 __STATIC_INLINE
uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef
*RTCx
)
998 return (uint32_t)(READ_BIT(RTCx
->PRER
, RTC_PRER_PREDIV_S
));
1002 * @brief Enable the write protection for RTC registers.
1003 * @rmtoll WPR KEY LL_RTC_EnableWriteProtection
1004 * @param RTCx RTC Instance
1007 __STATIC_INLINE
void LL_RTC_EnableWriteProtection(RTC_TypeDef
*RTCx
)
1009 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_DISABLE
);
1013 * @brief Disable the write protection for RTC registers.
1014 * @rmtoll WPR KEY LL_RTC_DisableWriteProtection
1015 * @param RTCx RTC Instance
1018 __STATIC_INLINE
void LL_RTC_DisableWriteProtection(RTC_TypeDef
*RTCx
)
1020 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_ENABLE_1
);
1021 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_ENABLE_2
);
1028 /** @defgroup RTC_LL_EF_Time Time
1033 * @brief Set time format (AM/24-hour or PM notation)
1034 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1035 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1036 * @rmtoll TR PM LL_RTC_TIME_SetFormat
1037 * @param RTCx RTC Instance
1038 * @param TimeFormat This parameter can be one of the following values:
1039 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1040 * @arg @ref LL_RTC_TIME_FORMAT_PM
1043 __STATIC_INLINE
void LL_RTC_TIME_SetFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
1045 MODIFY_REG(RTCx
->TR
, RTC_TR_PM
, TimeFormat
);
1049 * @brief Get time format (AM or PM notation)
1050 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1051 * before reading this bit
1052 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1053 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1054 * @rmtoll TR PM LL_RTC_TIME_GetFormat
1055 * @param RTCx RTC Instance
1056 * @retval Returned value can be one of the following values:
1057 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1058 * @arg @ref LL_RTC_TIME_FORMAT_PM
1060 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef
*RTCx
)
1062 return (uint32_t)(READ_BIT(RTCx
->TR
, RTC_TR_PM
));
1066 * @brief Set Hours in BCD format
1067 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1068 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1069 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format
1070 * @rmtoll TR HT LL_RTC_TIME_SetHour\n
1071 * TR HU LL_RTC_TIME_SetHour
1072 * @param RTCx RTC Instance
1073 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1076 __STATIC_INLINE
void LL_RTC_TIME_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
1078 MODIFY_REG(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
),
1079 (((Hours
& 0xF0U
) << (RTC_TR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_TR_HU_Pos
)));
1083 * @brief Get Hours in BCD format
1084 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1085 * before reading this bit
1086 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1087 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1088 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to
1090 * @rmtoll TR HT LL_RTC_TIME_GetHour\n
1091 * TR HU LL_RTC_TIME_GetHour
1092 * @param RTCx RTC Instance
1093 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1095 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef
*RTCx
)
1097 return (uint32_t)((READ_BIT(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
))) >> RTC_TR_HU_Pos
);
1101 * @brief Set Minutes in BCD format
1102 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1103 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1104 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1105 * @rmtoll TR MNT LL_RTC_TIME_SetMinute\n
1106 * TR MNU LL_RTC_TIME_SetMinute
1107 * @param RTCx RTC Instance
1108 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1111 __STATIC_INLINE
void LL_RTC_TIME_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
1113 MODIFY_REG(RTCx
->TR
, (RTC_TR_MNT
| RTC_TR_MNU
),
1114 (((Minutes
& 0xF0U
) << (RTC_TR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_TR_MNU_Pos
)));
1118 * @brief Get Minutes in BCD format
1119 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1120 * before reading this bit
1121 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1122 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1123 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD
1125 * @rmtoll TR MNT LL_RTC_TIME_GetMinute\n
1126 * TR MNU LL_RTC_TIME_GetMinute
1127 * @param RTCx RTC Instance
1128 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1130 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef
*RTCx
)
1132 return (uint32_t)(READ_BIT(RTCx
->TR
, (RTC_TR_MNT
| RTC_TR_MNU
))>> RTC_TR_MNU_Pos
);
1136 * @brief Set Seconds in BCD format
1137 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1138 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1139 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1140 * @rmtoll TR ST LL_RTC_TIME_SetSecond\n
1141 * TR SU LL_RTC_TIME_SetSecond
1142 * @param RTCx RTC Instance
1143 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1146 __STATIC_INLINE
void LL_RTC_TIME_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
1148 MODIFY_REG(RTCx
->TR
, (RTC_TR_ST
| RTC_TR_SU
),
1149 (((Seconds
& 0xF0U
) << (RTC_TR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_TR_SU_Pos
)));
1153 * @brief Get Seconds in BCD format
1154 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1155 * before reading this bit
1156 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1157 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1158 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD
1160 * @rmtoll TR ST LL_RTC_TIME_GetSecond\n
1161 * TR SU LL_RTC_TIME_GetSecond
1162 * @param RTCx RTC Instance
1163 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1165 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef
*RTCx
)
1167 return (uint32_t)(READ_BIT(RTCx
->TR
, (RTC_TR_ST
| RTC_TR_SU
)) >> RTC_TR_SU_Pos
);
1171 * @brief Set time (hour, minute and second) in BCD format
1172 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1173 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1174 * @note TimeFormat and Hours should follow the same format
1175 * @rmtoll TR PM LL_RTC_TIME_Config\n
1176 * TR HT LL_RTC_TIME_Config\n
1177 * TR HU LL_RTC_TIME_Config\n
1178 * TR MNT LL_RTC_TIME_Config\n
1179 * TR MNU LL_RTC_TIME_Config\n
1180 * TR ST LL_RTC_TIME_Config\n
1181 * TR SU LL_RTC_TIME_Config
1182 * @param RTCx RTC Instance
1183 * @param Format12_24 This parameter can be one of the following values:
1184 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1185 * @arg @ref LL_RTC_TIME_FORMAT_PM
1186 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1187 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1188 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1191 __STATIC_INLINE
void LL_RTC_TIME_Config(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
, uint32_t Seconds
)
1193 register uint32_t temp
= 0U;
1195 temp
= Format12_24
| \
1196 (((Hours
& 0xF0U
) << (RTC_TR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_TR_HU_Pos
)) | \
1197 (((Minutes
& 0xF0U
) << (RTC_TR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_TR_MNU_Pos
)) | \
1198 (((Seconds
& 0xF0U
) << (RTC_TR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_TR_SU_Pos
));
1199 MODIFY_REG(RTCx
->TR
, (RTC_TR_PM
| RTC_TR_HT
| RTC_TR_HU
| RTC_TR_MNT
| RTC_TR_MNU
| RTC_TR_ST
| RTC_TR_SU
), temp
);
1203 * @brief Get time (hour, minute and second) in BCD format
1204 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1205 * before reading this bit
1206 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1207 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1208 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
1209 * are available to get independently each parameter.
1210 * @rmtoll TR HT LL_RTC_TIME_Get\n
1211 * TR HU LL_RTC_TIME_Get\n
1212 * TR MNT LL_RTC_TIME_Get\n
1213 * TR MNU LL_RTC_TIME_Get\n
1214 * TR ST LL_RTC_TIME_Get\n
1215 * TR SU LL_RTC_TIME_Get
1216 * @param RTCx RTC Instance
1217 * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
1219 __STATIC_INLINE
uint32_t LL_RTC_TIME_Get(RTC_TypeDef
*RTCx
)
1221 register uint32_t temp
= 0U;
1223 temp
= READ_BIT(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
| RTC_TR_MNT
| RTC_TR_MNU
| RTC_TR_ST
| RTC_TR_SU
));
1224 return (uint32_t)((((((temp
& RTC_TR_HT
) >> RTC_TR_HT_Pos
) << 4U) | ((temp
& RTC_TR_HU
) >> RTC_TR_HU_Pos
)) << RTC_OFFSET_HOUR
) | \
1225 (((((temp
& RTC_TR_MNT
) >> RTC_TR_MNT_Pos
) << 4U) | ((temp
& RTC_TR_MNU
) >> RTC_TR_MNU_Pos
)) << RTC_OFFSET_MINUTE
) | \
1226 ((((temp
& RTC_TR_ST
) >> RTC_TR_ST_Pos
) << 4U) | ((temp
& RTC_TR_SU
) >> RTC_TR_SU_Pos
)));
1230 * @brief Memorize whether the daylight saving time change has been performed
1231 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1232 * @rmtoll CR BKP LL_RTC_TIME_EnableDayLightStore
1233 * @param RTCx RTC Instance
1236 __STATIC_INLINE
void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef
*RTCx
)
1238 SET_BIT(RTCx
->CR
, RTC_CR_BKP
);
1242 * @brief Disable memorization whether the daylight saving time change has been performed.
1243 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1244 * @rmtoll CR BKP LL_RTC_TIME_DisableDayLightStore
1245 * @param RTCx RTC Instance
1248 __STATIC_INLINE
void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef
*RTCx
)
1250 CLEAR_BIT(RTCx
->CR
, RTC_CR_BKP
);
1254 * @brief Check if RTC Day Light Saving stored operation has been enabled or not
1255 * @rmtoll CR BKP LL_RTC_TIME_IsDayLightStoreEnabled
1256 * @param RTCx RTC Instance
1257 * @retval State of bit (1 or 0).
1259 __STATIC_INLINE
uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef
*RTCx
)
1261 return (READ_BIT(RTCx
->CR
, RTC_CR_BKP
) == (RTC_CR_BKP
));
1265 * @brief Subtract 1 hour (winter time change)
1266 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1267 * @rmtoll CR SUB1H LL_RTC_TIME_DecHour
1268 * @param RTCx RTC Instance
1271 __STATIC_INLINE
void LL_RTC_TIME_DecHour(RTC_TypeDef
*RTCx
)
1273 SET_BIT(RTCx
->CR
, RTC_CR_SUB1H
);
1277 * @brief Add 1 hour (summer time change)
1278 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1279 * @rmtoll CR ADD1H LL_RTC_TIME_IncHour
1280 * @param RTCx RTC Instance
1283 __STATIC_INLINE
void LL_RTC_TIME_IncHour(RTC_TypeDef
*RTCx
)
1285 SET_BIT(RTCx
->CR
, RTC_CR_ADD1H
);
1289 * @brief Get Sub second value in the synchronous prescaler counter.
1290 * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through
1291 * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar
1292 * SubSeconds value in second fraction ratio with time unit following
1294 * ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit
1295 * This conversion can be performed only if no shift operation is pending
1296 * (ie. SHFP=0) when PREDIV_S >= SS.
1297 * @rmtoll SSR SS LL_RTC_TIME_GetSubSecond
1298 * @param RTCx RTC Instance
1299 * @retval Sub second value (number between 0 and 65535)
1301 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef
*RTCx
)
1303 return (uint32_t)(READ_BIT(RTCx
->SSR
, RTC_SSR_SS
));
1307 * @brief Synchronize to a remote clock with a high degree of precision.
1308 * @note This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
1309 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1310 * @note When REFCKON is set, firmware must not write to Shift control register.
1311 * @rmtoll SHIFTR ADD1S LL_RTC_TIME_Synchronize\n
1312 * SHIFTR SUBFS LL_RTC_TIME_Synchronize
1313 * @param RTCx RTC Instance
1314 * @param ShiftSecond This parameter can be one of the following values:
1315 * @arg @ref LL_RTC_SHIFT_SECOND_DELAY
1316 * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE
1317 * @param Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF)
1320 __STATIC_INLINE
void LL_RTC_TIME_Synchronize(RTC_TypeDef
*RTCx
, uint32_t ShiftSecond
, uint32_t Fraction
)
1322 WRITE_REG(RTCx
->SHIFTR
, ShiftSecond
| Fraction
);
1329 /** @defgroup RTC_LL_EF_Date Date
1334 * @brief Set Year in BCD format
1335 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format
1336 * @rmtoll DR YT LL_RTC_DATE_SetYear\n
1337 * DR YU LL_RTC_DATE_SetYear
1338 * @param RTCx RTC Instance
1339 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1342 __STATIC_INLINE
void LL_RTC_DATE_SetYear(RTC_TypeDef
*RTCx
, uint32_t Year
)
1344 MODIFY_REG(RTCx
->DR
, (RTC_DR_YT
| RTC_DR_YU
),
1345 (((Year
& 0xF0U
) << (RTC_DR_YT_Pos
- 4U)) | ((Year
& 0x0FU
) << RTC_DR_YU_Pos
)));
1349 * @brief Get Year in BCD format
1350 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1351 * before reading this bit
1352 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
1353 * @rmtoll DR YT LL_RTC_DATE_GetYear\n
1354 * DR YU LL_RTC_DATE_GetYear
1355 * @param RTCx RTC Instance
1356 * @retval Value between Min_Data=0x00 and Max_Data=0x99
1358 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef
*RTCx
)
1360 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_YT
| RTC_DR_YU
))) >> RTC_DR_YU_Pos
);
1364 * @brief Set Week day
1365 * @rmtoll DR WDU LL_RTC_DATE_SetWeekDay
1366 * @param RTCx RTC Instance
1367 * @param WeekDay This parameter can be one of the following values:
1368 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1369 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1370 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1371 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1372 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1373 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1374 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1377 __STATIC_INLINE
void LL_RTC_DATE_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
1379 MODIFY_REG(RTCx
->DR
, RTC_DR_WDU
, WeekDay
<< RTC_DR_WDU_Pos
);
1383 * @brief Get Week day
1384 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1385 * before reading this bit
1386 * @rmtoll DR WDU LL_RTC_DATE_GetWeekDay
1387 * @param RTCx RTC Instance
1388 * @retval Returned value can be one of the following values:
1389 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1390 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1391 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1392 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1393 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1394 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1395 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1397 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef
*RTCx
)
1399 return (uint32_t)(READ_BIT(RTCx
->DR
, RTC_DR_WDU
) >> RTC_DR_WDU_Pos
);
1403 * @brief Set Month in BCD format
1404 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format
1405 * @rmtoll DR MT LL_RTC_DATE_SetMonth\n
1406 * DR MU LL_RTC_DATE_SetMonth
1407 * @param RTCx RTC Instance
1408 * @param Month This parameter can be one of the following values:
1409 * @arg @ref LL_RTC_MONTH_JANUARY
1410 * @arg @ref LL_RTC_MONTH_FEBRUARY
1411 * @arg @ref LL_RTC_MONTH_MARCH
1412 * @arg @ref LL_RTC_MONTH_APRIL
1413 * @arg @ref LL_RTC_MONTH_MAY
1414 * @arg @ref LL_RTC_MONTH_JUNE
1415 * @arg @ref LL_RTC_MONTH_JULY
1416 * @arg @ref LL_RTC_MONTH_AUGUST
1417 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1418 * @arg @ref LL_RTC_MONTH_OCTOBER
1419 * @arg @ref LL_RTC_MONTH_NOVEMBER
1420 * @arg @ref LL_RTC_MONTH_DECEMBER
1423 __STATIC_INLINE
void LL_RTC_DATE_SetMonth(RTC_TypeDef
*RTCx
, uint32_t Month
)
1425 MODIFY_REG(RTCx
->DR
, (RTC_DR_MT
| RTC_DR_MU
),
1426 (((Month
& 0xF0U
) << (RTC_DR_MT_Pos
- 4U)) | ((Month
& 0x0FU
) << RTC_DR_MU_Pos
)));
1430 * @brief Get Month in BCD format
1431 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1432 * before reading this bit
1433 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
1434 * @rmtoll DR MT LL_RTC_DATE_GetMonth\n
1435 * DR MU LL_RTC_DATE_GetMonth
1436 * @param RTCx RTC Instance
1437 * @retval Returned value can be one of the following values:
1438 * @arg @ref LL_RTC_MONTH_JANUARY
1439 * @arg @ref LL_RTC_MONTH_FEBRUARY
1440 * @arg @ref LL_RTC_MONTH_MARCH
1441 * @arg @ref LL_RTC_MONTH_APRIL
1442 * @arg @ref LL_RTC_MONTH_MAY
1443 * @arg @ref LL_RTC_MONTH_JUNE
1444 * @arg @ref LL_RTC_MONTH_JULY
1445 * @arg @ref LL_RTC_MONTH_AUGUST
1446 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1447 * @arg @ref LL_RTC_MONTH_OCTOBER
1448 * @arg @ref LL_RTC_MONTH_NOVEMBER
1449 * @arg @ref LL_RTC_MONTH_DECEMBER
1451 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef
*RTCx
)
1453 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_MT
| RTC_DR_MU
)))>> RTC_DR_MU_Pos
);
1457 * @brief Set Day in BCD format
1458 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1459 * @rmtoll DR DT LL_RTC_DATE_SetDay\n
1460 * DR DU LL_RTC_DATE_SetDay
1461 * @param RTCx RTC Instance
1462 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1465 __STATIC_INLINE
void LL_RTC_DATE_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
1467 MODIFY_REG(RTCx
->DR
, (RTC_DR_DT
| RTC_DR_DU
),
1468 (((Day
& 0xF0U
) << (RTC_DR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_DR_DU_Pos
)));
1472 * @brief Get Day in BCD format
1473 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1474 * before reading this bit
1475 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1476 * @rmtoll DR DT LL_RTC_DATE_GetDay\n
1477 * DR DU LL_RTC_DATE_GetDay
1478 * @param RTCx RTC Instance
1479 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1481 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef
*RTCx
)
1483 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_DT
| RTC_DR_DU
))) >> RTC_DR_DU_Pos
);
1487 * @brief Set date (WeekDay, Day, Month and Year) in BCD format
1488 * @rmtoll DR WDU LL_RTC_DATE_Config\n
1489 * DR MT LL_RTC_DATE_Config\n
1490 * DR MU LL_RTC_DATE_Config\n
1491 * DR DT LL_RTC_DATE_Config\n
1492 * DR DU LL_RTC_DATE_Config\n
1493 * DR YT LL_RTC_DATE_Config\n
1494 * DR YU LL_RTC_DATE_Config
1495 * @param RTCx RTC Instance
1496 * @param WeekDay This parameter can be one of the following values:
1497 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1498 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1499 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1500 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1501 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1502 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1503 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1504 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1505 * @param Month This parameter can be one of the following values:
1506 * @arg @ref LL_RTC_MONTH_JANUARY
1507 * @arg @ref LL_RTC_MONTH_FEBRUARY
1508 * @arg @ref LL_RTC_MONTH_MARCH
1509 * @arg @ref LL_RTC_MONTH_APRIL
1510 * @arg @ref LL_RTC_MONTH_MAY
1511 * @arg @ref LL_RTC_MONTH_JUNE
1512 * @arg @ref LL_RTC_MONTH_JULY
1513 * @arg @ref LL_RTC_MONTH_AUGUST
1514 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1515 * @arg @ref LL_RTC_MONTH_OCTOBER
1516 * @arg @ref LL_RTC_MONTH_NOVEMBER
1517 * @arg @ref LL_RTC_MONTH_DECEMBER
1518 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1521 __STATIC_INLINE
void LL_RTC_DATE_Config(RTC_TypeDef
*RTCx
, uint32_t WeekDay
, uint32_t Day
, uint32_t Month
, uint32_t Year
)
1523 register uint32_t temp
= 0U;
1525 temp
= (WeekDay
<< RTC_DR_WDU_Pos
) | \
1526 (((Year
& 0xF0U
) << (RTC_DR_YT_Pos
- 4U)) | ((Year
& 0x0FU
) << RTC_DR_YU_Pos
)) | \
1527 (((Month
& 0xF0U
) << (RTC_DR_MT_Pos
- 4U)) | ((Month
& 0x0FU
) << RTC_DR_MU_Pos
)) | \
1528 (((Day
& 0xF0U
) << (RTC_DR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_DR_DU_Pos
));
1530 MODIFY_REG(RTCx
->DR
, (RTC_DR_WDU
| RTC_DR_MT
| RTC_DR_MU
| RTC_DR_DT
| RTC_DR_DU
| RTC_DR_YT
| RTC_DR_YU
), temp
);
1534 * @brief Get date (WeekDay, Day, Month and Year) in BCD format
1535 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1536 * before reading this bit
1537 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
1538 * and __LL_RTC_GET_DAY are available to get independently each parameter.
1539 * @rmtoll DR WDU LL_RTC_DATE_Get\n
1540 * DR MT LL_RTC_DATE_Get\n
1541 * DR MU LL_RTC_DATE_Get\n
1542 * DR DT LL_RTC_DATE_Get\n
1543 * DR DU LL_RTC_DATE_Get\n
1544 * DR YT LL_RTC_DATE_Get\n
1545 * DR YU LL_RTC_DATE_Get
1546 * @param RTCx RTC Instance
1547 * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY).
1549 __STATIC_INLINE
uint32_t LL_RTC_DATE_Get(RTC_TypeDef
*RTCx
)
1551 register uint32_t temp
= 0U;
1553 temp
= READ_BIT(RTCx
->DR
, (RTC_DR_WDU
| RTC_DR_MT
| RTC_DR_MU
| RTC_DR_DT
| RTC_DR_DU
| RTC_DR_YT
| RTC_DR_YU
));
1554 return (uint32_t)((((temp
& RTC_DR_WDU
) >> RTC_DR_WDU_Pos
) << RTC_OFFSET_WEEKDAY
) | \
1555 (((((temp
& RTC_DR_DT
) >> RTC_DR_DT_Pos
) << 4U) | ((temp
& RTC_DR_DU
) >> RTC_DR_DU_Pos
)) << RTC_OFFSET_DAY
) | \
1556 (((((temp
& RTC_DR_MT
) >> RTC_DR_MT_Pos
) << 4U) | ((temp
& RTC_DR_MU
) >> RTC_DR_MU_Pos
)) << RTC_OFFSET_MONTH
) | \
1557 ((((temp
& RTC_DR_YT
) >> RTC_DR_YT_Pos
) << 4U) | ((temp
& RTC_DR_YU
) >> RTC_DR_YU_Pos
)));
1564 /** @defgroup RTC_LL_EF_ALARMA ALARMA
1569 * @brief Enable Alarm A
1570 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1571 * @rmtoll CR ALRAE LL_RTC_ALMA_Enable
1572 * @param RTCx RTC Instance
1575 __STATIC_INLINE
void LL_RTC_ALMA_Enable(RTC_TypeDef
*RTCx
)
1577 SET_BIT(RTCx
->CR
, RTC_CR_ALRAE
);
1581 * @brief Disable Alarm A
1582 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1583 * @rmtoll CR ALRAE LL_RTC_ALMA_Disable
1584 * @param RTCx RTC Instance
1587 __STATIC_INLINE
void LL_RTC_ALMA_Disable(RTC_TypeDef
*RTCx
)
1589 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRAE
);
1593 * @brief Specify the Alarm A masks.
1594 * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_SetMask\n
1595 * ALRMAR MSK3 LL_RTC_ALMA_SetMask\n
1596 * ALRMAR MSK2 LL_RTC_ALMA_SetMask\n
1597 * ALRMAR MSK1 LL_RTC_ALMA_SetMask
1598 * @param RTCx RTC Instance
1599 * @param Mask This parameter can be a combination of the following values:
1600 * @arg @ref LL_RTC_ALMA_MASK_NONE
1601 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
1602 * @arg @ref LL_RTC_ALMA_MASK_HOURS
1603 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
1604 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
1605 * @arg @ref LL_RTC_ALMA_MASK_ALL
1608 __STATIC_INLINE
void LL_RTC_ALMA_SetMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
1610 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_MSK4
| RTC_ALRMAR_MSK3
| RTC_ALRMAR_MSK2
| RTC_ALRMAR_MSK1
, Mask
);
1614 * @brief Get the Alarm A masks.
1615 * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_GetMask\n
1616 * ALRMAR MSK3 LL_RTC_ALMA_GetMask\n
1617 * ALRMAR MSK2 LL_RTC_ALMA_GetMask\n
1618 * ALRMAR MSK1 LL_RTC_ALMA_GetMask
1619 * @param RTCx RTC Instance
1620 * @retval Returned value can be can be a combination of the following values:
1621 * @arg @ref LL_RTC_ALMA_MASK_NONE
1622 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
1623 * @arg @ref LL_RTC_ALMA_MASK_HOURS
1624 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
1625 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
1626 * @arg @ref LL_RTC_ALMA_MASK_ALL
1628 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef
*RTCx
)
1630 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_MSK4
| RTC_ALRMAR_MSK3
| RTC_ALRMAR_MSK2
| RTC_ALRMAR_MSK1
));
1634 * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
1635 * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday
1636 * @param RTCx RTC Instance
1639 __STATIC_INLINE
void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef
*RTCx
)
1641 SET_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_WDSEL
);
1645 * @brief Disable AlarmA Week day selection (DU[3:0] represents the date )
1646 * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday
1647 * @param RTCx RTC Instance
1650 __STATIC_INLINE
void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef
*RTCx
)
1652 CLEAR_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_WDSEL
);
1656 * @brief Set ALARM A Day in BCD format
1657 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1658 * @rmtoll ALRMAR DT LL_RTC_ALMA_SetDay\n
1659 * ALRMAR DU LL_RTC_ALMA_SetDay
1660 * @param RTCx RTC Instance
1661 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1664 __STATIC_INLINE
void LL_RTC_ALMA_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
1666 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_DT
| RTC_ALRMAR_DU
),
1667 (((Day
& 0xF0U
) << (RTC_ALRMAR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_ALRMAR_DU_Pos
)));
1671 * @brief Get ALARM A Day in BCD format
1672 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1673 * @rmtoll ALRMAR DT LL_RTC_ALMA_GetDay\n
1674 * ALRMAR DU LL_RTC_ALMA_GetDay
1675 * @param RTCx RTC Instance
1676 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1678 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef
*RTCx
)
1680 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_DT
| RTC_ALRMAR_DU
))) >> RTC_ALRMAR_DU_Pos
);
1684 * @brief Set ALARM A Weekday
1685 * @rmtoll ALRMAR DU LL_RTC_ALMA_SetWeekDay
1686 * @param RTCx RTC Instance
1687 * @param WeekDay This parameter can be one of the following values:
1688 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1689 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1690 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1691 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1692 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1693 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1694 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1697 __STATIC_INLINE
void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
1699 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_DU
, WeekDay
<< RTC_ALRMAR_DU_Pos
);
1703 * @brief Get ALARM A Weekday
1704 * @rmtoll ALRMAR DU LL_RTC_ALMA_GetWeekDay
1705 * @param RTCx RTC Instance
1706 * @retval Returned value can be one of the following values:
1707 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1708 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1709 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1710 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1711 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1712 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1713 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1715 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef
*RTCx
)
1717 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_DU
) >> RTC_ALRMAR_DU_Pos
);
1721 * @brief Set Alarm A time format (AM/24-hour or PM notation)
1722 * @rmtoll ALRMAR PM LL_RTC_ALMA_SetTimeFormat
1723 * @param RTCx RTC Instance
1724 * @param TimeFormat This parameter can be one of the following values:
1725 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1726 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1729 __STATIC_INLINE
void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
1731 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_PM
, TimeFormat
);
1735 * @brief Get Alarm A time format (AM or PM notation)
1736 * @rmtoll ALRMAR PM LL_RTC_ALMA_GetTimeFormat
1737 * @param RTCx RTC Instance
1738 * @retval Returned value can be one of the following values:
1739 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1740 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1742 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef
*RTCx
)
1744 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_PM
));
1748 * @brief Set ALARM A Hours in BCD format
1749 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
1750 * @rmtoll ALRMAR HT LL_RTC_ALMA_SetHour\n
1751 * ALRMAR HU LL_RTC_ALMA_SetHour
1752 * @param RTCx RTC Instance
1753 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1756 __STATIC_INLINE
void LL_RTC_ALMA_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
1758 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_HT
| RTC_ALRMAR_HU
),
1759 (((Hours
& 0xF0U
) << (RTC_ALRMAR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMAR_HU_Pos
)));
1763 * @brief Get ALARM A Hours in BCD format
1764 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
1765 * @rmtoll ALRMAR HT LL_RTC_ALMA_GetHour\n
1766 * ALRMAR HU LL_RTC_ALMA_GetHour
1767 * @param RTCx RTC Instance
1768 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1770 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef
*RTCx
)
1772 return (uint32_t)(( READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_HT
| RTC_ALRMAR_HU
))) >> RTC_ALRMAR_HU_Pos
);
1776 * @brief Set ALARM A Minutes in BCD format
1777 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1778 * @rmtoll ALRMAR MNT LL_RTC_ALMA_SetMinute\n
1779 * ALRMAR MNU LL_RTC_ALMA_SetMinute
1780 * @param RTCx RTC Instance
1781 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1784 __STATIC_INLINE
void LL_RTC_ALMA_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
1786 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
),
1787 (((Minutes
& 0xF0U
) << (RTC_ALRMAR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMAR_MNU_Pos
)));
1791 * @brief Get ALARM A Minutes in BCD format
1792 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
1793 * @rmtoll ALRMAR MNT LL_RTC_ALMA_GetMinute\n
1794 * ALRMAR MNU LL_RTC_ALMA_GetMinute
1795 * @param RTCx RTC Instance
1796 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1798 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef
*RTCx
)
1800 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
))) >> RTC_ALRMAR_MNU_Pos
);
1804 * @brief Set ALARM A Seconds in BCD format
1805 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1806 * @rmtoll ALRMAR ST LL_RTC_ALMA_SetSecond\n
1807 * ALRMAR SU LL_RTC_ALMA_SetSecond
1808 * @param RTCx RTC Instance
1809 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1812 __STATIC_INLINE
void LL_RTC_ALMA_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
1814 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_ST
| RTC_ALRMAR_SU
),
1815 (((Seconds
& 0xF0U
) << (RTC_ALRMAR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMAR_SU_Pos
)));
1819 * @brief Get ALARM A Seconds in BCD format
1820 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
1821 * @rmtoll ALRMAR ST LL_RTC_ALMA_GetSecond\n
1822 * ALRMAR SU LL_RTC_ALMA_GetSecond
1823 * @param RTCx RTC Instance
1824 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1826 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef
*RTCx
)
1828 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_ST
| RTC_ALRMAR_SU
))) >> RTC_ALRMAR_SU_Pos
);
1832 * @brief Set Alarm A Time (hour, minute and second) in BCD format
1833 * @rmtoll ALRMAR PM LL_RTC_ALMA_ConfigTime\n
1834 * ALRMAR HT LL_RTC_ALMA_ConfigTime\n
1835 * ALRMAR HU LL_RTC_ALMA_ConfigTime\n
1836 * ALRMAR MNT LL_RTC_ALMA_ConfigTime\n
1837 * ALRMAR MNU LL_RTC_ALMA_ConfigTime\n
1838 * ALRMAR ST LL_RTC_ALMA_ConfigTime\n
1839 * ALRMAR SU LL_RTC_ALMA_ConfigTime
1840 * @param RTCx RTC Instance
1841 * @param Format12_24 This parameter can be one of the following values:
1842 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1843 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1844 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1845 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1846 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1849 __STATIC_INLINE
void LL_RTC_ALMA_ConfigTime(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
, uint32_t Seconds
)
1851 register uint32_t temp
= 0U;
1853 temp
= Format12_24
| (((Hours
& 0xF0U
) << (RTC_ALRMAR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMAR_HU_Pos
)) | \
1854 (((Minutes
& 0xF0U
) << (RTC_ALRMAR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMAR_MNU_Pos
)) | \
1855 (((Seconds
& 0xF0U
) << (RTC_ALRMAR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMAR_SU_Pos
));
1857 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_PM
| RTC_ALRMAR_HT
| RTC_ALRMAR_HU
| RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
| RTC_ALRMAR_ST
| RTC_ALRMAR_SU
, temp
);
1861 * @brief Get Alarm B Time (hour, minute and second) in BCD format
1862 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
1863 * are available to get independently each parameter.
1864 * @rmtoll ALRMAR HT LL_RTC_ALMA_GetTime\n
1865 * ALRMAR HU LL_RTC_ALMA_GetTime\n
1866 * ALRMAR MNT LL_RTC_ALMA_GetTime\n
1867 * ALRMAR MNU LL_RTC_ALMA_GetTime\n
1868 * ALRMAR ST LL_RTC_ALMA_GetTime\n
1869 * ALRMAR SU LL_RTC_ALMA_GetTime
1870 * @param RTCx RTC Instance
1871 * @retval Combination of hours, minutes and seconds.
1873 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef
*RTCx
)
1875 return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx
) << RTC_OFFSET_HOUR
) | (LL_RTC_ALMA_GetMinute(RTCx
) << RTC_OFFSET_MINUTE
) | LL_RTC_ALMA_GetSecond(RTCx
));
1879 * @brief Set Alarm A Mask the most-significant bits starting at this bit
1880 * @note This register can be written only when ALRAE is reset in RTC_CR register,
1881 * or in initialization mode.
1882 * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask
1883 * @param RTCx RTC Instance
1884 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
1887 __STATIC_INLINE
void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
1889 MODIFY_REG(RTCx
->ALRMASSR
, RTC_ALRMASSR_MASKSS
, Mask
<< RTC_ALRMASSR_MASKSS_Pos
);
1893 * @brief Get Alarm A Mask the most-significant bits starting at this bit
1894 * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask
1895 * @param RTCx RTC Instance
1896 * @retval Value between Min_Data=0x00 and Max_Data=0xF
1898 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef
*RTCx
)
1900 return (uint32_t)(READ_BIT(RTCx
->ALRMASSR
, RTC_ALRMASSR_MASKSS
) >> RTC_ALRMASSR_MASKSS_Pos
);
1904 * @brief Set Alarm A Sub seconds value
1905 * @rmtoll ALRMASSR SS LL_RTC_ALMA_SetSubSecond
1906 * @param RTCx RTC Instance
1907 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
1910 __STATIC_INLINE
void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef
*RTCx
, uint32_t Subsecond
)
1912 MODIFY_REG(RTCx
->ALRMASSR
, RTC_ALRMASSR_SS
, Subsecond
);
1916 * @brief Get Alarm A Sub seconds value
1917 * @rmtoll ALRMASSR SS LL_RTC_ALMA_GetSubSecond
1918 * @param RTCx RTC Instance
1919 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
1921 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef
*RTCx
)
1923 return (uint32_t)(READ_BIT(RTCx
->ALRMASSR
, RTC_ALRMASSR_SS
));
1930 /** @defgroup RTC_LL_EF_ALARMB ALARMB
1935 * @brief Enable Alarm B
1936 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1937 * @rmtoll CR ALRBE LL_RTC_ALMB_Enable
1938 * @param RTCx RTC Instance
1941 __STATIC_INLINE
void LL_RTC_ALMB_Enable(RTC_TypeDef
*RTCx
)
1943 SET_BIT(RTCx
->CR
, RTC_CR_ALRBE
);
1947 * @brief Disable Alarm B
1948 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1949 * @rmtoll CR ALRBE LL_RTC_ALMB_Disable
1950 * @param RTCx RTC Instance
1953 __STATIC_INLINE
void LL_RTC_ALMB_Disable(RTC_TypeDef
*RTCx
)
1955 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRBE
);
1959 * @brief Specify the Alarm B masks.
1960 * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_SetMask\n
1961 * ALRMBR MSK3 LL_RTC_ALMB_SetMask\n
1962 * ALRMBR MSK2 LL_RTC_ALMB_SetMask\n
1963 * ALRMBR MSK1 LL_RTC_ALMB_SetMask
1964 * @param RTCx RTC Instance
1965 * @param Mask This parameter can be a combination of the following values:
1966 * @arg @ref LL_RTC_ALMB_MASK_NONE
1967 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
1968 * @arg @ref LL_RTC_ALMB_MASK_HOURS
1969 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
1970 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
1971 * @arg @ref LL_RTC_ALMB_MASK_ALL
1974 __STATIC_INLINE
void LL_RTC_ALMB_SetMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
1976 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_MSK4
| RTC_ALRMBR_MSK3
| RTC_ALRMBR_MSK2
| RTC_ALRMBR_MSK1
, Mask
);
1980 * @brief Get the Alarm B masks.
1981 * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_GetMask\n
1982 * ALRMBR MSK3 LL_RTC_ALMB_GetMask\n
1983 * ALRMBR MSK2 LL_RTC_ALMB_GetMask\n
1984 * ALRMBR MSK1 LL_RTC_ALMB_GetMask
1985 * @param RTCx RTC Instance
1986 * @retval Returned value can be can be a combination of the following values:
1987 * @arg @ref LL_RTC_ALMB_MASK_NONE
1988 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
1989 * @arg @ref LL_RTC_ALMB_MASK_HOURS
1990 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
1991 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
1992 * @arg @ref LL_RTC_ALMB_MASK_ALL
1994 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef
*RTCx
)
1996 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_MSK4
| RTC_ALRMBR_MSK3
| RTC_ALRMBR_MSK2
| RTC_ALRMBR_MSK1
));
2000 * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
2001 * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday
2002 * @param RTCx RTC Instance
2005 __STATIC_INLINE
void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef
*RTCx
)
2007 SET_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_WDSEL
);
2011 * @brief Disable AlarmB Week day selection (DU[3:0] represents the date )
2012 * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday
2013 * @param RTCx RTC Instance
2016 __STATIC_INLINE
void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef
*RTCx
)
2018 CLEAR_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_WDSEL
);
2022 * @brief Set ALARM B Day in BCD format
2023 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
2024 * @rmtoll ALRMBR DT LL_RTC_ALMB_SetDay\n
2025 * ALRMBR DU LL_RTC_ALMB_SetDay
2026 * @param RTCx RTC Instance
2027 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
2030 __STATIC_INLINE
void LL_RTC_ALMB_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
2032 MODIFY_REG(RTC
->ALRMBR
, (RTC_ALRMBR_DT
| RTC_ALRMBR_DU
),
2033 (((Day
& 0xF0U
) << (RTC_ALRMBR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_ALRMBR_DU_Pos
)));
2037 * @brief Get ALARM B Day in BCD format
2038 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2039 * @rmtoll ALRMBR DT LL_RTC_ALMB_GetDay\n
2040 * ALRMBR DU LL_RTC_ALMB_GetDay
2041 * @param RTCx RTC Instance
2042 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2044 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef
*RTCx
)
2046 return (uint32_t)(( READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_DT
| RTC_ALRMBR_DU
))) >> RTC_ALRMBR_DU_Pos
);
2050 * @brief Set ALARM B Weekday
2051 * @rmtoll ALRMBR DU LL_RTC_ALMB_SetWeekDay
2052 * @param RTCx RTC Instance
2053 * @param WeekDay This parameter can be one of the following values:
2054 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2055 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2056 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2057 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2058 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2059 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2060 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2063 __STATIC_INLINE
void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
2065 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_DU
, WeekDay
<< RTC_ALRMBR_DU_Pos
);
2069 * @brief Get ALARM B Weekday
2070 * @rmtoll ALRMBR DU LL_RTC_ALMB_GetWeekDay
2071 * @param RTCx RTC Instance
2072 * @retval Returned value can be one of the following values:
2073 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2074 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2075 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2076 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2077 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2078 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2079 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2081 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef
*RTCx
)
2083 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_DU
) >> RTC_ALRMBR_DU_Pos
);
2087 * @brief Set ALARM B time format (AM/24-hour or PM notation)
2088 * @rmtoll ALRMBR PM LL_RTC_ALMB_SetTimeFormat
2089 * @param RTCx RTC Instance
2090 * @param TimeFormat This parameter can be one of the following values:
2091 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2092 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2095 __STATIC_INLINE
void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
2097 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_PM
, TimeFormat
);
2101 * @brief Get ALARM B time format (AM or PM notation)
2102 * @rmtoll ALRMBR PM LL_RTC_ALMB_GetTimeFormat
2103 * @param RTCx RTC Instance
2104 * @retval Returned value can be one of the following values:
2105 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2106 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2108 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef
*RTCx
)
2110 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_PM
));
2114 * @brief Set ALARM B Hours in BCD format
2115 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
2116 * @rmtoll ALRMBR HT LL_RTC_ALMB_SetHour\n
2117 * ALRMBR HU LL_RTC_ALMB_SetHour
2118 * @param RTCx RTC Instance
2119 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2122 __STATIC_INLINE
void LL_RTC_ALMB_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
2124 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_HT
| RTC_ALRMBR_HU
),
2125 (((Hours
& 0xF0U
) << (RTC_ALRMBR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMBR_HU_Pos
)));
2129 * @brief Get ALARM B Hours in BCD format
2130 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2131 * @rmtoll ALRMBR HT LL_RTC_ALMB_GetHour\n
2132 * ALRMBR HU LL_RTC_ALMB_GetHour
2133 * @param RTCx RTC Instance
2134 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2136 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef
*RTCx
)
2138 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_HT
| RTC_ALRMBR_HU
))) >> RTC_ALRMBR_HU_Pos
);
2142 * @brief Set ALARM B Minutes in BCD format
2143 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
2144 * @rmtoll ALRMBR MNT LL_RTC_ALMB_SetMinute\n
2145 * ALRMBR MNU LL_RTC_ALMB_SetMinute
2146 * @param RTCx RTC Instance
2147 * @param Minutes between Min_Data=0x00 and Max_Data=0x59
2150 __STATIC_INLINE
void LL_RTC_ALMB_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
2152 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
),
2153 (((Minutes
& 0xF0U
) << (RTC_ALRMBR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMBR_MNU_Pos
)));
2157 * @brief Get ALARM B Minutes in BCD format
2158 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2159 * @rmtoll ALRMBR MNT LL_RTC_ALMB_GetMinute\n
2160 * ALRMBR MNU LL_RTC_ALMB_GetMinute
2161 * @param RTCx RTC Instance
2162 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2164 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef
*RTCx
)
2166 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
))) >> RTC_ALRMBR_MNU_Pos
);
2170 * @brief Set ALARM B Seconds in BCD format
2171 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
2172 * @rmtoll ALRMBR ST LL_RTC_ALMB_SetSecond\n
2173 * ALRMBR SU LL_RTC_ALMB_SetSecond
2174 * @param RTCx RTC Instance
2175 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2178 __STATIC_INLINE
void LL_RTC_ALMB_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
2180 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_ST
| RTC_ALRMBR_SU
),
2181 (((Seconds
& 0xF0U
) << (RTC_ALRMBR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMBR_SU_Pos
)));
2185 * @brief Get ALARM B Seconds in BCD format
2186 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2187 * @rmtoll ALRMBR ST LL_RTC_ALMB_GetSecond\n
2188 * ALRMBR SU LL_RTC_ALMB_GetSecond
2189 * @param RTCx RTC Instance
2190 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2192 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef
*RTCx
)
2194 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_ST
| RTC_ALRMBR_SU
))) >> RTC_ALRMBR_SU_Pos
);
2198 * @brief Set Alarm B Time (hour, minute and second) in BCD format
2199 * @rmtoll ALRMBR PM LL_RTC_ALMB_ConfigTime\n
2200 * ALRMBR HT LL_RTC_ALMB_ConfigTime\n
2201 * ALRMBR HU LL_RTC_ALMB_ConfigTime\n
2202 * ALRMBR MNT LL_RTC_ALMB_ConfigTime\n
2203 * ALRMBR MNU LL_RTC_ALMB_ConfigTime\n
2204 * ALRMBR ST LL_RTC_ALMB_ConfigTime\n
2205 * ALRMBR SU LL_RTC_ALMB_ConfigTime
2206 * @param RTCx RTC Instance
2207 * @param Format12_24 This parameter can be one of the following values:
2208 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2209 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2210 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2211 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2212 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2215 __STATIC_INLINE
void LL_RTC_ALMB_ConfigTime(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
, uint32_t Seconds
)
2217 register uint32_t temp
= 0U;
2219 temp
= Format12_24
| (((Hours
& 0xF0U
) << (RTC_ALRMBR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMBR_HU_Pos
)) | \
2220 (((Minutes
& 0xF0U
) << (RTC_ALRMBR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMBR_MNU_Pos
)) | \
2221 (((Seconds
& 0xF0U
) << (RTC_ALRMBR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMBR_SU_Pos
));
2223 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_PM
| RTC_ALRMBR_HT
| RTC_ALRMBR_HU
| RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
| RTC_ALRMBR_ST
| RTC_ALRMBR_SU
, temp
);
2227 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2228 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2229 * are available to get independently each parameter.
2230 * @rmtoll ALRMBR HT LL_RTC_ALMB_GetTime\n
2231 * ALRMBR HU LL_RTC_ALMB_GetTime\n
2232 * ALRMBR MNT LL_RTC_ALMB_GetTime\n
2233 * ALRMBR MNU LL_RTC_ALMB_GetTime\n
2234 * ALRMBR ST LL_RTC_ALMB_GetTime\n
2235 * ALRMBR SU LL_RTC_ALMB_GetTime
2236 * @param RTCx RTC Instance
2237 * @retval Combination of hours, minutes and seconds.
2239 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef
*RTCx
)
2241 return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx
) << RTC_OFFSET_HOUR
) | (LL_RTC_ALMB_GetMinute(RTCx
) << RTC_OFFSET_MINUTE
) | LL_RTC_ALMB_GetSecond(RTCx
));
2245 * @brief Set Alarm B Mask the most-significant bits starting at this bit
2246 * @note This register can be written only when ALRBE is reset in RTC_CR register,
2247 * or in initialization mode.
2248 * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask
2249 * @param RTCx RTC Instance
2250 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2253 __STATIC_INLINE
void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2255 MODIFY_REG(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_MASKSS
, Mask
<< RTC_ALRMBSSR_MASKSS_Pos
);
2259 * @brief Get Alarm B Mask the most-significant bits starting at this bit
2260 * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask
2261 * @param RTCx RTC Instance
2262 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2264 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef
*RTCx
)
2266 return (uint32_t)(READ_BIT(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_MASKSS
) >> RTC_ALRMBSSR_MASKSS_Pos
);
2270 * @brief Set Alarm B Sub seconds value
2271 * @rmtoll ALRMBSSR SS LL_RTC_ALMB_SetSubSecond
2272 * @param RTCx RTC Instance
2273 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2276 __STATIC_INLINE
void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef
*RTCx
, uint32_t Subsecond
)
2278 MODIFY_REG(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_SS
, Subsecond
);
2282 * @brief Get Alarm B Sub seconds value
2283 * @rmtoll ALRMBSSR SS LL_RTC_ALMB_GetSubSecond
2284 * @param RTCx RTC Instance
2285 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2287 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef
*RTCx
)
2289 return (uint32_t)(READ_BIT(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_SS
));
2296 /** @defgroup RTC_LL_EF_Timestamp Timestamp
2301 * @brief Enable internal event timestamp
2302 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2303 * @rmtoll CR ITSE LL_RTC_TS_EnableInternalEvent
2304 * @param RTCx RTC Instance
2307 __STATIC_INLINE
void LL_RTC_TS_EnableInternalEvent(RTC_TypeDef
*RTCx
)
2309 SET_BIT(RTCx
->CR
, RTC_CR_ITSE
);
2313 * @brief Disable internal event timestamp
2314 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2315 * @rmtoll CR ITSE LL_RTC_TS_DisableInternalEvent
2316 * @param RTCx RTC Instance
2319 __STATIC_INLINE
void LL_RTC_TS_DisableInternalEvent(RTC_TypeDef
*RTCx
)
2321 CLEAR_BIT(RTCx
->CR
, RTC_CR_ITSE
);
2325 * @brief Enable Timestamp
2326 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2327 * @rmtoll CR TSE LL_RTC_TS_Enable
2328 * @param RTCx RTC Instance
2331 __STATIC_INLINE
void LL_RTC_TS_Enable(RTC_TypeDef
*RTCx
)
2333 SET_BIT(RTCx
->CR
, RTC_CR_TSE
);
2337 * @brief Disable Timestamp
2338 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2339 * @rmtoll CR TSE LL_RTC_TS_Disable
2340 * @param RTCx RTC Instance
2343 __STATIC_INLINE
void LL_RTC_TS_Disable(RTC_TypeDef
*RTCx
)
2345 CLEAR_BIT(RTCx
->CR
, RTC_CR_TSE
);
2349 * @brief Set Time-stamp event active edge
2350 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2351 * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting
2352 * @rmtoll CR TSEDGE LL_RTC_TS_SetActiveEdge
2353 * @param RTCx RTC Instance
2354 * @param Edge This parameter can be one of the following values:
2355 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2356 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2359 __STATIC_INLINE
void LL_RTC_TS_SetActiveEdge(RTC_TypeDef
*RTCx
, uint32_t Edge
)
2361 MODIFY_REG(RTCx
->CR
, RTC_CR_TSEDGE
, Edge
);
2365 * @brief Get Time-stamp event active edge
2366 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2367 * @rmtoll CR TSEDGE LL_RTC_TS_GetActiveEdge
2368 * @param RTCx RTC Instance
2369 * @retval Returned value can be one of the following values:
2370 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2371 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2373 __STATIC_INLINE
uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef
*RTCx
)
2375 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_TSEDGE
));
2379 * @brief Get Timestamp AM/PM notation (AM or 24-hour format)
2380 * @rmtoll TSTR PM LL_RTC_TS_GetTimeFormat
2381 * @param RTCx RTC Instance
2382 * @retval Returned value can be one of the following values:
2383 * @arg @ref LL_RTC_TS_TIME_FORMAT_AM
2384 * @arg @ref LL_RTC_TS_TIME_FORMAT_PM
2386 __STATIC_INLINE
uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef
*RTCx
)
2388 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_PM
));
2392 * @brief Get Timestamp Hours in BCD format
2393 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2394 * @rmtoll TSTR HT LL_RTC_TS_GetHour\n
2395 * TSTR HU LL_RTC_TS_GetHour
2396 * @param RTCx RTC Instance
2397 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2399 __STATIC_INLINE
uint32_t LL_RTC_TS_GetHour(RTC_TypeDef
*RTCx
)
2401 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_HT
| RTC_TSTR_HU
) >> RTC_TSTR_HU_Pos
);
2405 * @brief Get Timestamp Minutes in BCD format
2406 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2407 * @rmtoll TSTR MNT LL_RTC_TS_GetMinute\n
2408 * TSTR MNU LL_RTC_TS_GetMinute
2409 * @param RTCx RTC Instance
2410 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2412 __STATIC_INLINE
uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef
*RTCx
)
2414 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_MNT
| RTC_TSTR_MNU
) >> RTC_TSTR_MNU_Pos
);
2418 * @brief Get Timestamp Seconds in BCD format
2419 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2420 * @rmtoll TSTR ST LL_RTC_TS_GetSecond\n
2421 * TSTR SU LL_RTC_TS_GetSecond
2422 * @param RTCx RTC Instance
2423 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2425 __STATIC_INLINE
uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef
*RTCx
)
2427 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_ST
| RTC_TSTR_SU
));
2431 * @brief Get Timestamp time (hour, minute and second) in BCD format
2432 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2433 * are available to get independently each parameter.
2434 * @rmtoll TSTR HT LL_RTC_TS_GetTime\n
2435 * TSTR HU LL_RTC_TS_GetTime\n
2436 * TSTR MNT LL_RTC_TS_GetTime\n
2437 * TSTR MNU LL_RTC_TS_GetTime\n
2438 * TSTR ST LL_RTC_TS_GetTime\n
2439 * TSTR SU LL_RTC_TS_GetTime
2440 * @param RTCx RTC Instance
2441 * @retval Combination of hours, minutes and seconds.
2443 __STATIC_INLINE
uint32_t LL_RTC_TS_GetTime(RTC_TypeDef
*RTCx
)
2445 return (uint32_t)(READ_BIT(RTCx
->TSTR
,
2446 RTC_TSTR_HT
| RTC_TSTR_HU
| RTC_TSTR_MNT
| RTC_TSTR_MNU
| RTC_TSTR_ST
| RTC_TSTR_SU
));
2450 * @brief Get Timestamp Week day
2451 * @rmtoll TSDR WDU LL_RTC_TS_GetWeekDay
2452 * @param RTCx RTC Instance
2453 * @retval Returned value can be one of the following values:
2454 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2455 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2456 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2457 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2458 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2459 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2460 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2462 __STATIC_INLINE
uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef
*RTCx
)
2464 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_WDU
) >> RTC_TSDR_WDU_Pos
);
2468 * @brief Get Timestamp Month in BCD format
2469 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
2470 * @rmtoll TSDR MT LL_RTC_TS_GetMonth\n
2471 * TSDR MU LL_RTC_TS_GetMonth
2472 * @param RTCx RTC Instance
2473 * @retval Returned value can be one of the following values:
2474 * @arg @ref LL_RTC_MONTH_JANUARY
2475 * @arg @ref LL_RTC_MONTH_FEBRUARY
2476 * @arg @ref LL_RTC_MONTH_MARCH
2477 * @arg @ref LL_RTC_MONTH_APRIL
2478 * @arg @ref LL_RTC_MONTH_MAY
2479 * @arg @ref LL_RTC_MONTH_JUNE
2480 * @arg @ref LL_RTC_MONTH_JULY
2481 * @arg @ref LL_RTC_MONTH_AUGUST
2482 * @arg @ref LL_RTC_MONTH_SEPTEMBER
2483 * @arg @ref LL_RTC_MONTH_OCTOBER
2484 * @arg @ref LL_RTC_MONTH_NOVEMBER
2485 * @arg @ref LL_RTC_MONTH_DECEMBER
2487 __STATIC_INLINE
uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef
*RTCx
)
2489 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_MT
| RTC_TSDR_MU
) >> RTC_TSDR_MU_Pos
);
2493 * @brief Get Timestamp Day in BCD format
2494 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2495 * @rmtoll TSDR DT LL_RTC_TS_GetDay\n
2496 * TSDR DU LL_RTC_TS_GetDay
2497 * @param RTCx RTC Instance
2498 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2500 __STATIC_INLINE
uint32_t LL_RTC_TS_GetDay(RTC_TypeDef
*RTCx
)
2502 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_DT
| RTC_TSDR_DU
));
2506 * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format
2507 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH,
2508 * and __LL_RTC_GET_DAY are available to get independently each parameter.
2509 * @rmtoll TSDR WDU LL_RTC_TS_GetDate\n
2510 * TSDR MT LL_RTC_TS_GetDate\n
2511 * TSDR MU LL_RTC_TS_GetDate\n
2512 * TSDR DT LL_RTC_TS_GetDate\n
2513 * TSDR DU LL_RTC_TS_GetDate
2514 * @param RTCx RTC Instance
2515 * @retval Combination of Weekday, Day and Month
2517 __STATIC_INLINE
uint32_t LL_RTC_TS_GetDate(RTC_TypeDef
*RTCx
)
2519 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_WDU
| RTC_TSDR_MT
| RTC_TSDR_MU
| RTC_TSDR_DT
| RTC_TSDR_DU
));
2523 * @brief Get time-stamp sub second value
2524 * @rmtoll TSSSR SS LL_RTC_TS_GetSubSecond
2525 * @param RTCx RTC Instance
2526 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
2528 __STATIC_INLINE
uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef
*RTCx
)
2530 return (uint32_t)(READ_BIT(RTCx
->TSSSR
, RTC_TSSSR_SS
));
2533 #if defined(RTC_TAMPCR_TAMPTS)
2535 * @brief Activate timestamp on tamper detection event
2536 * @rmtoll TAMPCR TAMPTS LL_RTC_TS_EnableOnTamper
2537 * @param RTCx RTC Instance
2540 __STATIC_INLINE
void LL_RTC_TS_EnableOnTamper(RTC_TypeDef
*RTCx
)
2542 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPTS
);
2546 * @brief Disable timestamp on tamper detection event
2547 * @rmtoll TAMPCR TAMPTS LL_RTC_TS_DisableOnTamper
2548 * @param RTCx RTC Instance
2551 __STATIC_INLINE
void LL_RTC_TS_DisableOnTamper(RTC_TypeDef
*RTCx
)
2553 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPTS
);
2555 #endif /* RTC_TAMPCR_TAMPTS */
2561 /** @defgroup RTC_LL_EF_Tamper Tamper
2566 * @brief Enable RTC_TAMPx input detection
2567 * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Enable\n
2568 * TAMPCR TAMP2E LL_RTC_TAMPER_Enable\n
2569 * TAMPCR TAMP3E LL_RTC_TAMPER_Enable
2570 * @param RTCx RTC Instance
2571 * @param Tamper This parameter can be a combination of the following values:
2572 * @arg @ref LL_RTC_TAMPER_1
2573 * @arg @ref LL_RTC_TAMPER_2
2574 * @arg @ref LL_RTC_TAMPER_3
2578 __STATIC_INLINE
void LL_RTC_TAMPER_Enable(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2580 SET_BIT(RTCx
->TAMPCR
, Tamper
);
2584 * @brief Clear RTC_TAMPx input detection
2585 * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Disable\n
2586 * TAMPCR TAMP2E LL_RTC_TAMPER_Disable\n
2587 * TAMPCR TAMP3E LL_RTC_TAMPER_Disable
2588 * @param RTCx RTC Instance
2589 * @param Tamper This parameter can be a combination of the following values:
2590 * @arg @ref LL_RTC_TAMPER_1
2591 * @arg @ref LL_RTC_TAMPER_2
2592 * @arg @ref LL_RTC_TAMPER_3
2596 __STATIC_INLINE
void LL_RTC_TAMPER_Disable(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2598 CLEAR_BIT(RTCx
->TAMPCR
, Tamper
);
2602 * @brief Enable Tamper mask flag
2603 * @note Associated Tamper IT must not enabled when tamper mask is set.
2604 * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_EnableMask\n
2605 * TAMPCR TAMP2MF LL_RTC_TAMPER_EnableMask\n
2606 * TAMPCR TAMP3MF LL_RTC_TAMPER_EnableMask
2607 * @param RTCx RTC Instance
2608 * @param Mask This parameter can be a combination of the following values:
2609 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
2610 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
2611 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3
2615 __STATIC_INLINE
void LL_RTC_TAMPER_EnableMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2617 SET_BIT(RTCx
->TAMPCR
, Mask
);
2621 * @brief Disable Tamper mask flag
2622 * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_DisableMask\n
2623 * TAMPCR TAMP2MF LL_RTC_TAMPER_DisableMask\n
2624 * TAMPCR TAMP3MF LL_RTC_TAMPER_DisableMask
2625 * @param RTCx RTC Instance
2626 * @param Mask This parameter can be a combination of the following values:
2627 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
2628 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
2629 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3
2633 __STATIC_INLINE
void LL_RTC_TAMPER_DisableMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2635 CLEAR_BIT(RTCx
->TAMPCR
, Mask
);
2639 * @brief Enable backup register erase after Tamper event detection
2640 * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP\n
2641 * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_EnableEraseBKP\n
2642 * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP
2643 * @param RTCx RTC Instance
2644 * @param Tamper This parameter can be a combination of the following values:
2645 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
2646 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
2647 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3
2651 __STATIC_INLINE
void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2653 CLEAR_BIT(RTCx
->TAMPCR
, Tamper
);
2657 * @brief Disable backup register erase after Tamper event detection
2658 * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP\n
2659 * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_DisableEraseBKP\n
2660 * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP
2661 * @param RTCx RTC Instance
2662 * @param Tamper This parameter can be a combination of the following values:
2663 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
2664 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
2665 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3
2669 __STATIC_INLINE
void LL_RTC_TAMPER_DisableEraseBKP(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2671 SET_BIT(RTCx
->TAMPCR
, Tamper
);
2674 #if defined(RTC_TAMPCR_TAMPPUDIS)
2676 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
2677 * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp
2678 * @param RTCx RTC Instance
2681 __STATIC_INLINE
void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef
*RTCx
)
2683 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPUDIS
);
2687 * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling)
2688 * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp
2689 * @param RTCx RTC Instance
2692 __STATIC_INLINE
void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef
*RTCx
)
2694 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPUDIS
);
2696 #endif /* RTC_TAMPCR_TAMPPUDIS */
2698 #if defined(RTC_TAMPCR_TAMPPRCH)
2700 * @brief Set RTC_TAMPx precharge duration
2701 * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge
2702 * @param RTCx RTC Instance
2703 * @param Duration This parameter can be one of the following values:
2704 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
2705 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
2706 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
2707 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
2710 __STATIC_INLINE
void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef
*RTCx
, uint32_t Duration
)
2712 MODIFY_REG(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPRCH
, Duration
);
2716 * @brief Get RTC_TAMPx precharge duration
2717 * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge
2718 * @param RTCx RTC Instance
2719 * @retval Returned value can be one of the following values:
2720 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
2721 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
2722 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
2723 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
2725 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef
*RTCx
)
2727 return (uint32_t)(READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPRCH
));
2729 #endif /* RTC_TAMPCR_TAMPPRCH */
2731 #if defined(RTC_TAMPCR_TAMPFLT)
2733 * @brief Set RTC_TAMPx filter count
2734 * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_SetFilterCount
2735 * @param RTCx RTC Instance
2736 * @param FilterCount This parameter can be one of the following values:
2737 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
2738 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
2739 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
2740 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
2743 __STATIC_INLINE
void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef
*RTCx
, uint32_t FilterCount
)
2745 MODIFY_REG(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFLT
, FilterCount
);
2749 * @brief Get RTC_TAMPx filter count
2750 * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_GetFilterCount
2751 * @param RTCx RTC Instance
2752 * @retval Returned value can be one of the following values:
2753 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
2754 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
2755 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
2756 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
2758 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef
*RTCx
)
2760 return (uint32_t)(READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFLT
));
2762 #endif /* RTC_TAMPCR_TAMPFLT */
2764 #if defined(RTC_TAMPCR_TAMPFREQ)
2766 * @brief Set Tamper sampling frequency
2767 * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq
2768 * @param RTCx RTC Instance
2769 * @param SamplingFreq This parameter can be one of the following values:
2770 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
2771 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
2772 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
2773 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
2774 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
2775 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
2776 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
2777 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
2780 __STATIC_INLINE
void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef
*RTCx
, uint32_t SamplingFreq
)
2782 MODIFY_REG(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFREQ
, SamplingFreq
);
2786 * @brief Get Tamper sampling frequency
2787 * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq
2788 * @param RTCx RTC Instance
2789 * @retval Returned value can be one of the following values:
2790 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
2791 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
2792 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
2793 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
2794 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
2795 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
2796 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
2797 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
2799 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef
*RTCx
)
2801 return (uint32_t)(READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFREQ
));
2803 #endif /* RTC_TAMPCR_TAMPFREQ */
2806 * @brief Enable Active level for Tamper input
2807 * @rmtoll TAMPCR TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel\n
2808 * TAMPCR TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel\n
2809 * TAMPCR TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel
2810 * @param RTCx RTC Instance
2811 * @param Tamper This parameter can be a combination of the following values:
2812 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
2813 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
2814 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3
2818 __STATIC_INLINE
void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2820 SET_BIT(RTCx
->TAMPCR
, Tamper
);
2824 * @brief Disable Active level for Tamper input
2825 * @rmtoll TAMPCR TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel\n
2826 * TAMPCR TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel\n
2827 * TAMPCR TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel
2828 * @param RTCx RTC Instance
2829 * @param Tamper This parameter can be a combination of the following values:
2830 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
2831 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
2832 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3
2836 __STATIC_INLINE
void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2838 CLEAR_BIT(RTCx
->TAMPCR
, Tamper
);
2845 /** @defgroup RTC_LL_EF_Wakeup Wakeup
2850 * @brief Enable Wakeup timer
2851 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2852 * @rmtoll CR WUTE LL_RTC_WAKEUP_Enable
2853 * @param RTCx RTC Instance
2856 __STATIC_INLINE
void LL_RTC_WAKEUP_Enable(RTC_TypeDef
*RTCx
)
2858 SET_BIT(RTCx
->CR
, RTC_CR_WUTE
);
2862 * @brief Disable Wakeup timer
2863 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2864 * @rmtoll CR WUTE LL_RTC_WAKEUP_Disable
2865 * @param RTCx RTC Instance
2868 __STATIC_INLINE
void LL_RTC_WAKEUP_Disable(RTC_TypeDef
*RTCx
)
2870 CLEAR_BIT(RTCx
->CR
, RTC_CR_WUTE
);
2874 * @brief Check if Wakeup timer is enabled or not
2875 * @rmtoll CR WUTE LL_RTC_WAKEUP_IsEnabled
2876 * @param RTCx RTC Instance
2877 * @retval State of bit (1 or 0).
2879 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef
*RTCx
)
2881 return (READ_BIT(RTCx
->CR
, RTC_CR_WUTE
) == (RTC_CR_WUTE
));
2885 * @brief Select Wakeup clock
2886 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2887 * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1
2888 * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_SetClock
2889 * @param RTCx RTC Instance
2890 * @param WakeupClock This parameter can be one of the following values:
2891 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
2892 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
2893 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
2894 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
2895 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
2896 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
2899 __STATIC_INLINE
void LL_RTC_WAKEUP_SetClock(RTC_TypeDef
*RTCx
, uint32_t WakeupClock
)
2901 MODIFY_REG(RTCx
->CR
, RTC_CR_WUCKSEL
, WakeupClock
);
2905 * @brief Get Wakeup clock
2906 * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_GetClock
2907 * @param RTCx RTC Instance
2908 * @retval Returned value can be one of the following values:
2909 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
2910 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
2911 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
2912 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
2913 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
2914 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
2916 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef
*RTCx
)
2918 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_WUCKSEL
));
2922 * @brief Set Wakeup auto-reload value
2923 * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR
2924 * @rmtoll WUTR WUT LL_RTC_WAKEUP_SetAutoReload
2925 * @param RTCx RTC Instance
2926 * @param Value Value between Min_Data=0x00 and Max_Data=0xFFFF
2929 __STATIC_INLINE
void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef
*RTCx
, uint32_t Value
)
2931 MODIFY_REG(RTCx
->WUTR
, RTC_WUTR_WUT
, Value
);
2935 * @brief Get Wakeup auto-reload value
2936 * @rmtoll WUTR WUT LL_RTC_WAKEUP_GetAutoReload
2937 * @param RTCx RTC Instance
2938 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
2940 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef
*RTCx
)
2942 return (uint32_t)(READ_BIT(RTCx
->WUTR
, RTC_WUTR_WUT
));
2949 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
2954 * @brief Writes a data in a specified RTC Backup data register.
2955 * @rmtoll BKPxR BKP LL_RTC_BAK_SetRegister
2956 * @param RTCx RTC Instance
2957 * @param BackupRegister This parameter can be one of the following values:
2958 * @arg @ref LL_RTC_BKP_DR0
2959 * @arg @ref LL_RTC_BKP_DR1
2960 * @arg @ref LL_RTC_BKP_DR2
2961 * @arg @ref LL_RTC_BKP_DR3
2962 * @arg @ref LL_RTC_BKP_DR4
2963 * @arg @ref LL_RTC_BKP_DR5
2964 * @arg @ref LL_RTC_BKP_DR6
2965 * @arg @ref LL_RTC_BKP_DR7
2966 * @arg @ref LL_RTC_BKP_DR8
2967 * @arg @ref LL_RTC_BKP_DR9
2968 * @arg @ref LL_RTC_BKP_DR10
2969 * @arg @ref LL_RTC_BKP_DR11
2970 * @arg @ref LL_RTC_BKP_DR12
2971 * @arg @ref LL_RTC_BKP_DR13
2972 * @arg @ref LL_RTC_BKP_DR14
2973 * @arg @ref LL_RTC_BKP_DR15
2974 * @arg @ref LL_RTC_BKP_DR16
2975 * @arg @ref LL_RTC_BKP_DR17
2976 * @arg @ref LL_RTC_BKP_DR18
2977 * @arg @ref LL_RTC_BKP_DR19
2978 * @arg @ref LL_RTC_BKP_DR20
2979 * @arg @ref LL_RTC_BKP_DR21
2980 * @arg @ref LL_RTC_BKP_DR22
2981 * @arg @ref LL_RTC_BKP_DR23
2982 * @arg @ref LL_RTC_BKP_DR24
2983 * @arg @ref LL_RTC_BKP_DR25
2984 * @arg @ref LL_RTC_BKP_DR26
2985 * @arg @ref LL_RTC_BKP_DR27
2986 * @arg @ref LL_RTC_BKP_DR28
2987 * @arg @ref LL_RTC_BKP_DR29
2988 * @arg @ref LL_RTC_BKP_DR30
2989 * @arg @ref LL_RTC_BKP_DR31
2990 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
2993 __STATIC_INLINE
void LL_RTC_BAK_SetRegister(RTC_TypeDef
*RTCx
, uint32_t BackupRegister
, uint32_t Data
)
2995 register uint32_t tmp
= 0U;
2997 tmp
= (uint32_t)(&(RTCx
->BKP0R
));
2998 tmp
+= (BackupRegister
* 4U);
3000 /* Write the specified register */
3001 *(__IO
uint32_t *)tmp
= (uint32_t)Data
;
3005 * @brief Reads data from the specified RTC Backup data Register.
3006 * @rmtoll BKPxR BKP LL_RTC_BAK_GetRegister
3007 * @param RTCx RTC Instance
3008 * @param BackupRegister This parameter can be one of the following values:
3009 * @arg @ref LL_RTC_BKP_DR0
3010 * @arg @ref LL_RTC_BKP_DR1
3011 * @arg @ref LL_RTC_BKP_DR2
3012 * @arg @ref LL_RTC_BKP_DR3
3013 * @arg @ref LL_RTC_BKP_DR4
3014 * @arg @ref LL_RTC_BKP_DR5
3015 * @arg @ref LL_RTC_BKP_DR6
3016 * @arg @ref LL_RTC_BKP_DR7
3017 * @arg @ref LL_RTC_BKP_DR8
3018 * @arg @ref LL_RTC_BKP_DR9
3019 * @arg @ref LL_RTC_BKP_DR10
3020 * @arg @ref LL_RTC_BKP_DR11
3021 * @arg @ref LL_RTC_BKP_DR12
3022 * @arg @ref LL_RTC_BKP_DR13
3023 * @arg @ref LL_RTC_BKP_DR14
3024 * @arg @ref LL_RTC_BKP_DR15
3025 * @arg @ref LL_RTC_BKP_DR16
3026 * @arg @ref LL_RTC_BKP_DR17
3027 * @arg @ref LL_RTC_BKP_DR18
3028 * @arg @ref LL_RTC_BKP_DR19
3029 * @arg @ref LL_RTC_BKP_DR20
3030 * @arg @ref LL_RTC_BKP_DR21
3031 * @arg @ref LL_RTC_BKP_DR22
3032 * @arg @ref LL_RTC_BKP_DR23
3033 * @arg @ref LL_RTC_BKP_DR24
3034 * @arg @ref LL_RTC_BKP_DR25
3035 * @arg @ref LL_RTC_BKP_DR26
3036 * @arg @ref LL_RTC_BKP_DR27
3037 * @arg @ref LL_RTC_BKP_DR28
3038 * @arg @ref LL_RTC_BKP_DR29
3039 * @arg @ref LL_RTC_BKP_DR30
3040 * @arg @ref LL_RTC_BKP_DR31
3041 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3043 __STATIC_INLINE
uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef
*RTCx
, uint32_t BackupRegister
)
3045 register uint32_t tmp
= 0U;
3047 tmp
= (uint32_t)(&(RTCx
->BKP0R
));
3048 tmp
+= (BackupRegister
* 4U);
3050 /* Read the specified register */
3051 return (*(__IO
uint32_t *)tmp
);
3058 /** @defgroup RTC_LL_EF_Calibration Calibration
3063 * @brief Set Calibration output frequency (1 Hz or 512 Hz)
3064 * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3065 * @rmtoll CR COE LL_RTC_CAL_SetOutputFreq\n
3066 * CR COSEL LL_RTC_CAL_SetOutputFreq
3067 * @param RTCx RTC Instance
3068 * @param Frequency This parameter can be one of the following values:
3069 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3070 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3071 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3074 __STATIC_INLINE
void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef
*RTCx
, uint32_t Frequency
)
3076 MODIFY_REG(RTCx
->CR
, RTC_CR_COE
| RTC_CR_COSEL
, Frequency
);
3080 * @brief Get Calibration output frequency (1 Hz or 512 Hz)
3081 * @rmtoll CR COE LL_RTC_CAL_GetOutputFreq\n
3082 * CR COSEL LL_RTC_CAL_GetOutputFreq
3083 * @param RTCx RTC Instance
3084 * @retval Returned value can be one of the following values:
3085 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3086 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3087 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3089 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef
*RTCx
)
3091 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_COE
| RTC_CR_COSEL
));
3095 * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm)
3096 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3097 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3098 * @rmtoll CALR CALP LL_RTC_CAL_SetPulse
3099 * @param RTCx RTC Instance
3100 * @param Pulse This parameter can be one of the following values:
3101 * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE
3102 * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET
3105 __STATIC_INLINE
void LL_RTC_CAL_SetPulse(RTC_TypeDef
*RTCx
, uint32_t Pulse
)
3107 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALP
, Pulse
);
3111 * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm)
3112 * @rmtoll CALR CALP LL_RTC_CAL_IsPulseInserted
3113 * @param RTCx RTC Instance
3114 * @retval State of bit (1 or 0).
3116 __STATIC_INLINE
uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef
*RTCx
)
3118 return (READ_BIT(RTCx
->CALR
, RTC_CALR_CALP
) == (RTC_CALR_CALP
));
3122 * @brief Set the calibration cycle period
3123 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3124 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3125 * @rmtoll CALR CALW8 LL_RTC_CAL_SetPeriod\n
3126 * CALR CALW16 LL_RTC_CAL_SetPeriod
3127 * @param RTCx RTC Instance
3128 * @param Period This parameter can be one of the following values:
3129 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3130 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3131 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3134 __STATIC_INLINE
void LL_RTC_CAL_SetPeriod(RTC_TypeDef
*RTCx
, uint32_t Period
)
3136 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALW8
| RTC_CALR_CALW16
, Period
);
3140 * @brief Get the calibration cycle period
3141 * @rmtoll CALR CALW8 LL_RTC_CAL_GetPeriod\n
3142 * CALR CALW16 LL_RTC_CAL_GetPeriod
3143 * @param RTCx RTC Instance
3144 * @retval Returned value can be one of the following values:
3145 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3146 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3147 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3149 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef
*RTCx
)
3151 return (uint32_t)(READ_BIT(RTCx
->CALR
, RTC_CALR_CALW8
| RTC_CALR_CALW16
));
3155 * @brief Set Calibration minus
3156 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3157 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3158 * @rmtoll CALR CALM LL_RTC_CAL_SetMinus
3159 * @param RTCx RTC Instance
3160 * @param CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF
3163 __STATIC_INLINE
void LL_RTC_CAL_SetMinus(RTC_TypeDef
*RTCx
, uint32_t CalibMinus
)
3165 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALM
, CalibMinus
);
3169 * @brief Get Calibration minus
3170 * @rmtoll CALR CALM LL_RTC_CAL_GetMinus
3171 * @param RTCx RTC Instance
3172 * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF
3174 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef
*RTCx
)
3176 return (uint32_t)(READ_BIT(RTCx
->CALR
, RTC_CALR_CALM
));
3183 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
3188 * @brief Get Internal Time-stamp flag
3189 * @rmtoll ISR ITSF LL_RTC_IsActiveFlag_ITS
3190 * @param RTCx RTC Instance
3191 * @retval State of bit (1 or 0).
3193 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef
*RTCx
)
3195 return (READ_BIT(RTCx
->ISR
, RTC_ISR_ITSF
) == (RTC_ISR_ITSF
));
3199 * @brief Get Recalibration pending Flag
3200 * @rmtoll ISR RECALPF LL_RTC_IsActiveFlag_RECALP
3201 * @param RTCx RTC Instance
3202 * @retval State of bit (1 or 0).
3204 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef
*RTCx
)
3206 return (READ_BIT(RTCx
->ISR
, RTC_ISR_RECALPF
) == (RTC_ISR_RECALPF
));
3210 * @brief Get RTC_TAMP3 detection flag
3211 * @rmtoll ISR TAMP3F LL_RTC_IsActiveFlag_TAMP3
3212 * @param RTCx RTC Instance
3213 * @retval State of bit (1 or 0).
3215 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef
*RTCx
)
3217 return (READ_BIT(RTCx
->ISR
, RTC_ISR_TAMP3F
) == (RTC_ISR_TAMP3F
));
3221 * @brief Get RTC_TAMP2 detection flag
3222 * @rmtoll ISR TAMP2F LL_RTC_IsActiveFlag_TAMP2
3223 * @param RTCx RTC Instance
3224 * @retval State of bit (1 or 0).
3226 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef
*RTCx
)
3228 return (READ_BIT(RTCx
->ISR
, RTC_ISR_TAMP2F
) == (RTC_ISR_TAMP2F
));
3232 * @brief Get RTC_TAMP1 detection flag
3233 * @rmtoll ISR TAMP1F LL_RTC_IsActiveFlag_TAMP1
3234 * @param RTCx RTC Instance
3235 * @retval State of bit (1 or 0).
3237 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef
*RTCx
)
3239 return (READ_BIT(RTCx
->ISR
, RTC_ISR_TAMP1F
) == (RTC_ISR_TAMP1F
));
3243 * @brief Get Time-stamp overflow flag
3244 * @rmtoll ISR TSOVF LL_RTC_IsActiveFlag_TSOV
3245 * @param RTCx RTC Instance
3246 * @retval State of bit (1 or 0).
3248 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef
*RTCx
)
3250 return (READ_BIT(RTCx
->ISR
, RTC_ISR_TSOVF
) == (RTC_ISR_TSOVF
));
3254 * @brief Get Time-stamp flag
3255 * @rmtoll ISR TSF LL_RTC_IsActiveFlag_TS
3256 * @param RTCx RTC Instance
3257 * @retval State of bit (1 or 0).
3259 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef
*RTCx
)
3261 return (READ_BIT(RTCx
->ISR
, RTC_ISR_TSF
) == (RTC_ISR_TSF
));
3265 * @brief Get Wakeup timer flag
3266 * @rmtoll ISR WUTF LL_RTC_IsActiveFlag_WUT
3267 * @param RTCx RTC Instance
3268 * @retval State of bit (1 or 0).
3270 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef
*RTCx
)
3272 return (READ_BIT(RTCx
->ISR
, RTC_ISR_WUTF
) == (RTC_ISR_WUTF
));
3276 * @brief Get Alarm B flag
3277 * @rmtoll ISR ALRBF LL_RTC_IsActiveFlag_ALRB
3278 * @param RTCx RTC Instance
3279 * @retval State of bit (1 or 0).
3281 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef
*RTCx
)
3283 return (READ_BIT(RTCx
->ISR
, RTC_ISR_ALRBF
) == (RTC_ISR_ALRBF
));
3287 * @brief Get Alarm A flag
3288 * @rmtoll ISR ALRAF LL_RTC_IsActiveFlag_ALRA
3289 * @param RTCx RTC Instance
3290 * @retval State of bit (1 or 0).
3292 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef
*RTCx
)
3294 return (READ_BIT(RTCx
->ISR
, RTC_ISR_ALRAF
) == (RTC_ISR_ALRAF
));
3298 * @brief Clear Internal Time-stamp flag
3299 * @rmtoll ISR ITSF LL_RTC_ClearFlag_ITS
3300 * @param RTCx RTC Instance
3303 __STATIC_INLINE
void LL_RTC_ClearFlag_ITS(RTC_TypeDef
*RTCx
)
3305 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_ITSF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3309 * @brief Clear RTC_TAMP3 detection flag
3310 * @rmtoll ISR TAMP3F LL_RTC_ClearFlag_TAMP3
3311 * @param RTCx RTC Instance
3314 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef
*RTCx
)
3316 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TAMP3F
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3320 * @brief Clear RTC_TAMP2 detection flag
3321 * @rmtoll ISR TAMP2F LL_RTC_ClearFlag_TAMP2
3322 * @param RTCx RTC Instance
3325 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef
*RTCx
)
3327 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TAMP2F
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3331 * @brief Clear RTC_TAMP1 detection flag
3332 * @rmtoll ISR TAMP1F LL_RTC_ClearFlag_TAMP1
3333 * @param RTCx RTC Instance
3336 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef
*RTCx
)
3338 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TAMP1F
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3342 * @brief Clear Time-stamp overflow flag
3343 * @rmtoll ISR TSOVF LL_RTC_ClearFlag_TSOV
3344 * @param RTCx RTC Instance
3347 __STATIC_INLINE
void LL_RTC_ClearFlag_TSOV(RTC_TypeDef
*RTCx
)
3349 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TSOVF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3353 * @brief Clear Time-stamp flag
3354 * @rmtoll ISR TSF LL_RTC_ClearFlag_TS
3355 * @param RTCx RTC Instance
3358 __STATIC_INLINE
void LL_RTC_ClearFlag_TS(RTC_TypeDef
*RTCx
)
3360 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TSF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3364 * @brief Clear Wakeup timer flag
3365 * @rmtoll ISR WUTF LL_RTC_ClearFlag_WUT
3366 * @param RTCx RTC Instance
3369 __STATIC_INLINE
void LL_RTC_ClearFlag_WUT(RTC_TypeDef
*RTCx
)
3371 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_WUTF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3375 * @brief Clear Alarm B flag
3376 * @rmtoll ISR ALRBF LL_RTC_ClearFlag_ALRB
3377 * @param RTCx RTC Instance
3380 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRB(RTC_TypeDef
*RTCx
)
3382 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_ALRBF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3386 * @brief Clear Alarm A flag
3387 * @rmtoll ISR ALRAF LL_RTC_ClearFlag_ALRA
3388 * @param RTCx RTC Instance
3391 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRA(RTC_TypeDef
*RTCx
)
3393 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_ALRAF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3397 * @brief Get Initialization flag
3398 * @rmtoll ISR INITF LL_RTC_IsActiveFlag_INIT
3399 * @param RTCx RTC Instance
3400 * @retval State of bit (1 or 0).
3402 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef
*RTCx
)
3404 return (READ_BIT(RTCx
->ISR
, RTC_ISR_INITF
) == (RTC_ISR_INITF
));
3408 * @brief Get Registers synchronization flag
3409 * @rmtoll ISR RSF LL_RTC_IsActiveFlag_RS
3410 * @param RTCx RTC Instance
3411 * @retval State of bit (1 or 0).
3413 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef
*RTCx
)
3415 return (READ_BIT(RTCx
->ISR
, RTC_ISR_RSF
) == (RTC_ISR_RSF
));
3419 * @brief Clear Registers synchronization flag
3420 * @rmtoll ISR RSF LL_RTC_ClearFlag_RS
3421 * @param RTCx RTC Instance
3424 __STATIC_INLINE
void LL_RTC_ClearFlag_RS(RTC_TypeDef
*RTCx
)
3426 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_RSF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
3430 * @brief Get Initialization status flag
3431 * @rmtoll ISR INITS LL_RTC_IsActiveFlag_INITS
3432 * @param RTCx RTC Instance
3433 * @retval State of bit (1 or 0).
3435 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef
*RTCx
)
3437 return (READ_BIT(RTCx
->ISR
, RTC_ISR_INITS
) == (RTC_ISR_INITS
));
3441 * @brief Get Shift operation pending flag
3442 * @rmtoll ISR SHPF LL_RTC_IsActiveFlag_SHP
3443 * @param RTCx RTC Instance
3444 * @retval State of bit (1 or 0).
3446 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef
*RTCx
)
3448 return (READ_BIT(RTCx
->ISR
, RTC_ISR_SHPF
) == (RTC_ISR_SHPF
));
3452 * @brief Get Wakeup timer write flag
3453 * @rmtoll ISR WUTWF LL_RTC_IsActiveFlag_WUTW
3454 * @param RTCx RTC Instance
3455 * @retval State of bit (1 or 0).
3457 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef
*RTCx
)
3459 return (READ_BIT(RTCx
->ISR
, RTC_ISR_WUTWF
) == (RTC_ISR_WUTWF
));
3463 * @brief Get Alarm B write flag
3464 * @rmtoll ISR ALRBWF LL_RTC_IsActiveFlag_ALRBW
3465 * @param RTCx RTC Instance
3466 * @retval State of bit (1 or 0).
3468 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef
*RTCx
)
3470 return (READ_BIT(RTCx
->ISR
, RTC_ISR_ALRBWF
) == (RTC_ISR_ALRBWF
));
3474 * @brief Get Alarm A write flag
3475 * @rmtoll ISR ALRAWF LL_RTC_IsActiveFlag_ALRAW
3476 * @param RTCx RTC Instance
3477 * @retval State of bit (1 or 0).
3479 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef
*RTCx
)
3481 return (READ_BIT(RTCx
->ISR
, RTC_ISR_ALRAWF
) == (RTC_ISR_ALRAWF
));
3488 /** @defgroup RTC_LL_EF_IT_Management IT_Management
3493 * @brief Enable Time-stamp interrupt
3494 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3495 * @rmtoll CR TSIE LL_RTC_EnableIT_TS
3496 * @param RTCx RTC Instance
3499 __STATIC_INLINE
void LL_RTC_EnableIT_TS(RTC_TypeDef
*RTCx
)
3501 SET_BIT(RTCx
->CR
, RTC_CR_TSIE
);
3505 * @brief Disable Time-stamp interrupt
3506 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3507 * @rmtoll CR TSIE LL_RTC_DisableIT_TS
3508 * @param RTCx RTC Instance
3511 __STATIC_INLINE
void LL_RTC_DisableIT_TS(RTC_TypeDef
*RTCx
)
3513 CLEAR_BIT(RTCx
->CR
, RTC_CR_TSIE
);
3517 * @brief Enable Wakeup timer interrupt
3518 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3519 * @rmtoll CR WUTIE LL_RTC_EnableIT_WUT
3520 * @param RTCx RTC Instance
3523 __STATIC_INLINE
void LL_RTC_EnableIT_WUT(RTC_TypeDef
*RTCx
)
3525 SET_BIT(RTCx
->CR
, RTC_CR_WUTIE
);
3529 * @brief Disable Wakeup timer interrupt
3530 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3531 * @rmtoll CR WUTIE LL_RTC_DisableIT_WUT
3532 * @param RTCx RTC Instance
3535 __STATIC_INLINE
void LL_RTC_DisableIT_WUT(RTC_TypeDef
*RTCx
)
3537 CLEAR_BIT(RTCx
->CR
, RTC_CR_WUTIE
);
3541 * @brief Enable Alarm B interrupt
3542 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3543 * @rmtoll CR ALRBIE LL_RTC_EnableIT_ALRB
3544 * @param RTCx RTC Instance
3547 __STATIC_INLINE
void LL_RTC_EnableIT_ALRB(RTC_TypeDef
*RTCx
)
3549 SET_BIT(RTCx
->CR
, RTC_CR_ALRBIE
);
3553 * @brief Disable Alarm B interrupt
3554 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3555 * @rmtoll CR ALRBIE LL_RTC_DisableIT_ALRB
3556 * @param RTCx RTC Instance
3559 __STATIC_INLINE
void LL_RTC_DisableIT_ALRB(RTC_TypeDef
*RTCx
)
3561 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRBIE
);
3565 * @brief Enable Alarm A interrupt
3566 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3567 * @rmtoll CR ALRAIE LL_RTC_EnableIT_ALRA
3568 * @param RTCx RTC Instance
3571 __STATIC_INLINE
void LL_RTC_EnableIT_ALRA(RTC_TypeDef
*RTCx
)
3573 SET_BIT(RTCx
->CR
, RTC_CR_ALRAIE
);
3577 * @brief Disable Alarm A interrupt
3578 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3579 * @rmtoll CR ALRAIE LL_RTC_DisableIT_ALRA
3580 * @param RTCx RTC Instance
3583 __STATIC_INLINE
void LL_RTC_DisableIT_ALRA(RTC_TypeDef
*RTCx
)
3585 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRAIE
);
3589 * @brief Enable Tamper 3 interrupt
3590 * @rmtoll TAMPCR TAMP3IE LL_RTC_EnableIT_TAMP3
3591 * @param RTCx RTC Instance
3594 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP3(RTC_TypeDef
*RTCx
)
3596 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP3IE
);
3600 * @brief Disable Tamper 3 interrupt
3601 * @rmtoll TAMPCR TAMP3IE LL_RTC_DisableIT_TAMP3
3602 * @param RTCx RTC Instance
3605 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP3(RTC_TypeDef
*RTCx
)
3607 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP3IE
);
3611 * @brief Enable Tamper 2 interrupt
3612 * @rmtoll TAMPCR TAMP2IE LL_RTC_EnableIT_TAMP2
3613 * @param RTCx RTC Instance
3616 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP2(RTC_TypeDef
*RTCx
)
3618 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP2IE
);
3622 * @brief Disable Tamper 2 interrupt
3623 * @rmtoll TAMPCR TAMP2IE LL_RTC_DisableIT_TAMP2
3624 * @param RTCx RTC Instance
3627 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP2(RTC_TypeDef
*RTCx
)
3629 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP2IE
);
3633 * @brief Enable Tamper 1 interrupt
3634 * @rmtoll TAMPCR TAMP1IE LL_RTC_EnableIT_TAMP1
3635 * @param RTCx RTC Instance
3638 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP1(RTC_TypeDef
*RTCx
)
3640 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP1IE
);
3644 * @brief Disable Tamper 1 interrupt
3645 * @rmtoll TAMPCR TAMP1IE LL_RTC_DisableIT_TAMP1
3646 * @param RTCx RTC Instance
3649 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP1(RTC_TypeDef
*RTCx
)
3651 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP1IE
);
3655 * @brief Enable all Tamper Interrupt
3656 * @rmtoll TAMPCR TAMPIE LL_RTC_EnableIT_TAMP
3657 * @param RTCx RTC Instance
3660 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP(RTC_TypeDef
*RTCx
)
3662 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPIE
);
3666 * @brief Disable all Tamper Interrupt
3667 * @rmtoll TAMPCR TAMPIE LL_RTC_DisableIT_TAMP
3668 * @param RTCx RTC Instance
3671 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP(RTC_TypeDef
*RTCx
)
3673 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPIE
);
3677 * @brief Check if Time-stamp interrupt is enabled or not
3678 * @rmtoll CR TSIE LL_RTC_IsEnabledIT_TS
3679 * @param RTCx RTC Instance
3680 * @retval State of bit (1 or 0).
3682 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef
*RTCx
)
3684 return (READ_BIT(RTCx
->CR
, RTC_CR_TSIE
) == (RTC_CR_TSIE
));
3688 * @brief Check if Wakeup timer interrupt is enabled or not
3689 * @rmtoll CR WUTIE LL_RTC_IsEnabledIT_WUT
3690 * @param RTCx RTC Instance
3691 * @retval State of bit (1 or 0).
3693 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef
*RTCx
)
3695 return (READ_BIT(RTCx
->CR
, RTC_CR_WUTIE
) == (RTC_CR_WUTIE
));
3699 * @brief Check if Alarm B interrupt is enabled or not
3700 * @rmtoll CR ALRBIE LL_RTC_IsEnabledIT_ALRB
3701 * @param RTCx RTC Instance
3702 * @retval State of bit (1 or 0).
3704 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef
*RTCx
)
3706 return (READ_BIT(RTCx
->CR
, RTC_CR_ALRBIE
) == (RTC_CR_ALRBIE
));
3710 * @brief Check if Alarm A interrupt is enabled or not
3711 * @rmtoll CR ALRAIE LL_RTC_IsEnabledIT_ALRA
3712 * @param RTCx RTC Instance
3713 * @retval State of bit (1 or 0).
3715 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef
*RTCx
)
3717 return (READ_BIT(RTCx
->CR
, RTC_CR_ALRAIE
) == (RTC_CR_ALRAIE
));
3721 * @brief Check if Tamper 3 interrupt is enabled or not
3722 * @rmtoll TAMPCR TAMP3IE LL_RTC_IsEnabledIT_TAMP3
3723 * @param RTCx RTC Instance
3724 * @retval State of bit (1 or 0).
3726 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef
*RTCx
)
3728 return (READ_BIT(RTCx
->TAMPCR
,
3729 RTC_TAMPCR_TAMP3IE
) == (RTC_TAMPCR_TAMP3IE
));
3733 * @brief Check if Tamper 2 interrupt is enabled or not
3734 * @rmtoll TAMPCR TAMP2IE LL_RTC_IsEnabledIT_TAMP2
3735 * @param RTCx RTC Instance
3736 * @retval State of bit (1 or 0).
3738 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP2(RTC_TypeDef
*RTCx
)
3740 return (READ_BIT(RTCx
->TAMPCR
,
3741 RTC_TAMPCR_TAMP2IE
) == (RTC_TAMPCR_TAMP2IE
));
3746 * @brief Check if Tamper 1 interrupt is enabled or not
3747 * @rmtoll TAMPCR TAMP1IE LL_RTC_IsEnabledIT_TAMP1
3748 * @param RTCx RTC Instance
3749 * @retval State of bit (1 or 0).
3751 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP1(RTC_TypeDef
*RTCx
)
3753 return (READ_BIT(RTCx
->TAMPCR
,
3754 RTC_TAMPCR_TAMP1IE
) == (RTC_TAMPCR_TAMP1IE
));
3758 * @brief Check if all the TAMPER interrupts are enabled or not
3759 * @rmtoll TAMPCR TAMPIE LL_RTC_IsEnabledIT_TAMP
3760 * @param RTCx RTC Instance
3761 * @retval State of bit (1 or 0).
3763 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef
*RTCx
)
3765 return (READ_BIT(RTCx
->TAMPCR
,
3766 RTC_TAMPCR_TAMPIE
) == (RTC_TAMPCR_TAMPIE
));
3773 #if defined(USE_FULL_LL_DRIVER)
3774 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
3778 ErrorStatus
LL_RTC_DeInit(RTC_TypeDef
*RTCx
);
3779 ErrorStatus
LL_RTC_Init(RTC_TypeDef
*RTCx
, LL_RTC_InitTypeDef
*RTC_InitStruct
);
3780 void LL_RTC_StructInit(LL_RTC_InitTypeDef
*RTC_InitStruct
);
3781 ErrorStatus
LL_RTC_TIME_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_TimeTypeDef
*RTC_TimeStruct
);
3782 void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef
*RTC_TimeStruct
);
3783 ErrorStatus
LL_RTC_DATE_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_DateTypeDef
*RTC_DateStruct
);
3784 void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef
*RTC_DateStruct
);
3785 ErrorStatus
LL_RTC_ALMA_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
3786 ErrorStatus
LL_RTC_ALMB_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
3787 void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
3788 void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
3789 ErrorStatus
LL_RTC_EnterInitMode(RTC_TypeDef
*RTCx
);
3790 ErrorStatus
LL_RTC_ExitInitMode(RTC_TypeDef
*RTCx
);
3791 ErrorStatus
LL_RTC_WaitForSynchro(RTC_TypeDef
*RTCx
);
3796 #endif /* USE_FULL_LL_DRIVER */
3806 #endif /* defined(RTC) */
3816 #endif /* __STM32F7xx_LL_RTC_H */
3818 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/