2 ******************************************************************************
3 * @file stm32h7xx_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 STM32H7xx_LL_RTC_H
22 #define STM32H7xx_LL_RTC_H
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx.h"
31 /** @addtogroup STM32H7xx_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_LL_INIT_MASK 0xFFFFFFFFU
49 #define RTC_LL_RSF_MASK 0xFFFFFF5FU
51 /* Write protection defines */
52 #define RTC_WRITE_PROTECTION_DISABLE 0xFFU
53 #define RTC_WRITE_PROTECTION_ENABLE_1 0xCAU
54 #define RTC_WRITE_PROTECTION_ENABLE_2 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 0x00000000U /*!< Binary data format */
209 #define LL_RTC_FORMAT_BCD 0x00000001U /*!< 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 #if defined(RTC_SCR_CALRAF)
239 #define LL_RTC_SCR_ITSF RTC_SCR_CITSF
240 #define LL_RTC_SCR_TSOVF RTC_SCR_CTSOVF
241 #define LL_RTC_SCR_TSF RTC_SCR_CTSF
242 #define LL_RTC_SCR_WUTF RTC_SCR_CWUTF
243 #define LL_RTC_SCR_ALRBF RTC_SCR_CALRBF
244 #define LL_RTC_SCR_ALRAF RTC_SCR_CALRAF
245 #endif /* RTC_SCR_CALRAF */
247 #if defined(RTC_ICSR_ALRAWF)
248 #define LL_RTC_ICSR_RECALPF RTC_ICSR_RECALPF
249 #define LL_RTC_ICSR_INITF RTC_ICSR_INITF
250 #define LL_RTC_ICSR_RSF RTC_ICSR_RSF
251 #define LL_RTC_ICSR_INITS RTC_ICSR_INITS
252 #define LL_RTC_ICSR_SHPF RTC_ICSR_SHPF
253 #define LL_RTC_ICSR_WUTWF RTC_ICSR_WUTWF
254 #endif /* RTC_ICSR_ALRAWF */
255 #if defined(RTC_ISR_ALRAWF)
256 #define LL_RTC_ISR_ITSF RTC_ISR_ITSF
257 #define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF
258 #define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F
259 #define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F
260 #define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F
261 #define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF
262 #define LL_RTC_ISR_TSF RTC_ISR_TSF
263 #define LL_RTC_ISR_WUTF RTC_ISR_WUTF
264 #define LL_RTC_ISR_ALRBF RTC_ISR_ALRBF
265 #define LL_RTC_ISR_ALRAF RTC_ISR_ALRAF
266 #define LL_RTC_ISR_INITF RTC_ISR_INITF
267 #define LL_RTC_ISR_RSF RTC_ISR_RSF
268 #define LL_RTC_ISR_INITS RTC_ISR_INITS
269 #define LL_RTC_ISR_SHPF RTC_ISR_SHPF
270 #define LL_RTC_ISR_WUTWF RTC_ISR_WUTWF
271 #define LL_RTC_ISR_ALRBWF RTC_ISR_ALRBWF
272 #define LL_RTC_ISR_ALRAWF RTC_ISR_ALRAWF
273 #endif /* RTC_ISR_ALRAWF */
278 /** @defgroup RTC_LL_EC_IT IT Defines
279 * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions
282 #define LL_RTC_CR_TSIE RTC_CR_TSIE
283 #define LL_RTC_CR_WUTIE RTC_CR_WUTIE
284 #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE
285 #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE
286 #if defined(RTC_TAMPCR_TAMP3E)
287 #define LL_RTC_TAMPCR_TAMP3IE RTC_TAMPCR_TAMP3IE
288 #endif /* RTC_TAMPCR_TAMP3E */
289 #if defined(RTC_TAMPCR_TAMP2E)
290 #define LL_RTC_TAMPCR_TAMP2IE RTC_TAMPCR_TAMP2IE
291 #endif /* RTC_TAMPCR_TAMP2E */
292 #if defined(RTC_TAMPCR_TAMP1E)
293 #define LL_RTC_TAMPCR_TAMP1IE RTC_TAMPCR_TAMP1IE
294 #endif /* RTC_TAMPCR_TAMP1E */
295 #if defined(RTC_TAMPCR_TAMPIE)
296 #define LL_RTC_TAMPCR_TAMPIE RTC_TAMPCR_TAMPIE
297 #endif /* RTC_TAMPCR_TAMPIE */
302 /** @defgroup RTC_LL_EC_WEEKDAY WEEK DAY
305 #define LL_RTC_WEEKDAY_MONDAY (uint8_t)0x01 /*!< Monday */
306 #define LL_RTC_WEEKDAY_TUESDAY (uint8_t)0x02 /*!< Tuesday */
307 #define LL_RTC_WEEKDAY_WEDNESDAY (uint8_t)0x03 /*!< Wednesday */
308 #define LL_RTC_WEEKDAY_THURSDAY (uint8_t)0x04 /*!< Thrusday */
309 #define LL_RTC_WEEKDAY_FRIDAY (uint8_t)0x05 /*!< Friday */
310 #define LL_RTC_WEEKDAY_SATURDAY (uint8_t)0x06 /*!< Saturday */
311 #define LL_RTC_WEEKDAY_SUNDAY (uint8_t)0x07 /*!< Sunday */
316 /** @defgroup RTC_LL_EC_MONTH MONTH
319 #define LL_RTC_MONTH_JANUARY (uint8_t)0x01 /*!< January */
320 #define LL_RTC_MONTH_FEBRUARY (uint8_t)0x02 /*!< February */
321 #define LL_RTC_MONTH_MARCH (uint8_t)0x03 /*!< March */
322 #define LL_RTC_MONTH_APRIL (uint8_t)0x04 /*!< April */
323 #define LL_RTC_MONTH_MAY (uint8_t)0x05 /*!< May */
324 #define LL_RTC_MONTH_JUNE (uint8_t)0x06 /*!< June */
325 #define LL_RTC_MONTH_JULY (uint8_t)0x07 /*!< July */
326 #define LL_RTC_MONTH_AUGUST (uint8_t)0x08 /*!< August */
327 #define LL_RTC_MONTH_SEPTEMBER (uint8_t)0x09 /*!< September */
328 #define LL_RTC_MONTH_OCTOBER (uint8_t)0x10 /*!< October */
329 #define LL_RTC_MONTH_NOVEMBER (uint8_t)0x11 /*!< November */
330 #define LL_RTC_MONTH_DECEMBER (uint8_t)0x12 /*!< December */
335 /** @defgroup RTC_LL_EC_HOURFORMAT HOUR FORMAT
338 #define LL_RTC_HOURFORMAT_24HOUR 0x00000000U /*!< 24 hour/day format */
339 #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */
344 /** @defgroup RTC_LL_EC_ALARMOUT ALARM OUTPUT
347 #define LL_RTC_ALARMOUT_DISABLE 0x00000000U /*!< Output disabled */
348 #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */
349 #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */
350 #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */
355 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUT TYPE
358 #if defined(RTC_CR_TAMPALRM_TYPE)
359 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN RTC_CR_TAMPALRM_TYPE /*!< RTC_ALARM is open-drain output */
360 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL 0x00000000U /*!< RTC_ALARM is push-pull output */
361 #endif /* RTC_CR_TAMPALRM_TYPE */
362 #if defined(RTC_OR_ALARMOUTTYPE)
363 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 0x00000000U /*!< RTC_ALARM, when mapped on PC13, is open-drain output */
364 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_OR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */
365 #endif /* RTC_OR_ALARMOUTTYPE */
370 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUT POLARITY PIN
373 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH 0x00000000U /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/
374 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */
379 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT
382 #define LL_RTC_TIME_FORMAT_AM_OR_24 0x00000000U /*!< AM or 24-hour format */
383 #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */
388 /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND
391 #define LL_RTC_SHIFT_SECOND_DELAY 0x00000000U /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */
392 #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */
397 /** @defgroup RTC_LL_EC_ALMA_MASK ALARMA MASK
400 #define LL_RTC_ALMA_MASK_NONE 0x00000000U /*!< No masks applied on Alarm A*/
401 #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */
402 #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */
403 #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */
404 #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */
405 #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */
410 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALARMA TIME FORMAT
413 #define LL_RTC_ALMA_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
414 #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */
419 /** @defgroup RTC_LL_EC_ALMB_MASK ALARMB MASK
422 #define LL_RTC_ALMB_MASK_NONE 0x00000000U /*!< No masks applied on Alarm B*/
423 #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */
424 #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */
425 #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */
426 #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */
427 #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */
432 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALARMB TIME FORMAT
435 #define LL_RTC_ALMB_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
436 #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */
441 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE
444 #define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
445 #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */
450 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TIMESTAMP TIME FORMAT
453 #define LL_RTC_TS_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
454 #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */
459 /** @defgroup RTC_LL_EC_TAMPER TAMPER
462 #if defined(TAMP_CR1_TAMP1E)
463 #define LL_RTC_TAMPER_1 TAMP_CR1_TAMP1E /*!< Tamper 1 input detection */
464 #endif /* TAMP_CR1_TAMP1E */
465 #if defined(TAMP_CR1_TAMP2E)
466 #define LL_RTC_TAMPER_2 TAMP_CR1_TAMP2E /*!< Tamper 2 input detection */
467 #endif /* TAMP_CR1_TAMP2E */
468 #if defined(TAMP_CR1_TAMP3E)
469 #define LL_RTC_TAMPER_3 TAMP_CR1_TAMP3E /*!< Tamper 3 input detection */
470 #endif /* TAMP_CR1_TAMP3E */
475 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK
478 #if defined(TAMP_CR1_TAMP1E)
479 #define LL_RTC_TAMPER_MASK_TAMPER1 TAMP_CR2_TAMP1MSK /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware. The backup registers are not erased */
480 #endif /* TAMP_CR1_TAMP1E */
481 #if defined(TAMP_CR1_TAMP2E)
482 #define LL_RTC_TAMPER_MASK_TAMPER2 TAMP_CR2_TAMP2MSK /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
483 #endif /* TAMP_CR1_TAMP2E */
484 #if defined(TAMP_CR1_TAMP3E)
485 #define LL_RTC_TAMPER_MASK_TAMPER3 TAMP_CR2_TAMP3MSK /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased. */
486 #endif /* TAMP_CR1_TAMP3E */
491 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE
494 #if defined(TAMP_CR1_TAMP1E)
495 #define LL_RTC_TAMPER_NOERASE_TAMPER1 TAMP_CR2_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
496 #endif /* TAMP_CR1_TAMP1E */
497 #if defined(TAMP_CR1_TAMP2E)
498 #define LL_RTC_TAMPER_NOERASE_TAMPER2 TAMP_CR2_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
499 #endif /* TAMP_CR1_TAMP2E */
500 #if defined(TAMP_CR1_TAMP3E)
501 #define LL_RTC_TAMPER_NOERASE_TAMPER3 TAMP_CR2_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
502 #endif /* TAMP_CR1_TAMP3E */
507 #if defined(TAMP_FLTCR_TAMPPRCH)
508 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION
511 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */
512 #define LL_RTC_TAMPER_DURATION_2RTCCLK TAMP_FLTCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
513 #define LL_RTC_TAMPER_DURATION_4RTCCLK TAMP_FLTCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
514 #define LL_RTC_TAMPER_DURATION_8RTCCLK TAMP_FLTCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
518 #endif /* TAMP_FLTCR_TAMPPRCH */
520 #if defined(TAMP_FLTCR_TAMPFLT)
521 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER
524 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */
525 #define LL_RTC_TAMPER_FILTER_2SAMPLE TAMP_FLTCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */
526 #define LL_RTC_TAMPER_FILTER_4SAMPLE TAMP_FLTCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */
527 #define LL_RTC_TAMPER_FILTER_8SAMPLE TAMP_FLTCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */
531 #endif /* TAMP_FLTCR_TAMPFLT */
533 #if defined(TAMP_FLTCR_TAMPFREQ)
534 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER
537 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */
538 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 TAMP_FLTCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */
539 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 TAMP_FLTCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */
540 #define LL_RTC_TAMPER_SAMPLFREQDIV_4096 (TAMP_FLTCR_TAMPFREQ_1 | TAMP_FLTCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */
541 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 TAMP_FLTCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */
542 #define LL_RTC_TAMPER_SAMPLFREQDIV_1024 (TAMP_FLTCR_TAMPFREQ_2 | TAMP_FLTCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */
543 #define LL_RTC_TAMPER_SAMPLFREQDIV_512 (TAMP_FLTCR_TAMPFREQ_2 | TAMP_FLTCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */
544 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 TAMP_FLTCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */
548 #endif /* TAMP_FLTCR_TAMPFREQ */
550 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL
553 #if defined(TAMP_CR1_TAMP1E)
554 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 TAMP_CR2_TAMP1TRG /*!< Tamper 1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
555 #endif /* TAMP_CR1_TAMP1E */
556 #if defined(TAMP_CR1_TAMP2E)
557 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 TAMP_CR2_TAMP2TRG /*!< Tamper 2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
558 #endif /* TAMP_CR1_TAMP2E */
559 #if defined(TAMP_CR1_TAMP3E)
560 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 TAMP_CR2_TAMP3TRG /*!< Tamper 3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
561 #endif /* TAMP_CR1_TAMP3E */
566 /** @defgroup RTC_LL_EC_TAMPER TAMPER
569 #if defined (RTC_TAMPCR_TAMP1E)
570 #define LL_RTC_TAMPER_1 RTC_TAMPCR_TAMP1E /*!< RTC_TAMP1 input detection */
571 #endif /* RTC_TAMPCR_TAMP1E */
572 #if defined (RTC_TAMPCR_TAMP2E)
573 #define LL_RTC_TAMPER_2 RTC_TAMPCR_TAMP2E /*!< RTC_TAMP2 input detection */
574 #endif /* RTC_TAMPCR_TAMP2E */
575 #if defined (RTC_TAMPCR_TAMP3E)
576 #define LL_RTC_TAMPER_3 RTC_TAMPCR_TAMP3E /*!< RTC_TAMP3 input detection */
577 #endif /* RTC_TAMPCR_TAMP3E */
582 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK
585 #if defined (RTC_TAMPCR_TAMP1E)
586 #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 */
587 #endif /* RTC_TAMPCR_TAMP1E */
588 #if defined (RTC_TAMPCR_TAMP2E)
589 #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. */
590 #endif /* RTC_TAMPCR_TAMP2E */
591 #if defined (RTC_TAMPCR_TAMP3E)
592 #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 */
593 #endif /* RTC_TAMPCR_TAMP3E */
598 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE
601 #if defined (RTC_TAMPCR_TAMP1E)
602 #define LL_RTC_TAMPER_NOERASE_TAMPER1 RTC_TAMPCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
603 #endif /* RTC_TAMPCR_TAMP1E */
604 #if defined (RTC_TAMPCR_TAMP2E)
605 #define LL_RTC_TAMPER_NOERASE_TAMPER2 RTC_TAMPCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
606 #endif /* RTC_TAMPCR_TAMP2E */
607 #if defined (RTC_TAMPCR_TAMP3E)
608 #define LL_RTC_TAMPER_NOERASE_TAMPER3 RTC_TAMPCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
609 #endif /* RTC_TAMPCR_TAMP3E */
614 #if defined(RTC_TAMPCR_TAMPPRCH)
615 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION
618 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */
619 #define LL_RTC_TAMPER_DURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
620 #define LL_RTC_TAMPER_DURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
621 #define LL_RTC_TAMPER_DURATION_8RTCCLK RTC_TAMPCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
625 #endif /* RTC_TAMPCR_TAMPPRCH */
627 #if defined(RTC_TAMPCR_TAMPFLT)
628 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER
631 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */
632 #define LL_RTC_TAMPER_FILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */
633 #define LL_RTC_TAMPER_FILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */
634 #define LL_RTC_TAMPER_FILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */
638 #endif /* RTC_TAMPCR_TAMPFLT */
640 #if defined(RTC_TAMPCR_TAMPFREQ)
641 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER
644 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */
645 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */
646 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */
647 #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 */
648 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */
649 #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 */
650 #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 */
651 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 RTC_TAMPCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */
655 #endif /* RTC_TAMPCR_TAMPFREQ */
657 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL
660 #if defined (RTC_TAMPCR_TAMP1E)
661 #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*/
662 #endif /* RTC_TAMPCR_TAMP1E */
663 #if defined (RTC_TAMPCR_TAMP2E)
664 #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*/
665 #endif /* RTC_TAMPCR_TAMP2E */
666 #if defined (RTC_TAMPCR_TAMP3E)
667 #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*/
668 #endif /* RTC_TAMPCR_TAMP3E */
673 /** @defgroup RTC_LL_EC_ACTIVE_MODE ACTIVE TAMPER MODE
676 #if defined(TAMP_ATCR1_TAMP1AM)
677 #define LL_RTC_TAMPER_ATAMP_TAMP1AM TAMP_ATCR1_TAMP1AM /*!< tamper 1 is active */
678 #endif /* TAMP_ATCR1_TAMP1AM */
679 #if defined(TAMP_ATCR1_TAMP2AM)
680 #define LL_RTC_TAMPER_ATAMP_TAMP2AM TAMP_ATCR1_TAMP2AM /*!< tamper 2 is active */
681 #endif /* TAMP_ATCR1_TAMP2AM */
682 #if defined(TAMP_ATCR1_TAMP3AM)
683 #define LL_RTC_TAMPER_ATAMP_TAMP3AM TAMP_ATCR1_TAMP3AM /*!< tamper 3 is active */
684 #endif /* TAMP_ATCR1_TAMP3AM */
689 #if defined(TAMP_ATCR1_ATCKSEL)
690 /** @defgroup RTC_LL_EC_ACTIVE_ASYNC_PRESCALER ACTIVE TAMPER ASYNCHRONOUS PRESCALER CLOCK
693 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK 0U /*!< RTCCLK */
694 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_2 TAMP_ATCR1_ATCKSEL_0 /*!< RTCCLK/2 */
695 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_4 TAMP_ATCR1_ATCKSEL_1 /*!< RTCCLK/4 */
696 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_8 (TAMP_ATCR1_ATCKSEL_1 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/8 */
697 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_16 TAMP_ATCR1_ATCKSEL_2 /*!< RTCCLK/16 */
698 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_32 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/32 */
699 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_64 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_1) /*!< RTCCLK/64 */
700 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_128 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_1 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/128 */
704 #endif /* TAMP_ATCR1_ATCKSEL */
706 /** @defgroup RTC_LL_EC_ACTIVE_OUTPUT_SELECTION ACTIVE TAMPER OUTPUT SELECTION
709 #if defined(TAMP_ATCR1_TAMP1AM)
710 #define LL_RTC_TAMPER_ATAMP1IN_ATAMP1OUT (0UL << TAMP_ATCR2_ATOSEL1_Pos)
711 #define LL_RTC_TAMPER_ATAMP1IN_ATAMP2OUT (1UL << TAMP_ATCR2_ATOSEL1_Pos)
712 #define LL_RTC_TAMPER_ATAMP1IN_ATAMP3OUT (2UL << TAMP_ATCR2_ATOSEL1_Pos)
713 #endif /* TAMP_ATCR1_TAMP1AM */
715 #if defined(TAMP_ATCR1_TAMP2AM)
716 #define LL_RTC_TAMPER_ATAMP2IN_ATAMP1OUT (0UL << TAMP_ATCR2_ATOSEL2_Pos)
717 #define LL_RTC_TAMPER_ATAMP2IN_ATAMP2OUT (1UL << TAMP_ATCR2_ATOSEL2_Pos)
718 #define LL_RTC_TAMPER_ATAMP2IN_ATAMP3OUT (2UL << TAMP_ATCR2_ATOSEL2_Pos)
719 #endif /* TAMP_ATCR1_TAMP2AM */
721 #if defined(TAMP_ATCR1_TAMP3AM)
722 #define LL_RTC_TAMPER_ATAMP3IN_ATAMP1OUT (0UL << TAMP_ATCR2_ATOSEL3_Pos)
723 #define LL_RTC_TAMPER_ATAMP3IN_ATAMP2OUT (1UL << TAMP_ATCR2_ATOSEL3_Pos)
724 #define LL_RTC_TAMPER_ATAMP3IN_ATAMP3OUT (2UL << TAMP_ATCR2_ATOSEL3_Pos)
725 #endif /* TAMP_ATCR1_TAMP3AM */
730 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUP CLOCK DIV
733 #define LL_RTC_WAKEUPCLOCK_DIV_16 0x00000000U /*!< RTC/16 clock is selected */
734 #define LL_RTC_WAKEUPCLOCK_DIV_8 RTC_CR_WUCKSEL_0 /*!< RTC/8 clock is selected */
735 #define LL_RTC_WAKEUPCLOCK_DIV_4 RTC_CR_WUCKSEL_1 /*!< RTC/4 clock is selected */
736 #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */
737 #define LL_RTC_WAKEUPCLOCK_CKSPRE RTC_CR_WUCKSEL_2 /*!< ck_spre (usually 1 Hz) clock is selected */
738 #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*/
743 /** @defgroup RTC_LL_EC_BKP BACKUP
746 #define LL_RTC_BKP_DR0 0x00000000U
747 #define LL_RTC_BKP_DR1 0x00000001U
748 #define LL_RTC_BKP_DR2 0x00000002U
749 #define LL_RTC_BKP_DR3 0x00000003U
750 #define LL_RTC_BKP_DR4 0x00000004U
751 #define LL_RTC_BKP_DR5 0x00000005U
752 #define LL_RTC_BKP_DR6 0x00000006U
753 #define LL_RTC_BKP_DR7 0x00000007U
754 #define LL_RTC_BKP_DR8 0x00000008U
755 #define LL_RTC_BKP_DR9 0x00000009U
756 #define LL_RTC_BKP_DR10 0x0000000AU
757 #define LL_RTC_BKP_DR11 0x0000000BU
758 #define LL_RTC_BKP_DR12 0x0000000CU
759 #define LL_RTC_BKP_DR13 0x0000000DU
760 #define LL_RTC_BKP_DR14 0x0000000EU
761 #define LL_RTC_BKP_DR15 0x0000000FU
762 #define LL_RTC_BKP_DR16 0x00000010U
763 #define LL_RTC_BKP_DR17 0x00000011U
764 #define LL_RTC_BKP_DR18 0x00000012U
765 #define LL_RTC_BKP_DR19 0x00000013U
766 #define LL_RTC_BKP_DR20 0x00000014U
767 #define LL_RTC_BKP_DR21 0x00000015U
768 #define LL_RTC_BKP_DR22 0x00000016U
769 #define LL_RTC_BKP_DR23 0x00000017U
770 #define LL_RTC_BKP_DR24 0x00000018U
771 #define LL_RTC_BKP_DR25 0x00000019U
772 #define LL_RTC_BKP_DR26 0x0000001AU
773 #define LL_RTC_BKP_DR27 0x0000001BU
774 #define LL_RTC_BKP_DR28 0x0000001CU
775 #define LL_RTC_BKP_DR29 0x0000001DU
776 #define LL_RTC_BKP_DR30 0x0000001EU
777 #define LL_RTC_BKP_DR31 0x0000001FU
782 /** @defgroup RTC_LL_EC_CALIB_OUTPUT Calibration output
785 #define LL_RTC_CALIB_OUTPUT_NONE 0x00000000U /*!< Calibration output disabled */
786 #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */
787 #define LL_RTC_CALIB_OUTPUT_512HZ RTC_CR_COE /*!< Calibration output is 512 Hz */
792 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE Calibration pulse insertion
795 #define LL_RTC_CALIB_INSERTPULSE_NONE 0x00000000U /*!< No RTCCLK pulses are added */
796 #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */
801 /** @defgroup RTC_LL_EC_CALIB_PERIOD Calibration period
804 #define LL_RTC_CALIB_PERIOD_32SEC 0x00000000U /*!< Use a 32-second calibration cycle period */
805 #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */
806 #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */
815 /* Exported macro ------------------------------------------------------------*/
816 /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros
820 /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros
825 * @brief Write a value in RTC register
826 * @param __INSTANCE__ RTC Instance
827 * @param __REG__ Register to be written
828 * @param __VALUE__ Value to be written in the register
831 #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, __VALUE__)
834 * @brief Read a value in RTC register
835 * @param __INSTANCE__ RTC Instance
836 * @param __REG__ Register to be read
837 * @retval Register value
839 #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__)
844 /** @defgroup RTC_LL_EM_Convert Convert helper Macros
849 * @brief Helper macro to convert a value from 2 digit decimal format to BCD format
850 * @param __VALUE__ Byte to be converted
851 * @retval Converted byte
853 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
856 * @brief Helper macro to convert a value from BCD format to 2 digit decimal format
857 * @param __VALUE__ BCD value to be converted
858 * @retval Converted byte
860 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) ((uint8_t)((((uint8_t)((__VALUE__) & (uint8_t)0xF0) >> (uint8_t)0x4) * 10U) + ((__VALUE__) & (uint8_t)0x0F)))
866 /** @defgroup RTC_LL_EM_Date Date helper Macros
871 * @brief Helper macro to retrieve weekday.
872 * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function.
873 * @retval Returned value can be one of the following values:
874 * @arg @ref LL_RTC_WEEKDAY_MONDAY
875 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
876 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
877 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
878 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
879 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
880 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
882 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU)
885 * @brief Helper macro to retrieve Year in BCD format
886 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
887 * @retval Year in BCD format (0x00 . . . 0x99)
889 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU)
892 * @brief Helper macro to retrieve Month in BCD format
893 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
894 * @retval Returned value can be one of the following values:
895 * @arg @ref LL_RTC_MONTH_JANUARY
896 * @arg @ref LL_RTC_MONTH_FEBRUARY
897 * @arg @ref LL_RTC_MONTH_MARCH
898 * @arg @ref LL_RTC_MONTH_APRIL
899 * @arg @ref LL_RTC_MONTH_MAY
900 * @arg @ref LL_RTC_MONTH_JUNE
901 * @arg @ref LL_RTC_MONTH_JULY
902 * @arg @ref LL_RTC_MONTH_AUGUST
903 * @arg @ref LL_RTC_MONTH_SEPTEMBER
904 * @arg @ref LL_RTC_MONTH_OCTOBER
905 * @arg @ref LL_RTC_MONTH_NOVEMBER
906 * @arg @ref LL_RTC_MONTH_DECEMBER
908 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU)
911 * @brief Helper macro to retrieve Day in BCD format
912 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
913 * @retval Day in BCD format (0x01 . . . 0x31)
915 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU)
921 /** @defgroup RTC_LL_EM_Time Time helper Macros
926 * @brief Helper macro to retrieve hour in BCD format
927 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
928 * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23)
930 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU)
933 * @brief Helper macro to retrieve minute in BCD format
934 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
935 * @retval Minutes in BCD format (0x00. . .0x59)
937 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU)
940 * @brief Helper macro to retrieve second in BCD format
941 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
942 * @retval Seconds in format (0x00. . .0x59)
944 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU)
954 /* Exported functions --------------------------------------------------------*/
955 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
959 /** @defgroup RTC_LL_EF_Configuration Configuration
964 * @brief Set Hours format (24 hour/day or AM/PM hour format)
965 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
966 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
967 * @rmtoll RTC_CR FMT LL_RTC_SetHourFormat
968 * @param RTCx RTC Instance
969 * @param HourFormat This parameter can be one of the following values:
970 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
971 * @arg @ref LL_RTC_HOURFORMAT_AMPM
974 __STATIC_INLINE
void LL_RTC_SetHourFormat(RTC_TypeDef
*RTCx
, uint32_t HourFormat
)
976 MODIFY_REG(RTCx
->CR
, RTC_CR_FMT
, HourFormat
);
980 * @brief Get Hours format (24 hour/day or AM/PM hour format)
981 * @rmtoll RTC_CR FMT LL_RTC_GetHourFormat
982 * @param RTCx RTC Instance
983 * @retval Returned value can be one of the following values:
984 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
985 * @arg @ref LL_RTC_HOURFORMAT_AMPM
987 __STATIC_INLINE
uint32_t LL_RTC_GetHourFormat(RTC_TypeDef
*RTCx
)
989 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_FMT
));
993 * @brief Select the flag to be routed to RTC_ALARM output
994 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
995 * @rmtoll RTC_CR OSEL LL_RTC_SetAlarmOutEvent
996 * @param RTCx RTC Instance
997 * @param AlarmOutput This parameter can be one of the following values:
998 * @arg @ref LL_RTC_ALARMOUT_DISABLE
999 * @arg @ref LL_RTC_ALARMOUT_ALMA
1000 * @arg @ref LL_RTC_ALARMOUT_ALMB
1001 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
1004 __STATIC_INLINE
void LL_RTC_SetAlarmOutEvent(RTC_TypeDef
*RTCx
, uint32_t AlarmOutput
)
1006 MODIFY_REG(RTCx
->CR
, RTC_CR_OSEL
, AlarmOutput
);
1010 * @brief Get the flag to be routed to RTC_ALARM output
1011 * @rmtoll RTC_CR OSEL LL_RTC_GetAlarmOutEvent
1012 * @param RTCx RTC Instance
1013 * @retval Returned value can be one of the following values:
1014 * @arg @ref LL_RTC_ALARMOUT_DISABLE
1015 * @arg @ref LL_RTC_ALARMOUT_ALMA
1016 * @arg @ref LL_RTC_ALARMOUT_ALMB
1017 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
1019 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef
*RTCx
)
1021 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_OSEL
));
1024 #if defined(RTC_CR_TAMPALRM_TYPE)
1026 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
1027 * @rmtoll RTC_CR TAMPALRM_TYPE LL_RTC_SetAlarmOutputType
1028 * @param RTCx RTC Instance
1029 * @param Output This parameter can be one of the following values:
1030 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
1031 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
1034 __STATIC_INLINE
void LL_RTC_SetAlarmOutputType(RTC_TypeDef
*RTCx
, uint32_t Output
)
1036 MODIFY_REG(RTCx
->CR
, RTC_CR_TAMPALRM_TYPE
, Output
);
1040 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
1041 * @rmtoll RTC_CR TAMPALRM_TYPE LL_RTC_SetAlarmOutputType
1042 * @param RTCx RTC Instance
1043 * @retval Returned value can be one of the following values:
1044 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
1045 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
1047 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef
*RTCx
)
1049 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_TYPE
));
1051 #endif /* RTC_CR_TAMPALRM_TYPE */
1053 #if defined(RTC_ICSR_INIT)
1055 * @brief Enable initialization mode
1056 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
1057 * and prescaler register (RTC_PRER).
1058 * Counters are stopped and start counting from the new value when INIT is reset.
1059 * @rmtoll RTC_ICSR INIT LL_RTC_EnableInitMode
1060 * @param RTCx RTC Instance
1063 __STATIC_INLINE
void LL_RTC_EnableInitMode(RTC_TypeDef
*RTCx
)
1065 /* Set the Initialization mode */
1066 WRITE_REG(RTCx
->ICSR
, RTC_LL_INIT_MASK
);
1070 * @brief Disable initialization mode (Free running mode)
1071 * @rmtoll RTC_ICSR INIT LL_RTC_DisableInitMode
1072 * @param RTCx RTC Instance
1075 __STATIC_INLINE
void LL_RTC_DisableInitMode(RTC_TypeDef
*RTCx
)
1077 /* Exit Initialization mode */
1078 WRITE_REG(RTCx
->ICSR
, (uint32_t)~RTC_ICSR_INIT
);
1081 #endif /* RTC_ICSR_INIT */
1083 #if defined(RTC_OR_ALARMOUTTYPE)
1085 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
1086 * @note Used only when RTC_ALARM is mapped on PC13
1087 * @rmtoll OR ALARMOUTTYPE LL_RTC_SetAlarmOutputType
1088 * @param RTCx RTC Instance
1089 * @param Output This parameter can be one of the following values:
1090 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
1091 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
1094 __STATIC_INLINE
void LL_RTC_SetAlarmOutputType(RTC_TypeDef
*RTCx
, uint32_t Output
)
1096 MODIFY_REG(RTCx
->OR
, RTC_OR_ALARMOUTTYPE
, Output
);
1100 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
1101 * @note used only when RTC_ALARM is mapped on PC13
1102 * @rmtoll OR ALARMOUTTYPE LL_RTC_GetAlarmOutputType
1103 * @param RTCx RTC Instance
1104 * @retval Returned value can be one of the following values:
1105 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
1106 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
1108 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef
*RTCx
)
1110 return (uint32_t)(READ_BIT(RTCx
->OR
, RTC_OR_ALARMOUTTYPE
));
1112 #endif /* RTC_OR_ALARMOUTTYPE */
1114 #if defined(RTC_ISR_INIT)
1116 * @brief Enable initialization mode
1117 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
1118 * and prescaler register (RTC_PRER).
1119 * Counters are stopped and start counting from the new value when INIT is reset.
1120 * @rmtoll ISR INIT LL_RTC_EnableInitMode
1121 * @param RTCx RTC Instance
1124 __STATIC_INLINE
void LL_RTC_EnableInitMode(RTC_TypeDef
*RTCx
)
1126 /* Set the Initialization mode */
1127 WRITE_REG(RTCx
->ISR
, RTC_LL_INIT_MASK
);
1131 * @brief Disable initialization mode (Free running mode)
1132 * @rmtoll ISR INIT LL_RTC_DisableInitMode
1133 * @param RTCx RTC Instance
1136 __STATIC_INLINE
void LL_RTC_DisableInitMode(RTC_TypeDef
*RTCx
)
1138 /* Exit Initialization mode */
1139 WRITE_REG(RTCx
->ISR
, (uint32_t)~RTC_ISR_INIT
);
1141 #endif /* RTC_ISR_INIT */
1144 * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted)
1145 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1146 * @rmtoll RTC_CR POL LL_RTC_SetOutputPolarity
1147 * @param RTCx RTC Instance
1148 * @param Polarity This parameter can be one of the following values:
1149 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
1150 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
1153 __STATIC_INLINE
void LL_RTC_SetOutputPolarity(RTC_TypeDef
*RTCx
, uint32_t Polarity
)
1155 MODIFY_REG(RTCx
->CR
, RTC_CR_POL
, Polarity
);
1159 * @brief Get Output polarity
1160 * @rmtoll RTC_CR POL LL_RTC_GetOutputPolarity
1161 * @param RTCx RTC Instance
1162 * @retval Returned value can be one of the following values:
1163 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
1164 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
1166 __STATIC_INLINE
uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef
*RTCx
)
1168 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_POL
));
1172 * @brief Enable Bypass the shadow registers
1173 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1174 * @rmtoll RTC_CR BYPSHAD LL_RTC_EnableShadowRegBypass
1175 * @param RTCx RTC Instance
1178 __STATIC_INLINE
void LL_RTC_EnableShadowRegBypass(RTC_TypeDef
*RTCx
)
1180 SET_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
);
1184 * @brief Disable Bypass the shadow registers
1185 * @rmtoll RTC_CR BYPSHAD LL_RTC_DisableShadowRegBypass
1186 * @param RTCx RTC Instance
1189 __STATIC_INLINE
void LL_RTC_DisableShadowRegBypass(RTC_TypeDef
*RTCx
)
1191 CLEAR_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
);
1195 * @brief Check if Shadow registers bypass is enabled or not.
1196 * @rmtoll RTC_CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled
1197 * @param RTCx RTC Instance
1198 * @retval State of bit (1 or 0).
1200 __STATIC_INLINE
uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef
*RTCx
)
1202 return ((READ_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
) == (RTC_CR_BYPSHAD
)) ? 1UL : 0UL);
1206 * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz)
1207 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1208 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1209 * @rmtoll RTC_CR REFCKON LL_RTC_EnableRefClock
1210 * @param RTCx RTC Instance
1213 __STATIC_INLINE
void LL_RTC_EnableRefClock(RTC_TypeDef
*RTCx
)
1215 SET_BIT(RTCx
->CR
, RTC_CR_REFCKON
);
1219 * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz)
1220 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1221 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1222 * @rmtoll RTC_CR REFCKON LL_RTC_DisableRefClock
1223 * @param RTCx RTC Instance
1226 __STATIC_INLINE
void LL_RTC_DisableRefClock(RTC_TypeDef
*RTCx
)
1228 CLEAR_BIT(RTCx
->CR
, RTC_CR_REFCKON
);
1232 * @brief Set Asynchronous prescaler factor
1233 * @rmtoll RTC_PRER PREDIV_A LL_RTC_SetAsynchPrescaler
1234 * @param RTCx RTC Instance
1235 * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F
1238 __STATIC_INLINE
void LL_RTC_SetAsynchPrescaler(RTC_TypeDef
*RTCx
, uint32_t AsynchPrescaler
)
1240 MODIFY_REG(RTCx
->PRER
, RTC_PRER_PREDIV_A
, AsynchPrescaler
<< RTC_PRER_PREDIV_A_Pos
);
1244 * @brief Set Synchronous prescaler factor
1245 * @rmtoll RTC_PRER PREDIV_S LL_RTC_SetSynchPrescaler
1246 * @param RTCx RTC Instance
1247 * @param SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF
1250 __STATIC_INLINE
void LL_RTC_SetSynchPrescaler(RTC_TypeDef
*RTCx
, uint32_t SynchPrescaler
)
1252 MODIFY_REG(RTCx
->PRER
, RTC_PRER_PREDIV_S
, SynchPrescaler
);
1256 * @brief Get Asynchronous prescaler factor
1257 * @rmtoll RTC_PRER PREDIV_A LL_RTC_GetAsynchPrescaler
1258 * @param RTCx RTC Instance
1259 * @retval Value between Min_Data = 0 and Max_Data = 0x7F
1261 __STATIC_INLINE
uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef
*RTCx
)
1263 return (uint32_t)(READ_BIT(RTCx
->PRER
, RTC_PRER_PREDIV_A
) >> RTC_PRER_PREDIV_A_Pos
);
1267 * @brief Get Synchronous prescaler factor
1268 * @rmtoll RTC_PRER PREDIV_S LL_RTC_GetSynchPrescaler
1269 * @param RTCx RTC Instance
1270 * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF
1272 __STATIC_INLINE
uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef
*RTCx
)
1274 return (uint32_t)(READ_BIT(RTCx
->PRER
, RTC_PRER_PREDIV_S
));
1278 * @brief Enable the write protection for RTC registers.
1279 * @rmtoll RTC_WPR KEY LL_RTC_EnableWriteProtection
1280 * @param RTCx RTC Instance
1283 __STATIC_INLINE
void LL_RTC_EnableWriteProtection(RTC_TypeDef
*RTCx
)
1285 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_DISABLE
);
1289 * @brief Disable the write protection for RTC registers.
1290 * @rmtoll RTC_WPR KEY LL_RTC_DisableWriteProtection
1291 * @param RTCx RTC Instance
1294 __STATIC_INLINE
void LL_RTC_DisableWriteProtection(RTC_TypeDef
*RTCx
)
1296 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_ENABLE_1
);
1297 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_ENABLE_2
);
1300 #if defined(RTC_CR_TAMPOE)
1302 * @brief Enable tamper output.
1303 * @note When the tamper output is enabled, all external and internal tamper flags
1304 * are ORed and routed to the TAMPALRM output.
1305 * @rmtoll RTC_CR TAMPOE LL_RTC_EnableTamperOutput
1306 * @param RTCx RTC Instance
1309 __STATIC_INLINE
void LL_RTC_EnableTamperOutput(RTC_TypeDef
*RTCx
)
1311 SET_BIT(RTCx
->CR
, RTC_CR_TAMPOE
);
1315 * @brief Disable tamper output.
1316 * @rmtoll RTC_CR TAMPOE LL_RTC_DisableTamperOutput
1317 * @param RTCx RTC Instance
1320 __STATIC_INLINE
void LL_RTC_DisableTamperOutput(RTC_TypeDef
*RTCx
)
1322 CLEAR_BIT(RTCx
->CR
, RTC_CR_TAMPOE
);
1326 * @brief Check if tamper output is enabled or not.
1327 * @rmtoll RTC_CR TAMPOE LL_RTC_IsTamperOutputEnabled
1328 * @param RTCx RTC Instance
1329 * @retval State of bit (1 or 0).
1331 __STATIC_INLINE
uint32_t LL_RTC_IsTamperOutputEnabled(RTC_TypeDef
*RTCx
)
1333 return ((READ_BIT(RTCx
->CR
, RTC_CR_TAMPOE
) == (RTC_CR_TAMPOE
)) ? 1UL : 0UL);
1335 #endif /* RTC_CR_TAMPOE */
1337 #if defined(RTC_CR_TAMPALRM_PU)
1339 * @brief Enable internal pull-up in output mode.
1340 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_EnableAlarmPullUp
1341 * @param RTCx RTC Instance
1344 __STATIC_INLINE
void LL_RTC_EnableAlarmPullUp(RTC_TypeDef
*RTCx
)
1346 SET_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_PU
);
1350 * @brief Disable internal pull-up in output mode.
1351 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_EnableAlarmPullUp
1352 * @param RTCx RTC Instance
1355 __STATIC_INLINE
void LL_RTC_DisableAlarmPullUp(RTC_TypeDef
*RTCx
)
1357 CLEAR_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_PU
);
1361 * @brief Check if internal pull-up in output mode is enabled or not.
1362 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_IsAlarmPullUpEnabled
1363 * @param RTCx RTC Instance
1364 * @retval State of bit (1 or 0).
1366 __STATIC_INLINE
uint32_t LL_RTC_IsAlarmPullUpEnabled(RTC_TypeDef
*RTCx
)
1368 return ((READ_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_PU
) == (RTC_CR_TAMPALRM_PU
)) ? 1UL : 0UL);
1370 #endif /* RTC_CR_TAMPALRM_PU */
1372 #if defined(RTC_CR_OUT2EN)
1374 * @brief Enable RTC_OUT2 output
1375 * @note RTC_OUT2 mapping depends on both OSEL (@ref LL_RTC_SetAlarmOutEvent)
1376 * and COE (@ref LL_RTC_CAL_SetOutputFreq) settings.
1377 * @note RTC_OUT2 isn't available ins VBAT mode.
1378 * @rmtoll RTC_CR OUT2EN LL_RTC_EnableOutput2
1379 * @param RTCx RTC Instance
1382 __STATIC_INLINE
void LL_RTC_EnableOutput2(RTC_TypeDef
*RTCx
)
1384 SET_BIT(RTCx
->CR
, RTC_CR_OUT2EN
);
1388 * @brief Disable RTC_OUT2 output
1389 * @rmtoll RTC_CR OUT2EN LL_RTC_DisableOutput2
1390 * @param RTCx RTC Instance
1393 __STATIC_INLINE
void LL_RTC_DisableOutput2(RTC_TypeDef
*RTCx
)
1395 CLEAR_BIT(RTCx
->CR
, RTC_CR_OUT2EN
);
1399 * @brief Check if RTC_OUT2 output is enabled or not.
1400 * @rmtoll RTC_CR OUT2EN LL_RTC_IsOutput2Enabled
1401 * @param RTCx RTC Instance
1402 * @retval State of bit (1 or 0).
1404 __STATIC_INLINE
uint32_t LL_RTC_IsOutput2Enabled(RTC_TypeDef
*RTCx
)
1406 return ((READ_BIT(RTCx
->CR
, RTC_CR_OUT2EN
) == (RTC_CR_OUT2EN
)) ? 1UL : 0UL);
1409 #endif /* RTC_CR_OUT2EN */
1411 #if defined(RTC_OR_OUT_RMP)
1413 * @brief Enable RTC_OUT remap
1414 * @rmtoll OR OUT_RMP LL_RTC_EnableOutRemap
1415 * @param RTCx RTC Instance
1418 __STATIC_INLINE
void LL_RTC_EnableOutRemap(RTC_TypeDef
*RTCx
)
1420 SET_BIT(RTCx
->OR
, RTC_OR_OUT_RMP
);
1424 * @brief Disable RTC_OUT remap
1425 * @rmtoll OR OUT_RMP LL_RTC_DisableOutRemap
1426 * @param RTCx RTC Instance
1429 __STATIC_INLINE
void LL_RTC_DisableOutRemap(RTC_TypeDef
*RTCx
)
1431 CLEAR_BIT(RTCx
->OR
, RTC_OR_OUT_RMP
);
1433 #endif /* RTC_OR_OUT_RMP */
1439 /** @defgroup RTC_LL_EF_Time Time
1444 * @brief Set time format (AM/24-hour or PM notation)
1445 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1446 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1447 * @rmtoll RTC_TR PM LL_RTC_TIME_SetFormat
1448 * @param RTCx RTC Instance
1449 * @param TimeFormat This parameter can be one of the following values:
1450 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1451 * @arg @ref LL_RTC_TIME_FORMAT_PM
1454 __STATIC_INLINE
void LL_RTC_TIME_SetFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
1456 MODIFY_REG(RTCx
->TR
, RTC_TR_PM
, TimeFormat
);
1460 * @brief Get time format (AM or PM notation)
1461 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1462 * before reading this bit
1463 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1464 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1465 * @rmtoll RTC_TR PM LL_RTC_TIME_GetFormat
1466 * @param RTCx RTC Instance
1467 * @retval Returned value can be one of the following values:
1468 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1469 * @arg @ref LL_RTC_TIME_FORMAT_PM
1471 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef
*RTCx
)
1473 return (uint32_t)(READ_BIT(RTCx
->TR
, RTC_TR_PM
));
1477 * @brief Set Hours in BCD format
1478 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1479 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1480 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format
1481 * @rmtoll RTC_TR HT LL_RTC_TIME_SetHour
1482 * RTC_TR HU LL_RTC_TIME_SetHour
1483 * @param RTCx RTC Instance
1484 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1487 __STATIC_INLINE
void LL_RTC_TIME_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
1489 MODIFY_REG(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
),
1490 (((Hours
& 0xF0U
) << (RTC_TR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_TR_HU_Pos
)));
1494 * @brief Get Hours in BCD format
1495 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1496 * before reading this bit
1497 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1498 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1499 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to
1501 * @rmtoll RTC_TR HT LL_RTC_TIME_GetHour
1502 * RTC_TR HU LL_RTC_TIME_GetHour
1503 * @param RTCx RTC Instance
1504 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1506 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef
*RTCx
)
1508 return (uint32_t)((READ_BIT(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
))) >> RTC_TR_HU_Pos
);
1512 * @brief Set Minutes in BCD format
1513 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1514 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1515 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1516 * @rmtoll RTC_TR MNT LL_RTC_TIME_SetMinute
1517 * RTC_TR MNU LL_RTC_TIME_SetMinute
1518 * @param RTCx RTC Instance
1519 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1522 __STATIC_INLINE
void LL_RTC_TIME_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
1524 MODIFY_REG(RTCx
->TR
, (RTC_TR_MNT
| RTC_TR_MNU
),
1525 (((Minutes
& 0xF0U
) << (RTC_TR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_TR_MNU_Pos
)));
1529 * @brief Get Minutes in BCD format
1530 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1531 * before reading this bit
1532 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1533 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1534 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD
1536 * @rmtoll RTC_TR MNT LL_RTC_TIME_GetMinute
1537 * RTC_TR MNU LL_RTC_TIME_GetMinute
1538 * @param RTCx RTC Instance
1539 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1541 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef
*RTCx
)
1543 return (uint32_t)(READ_BIT(RTCx
->TR
, (RTC_TR_MNT
| RTC_TR_MNU
)) >> RTC_TR_MNU_Pos
);
1547 * @brief Set Seconds in BCD format
1548 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1549 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1550 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1551 * @rmtoll RTC_TR ST LL_RTC_TIME_SetSecond
1552 * RTC_TR SU LL_RTC_TIME_SetSecond
1553 * @param RTCx RTC Instance
1554 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1557 __STATIC_INLINE
void LL_RTC_TIME_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
1559 MODIFY_REG(RTCx
->TR
, (RTC_TR_ST
| RTC_TR_SU
),
1560 (((Seconds
& 0xF0U
) << (RTC_TR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_TR_SU_Pos
)));
1564 * @brief Get Seconds in BCD format
1565 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1566 * before reading this bit
1567 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1568 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1569 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD
1571 * @rmtoll RTC_TR ST LL_RTC_TIME_GetSecond
1572 * RTC_TR SU LL_RTC_TIME_GetSecond
1573 * @param RTCx RTC Instance
1574 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1576 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef
*RTCx
)
1578 return (uint32_t)(READ_BIT(RTCx
->TR
, (RTC_TR_ST
| RTC_TR_SU
)) >> RTC_TR_SU_Pos
);
1582 * @brief Set time (hour, minute and second) in BCD format
1583 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1584 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1585 * @note TimeFormat and Hours should follow the same format
1586 * @rmtoll RTC_TR PM LL_RTC_TIME_Config
1587 * RTC_TR HT LL_RTC_TIME_Config
1588 * RTC_TR HU LL_RTC_TIME_Config
1589 * RTC_TR MNT LL_RTC_TIME_Config
1590 * RTC_TR MNU LL_RTC_TIME_Config
1591 * RTC_TR ST LL_RTC_TIME_Config
1592 * RTC_TR SU LL_RTC_TIME_Config
1593 * @param RTCx RTC Instance
1594 * @param Format12_24 This parameter can be one of the following values:
1595 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1596 * @arg @ref LL_RTC_TIME_FORMAT_PM
1597 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1598 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1599 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1602 __STATIC_INLINE
void LL_RTC_TIME_Config(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
, uint32_t Seconds
)
1606 temp
= Format12_24
| \
1607 (((Hours
& 0xF0U
) << (RTC_TR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_TR_HU_Pos
)) | \
1608 (((Minutes
& 0xF0U
) << (RTC_TR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_TR_MNU_Pos
)) | \
1609 (((Seconds
& 0xF0U
) << (RTC_TR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_TR_SU_Pos
));
1610 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
);
1614 * @brief Get time (hour, minute and second) in BCD format
1615 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1616 * before reading this bit
1617 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1618 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1619 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
1620 * are available to get independently each parameter.
1621 * @rmtoll RTC_TR HT LL_RTC_TIME_Get
1622 * RTC_TR HU LL_RTC_TIME_Get
1623 * RTC_TR MNT LL_RTC_TIME_Get
1624 * RTC_TR MNU LL_RTC_TIME_Get
1625 * RTC_TR ST LL_RTC_TIME_Get
1626 * RTC_TR SU LL_RTC_TIME_Get
1627 * @param RTCx RTC Instance
1628 * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
1630 __STATIC_INLINE
uint32_t LL_RTC_TIME_Get(RTC_TypeDef
*RTCx
)
1634 temp
= READ_BIT(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
| RTC_TR_MNT
| RTC_TR_MNU
| RTC_TR_ST
| RTC_TR_SU
));
1635 return (uint32_t)((((((temp
& RTC_TR_HT
) >> RTC_TR_HT_Pos
) << 4U) | ((temp
& RTC_TR_HU
) >> RTC_TR_HU_Pos
)) << RTC_OFFSET_HOUR
) | \
1636 (((((temp
& RTC_TR_MNT
) >> RTC_TR_MNT_Pos
) << 4U) | ((temp
& RTC_TR_MNU
) >> RTC_TR_MNU_Pos
)) << RTC_OFFSET_MINUTE
) | \
1637 ((((temp
& RTC_TR_ST
) >> RTC_TR_ST_Pos
) << 4U) | ((temp
& RTC_TR_SU
) >> RTC_TR_SU_Pos
)));
1641 * @brief Memorize whether the daylight saving time change has been performed
1642 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1643 * @rmtoll RTC_CR BKP LL_RTC_TIME_EnableDayLightStore
1644 * @param RTCx RTC Instance
1647 __STATIC_INLINE
void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef
*RTCx
)
1649 SET_BIT(RTCx
->CR
, RTC_CR_BKP
);
1653 * @brief Disable memorization whether the daylight saving time change has been performed.
1654 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1655 * @rmtoll RTC_CR BKP LL_RTC_TIME_DisableDayLightStore
1656 * @param RTCx RTC Instance
1659 __STATIC_INLINE
void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef
*RTCx
)
1661 CLEAR_BIT(RTCx
->CR
, RTC_CR_BKP
);
1665 * @brief Check if RTC Day Light Saving stored operation has been enabled or not
1666 * @rmtoll RTC_CR BKP LL_RTC_TIME_IsDayLightStoreEnabled
1667 * @param RTCx RTC Instance
1668 * @retval State of bit (1 or 0).
1670 __STATIC_INLINE
uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef
*RTCx
)
1672 return ((READ_BIT(RTCx
->CR
, RTC_CR_BKP
) == (RTC_CR_BKP
)) ? 1UL : 0UL);
1676 * @brief Subtract 1 hour (winter time change)
1677 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1678 * @rmtoll RTC_CR SUB1H LL_RTC_TIME_DecHour
1679 * @param RTCx RTC Instance
1682 __STATIC_INLINE
void LL_RTC_TIME_DecHour(RTC_TypeDef
*RTCx
)
1684 SET_BIT(RTCx
->CR
, RTC_CR_SUB1H
);
1688 * @brief Add 1 hour (summer time change)
1689 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1690 * @rmtoll RTC_CR ADD1H LL_RTC_TIME_IncHour
1691 * @param RTCx RTC Instance
1694 __STATIC_INLINE
void LL_RTC_TIME_IncHour(RTC_TypeDef
*RTCx
)
1696 SET_BIT(RTCx
->CR
, RTC_CR_ADD1H
);
1700 * @brief Get Sub second value in the synchronous prescaler counter.
1701 * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through
1702 * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar
1703 * SubSeconds value in second fraction ratio with time unit following
1705 * ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit
1706 * This conversion can be performed only if no shift operation is pending
1707 * (ie. SHFP=0) when PREDIV_S >= SS.
1708 * @rmtoll RTC_SSR SS LL_RTC_TIME_GetSubSecond
1709 * @param RTCx RTC Instance
1710 * @retval Sub second value (number between 0 and 65535)
1712 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef
*RTCx
)
1714 return (uint32_t)(READ_BIT(RTCx
->SSR
, RTC_SSR_SS
));
1718 * @brief Synchronize to a remote clock with a high degree of precision.
1719 * @note This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
1720 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1721 * @note When REFCKON is set, firmware must not write to Shift control register.
1722 * @rmtoll RTC_SHIFTR ADD1S LL_RTC_TIME_Synchronize
1723 * RTC_SHIFTR SUBFS LL_RTC_TIME_Synchronize
1724 * @param RTCx RTC Instance
1725 * @param ShiftSecond This parameter can be one of the following values:
1726 * @arg @ref LL_RTC_SHIFT_SECOND_DELAY
1727 * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE
1728 * @param Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF)
1731 __STATIC_INLINE
void LL_RTC_TIME_Synchronize(RTC_TypeDef
*RTCx
, uint32_t ShiftSecond
, uint32_t Fraction
)
1733 WRITE_REG(RTCx
->SHIFTR
, ShiftSecond
| Fraction
);
1740 /** @defgroup RTC_LL_EF_Date Date
1745 * @brief Set Year in BCD format
1746 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format
1747 * @rmtoll RTC_DR YT LL_RTC_DATE_SetYear
1748 * RTC_DR YU LL_RTC_DATE_SetYear
1749 * @param RTCx RTC Instance
1750 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1753 __STATIC_INLINE
void LL_RTC_DATE_SetYear(RTC_TypeDef
*RTCx
, uint32_t Year
)
1755 MODIFY_REG(RTCx
->DR
, (RTC_DR_YT
| RTC_DR_YU
),
1756 (((Year
& 0xF0U
) << (RTC_DR_YT_Pos
- 4U)) | ((Year
& 0x0FU
) << RTC_DR_YU_Pos
)));
1760 * @brief Get Year in BCD format
1761 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1762 * before reading this bit
1763 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
1764 * @rmtoll RTC_DR YT LL_RTC_DATE_GetYear
1765 * RTC_DR YU LL_RTC_DATE_GetYear
1766 * @param RTCx RTC Instance
1767 * @retval Value between Min_Data=0x00 and Max_Data=0x99
1769 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef
*RTCx
)
1771 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_YT
| RTC_DR_YU
))) >> RTC_DR_YU_Pos
);
1775 * @brief Set Week day
1776 * @rmtoll RTC_DR WDU LL_RTC_DATE_SetWeekDay
1777 * @param RTCx RTC Instance
1778 * @param WeekDay This parameter can be one of the following values:
1779 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1780 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1781 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1782 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1783 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1784 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1785 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1788 __STATIC_INLINE
void LL_RTC_DATE_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
1790 MODIFY_REG(RTCx
->DR
, RTC_DR_WDU
, WeekDay
<< RTC_DR_WDU_Pos
);
1794 * @brief Get Week day
1795 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1796 * before reading this bit
1797 * @rmtoll RTC_DR WDU LL_RTC_DATE_GetWeekDay
1798 * @param RTCx RTC Instance
1799 * @retval Returned value can be one of the following values:
1800 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1801 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1802 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1803 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1804 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1805 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1806 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1808 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef
*RTCx
)
1810 return (uint32_t)(READ_BIT(RTCx
->DR
, RTC_DR_WDU
) >> RTC_DR_WDU_Pos
);
1814 * @brief Set Month in BCD format
1815 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format
1816 * @rmtoll RTC_DR MT LL_RTC_DATE_SetMonth
1817 * RTC_DR MU LL_RTC_DATE_SetMonth
1818 * @param RTCx RTC Instance
1819 * @param Month This parameter can be one of the following values:
1820 * @arg @ref LL_RTC_MONTH_JANUARY
1821 * @arg @ref LL_RTC_MONTH_FEBRUARY
1822 * @arg @ref LL_RTC_MONTH_MARCH
1823 * @arg @ref LL_RTC_MONTH_APRIL
1824 * @arg @ref LL_RTC_MONTH_MAY
1825 * @arg @ref LL_RTC_MONTH_JUNE
1826 * @arg @ref LL_RTC_MONTH_JULY
1827 * @arg @ref LL_RTC_MONTH_AUGUST
1828 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1829 * @arg @ref LL_RTC_MONTH_OCTOBER
1830 * @arg @ref LL_RTC_MONTH_NOVEMBER
1831 * @arg @ref LL_RTC_MONTH_DECEMBER
1834 __STATIC_INLINE
void LL_RTC_DATE_SetMonth(RTC_TypeDef
*RTCx
, uint32_t Month
)
1836 MODIFY_REG(RTCx
->DR
, (RTC_DR_MT
| RTC_DR_MU
),
1837 (((Month
& 0xF0U
) << (RTC_DR_MT_Pos
- 4U)) | ((Month
& 0x0FU
) << RTC_DR_MU_Pos
)));
1841 * @brief Get Month in BCD format
1842 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1843 * before reading this bit
1844 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
1845 * @rmtoll RTC_DR MT LL_RTC_DATE_GetMonth
1846 * RTC_DR MU LL_RTC_DATE_GetMonth
1847 * @param RTCx RTC Instance
1848 * @retval Returned value can be one of the following values:
1849 * @arg @ref LL_RTC_MONTH_JANUARY
1850 * @arg @ref LL_RTC_MONTH_FEBRUARY
1851 * @arg @ref LL_RTC_MONTH_MARCH
1852 * @arg @ref LL_RTC_MONTH_APRIL
1853 * @arg @ref LL_RTC_MONTH_MAY
1854 * @arg @ref LL_RTC_MONTH_JUNE
1855 * @arg @ref LL_RTC_MONTH_JULY
1856 * @arg @ref LL_RTC_MONTH_AUGUST
1857 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1858 * @arg @ref LL_RTC_MONTH_OCTOBER
1859 * @arg @ref LL_RTC_MONTH_NOVEMBER
1860 * @arg @ref LL_RTC_MONTH_DECEMBER
1862 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef
*RTCx
)
1864 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_MT
| RTC_DR_MU
))) >> RTC_DR_MU_Pos
);
1868 * @brief Set Day in BCD format
1869 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1870 * @rmtoll RTC_DR DT LL_RTC_DATE_SetDay
1871 * RTC_DR DU LL_RTC_DATE_SetDay
1872 * @param RTCx RTC Instance
1873 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1876 __STATIC_INLINE
void LL_RTC_DATE_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
1878 MODIFY_REG(RTCx
->DR
, (RTC_DR_DT
| RTC_DR_DU
),
1879 (((Day
& 0xF0U
) << (RTC_DR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_DR_DU_Pos
)));
1883 * @brief Get Day in BCD format
1884 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1885 * before reading this bit
1886 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1887 * @rmtoll RTC_DR DT LL_RTC_DATE_GetDay
1888 * RTC_DR DU LL_RTC_DATE_GetDay
1889 * @param RTCx RTC Instance
1890 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1892 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef
*RTCx
)
1894 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_DT
| RTC_DR_DU
))) >> RTC_DR_DU_Pos
);
1898 * @brief Set date (WeekDay, Day, Month and Year) in BCD format
1899 * @rmtoll RTC_DR WDU LL_RTC_DATE_Config
1900 * RTC_DR MT LL_RTC_DATE_Config
1901 * RTC_DR MU LL_RTC_DATE_Config
1902 * RTC_DR DT LL_RTC_DATE_Config
1903 * RTC_DR DU LL_RTC_DATE_Config
1904 * RTC_DR YT LL_RTC_DATE_Config
1905 * RTC_DR YU LL_RTC_DATE_Config
1906 * @param RTCx RTC Instance
1907 * @param WeekDay This parameter can be one of the following values:
1908 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1909 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1910 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1911 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1912 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1913 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1914 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1915 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1916 * @param Month This parameter can be one of the following values:
1917 * @arg @ref LL_RTC_MONTH_JANUARY
1918 * @arg @ref LL_RTC_MONTH_FEBRUARY
1919 * @arg @ref LL_RTC_MONTH_MARCH
1920 * @arg @ref LL_RTC_MONTH_APRIL
1921 * @arg @ref LL_RTC_MONTH_MAY
1922 * @arg @ref LL_RTC_MONTH_JUNE
1923 * @arg @ref LL_RTC_MONTH_JULY
1924 * @arg @ref LL_RTC_MONTH_AUGUST
1925 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1926 * @arg @ref LL_RTC_MONTH_OCTOBER
1927 * @arg @ref LL_RTC_MONTH_NOVEMBER
1928 * @arg @ref LL_RTC_MONTH_DECEMBER
1929 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1932 __STATIC_INLINE
void LL_RTC_DATE_Config(RTC_TypeDef
*RTCx
, uint32_t WeekDay
, uint32_t Day
, uint32_t Month
, uint32_t Year
)
1936 temp
= (WeekDay
<< RTC_DR_WDU_Pos
) | \
1937 (((Year
& 0xF0U
) << (RTC_DR_YT_Pos
- 4U)) | ((Year
& 0x0FU
) << RTC_DR_YU_Pos
)) | \
1938 (((Month
& 0xF0U
) << (RTC_DR_MT_Pos
- 4U)) | ((Month
& 0x0FU
) << RTC_DR_MU_Pos
)) | \
1939 (((Day
& 0xF0U
) << (RTC_DR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_DR_DU_Pos
));
1941 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
);
1945 * @brief Get date (WeekDay, Day, Month and Year) in BCD format
1946 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1947 * before reading this bit
1948 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
1949 * and __LL_RTC_GET_DAY are available to get independently each parameter.
1950 * @rmtoll RTC_DR WDU LL_RTC_DATE_Get
1951 * RTC_DR MT LL_RTC_DATE_Get
1952 * RTC_DR MU LL_RTC_DATE_Get
1953 * RTC_DR DT LL_RTC_DATE_Get
1954 * RTC_DR DU LL_RTC_DATE_Get
1955 * RTC_DR YT LL_RTC_DATE_Get
1956 * RTC_DR YU LL_RTC_DATE_Get
1957 * @param RTCx RTC Instance
1958 * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY).
1960 __STATIC_INLINE
uint32_t LL_RTC_DATE_Get(RTC_TypeDef
*RTCx
)
1964 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
));
1965 return (uint32_t)((((temp
& RTC_DR_WDU
) >> RTC_DR_WDU_Pos
) << RTC_OFFSET_WEEKDAY
) | \
1966 (((((temp
& RTC_DR_DT
) >> RTC_DR_DT_Pos
) << 4U) | ((temp
& RTC_DR_DU
) >> RTC_DR_DU_Pos
)) << RTC_OFFSET_DAY
) | \
1967 (((((temp
& RTC_DR_MT
) >> RTC_DR_MT_Pos
) << 4U) | ((temp
& RTC_DR_MU
) >> RTC_DR_MU_Pos
)) << RTC_OFFSET_MONTH
) | \
1968 ((((temp
& RTC_DR_YT
) >> RTC_DR_YT_Pos
) << 4U) | ((temp
& RTC_DR_YU
) >> RTC_DR_YU_Pos
)));
1975 /** @defgroup RTC_LL_EF_ALARMA ALARMA
1980 * @brief Enable Alarm A
1981 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1982 * @rmtoll RTC_CR ALRAE LL_RTC_ALMA_Enable
1983 * @param RTCx RTC Instance
1986 __STATIC_INLINE
void LL_RTC_ALMA_Enable(RTC_TypeDef
*RTCx
)
1988 SET_BIT(RTCx
->CR
, RTC_CR_ALRAE
);
1992 * @brief Disable Alarm A
1993 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1994 * @rmtoll RTC_CR ALRAE LL_RTC_ALMA_Disable
1995 * @param RTCx RTC Instance
1998 __STATIC_INLINE
void LL_RTC_ALMA_Disable(RTC_TypeDef
*RTCx
)
2000 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRAE
);
2004 * @brief Specify the Alarm A masks.
2005 * @rmtoll RTC_ALRMAR MSK4 LL_RTC_ALMA_SetMask
2006 * RTC_ALRMAR MSK3 LL_RTC_ALMA_SetMask
2007 * RTC_ALRMAR MSK2 LL_RTC_ALMA_SetMask
2008 * RTC_ALRMAR MSK1 LL_RTC_ALMA_SetMask
2009 * @param RTCx RTC Instance
2010 * @param Mask This parameter can be a combination of the following values:
2011 * @arg @ref LL_RTC_ALMA_MASK_NONE
2012 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
2013 * @arg @ref LL_RTC_ALMA_MASK_HOURS
2014 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
2015 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
2016 * @arg @ref LL_RTC_ALMA_MASK_ALL
2019 __STATIC_INLINE
void LL_RTC_ALMA_SetMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2021 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_MSK4
| RTC_ALRMAR_MSK3
| RTC_ALRMAR_MSK2
| RTC_ALRMAR_MSK1
, Mask
);
2025 * @brief Get the Alarm A masks.
2026 * @rmtoll RTC_ALRMAR MSK4 LL_RTC_ALMA_GetMask
2027 * RTC_ALRMAR MSK3 LL_RTC_ALMA_GetMask
2028 * RTC_ALRMAR MSK2 LL_RTC_ALMA_GetMask
2029 * RTC_ALRMAR MSK1 LL_RTC_ALMA_GetMask
2030 * @param RTCx RTC Instance
2031 * @retval Returned value can be can be a combination of the following values:
2032 * @arg @ref LL_RTC_ALMA_MASK_NONE
2033 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
2034 * @arg @ref LL_RTC_ALMA_MASK_HOURS
2035 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
2036 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
2037 * @arg @ref LL_RTC_ALMA_MASK_ALL
2039 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef
*RTCx
)
2041 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_MSK4
| RTC_ALRMAR_MSK3
| RTC_ALRMAR_MSK2
| RTC_ALRMAR_MSK1
));
2045 * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
2046 * @rmtoll RTC_ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday
2047 * @param RTCx RTC Instance
2050 __STATIC_INLINE
void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef
*RTCx
)
2052 SET_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_WDSEL
);
2056 * @brief Disable AlarmA Week day selection (DU[3:0] represents the date )
2057 * @rmtoll RTC_ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday
2058 * @param RTCx RTC Instance
2061 __STATIC_INLINE
void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef
*RTCx
)
2063 CLEAR_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_WDSEL
);
2067 * @brief Set ALARM A Day in BCD format
2068 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
2069 * @rmtoll RTC_ALRMAR DT LL_RTC_ALMA_SetDay
2070 * RTC_ALRMAR DU LL_RTC_ALMA_SetDay
2071 * @param RTCx RTC Instance
2072 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
2075 __STATIC_INLINE
void LL_RTC_ALMA_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
2077 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_DT
| RTC_ALRMAR_DU
),
2078 (((Day
& 0xF0U
) << (RTC_ALRMAR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_ALRMAR_DU_Pos
)));
2082 * @brief Get ALARM A Day in BCD format
2083 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2084 * @rmtoll RTC_ALRMAR DT LL_RTC_ALMA_GetDay
2085 * RTC_ALRMAR DU LL_RTC_ALMA_GetDay
2086 * @param RTCx RTC Instance
2087 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2089 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef
*RTCx
)
2091 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_DT
| RTC_ALRMAR_DU
))) >> RTC_ALRMAR_DU_Pos
);
2095 * @brief Set ALARM A Weekday
2096 * @rmtoll RTC_ALRMAR DU LL_RTC_ALMA_SetWeekDay
2097 * @param RTCx RTC Instance
2098 * @param WeekDay This parameter can be one of the following values:
2099 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2100 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2101 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2102 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2103 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2104 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2105 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2108 __STATIC_INLINE
void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
2110 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_DU
, WeekDay
<< RTC_ALRMAR_DU_Pos
);
2114 * @brief Get ALARM A Weekday
2115 * @rmtoll RTC_ALRMAR DU LL_RTC_ALMA_GetWeekDay
2116 * @param RTCx RTC Instance
2117 * @retval Returned value can be one of the following values:
2118 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2119 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2120 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2121 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2122 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2123 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2124 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2126 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef
*RTCx
)
2128 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_DU
) >> RTC_ALRMAR_DU_Pos
);
2132 * @brief Set Alarm A time format (AM/24-hour or PM notation)
2133 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_SetTimeFormat
2134 * @param RTCx RTC Instance
2135 * @param TimeFormat This parameter can be one of the following values:
2136 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
2137 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
2140 __STATIC_INLINE
void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
2142 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_PM
, TimeFormat
);
2146 * @brief Get Alarm A time format (AM or PM notation)
2147 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_GetTimeFormat
2148 * @param RTCx RTC Instance
2149 * @retval Returned value can be one of the following values:
2150 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
2151 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
2153 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef
*RTCx
)
2155 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_PM
));
2159 * @brief Set ALARM A Hours in BCD format
2160 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
2161 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_SetHour
2162 * RTC_ALRMAR HU LL_RTC_ALMA_SetHour
2163 * @param RTCx RTC Instance
2164 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2167 __STATIC_INLINE
void LL_RTC_ALMA_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
2169 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_HT
| RTC_ALRMAR_HU
),
2170 (((Hours
& 0xF0U
) << (RTC_ALRMAR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMAR_HU_Pos
)));
2174 * @brief Get ALARM A Hours in BCD format
2175 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2176 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_GetHour
2177 * RTC_ALRMAR HU LL_RTC_ALMA_GetHour
2178 * @param RTCx RTC Instance
2179 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2181 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef
*RTCx
)
2183 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_HT
| RTC_ALRMAR_HU
))) >> RTC_ALRMAR_HU_Pos
);
2187 * @brief Set ALARM A Minutes in BCD format
2188 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
2189 * @rmtoll RTC_ALRMAR MNT LL_RTC_ALMA_SetMinute
2190 * RTC_ALRMAR MNU LL_RTC_ALMA_SetMinute
2191 * @param RTCx RTC Instance
2192 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2195 __STATIC_INLINE
void LL_RTC_ALMA_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
2197 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
),
2198 (((Minutes
& 0xF0U
) << (RTC_ALRMAR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMAR_MNU_Pos
)));
2202 * @brief Get ALARM A Minutes in BCD format
2203 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2204 * @rmtoll RTC_ALRMAR MNT LL_RTC_ALMA_GetMinute
2205 * RTC_ALRMAR MNU LL_RTC_ALMA_GetMinute
2206 * @param RTCx RTC Instance
2207 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2209 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef
*RTCx
)
2211 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
))) >> RTC_ALRMAR_MNU_Pos
);
2215 * @brief Set ALARM A Seconds in BCD format
2216 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
2217 * @rmtoll RTC_ALRMAR ST LL_RTC_ALMA_SetSecond
2218 * RTC_ALRMAR SU LL_RTC_ALMA_SetSecond
2219 * @param RTCx RTC Instance
2220 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2223 __STATIC_INLINE
void LL_RTC_ALMA_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
2225 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_ST
| RTC_ALRMAR_SU
),
2226 (((Seconds
& 0xF0U
) << (RTC_ALRMAR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMAR_SU_Pos
)));
2230 * @brief Get ALARM A Seconds in BCD format
2231 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2232 * @rmtoll RTC_ALRMAR ST LL_RTC_ALMA_GetSecond
2233 * RTC_ALRMAR SU LL_RTC_ALMA_GetSecond
2234 * @param RTCx RTC Instance
2235 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2237 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef
*RTCx
)
2239 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_ST
| RTC_ALRMAR_SU
))) >> RTC_ALRMAR_SU_Pos
);
2243 * @brief Set Alarm A Time (hour, minute and second) in BCD format
2244 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_ConfigTime
2245 * RTC_ALRMAR HT LL_RTC_ALMA_ConfigTime
2246 * RTC_ALRMAR HU LL_RTC_ALMA_ConfigTime
2247 * RTC_ALRMAR MNT LL_RTC_ALMA_ConfigTime
2248 * RTC_ALRMAR MNU LL_RTC_ALMA_ConfigTime
2249 * RTC_ALRMAR ST LL_RTC_ALMA_ConfigTime
2250 * RTC_ALRMAR SU LL_RTC_ALMA_ConfigTime
2251 * @param RTCx RTC Instance
2252 * @param Format12_24 This parameter can be one of the following values:
2253 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
2254 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
2255 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2256 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2257 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2260 __STATIC_INLINE
void LL_RTC_ALMA_ConfigTime(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
, uint32_t Seconds
)
2264 temp
= Format12_24
| (((Hours
& 0xF0U
) << (RTC_ALRMAR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMAR_HU_Pos
)) | \
2265 (((Minutes
& 0xF0U
) << (RTC_ALRMAR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMAR_MNU_Pos
)) | \
2266 (((Seconds
& 0xF0U
) << (RTC_ALRMAR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMAR_SU_Pos
));
2268 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
);
2272 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2273 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2274 * are available to get independently each parameter.
2275 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_GetTime
2276 * RTC_ALRMAR HU LL_RTC_ALMA_GetTime
2277 * RTC_ALRMAR MNT LL_RTC_ALMA_GetTime
2278 * RTC_ALRMAR MNU LL_RTC_ALMA_GetTime
2279 * RTC_ALRMAR ST LL_RTC_ALMA_GetTime
2280 * RTC_ALRMAR SU LL_RTC_ALMA_GetTime
2281 * @param RTCx RTC Instance
2282 * @retval Combination of hours, minutes and seconds.
2284 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef
*RTCx
)
2286 return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx
) << RTC_OFFSET_HOUR
) | (LL_RTC_ALMA_GetMinute(RTCx
) << RTC_OFFSET_MINUTE
) | LL_RTC_ALMA_GetSecond(RTCx
));
2290 * @brief Set Alarm A Mask the most-significant bits starting at this bit
2291 * @note This register can be written only when ALRAE is reset in RTC_CR register,
2292 * or in initialization mode.
2293 * @rmtoll RTC_ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask
2294 * @param RTCx RTC Instance
2295 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2298 __STATIC_INLINE
void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2300 MODIFY_REG(RTCx
->ALRMASSR
, RTC_ALRMASSR_MASKSS
, Mask
<< RTC_ALRMASSR_MASKSS_Pos
);
2304 * @brief Get Alarm A Mask the most-significant bits starting at this bit
2305 * @rmtoll RTC_ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask
2306 * @param RTCx RTC Instance
2307 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2309 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef
*RTCx
)
2311 return (uint32_t)(READ_BIT(RTCx
->ALRMASSR
, RTC_ALRMASSR_MASKSS
) >> RTC_ALRMASSR_MASKSS_Pos
);
2315 * @brief Set Alarm A Sub seconds value
2316 * @rmtoll RCT_ALRMASSR SS LL_RTC_ALMA_SetSubSecond
2317 * @param RTCx RTC Instance
2318 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2321 __STATIC_INLINE
void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef
*RTCx
, uint32_t Subsecond
)
2323 MODIFY_REG(RTCx
->ALRMASSR
, RTC_ALRMASSR_SS
, Subsecond
);
2327 * @brief Get Alarm A Sub seconds value
2328 * @rmtoll RCT_ALRMASSR SS LL_RTC_ALMA_GetSubSecond
2329 * @param RTCx RTC Instance
2330 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2332 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef
*RTCx
)
2334 return (uint32_t)(READ_BIT(RTCx
->ALRMASSR
, RTC_ALRMASSR_SS
));
2341 /** @defgroup RTC_LL_EF_ALARMB ALARMB
2346 * @brief Enable Alarm B
2347 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2348 * @rmtoll RTC_CR ALRBE LL_RTC_ALMB_Enable
2349 * @param RTCx RTC Instance
2352 __STATIC_INLINE
void LL_RTC_ALMB_Enable(RTC_TypeDef
*RTCx
)
2354 SET_BIT(RTCx
->CR
, RTC_CR_ALRBE
);
2358 * @brief Disable Alarm B
2359 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2360 * @rmtoll RTC_CR ALRBE LL_RTC_ALMB_Disable
2361 * @param RTCx RTC Instance
2364 __STATIC_INLINE
void LL_RTC_ALMB_Disable(RTC_TypeDef
*RTCx
)
2366 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRBE
);
2370 * @brief Specify the Alarm B masks.
2371 * @rmtoll RTC_ALRMBR MSK4 LL_RTC_ALMB_SetMask
2372 * RTC_ALRMBR MSK3 LL_RTC_ALMB_SetMask
2373 * RTC_ALRMBR MSK2 LL_RTC_ALMB_SetMask
2374 * RTC_ALRMBR MSK1 LL_RTC_ALMB_SetMask
2375 * @param RTCx RTC Instance
2376 * @param Mask This parameter can be a combination of the following values:
2377 * @arg @ref LL_RTC_ALMB_MASK_NONE
2378 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
2379 * @arg @ref LL_RTC_ALMB_MASK_HOURS
2380 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
2381 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
2382 * @arg @ref LL_RTC_ALMB_MASK_ALL
2385 __STATIC_INLINE
void LL_RTC_ALMB_SetMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2387 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_MSK4
| RTC_ALRMBR_MSK3
| RTC_ALRMBR_MSK2
| RTC_ALRMBR_MSK1
, Mask
);
2391 * @brief Get the Alarm B masks.
2392 * @rmtoll RTC_ALRMBR MSK4 LL_RTC_ALMB_GetMask
2393 * RTC_ALRMBR MSK3 LL_RTC_ALMB_GetMask
2394 * RTC_ALRMBR MSK2 LL_RTC_ALMB_GetMask
2395 * RTC_ALRMBR MSK1 LL_RTC_ALMB_GetMask
2396 * @param RTCx RTC Instance
2397 * @retval Returned value can be can be a combination of the following values:
2398 * @arg @ref LL_RTC_ALMB_MASK_NONE
2399 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
2400 * @arg @ref LL_RTC_ALMB_MASK_HOURS
2401 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
2402 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
2403 * @arg @ref LL_RTC_ALMB_MASK_ALL
2405 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef
*RTCx
)
2407 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_MSK4
| RTC_ALRMBR_MSK3
| RTC_ALRMBR_MSK2
| RTC_ALRMBR_MSK1
));
2411 * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
2412 * @rmtoll RTC_ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday
2413 * @param RTCx RTC Instance
2416 __STATIC_INLINE
void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef
*RTCx
)
2418 SET_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_WDSEL
);
2422 * @brief Disable AlarmB Week day selection (DU[3:0] represents the date )
2423 * @rmtoll RTC_ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday
2424 * @param RTCx RTC Instance
2427 __STATIC_INLINE
void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef
*RTCx
)
2429 CLEAR_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_WDSEL
);
2433 * @brief Set ALARM B Day in BCD format
2434 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
2435 * @rmtoll RTC_ALRMBR DT LL_RTC_ALMB_SetDay
2436 * RTC_ALRMBR DU LL_RTC_ALMB_SetDay
2437 * @param RTCx RTC Instance
2438 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
2441 __STATIC_INLINE
void LL_RTC_ALMB_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
2443 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_DT
| RTC_ALRMBR_DU
),
2444 (((Day
& 0xF0U
) << (RTC_ALRMBR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_ALRMBR_DU_Pos
)));
2448 * @brief Get ALARM B Day in BCD format
2449 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2450 * @rmtoll RTC_ALRMBR DT LL_RTC_ALMB_GetDay
2451 * RTC_ALRMBR DU LL_RTC_ALMB_GetDay
2452 * @param RTCx RTC Instance
2453 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2455 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef
*RTCx
)
2457 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_DT
| RTC_ALRMBR_DU
))) >> RTC_ALRMBR_DU_Pos
);
2461 * @brief Set ALARM B Weekday
2462 * @rmtoll RTC_ALRMBR DU LL_RTC_ALMB_SetWeekDay
2463 * @param RTCx RTC Instance
2464 * @param WeekDay This parameter can be one of the following values:
2465 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2466 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2467 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2468 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2469 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2470 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2471 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2474 __STATIC_INLINE
void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
2476 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_DU
, WeekDay
<< RTC_ALRMBR_DU_Pos
);
2480 * @brief Get ALARM B Weekday
2481 * @rmtoll RTC_ALRMBR DU LL_RTC_ALMB_GetWeekDay
2482 * @param RTCx RTC Instance
2483 * @retval Returned value can be one of the following values:
2484 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2485 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2486 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2487 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2488 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2489 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2490 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2492 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef
*RTCx
)
2494 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_DU
) >> RTC_ALRMBR_DU_Pos
);
2498 * @brief Set ALARM B time format (AM/24-hour or PM notation)
2499 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_SetTimeFormat
2500 * @param RTCx RTC Instance
2501 * @param TimeFormat This parameter can be one of the following values:
2502 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2503 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2506 __STATIC_INLINE
void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
2508 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_PM
, TimeFormat
);
2512 * @brief Get ALARM B time format (AM or PM notation)
2513 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_GetTimeFormat
2514 * @param RTCx RTC Instance
2515 * @retval Returned value can be one of the following values:
2516 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2517 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2519 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef
*RTCx
)
2521 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_PM
));
2525 * @brief Set ALARM B Hours in BCD format
2526 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
2527 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_SetHour
2528 * RTC_ALRMBR HU LL_RTC_ALMB_SetHour
2529 * @param RTCx RTC Instance
2530 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2533 __STATIC_INLINE
void LL_RTC_ALMB_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
2535 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_HT
| RTC_ALRMBR_HU
),
2536 (((Hours
& 0xF0U
) << (RTC_ALRMBR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMBR_HU_Pos
)));
2540 * @brief Get ALARM B Hours in BCD format
2541 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2542 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_GetHour
2543 * RTC_ALRMBR HU LL_RTC_ALMB_GetHour
2544 * @param RTCx RTC Instance
2545 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2547 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef
*RTCx
)
2549 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_HT
| RTC_ALRMBR_HU
))) >> RTC_ALRMBR_HU_Pos
);
2553 * @brief Set ALARM B Minutes in BCD format
2554 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
2555 * @rmtoll RTC_ALRMBR MNT LL_RTC_ALMB_SetMinute
2556 * RTC_ALRMBR MNU LL_RTC_ALMB_SetMinute
2557 * @param RTCx RTC Instance
2558 * @param Minutes between Min_Data=0x00 and Max_Data=0x59
2561 __STATIC_INLINE
void LL_RTC_ALMB_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
2563 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
),
2564 (((Minutes
& 0xF0U
) << (RTC_ALRMBR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMBR_MNU_Pos
)));
2568 * @brief Get ALARM B Minutes in BCD format
2569 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2570 * @rmtoll RTC_ALRMBR MNT LL_RTC_ALMB_GetMinute
2571 * RTC_ALRMBR MNU LL_RTC_ALMB_GetMinute
2572 * @param RTCx RTC Instance
2573 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2575 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef
*RTCx
)
2577 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
))) >> RTC_ALRMBR_MNU_Pos
);
2581 * @brief Set ALARM B Seconds in BCD format
2582 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
2583 * @rmtoll RTC_ALRMBR ST LL_RTC_ALMB_SetSecond
2584 * RTC_ALRMBR SU LL_RTC_ALMB_SetSecond
2585 * @param RTCx RTC Instance
2586 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2589 __STATIC_INLINE
void LL_RTC_ALMB_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
2591 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_ST
| RTC_ALRMBR_SU
),
2592 (((Seconds
& 0xF0U
) << (RTC_ALRMBR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMBR_SU_Pos
)));
2596 * @brief Get ALARM B Seconds in BCD format
2597 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2598 * @rmtoll RTC_ALRMBR ST LL_RTC_ALMB_GetSecond
2599 * RTC_ALRMBR SU LL_RTC_ALMB_GetSecond
2600 * @param RTCx RTC Instance
2601 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2603 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef
*RTCx
)
2605 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_ST
| RTC_ALRMBR_SU
))) >> RTC_ALRMBR_SU_Pos
);
2609 * @brief Set Alarm B Time (hour, minute and second) in BCD format
2610 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_ConfigTime
2611 * RTC_ALRMBR HT LL_RTC_ALMB_ConfigTime
2612 * RTC_ALRMBR HU LL_RTC_ALMB_ConfigTime
2613 * RTC_ALRMBR MNT LL_RTC_ALMB_ConfigTime
2614 * RTC_ALRMBR MNU LL_RTC_ALMB_ConfigTime
2615 * RTC_ALRMBR ST LL_RTC_ALMB_ConfigTime
2616 * RTC_ALRMBR SU LL_RTC_ALMB_ConfigTime
2617 * @param RTCx RTC Instance
2618 * @param Format12_24 This parameter can be one of the following values:
2619 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2620 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2621 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2622 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2623 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2626 __STATIC_INLINE
void LL_RTC_ALMB_ConfigTime(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
, uint32_t Seconds
)
2630 temp
= Format12_24
| (((Hours
& 0xF0U
) << (RTC_ALRMBR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMBR_HU_Pos
)) | \
2631 (((Minutes
& 0xF0U
) << (RTC_ALRMBR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMBR_MNU_Pos
)) | \
2632 (((Seconds
& 0xF0U
) << (RTC_ALRMBR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMBR_SU_Pos
));
2634 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
);
2638 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2639 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2640 * are available to get independently each parameter.
2641 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_GetTime
2642 * RTC_ALRMBR HU LL_RTC_ALMB_GetTime
2643 * RTC_ALRMBR MNT LL_RTC_ALMB_GetTime
2644 * RTC_ALRMBR MNU LL_RTC_ALMB_GetTime
2645 * RTC_ALRMBR ST LL_RTC_ALMB_GetTime
2646 * RTC_ALRMBR SU LL_RTC_ALMB_GetTime
2647 * @param RTCx RTC Instance
2648 * @retval Combination of hours, minutes and seconds.
2650 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef
*RTCx
)
2652 return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx
) << RTC_OFFSET_HOUR
) | (LL_RTC_ALMB_GetMinute(RTCx
) << RTC_OFFSET_MINUTE
) | LL_RTC_ALMB_GetSecond(RTCx
));
2656 * @brief Set Alarm B Mask the most-significant bits starting at this bit
2657 * @note This register can be written only when ALRBE is reset in RTC_CR register,
2658 * or in initialization mode.
2659 * @rmtoll RTC_ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask
2660 * @param RTCx RTC Instance
2661 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2664 __STATIC_INLINE
void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2666 MODIFY_REG(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_MASKSS
, Mask
<< RTC_ALRMBSSR_MASKSS_Pos
);
2670 * @brief Get Alarm B Mask the most-significant bits starting at this bit
2671 * @rmtoll RTC_ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask
2672 * @param RTCx RTC Instance
2673 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2675 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef
*RTCx
)
2677 return (uint32_t)(READ_BIT(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_MASKSS
) >> RTC_ALRMBSSR_MASKSS_Pos
);
2681 * @brief Set Alarm B Sub seconds value
2682 * @rmtoll RTC_ALRMBSSR SS LL_RTC_ALMB_SetSubSecond
2683 * @param RTCx RTC Instance
2684 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2687 __STATIC_INLINE
void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef
*RTCx
, uint32_t Subsecond
)
2689 MODIFY_REG(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_SS
, Subsecond
);
2693 * @brief Get Alarm B Sub seconds value
2694 * @rmtoll RTC_ALRMBSSR SS LL_RTC_ALMB_GetSubSecond
2695 * @param RTCx RTC Instance
2696 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2698 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef
*RTCx
)
2700 return (uint32_t)(READ_BIT(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_SS
));
2707 /** @defgroup RTC_LL_EF_Timestamp Timestamp
2712 * @brief Enable internal event timestamp
2713 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2714 * @rmtoll RTC_CR ITSE LL_RTC_TS_EnableInternalEvent
2715 * @param RTCx RTC Instance
2718 __STATIC_INLINE
void LL_RTC_TS_EnableInternalEvent(RTC_TypeDef
*RTCx
)
2720 SET_BIT(RTCx
->CR
, RTC_CR_ITSE
);
2724 * @brief Disable internal event timestamp
2725 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2726 * @rmtoll RTC_CR ITSE LL_RTC_TS_DisableInternalEvent
2727 * @param RTCx RTC Instance
2730 __STATIC_INLINE
void LL_RTC_TS_DisableInternalEvent(RTC_TypeDef
*RTCx
)
2732 CLEAR_BIT(RTCx
->CR
, RTC_CR_ITSE
);
2736 * @brief Enable Timestamp
2737 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2738 * @rmtoll RTC_CR TSE LL_RTC_TS_Enable
2739 * @param RTCx RTC Instance
2742 __STATIC_INLINE
void LL_RTC_TS_Enable(RTC_TypeDef
*RTCx
)
2744 SET_BIT(RTCx
->CR
, RTC_CR_TSE
);
2748 * @brief Disable Timestamp
2749 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2750 * @rmtoll RTC_CR TSE LL_RTC_TS_Disable
2751 * @param RTCx RTC Instance
2754 __STATIC_INLINE
void LL_RTC_TS_Disable(RTC_TypeDef
*RTCx
)
2756 CLEAR_BIT(RTCx
->CR
, RTC_CR_TSE
);
2760 * @brief Set Time-stamp event active edge
2761 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2762 * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting
2763 * @rmtoll RTC_CR TSEDGE LL_RTC_TS_SetActiveEdge
2764 * @param RTCx RTC Instance
2765 * @param Edge This parameter can be one of the following values:
2766 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2767 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2770 __STATIC_INLINE
void LL_RTC_TS_SetActiveEdge(RTC_TypeDef
*RTCx
, uint32_t Edge
)
2772 MODIFY_REG(RTCx
->CR
, RTC_CR_TSEDGE
, Edge
);
2776 * @brief Get Time-stamp event active edge
2777 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2778 * @rmtoll RTC_CR TSEDGE LL_RTC_TS_GetActiveEdge
2779 * @param RTCx RTC Instance
2780 * @retval Returned value can be one of the following values:
2781 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2782 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2784 __STATIC_INLINE
uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef
*RTCx
)
2786 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_TSEDGE
));
2790 * @brief Get Timestamp AM/PM notation (AM or 24-hour format)
2791 * @rmtoll RTC_TSTR PM LL_RTC_TS_GetTimeFormat
2792 * @param RTCx RTC Instance
2793 * @retval Returned value can be one of the following values:
2794 * @arg @ref LL_RTC_TS_TIME_FORMAT_AM
2795 * @arg @ref LL_RTC_TS_TIME_FORMAT_PM
2797 __STATIC_INLINE
uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef
*RTCx
)
2799 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_PM
));
2803 * @brief Get Timestamp Hours in BCD format
2804 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2805 * @rmtoll RTC_TSTR HT LL_RTC_TS_GetHour
2806 * RTC_TSTR HU LL_RTC_TS_GetHour
2807 * @param RTCx RTC Instance
2808 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2810 __STATIC_INLINE
uint32_t LL_RTC_TS_GetHour(RTC_TypeDef
*RTCx
)
2812 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_HT
| RTC_TSTR_HU
) >> RTC_TSTR_HU_Pos
);
2816 * @brief Get Timestamp Minutes in BCD format
2817 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2818 * @rmtoll RTC_TSTR MNT LL_RTC_TS_GetMinute
2819 * RTC_TSTR MNU LL_RTC_TS_GetMinute
2820 * @param RTCx RTC Instance
2821 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2823 __STATIC_INLINE
uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef
*RTCx
)
2825 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_MNT
| RTC_TSTR_MNU
) >> RTC_TSTR_MNU_Pos
);
2829 * @brief Get Timestamp Seconds in BCD format
2830 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2831 * @rmtoll RTC_TSTR ST LL_RTC_TS_GetSecond
2832 * RTC_TSTR SU LL_RTC_TS_GetSecond
2833 * @param RTCx RTC Instance
2834 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2836 __STATIC_INLINE
uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef
*RTCx
)
2838 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_ST
| RTC_TSTR_SU
));
2842 * @brief Get Timestamp time (hour, minute and second) in BCD format
2843 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2844 * are available to get independently each parameter.
2845 * @rmtoll RTC_TSTR HT LL_RTC_TS_GetTime
2846 * RTC_TSTR HU LL_RTC_TS_GetTime
2847 * RTC_TSTR MNT LL_RTC_TS_GetTime
2848 * RTC_TSTR MNU LL_RTC_TS_GetTime
2849 * RTC_TSTR ST LL_RTC_TS_GetTime
2850 * RTC_TSTR SU LL_RTC_TS_GetTime
2851 * @param RTCx RTC Instance
2852 * @retval Combination of hours, minutes and seconds.
2854 __STATIC_INLINE
uint32_t LL_RTC_TS_GetTime(RTC_TypeDef
*RTCx
)
2856 return (uint32_t)(READ_BIT(RTCx
->TSTR
,
2857 RTC_TSTR_HT
| RTC_TSTR_HU
| RTC_TSTR_MNT
| RTC_TSTR_MNU
| RTC_TSTR_ST
| RTC_TSTR_SU
));
2861 * @brief Get Timestamp Week day
2862 * @rmtoll RTC_TSDR WDU LL_RTC_TS_GetWeekDay
2863 * @param RTCx RTC Instance
2864 * @retval Returned value can be one of the following values:
2865 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2866 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2867 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2868 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2869 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2870 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2871 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2873 __STATIC_INLINE
uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef
*RTCx
)
2875 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_WDU
) >> RTC_TSDR_WDU_Pos
);
2879 * @brief Get Timestamp Month in BCD format
2880 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
2881 * @rmtoll RTC_TSDR MT LL_RTC_TS_GetMonth
2882 * RTC_TSDR MU LL_RTC_TS_GetMonth
2883 * @param RTCx RTC Instance
2884 * @retval Returned value can be one of the following values:
2885 * @arg @ref LL_RTC_MONTH_JANUARY
2886 * @arg @ref LL_RTC_MONTH_FEBRUARY
2887 * @arg @ref LL_RTC_MONTH_MARCH
2888 * @arg @ref LL_RTC_MONTH_APRIL
2889 * @arg @ref LL_RTC_MONTH_MAY
2890 * @arg @ref LL_RTC_MONTH_JUNE
2891 * @arg @ref LL_RTC_MONTH_JULY
2892 * @arg @ref LL_RTC_MONTH_AUGUST
2893 * @arg @ref LL_RTC_MONTH_SEPTEMBER
2894 * @arg @ref LL_RTC_MONTH_OCTOBER
2895 * @arg @ref LL_RTC_MONTH_NOVEMBER
2896 * @arg @ref LL_RTC_MONTH_DECEMBER
2898 __STATIC_INLINE
uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef
*RTCx
)
2900 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_MT
| RTC_TSDR_MU
) >> RTC_TSDR_MU_Pos
);
2904 * @brief Get Timestamp Day in BCD format
2905 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2906 * @rmtoll RTC_TSDR DT LL_RTC_TS_GetDay
2907 * RTC_TSDR DU LL_RTC_TS_GetDay
2908 * @param RTCx RTC Instance
2909 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2911 __STATIC_INLINE
uint32_t LL_RTC_TS_GetDay(RTC_TypeDef
*RTCx
)
2913 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_DT
| RTC_TSDR_DU
));
2917 * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format
2918 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH,
2919 * and __LL_RTC_GET_DAY are available to get independently each parameter.
2920 * @rmtoll RTC_TSDR WDU LL_RTC_TS_GetDate
2921 * RTC_TSDR MT LL_RTC_TS_GetDate
2922 * RTC_TSDR MU LL_RTC_TS_GetDate
2923 * RTC_TSDR DT LL_RTC_TS_GetDate
2924 * RTC_TSDR DU LL_RTC_TS_GetDate
2925 * @param RTCx RTC Instance
2926 * @retval Combination of Weekday, Day and Month
2928 __STATIC_INLINE
uint32_t LL_RTC_TS_GetDate(RTC_TypeDef
*RTCx
)
2930 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_WDU
| RTC_TSDR_MT
| RTC_TSDR_MU
| RTC_TSDR_DT
| RTC_TSDR_DU
));
2934 * @brief Get time-stamp sub second value
2935 * @rmtoll RTC_TSSSR SS LL_RTC_TS_GetSubSecond
2936 * @param RTCx RTC Instance
2937 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
2939 __STATIC_INLINE
uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef
*RTCx
)
2941 return (uint32_t)(READ_BIT(RTCx
->TSSSR
, RTC_TSSSR_SS
));
2948 /** @defgroup RTC_LL_EF_Tamper_Timestamp Time-stamp on Tamper
2952 #if defined(RTC_TAMPCR_TAMPTS)
2954 * @brief Activate timestamp on tamper detection event
2955 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_EnableOnTamper
2956 * @param RTCx RTC Instance
2959 __STATIC_INLINE
void LL_RTC_TS_EnableOnTamper(RTC_TypeDef
*RTCx
)
2961 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPTS
);
2965 * @brief Disable timestamp on tamper detection event
2966 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_DisableOnTamper
2967 * @param RTCx RTC Instance
2970 __STATIC_INLINE
void LL_RTC_TS_DisableOnTamper(RTC_TypeDef
*RTCx
)
2972 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPTS
);
2974 #endif /* RTC_TAMPCR_TAMPTS */
2976 #if defined(RTC_CR_TAMPTS)
2978 * @brief Activate timestamp on tamper detection event
2979 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_EnableOnTamper
2980 * @param RTCx RTC Instance
2984 __STATIC_INLINE
void LL_RTC_TS_EnableOnTamper(RTC_TypeDef
*RTCx
)
2986 SET_BIT(RTCx
->CR
, RTC_CR_TAMPTS
);
2990 * @brief Disable timestamp on tamper detection event
2991 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_DisableOnTamper
2992 * @param RTCx RTC Instance
2995 __STATIC_INLINE
void LL_RTC_TS_DisableOnTamper(RTC_TypeDef
*RTCx
)
2997 CLEAR_BIT(RTCx
->CR
, RTC_CR_TAMPTS
);
2999 #endif /* RTC_CR_TAMPTS */
3005 /** @defgroup RTC_LL_EF_Tamper Tamper
3009 #if defined(RTC_TAMPCR_TAMP1E)
3011 * @brief Enable RTC_TAMPx input detection
3012 * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Enable
3013 * TAMPCR TAMP2E LL_RTC_TAMPER_Enable
3014 * TAMPCR TAMP3E LL_RTC_TAMPER_Enable
3015 * @param RTCx RTC Instance
3016 * @param Tamper This parameter can be a combination of the following values:
3017 * @arg @ref LL_RTC_TAMPER_1
3018 * @arg @ref LL_RTC_TAMPER_2
3019 * @arg @ref LL_RTC_TAMPER_3
3023 __STATIC_INLINE
void LL_RTC_TAMPER_Enable(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
3025 SET_BIT(RTCx
->TAMPCR
, Tamper
);
3029 * @brief Clear RTC_TAMPx input detection
3030 * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Disable
3031 * TAMPCR TAMP2E LL_RTC_TAMPER_Disable
3032 * TAMPCR TAMP3E LL_RTC_TAMPER_Disable
3033 * @param RTCx RTC Instance
3034 * @param Tamper This parameter can be a combination of the following values:
3035 * @arg @ref LL_RTC_TAMPER_1
3036 * @arg @ref LL_RTC_TAMPER_2
3037 * @arg @ref LL_RTC_TAMPER_3
3041 __STATIC_INLINE
void LL_RTC_TAMPER_Disable(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
3043 CLEAR_BIT(RTCx
->TAMPCR
, Tamper
);
3047 * @brief Enable Tamper mask flag
3048 * @note Associated Tamper IT must not enabled when tamper mask is set.
3049 * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_EnableMask
3050 * TAMPCR TAMP2MF LL_RTC_TAMPER_EnableMask
3051 * TAMPCR TAMP3MF LL_RTC_TAMPER_EnableMask
3052 * @param RTCx RTC Instance
3053 * @param Mask This parameter can be a combination of the following values:
3054 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
3055 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
3056 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3
3060 __STATIC_INLINE
void LL_RTC_TAMPER_EnableMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
3062 SET_BIT(RTCx
->TAMPCR
, Mask
);
3066 * @brief Disable Tamper mask flag
3067 * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_DisableMask
3068 * TAMPCR TAMP2MF LL_RTC_TAMPER_DisableMask
3069 * TAMPCR TAMP3MF LL_RTC_TAMPER_DisableMask
3070 * @param RTCx RTC Instance
3071 * @param Mask This parameter can be a combination of the following values:
3072 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
3073 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
3074 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3
3078 __STATIC_INLINE
void LL_RTC_TAMPER_DisableMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
3080 CLEAR_BIT(RTCx
->TAMPCR
, Mask
);
3084 * @brief Enable backup register erase after Tamper event detection
3085 * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP
3086 * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_EnableEraseBKP
3087 * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP
3088 * @param RTCx RTC Instance
3089 * @param Tamper This parameter can be a combination of the following values:
3090 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
3091 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
3092 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3
3096 __STATIC_INLINE
void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
3098 CLEAR_BIT(RTCx
->TAMPCR
, Tamper
);
3102 * @brief Disable backup register erase after Tamper event detection
3103 * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP
3104 * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_DisableEraseBKP
3105 * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP
3106 * @param RTCx RTC Instance
3107 * @param Tamper This parameter can be a combination of the following values:
3108 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
3109 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
3110 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3
3114 __STATIC_INLINE
void LL_RTC_TAMPER_DisableEraseBKP(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
3116 SET_BIT(RTCx
->TAMPCR
, Tamper
);
3118 #endif /* RTC_TAMPCR_TAMP1E */
3120 #if defined(RTC_TAMPCR_TAMPPUDIS)
3122 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
3123 * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp
3124 * @param RTCx RTC Instance
3127 __STATIC_INLINE
void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef
*RTCx
)
3129 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPUDIS
);
3133 * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling)
3134 * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp
3135 * @param RTCx RTC Instance
3138 __STATIC_INLINE
void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef
*RTCx
)
3140 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPUDIS
);
3142 #endif /* RTC_TAMPCR_TAMPPUDIS */
3144 #if defined(RTC_TAMPCR_TAMPPRCH)
3146 * @brief Set RTC_TAMPx precharge duration
3147 * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge
3148 * @param RTCx RTC Instance
3149 * @param Duration This parameter can be one of the following values:
3150 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
3151 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
3152 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
3153 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
3156 __STATIC_INLINE
void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef
*RTCx
, uint32_t Duration
)
3158 MODIFY_REG(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPRCH
, Duration
);
3162 * @brief Get RTC_TAMPx precharge duration
3163 * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge
3164 * @param RTCx RTC Instance
3165 * @retval Returned value can be one of the following values:
3166 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
3167 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
3168 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
3169 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
3171 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef
*RTCx
)
3173 return (uint32_t)(READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPPRCH
));
3175 #endif /* RTC_TAMPCR_TAMPPRCH */
3177 #if defined(RTC_TAMPCR_TAMPFLT)
3179 * @brief Set RTC_TAMPx filter count
3180 * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_SetFilterCount
3181 * @param RTCx RTC Instance
3182 * @param FilterCount This parameter can be one of the following values:
3183 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
3184 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
3185 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
3186 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
3189 __STATIC_INLINE
void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef
*RTCx
, uint32_t FilterCount
)
3191 MODIFY_REG(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFLT
, FilterCount
);
3195 * @brief Get RTC_TAMPx filter count
3196 * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_GetFilterCount
3197 * @param RTCx RTC Instance
3198 * @retval Returned value can be one of the following values:
3199 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
3200 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
3201 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
3202 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
3204 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef
*RTCx
)
3206 return (uint32_t)(READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFLT
));
3208 #endif /* RTC_TAMPCR_TAMPFLT */
3210 #if defined(RTC_TAMPCR_TAMPFREQ)
3212 * @brief Set Tamper sampling frequency
3213 * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq
3214 * @param RTCx RTC Instance
3215 * @param SamplingFreq This parameter can be one of the following values:
3216 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
3217 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
3218 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
3219 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
3220 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
3221 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
3222 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
3223 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
3226 __STATIC_INLINE
void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef
*RTCx
, uint32_t SamplingFreq
)
3228 MODIFY_REG(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFREQ
, SamplingFreq
);
3232 * @brief Get Tamper sampling frequency
3233 * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq
3234 * @param RTCx RTC Instance
3235 * @retval Returned value can be one of the following values:
3236 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
3237 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
3238 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
3239 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
3240 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
3241 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
3242 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
3243 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
3245 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef
*RTCx
)
3247 return (uint32_t)(READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPFREQ
));
3249 #endif /* RTC_TAMPCR_TAMPFREQ */
3251 #if defined(RTC_TAMPCR_TAMP1E)
3253 * @brief Enable Active level for Tamper input
3254 * @rmtoll TAMPCR TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel
3255 * TAMPCR TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel
3256 * TAMPCR TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel
3257 * @param RTCx RTC Instance
3258 * @param Tamper This parameter can be a combination of the following values:
3259 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
3260 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
3261 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3
3265 __STATIC_INLINE
void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
3267 SET_BIT(RTCx
->TAMPCR
, Tamper
);
3271 * @brief Disable Active level for Tamper input
3272 * @rmtoll TAMPCR TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel
3273 * TAMPCR TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel
3274 * TAMPCR TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel
3275 * @param RTCx RTC Instance
3276 * @param Tamper This parameter can be a combination of the following values:
3277 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
3278 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
3279 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3
3283 __STATIC_INLINE
void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
3285 CLEAR_BIT(RTCx
->TAMPCR
, Tamper
);
3287 #endif /* RTC_TAMPCR_TAMP1E */
3289 #if defined(TAMP_CR1_TAMP1E)
3291 * @brief Enable TAMPx input detection
3292 * @rmtoll TAMP_CR1 TAMP1E LL_RTC_TAMPER_Enable
3293 * TAMP_CR1 TAMP2E LL_RTC_TAMPER_Enable
3294 * TAMP_CR1 TAMP3E LL_RTC_TAMPER_Enable
3295 * @param TAMPx TAMP Instance
3296 * @param Tamper This parameter can be a combination of the following values:
3297 * @arg @ref LL_RTC_TAMPER_1
3298 * @arg @ref LL_RTC_TAMPER_2
3299 * @arg @ref LL_RTC_TAMPER_3
3303 __STATIC_INLINE
void LL_RTC_TAMPER_Enable(TAMP_TypeDef
*TAMPx
, uint32_t Tamper
)
3305 SET_BIT(TAMPx
->CR1
, Tamper
);
3309 * @brief Clear TAMPx input detection
3310 * @rmtoll TAMP_CR1 TAMP1E LL_RTC_TAMPER_Disable
3311 * TAMP_CR1 TAMP2E LL_RTC_TAMPER_Disable
3312 * TAMP_CR1 TAMP3E LL_RTC_TAMPER_Disable
3313 * @param TAMPx TAMP Instance
3314 * @param Tamper This parameter can be a combination of the following values:
3315 * @arg @ref LL_RTC_TAMPER_1
3316 * @arg @ref LL_RTC_TAMPER_2
3317 * @arg @ref LL_RTC_TAMPER_3
3321 __STATIC_INLINE
void LL_RTC_TAMPER_Disable(TAMP_TypeDef
*TAMPx
, uint32_t Tamper
)
3323 CLEAR_BIT(TAMPx
->CR1
, Tamper
);
3325 #endif /* TAMP_CR1_TAMP1E */
3327 #if defined(TAMP_CR2_TAMP1MSK)
3329 * @brief Enable Tamper mask flag
3330 * @note Associated Tamper IT must not enabled when tamper mask is set.
3331 * @rmtoll TAMP_CR2 TAMP1MF LL_RTC_TAMPER_EnableMask
3332 * TAMP_CR2 TAMP2MF LL_RTC_TAMPER_EnableMask
3333 * TAMP_CR2 TAMP3MF LL_RTC_TAMPER_EnableMask
3334 * @param TAMPx TAMP Instance
3335 * @param Mask This parameter can be a combination of the following values:
3336 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
3337 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
3338 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3
3342 __STATIC_INLINE
void LL_RTC_TAMPER_EnableMask(TAMP_TypeDef
*TAMPx
, uint32_t Mask
)
3344 SET_BIT(TAMPx
->CR2
, Mask
);
3348 * @brief Disable Tamper mask flag
3349 * @rmtoll TAMP_CR2 TAMP1MF LL_RTC_TAMPER_DisableMask
3350 * TAMP_CR2 TAMP2MF LL_RTC_TAMPER_DisableMask
3351 * TAMP_CR2 TAMP3MF LL_RTC_TAMPER_DisableMask
3352 * @param TAMPx TAMP Instance
3353 * @param Mask This parameter can be a combination of the following values:
3354 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
3355 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
3356 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3
3360 __STATIC_INLINE
void LL_RTC_TAMPER_DisableMask(TAMP_TypeDef
*TAMPx
, uint32_t Mask
)
3362 CLEAR_BIT(TAMPx
->CR2
, Mask
);
3366 * @brief Enable backup register erase after Tamper event detection
3367 * @rmtoll TAMP_CR2 TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP
3368 * TAMP_CR2 TAMP2NOERASE LL_RTC_TAMPER_EnableEraseBKP
3369 * TAMP_CR2 TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP
3370 * @param TAMPx TAMP Instance
3371 * @param Tamper This parameter can be a combination of the following values:
3372 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
3373 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
3374 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3
3378 __STATIC_INLINE
void LL_RTC_TAMPER_EnableEraseBKP(TAMP_TypeDef
*TAMPx
, uint32_t Tamper
)
3380 CLEAR_BIT(TAMPx
->CR2
, Tamper
);
3384 * @brief Disable backup register erase after Tamper event detection
3385 * @rmtoll TAMP_CR2 TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP
3386 * TAMP_CR2 TAMP2NOERASE LL_RTC_TAMPER_DisableEraseBKP
3387 * TAMP_CR2 TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP
3388 * @param TAMPx TAMP Instance
3389 * @param Tamper This parameter can be a combination of the following values:
3390 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
3391 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
3392 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3
3396 __STATIC_INLINE
void LL_RTC_TAMPER_DisableEraseBKP(TAMP_TypeDef
*TAMPx
, uint32_t Tamper
)
3398 SET_BIT(TAMPx
->CR2
, Tamper
);
3402 * @brief Enable Active level for Tamper input
3403 * @rmtoll TAMP_CR2 TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel
3404 * TAMP_CR2 TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel
3405 * TAMP_CR2 TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel
3406 * @param TAMPx TAMP Instance
3407 * @param Tamper This parameter can be a combination of the following values:
3408 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
3409 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
3410 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3
3414 __STATIC_INLINE
void LL_RTC_TAMPER_EnableActiveLevel(TAMP_TypeDef
*TAMPx
, uint32_t Tamper
)
3416 SET_BIT(TAMPx
->CR2
, Tamper
);
3420 * @brief Disable Active level for Tamper input
3421 * @rmtoll TAMP_CR2 TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel
3422 * TAMP_CR2 TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel
3423 * TAMP_CR2 TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel
3424 * @param TAMPx TAMP Instance
3425 * @param Tamper This parameter can be a combination of the following values:
3426 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
3427 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
3428 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3
3432 __STATIC_INLINE
void LL_RTC_TAMPER_DisableActiveLevel(TAMP_TypeDef
*TAMPx
, uint32_t Tamper
)
3434 CLEAR_BIT(TAMPx
->CR2
, Tamper
);
3436 #endif /* TAMP_CR2_TAMP1MSK */
3438 #if defined(TAMP_FLTCR_TAMPPUDIS)
3440 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
3441 * @rmtoll TAMP_FLTCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp
3442 * @param TAMPx TAMP Instance
3445 __STATIC_INLINE
void LL_RTC_TAMPER_DisablePullUp(TAMP_TypeDef
*TAMPx
)
3447 SET_BIT(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPPUDIS
);
3451 * @brief Enable RTC_TAMPx pull-up disable (Precharge RTC_TAMPx pins before sampling)
3452 * @rmtoll TAMP_FLTCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp
3453 * @param TAMPx TAMP Instance
3456 __STATIC_INLINE
void LL_RTC_TAMPER_EnablePullUp(TAMP_TypeDef
*TAMPx
)
3458 CLEAR_BIT(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPPUDIS
);
3462 * @brief Set RTC_TAMPx precharge duration
3463 * @rmtoll TAMP_FLTCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge
3464 * @param TAMPx TAMP Instance
3465 * @param Duration This parameter can be one of the following values:
3466 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
3467 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
3468 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
3469 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
3472 __STATIC_INLINE
void LL_RTC_TAMPER_SetPrecharge(TAMP_TypeDef
*TAMPx
, uint32_t Duration
)
3474 MODIFY_REG(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPPRCH
, Duration
);
3478 * @brief Get RTC_TAMPx precharge duration
3479 * @rmtoll TAMP_FLTCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge
3480 * @param TAMPx TAMP Instance
3481 * @retval Returned value can be one of the following values:
3482 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
3483 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
3484 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
3485 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
3487 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetPrecharge(TAMP_TypeDef
*TAMPx
)
3489 return (uint32_t)(READ_BIT(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPPRCH
));
3493 * @brief Set RTC_TAMPx filter count
3494 * @rmtoll TAMP_FLTCR TAMPFLT LL_RTC_TAMPER_SetFilterCount
3495 * @param TAMPx TAMP Instance
3496 * @param FilterCount This parameter can be one of the following values:
3497 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
3498 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
3499 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
3500 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
3503 __STATIC_INLINE
void LL_RTC_TAMPER_SetFilterCount(TAMP_TypeDef
*TAMPx
, uint32_t FilterCount
)
3505 MODIFY_REG(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPFLT
, FilterCount
);
3509 * @brief Get RTC_TAMPx filter count
3510 * @rmtoll TAMP_FLTCR TAMPFLT LL_RTC_TAMPER_GetFilterCount
3511 * @param TAMPx TAMP Instance
3512 * @retval Returned value can be one of the following values:
3513 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
3514 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
3515 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
3516 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
3518 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetFilterCount(TAMP_TypeDef
*TAMPx
)
3520 return (uint32_t)(READ_BIT(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPFLT
));
3524 * @brief Set Tamper sampling frequency
3525 * @rmtoll TAMP_FLTCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq
3526 * @param TAMPx TAMP Instance
3527 * @param SamplingFreq This parameter can be one of the following values:
3528 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
3529 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
3530 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
3531 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
3532 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
3533 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
3534 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
3535 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
3538 __STATIC_INLINE
void LL_RTC_TAMPER_SetSamplingFreq(TAMP_TypeDef
*TAMPx
, uint32_t SamplingFreq
)
3540 MODIFY_REG(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPFREQ
, SamplingFreq
);
3544 * @brief Get Tamper sampling frequency
3545 * @rmtoll TAMP_FLTCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq
3546 * @param TAMPx TAMP Instance
3547 * @retval Returned value can be one of the following values:
3548 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
3549 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
3550 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
3551 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
3552 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
3553 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
3554 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
3555 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
3557 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetSamplingFreq(TAMP_TypeDef
*TAMPx
)
3559 return (uint32_t)(READ_BIT(TAMPx
->FLTCR
, TAMP_FLTCR_TAMPFREQ
));
3561 #endif /* TAMP_FLTCR_TAMPPUDIS */
3567 /** @defgroup RTC_LL_EF_Wakeup Wakeup
3572 * @brief Enable Wakeup timer
3573 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3574 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_Enable
3575 * @param RTCx RTC Instance
3578 __STATIC_INLINE
void LL_RTC_WAKEUP_Enable(RTC_TypeDef
*RTCx
)
3580 SET_BIT(RTCx
->CR
, RTC_CR_WUTE
);
3584 * @brief Disable Wakeup timer
3585 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3586 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_Disable
3587 * @param RTCx RTC Instance
3590 __STATIC_INLINE
void LL_RTC_WAKEUP_Disable(RTC_TypeDef
*RTCx
)
3592 CLEAR_BIT(RTCx
->CR
, RTC_CR_WUTE
);
3596 * @brief Check if Wakeup timer is enabled or not
3597 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_IsEnabled
3598 * @param RTCx RTC Instance
3599 * @retval State of bit (1 or 0).
3601 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef
*RTCx
)
3603 return ((READ_BIT(RTCx
->CR
, RTC_CR_WUTE
) == (RTC_CR_WUTE
)) ? 1UL : 0UL);
3607 * @brief Select Wakeup clock
3608 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3609 * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1
3610 * @rmtoll RTC_CR WUCKSEL LL_RTC_WAKEUP_SetClock
3611 * @param RTCx RTC Instance
3612 * @param WakeupClock This parameter can be one of the following values:
3613 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
3614 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
3615 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
3616 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
3617 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
3618 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
3621 __STATIC_INLINE
void LL_RTC_WAKEUP_SetClock(RTC_TypeDef
*RTCx
, uint32_t WakeupClock
)
3623 MODIFY_REG(RTCx
->CR
, RTC_CR_WUCKSEL
, WakeupClock
);
3627 * @brief Get Wakeup clock
3628 * @rmtoll RTC_CR WUCKSEL LL_RTC_WAKEUP_GetClock
3629 * @param RTCx RTC Instance
3630 * @retval Returned value can be one of the following values:
3631 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
3632 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
3633 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
3634 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
3635 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
3636 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
3638 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef
*RTCx
)
3640 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_WUCKSEL
));
3644 * @brief Set Wakeup auto-reload value
3645 * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR
3646 * @rmtoll RTC_WUTR WUT LL_RTC_WAKEUP_SetAutoReload
3647 * @param RTCx RTC Instance
3648 * @param Value Value between Min_Data=0x00 and Max_Data=0xFFFF
3651 __STATIC_INLINE
void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef
*RTCx
, uint32_t Value
)
3653 MODIFY_REG(RTCx
->WUTR
, RTC_WUTR_WUT
, Value
);
3657 * @brief Get Wakeup auto-reload value
3658 * @rmtoll RTC_WUTR WUT LL_RTC_WAKEUP_GetAutoReload
3659 * @param RTCx RTC Instance
3660 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
3662 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef
*RTCx
)
3664 return (uint32_t)(READ_BIT(RTCx
->WUTR
, RTC_WUTR_WUT
));
3672 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
3676 #if defined(RTC_BKP0R)
3678 * @brief Writes a data in a specified RTC Backup data register.
3679 * @rmtoll BKPxR BKP LL_RTC_BAK_SetRegister
3680 * @param RTCx RTC Instance
3681 * @param BackupRegister This parameter can be one of the following values:
3682 * @arg @ref LL_RTC_BKP_DR0
3683 * @arg @ref LL_RTC_BKP_DR1
3684 * @arg @ref LL_RTC_BKP_DR2
3685 * @arg @ref LL_RTC_BKP_DR3
3686 * @arg @ref LL_RTC_BKP_DR4
3687 * @arg @ref LL_RTC_BKP_DR5
3688 * @arg @ref LL_RTC_BKP_DR6
3689 * @arg @ref LL_RTC_BKP_DR7
3690 * @arg @ref LL_RTC_BKP_DR8
3691 * @arg @ref LL_RTC_BKP_DR9
3692 * @arg @ref LL_RTC_BKP_DR10
3693 * @arg @ref LL_RTC_BKP_DR11
3694 * @arg @ref LL_RTC_BKP_DR12
3695 * @arg @ref LL_RTC_BKP_DR13
3696 * @arg @ref LL_RTC_BKP_DR14
3697 * @arg @ref LL_RTC_BKP_DR15
3698 * @arg @ref LL_RTC_BKP_DR16
3699 * @arg @ref LL_RTC_BKP_DR17
3700 * @arg @ref LL_RTC_BKP_DR18
3701 * @arg @ref LL_RTC_BKP_DR19
3702 * @arg @ref LL_RTC_BKP_DR20
3703 * @arg @ref LL_RTC_BKP_DR21
3704 * @arg @ref LL_RTC_BKP_DR22
3705 * @arg @ref LL_RTC_BKP_DR23
3706 * @arg @ref LL_RTC_BKP_DR24
3707 * @arg @ref LL_RTC_BKP_DR25
3708 * @arg @ref LL_RTC_BKP_DR26
3709 * @arg @ref LL_RTC_BKP_DR27
3710 * @arg @ref LL_RTC_BKP_DR28
3711 * @arg @ref LL_RTC_BKP_DR29
3712 * @arg @ref LL_RTC_BKP_DR30
3713 * @arg @ref LL_RTC_BKP_DR31
3714 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3717 __STATIC_INLINE
void LL_RTC_BAK_SetRegister(RTC_TypeDef
*RTCx
, uint32_t BackupRegister
, uint32_t Data
)
3721 tmp
= (uint32_t)(&(RTCx
->BKP0R
));
3722 tmp
+= (BackupRegister
* 4U);
3724 /* Write the specified register */
3725 *(__IO
uint32_t *)tmp
= (uint32_t)Data
;
3729 * @brief Reads data from the specified RTC Backup data Register.
3730 * @rmtoll BKPxR BKP LL_RTC_BAK_GetRegister
3731 * @param RTCx RTC Instance
3732 * @param BackupRegister This parameter can be one of the following values:
3733 * @arg @ref LL_RTC_BKP_DR0
3734 * @arg @ref LL_RTC_BKP_DR1
3735 * @arg @ref LL_RTC_BKP_DR2
3736 * @arg @ref LL_RTC_BKP_DR3
3737 * @arg @ref LL_RTC_BKP_DR4
3738 * @arg @ref LL_RTC_BKP_DR5
3739 * @arg @ref LL_RTC_BKP_DR6
3740 * @arg @ref LL_RTC_BKP_DR7
3741 * @arg @ref LL_RTC_BKP_DR8
3742 * @arg @ref LL_RTC_BKP_DR9
3743 * @arg @ref LL_RTC_BKP_DR10
3744 * @arg @ref LL_RTC_BKP_DR11
3745 * @arg @ref LL_RTC_BKP_DR12
3746 * @arg @ref LL_RTC_BKP_DR13
3747 * @arg @ref LL_RTC_BKP_DR14
3748 * @arg @ref LL_RTC_BKP_DR15
3749 * @arg @ref LL_RTC_BKP_DR16
3750 * @arg @ref LL_RTC_BKP_DR17
3751 * @arg @ref LL_RTC_BKP_DR18
3752 * @arg @ref LL_RTC_BKP_DR19
3753 * @arg @ref LL_RTC_BKP_DR20
3754 * @arg @ref LL_RTC_BKP_DR21
3755 * @arg @ref LL_RTC_BKP_DR22
3756 * @arg @ref LL_RTC_BKP_DR23
3757 * @arg @ref LL_RTC_BKP_DR24
3758 * @arg @ref LL_RTC_BKP_DR25
3759 * @arg @ref LL_RTC_BKP_DR26
3760 * @arg @ref LL_RTC_BKP_DR27
3761 * @arg @ref LL_RTC_BKP_DR28
3762 * @arg @ref LL_RTC_BKP_DR29
3763 * @arg @ref LL_RTC_BKP_DR30
3764 * @arg @ref LL_RTC_BKP_DR31
3765 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3767 __STATIC_INLINE
uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef
*RTCx
, uint32_t BackupRegister
)
3771 tmp
= (uint32_t)(&(RTCx
->BKP0R
));
3772 tmp
+= (BackupRegister
* 4U);
3774 /* Read the specified register */
3775 return (*(__IO
uint32_t *)tmp
);
3777 #endif /* RTC_BKP0R */
3779 #if defined(TAMP_BKP0R_BKP)
3781 * @brief Writes a data in a specified Backup data register.
3782 * @rmtoll TAMP_BKPxR BKP LL_RTC_BKP_SetRegister
3783 * @param TAMPx RTC Instance
3784 * @param BackupRegister This parameter can be one of the following values:
3785 * @arg @ref LL_RTC_BKP_DR0
3786 * @arg @ref LL_RTC_BKP_DR1
3787 * @arg @ref LL_RTC_BKP_DR2
3788 * @arg @ref LL_RTC_BKP_DR3
3789 * @arg @ref LL_RTC_BKP_DR4
3790 * @arg @ref LL_RTC_BKP_DR5
3791 * @arg @ref LL_RTC_BKP_DR6
3792 * @arg @ref LL_RTC_BKP_DR7
3793 * @arg @ref LL_RTC_BKP_DR8
3794 * @arg @ref LL_RTC_BKP_DR9
3795 * @arg @ref LL_RTC_BKP_DR10
3796 * @arg @ref LL_RTC_BKP_DR11
3797 * @arg @ref LL_RTC_BKP_DR12
3798 * @arg @ref LL_RTC_BKP_DR13
3799 * @arg @ref LL_RTC_BKP_DR14
3800 * @arg @ref LL_RTC_BKP_DR15
3801 * @arg @ref LL_RTC_BKP_DR16
3802 * @arg @ref LL_RTC_BKP_DR17
3803 * @arg @ref LL_RTC_BKP_DR18
3804 * @arg @ref LL_RTC_BKP_DR19
3805 * @arg @ref LL_RTC_BKP_DR20
3806 * @arg @ref LL_RTC_BKP_DR21
3807 * @arg @ref LL_RTC_BKP_DR22
3808 * @arg @ref LL_RTC_BKP_DR23
3809 * @arg @ref LL_RTC_BKP_DR24
3810 * @arg @ref LL_RTC_BKP_DR25
3811 * @arg @ref LL_RTC_BKP_DR26
3812 * @arg @ref LL_RTC_BKP_DR27
3813 * @arg @ref LL_RTC_BKP_DR28
3814 * @arg @ref LL_RTC_BKP_DR29
3815 * @arg @ref LL_RTC_BKP_DR30
3816 * @arg @ref LL_RTC_BKP_DR31
3817 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3820 __STATIC_INLINE
void LL_RTC_BKP_SetRegister(TAMP_TypeDef
*TAMPx
, uint32_t BackupRegister
, uint32_t Data
)
3824 tmp
= (uint32_t)(&(TAMPx
->BKP0R
));
3825 tmp
+= (BackupRegister
* 4U);
3827 /* Write the specified register */
3828 *(__IO
uint32_t *)tmp
= (uint32_t)Data
;
3832 * @brief Reads data from the specified RTC Backup data Register.
3833 * @rmtoll TAMP_BKPxR BKP LL_RTC_BKP_GetRegister
3834 * @param TAMPx RTC Instance
3835 * @param BackupRegister This parameter can be one of the following values:
3836 * @arg @ref LL_RTC_BKP_DR0
3837 * @arg @ref LL_RTC_BKP_DR1
3838 * @arg @ref LL_RTC_BKP_DR2
3839 * @arg @ref LL_RTC_BKP_DR3
3840 * @arg @ref LL_RTC_BKP_DR4
3841 * @arg @ref LL_RTC_BKP_DR5
3842 * @arg @ref LL_RTC_BKP_DR6
3843 * @arg @ref LL_RTC_BKP_DR7
3844 * @arg @ref LL_RTC_BKP_DR8
3845 * @arg @ref LL_RTC_BKP_DR9
3846 * @arg @ref LL_RTC_BKP_DR10
3847 * @arg @ref LL_RTC_BKP_DR11
3848 * @arg @ref LL_RTC_BKP_DR12
3849 * @arg @ref LL_RTC_BKP_DR13
3850 * @arg @ref LL_RTC_BKP_DR14
3851 * @arg @ref LL_RTC_BKP_DR15
3852 * @arg @ref LL_RTC_BKP_DR16
3853 * @arg @ref LL_RTC_BKP_DR17
3854 * @arg @ref LL_RTC_BKP_DR18
3855 * @arg @ref LL_RTC_BKP_DR19
3856 * @arg @ref LL_RTC_BKP_DR20
3857 * @arg @ref LL_RTC_BKP_DR21
3858 * @arg @ref LL_RTC_BKP_DR22
3859 * @arg @ref LL_RTC_BKP_DR23
3860 * @arg @ref LL_RTC_BKP_DR24
3861 * @arg @ref LL_RTC_BKP_DR25
3862 * @arg @ref LL_RTC_BKP_DR26
3863 * @arg @ref LL_RTC_BKP_DR27
3864 * @arg @ref LL_RTC_BKP_DR28
3865 * @arg @ref LL_RTC_BKP_DR29
3866 * @arg @ref LL_RTC_BKP_DR30
3867 * @arg @ref LL_RTC_BKP_DR31
3868 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3870 __STATIC_INLINE
uint32_t LL_RTC_BKP_GetRegister(TAMP_TypeDef
*TAMPx
, uint32_t BackupRegister
)
3874 tmp
= (uint32_t)(&(TAMPx
->BKP0R
));
3875 tmp
+= (BackupRegister
* 4U);
3877 /* Read the specified register */
3878 return (*(__IO
uint32_t *)tmp
);
3880 #endif /* TAMP_BKP0R_BKP */
3887 /** @defgroup RTC_LL_EF_Calibration Calibration
3892 * @brief Set Calibration output frequency (1 Hz or 512 Hz)
3893 * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3894 * @rmtoll RTC_CR COE LL_RTC_CAL_SetOutputFreq
3895 * RTC_CR COSEL LL_RTC_CAL_SetOutputFreq
3896 * @param RTCx RTC Instance
3897 * @param Frequency This parameter can be one of the following values:
3898 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3899 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3900 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3903 __STATIC_INLINE
void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef
*RTCx
, uint32_t Frequency
)
3905 MODIFY_REG(RTCx
->CR
, RTC_CR_COE
| RTC_CR_COSEL
, Frequency
);
3909 * @brief Get Calibration output frequency (1 Hz or 512 Hz)
3910 * @rmtoll RTC_CR COE LL_RTC_CAL_GetOutputFreq
3911 * RTC_CR COSEL LL_RTC_CAL_GetOutputFreq
3912 * @param RTCx RTC Instance
3913 * @retval Returned value can be one of the following values:
3914 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3915 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3916 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3918 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef
*RTCx
)
3920 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_COE
| RTC_CR_COSEL
));
3924 * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm)
3925 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3926 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3927 * @rmtoll RTC_CALR CALP LL_RTC_CAL_SetPulse
3928 * @param RTCx RTC Instance
3929 * @param Pulse This parameter can be one of the following values:
3930 * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE
3931 * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET
3934 __STATIC_INLINE
void LL_RTC_CAL_SetPulse(RTC_TypeDef
*RTCx
, uint32_t Pulse
)
3936 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALP
, Pulse
);
3940 * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm)
3941 * @rmtoll RTC_CALR CALP LL_RTC_CAL_IsPulseInserted
3942 * @param RTCx RTC Instance
3943 * @retval State of bit (1 or 0).
3945 __STATIC_INLINE
uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef
*RTCx
)
3947 return ((READ_BIT(RTCx
->CALR
, RTC_CALR_CALP
) == (RTC_CALR_CALP
)) ? 1UL : 0UL);
3951 * @brief Set the calibration cycle period
3952 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3953 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3954 * @rmtoll RTC_CALR CALW8 LL_RTC_CAL_SetPeriod
3955 * RTC_CALR CALW16 LL_RTC_CAL_SetPeriod
3956 * @param RTCx RTC Instance
3957 * @param Period This parameter can be one of the following values:
3958 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3959 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3960 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3963 __STATIC_INLINE
void LL_RTC_CAL_SetPeriod(RTC_TypeDef
*RTCx
, uint32_t Period
)
3965 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALW8
| RTC_CALR_CALW16
, Period
);
3969 * @brief Get the calibration cycle period
3970 * @rmtoll RTC_CALR CALW8 LL_RTC_CAL_GetPeriod
3971 * RTC_CALR CALW16 LL_RTC_CAL_GetPeriod
3972 * @param RTCx RTC Instance
3973 * @retval Returned value can be one of the following values:
3974 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3975 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3976 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3978 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef
*RTCx
)
3980 return (uint32_t)(READ_BIT(RTCx
->CALR
, RTC_CALR_CALW8
| RTC_CALR_CALW16
));
3984 * @brief Set Calibration minus
3985 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3986 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3987 * @rmtoll RTC_CALR CALM LL_RTC_CAL_SetMinus
3988 * @param RTCx RTC Instance
3989 * @param CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF
3992 __STATIC_INLINE
void LL_RTC_CAL_SetMinus(RTC_TypeDef
*RTCx
, uint32_t CalibMinus
)
3994 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALM
, CalibMinus
);
3998 * @brief Get Calibration minus
3999 * @rmtoll RTC_CALR CALM LL_RTC_CAL_GetMinus
4000 * @param RTCx RTC Instance
4001 * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF
4003 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef
*RTCx
)
4005 return (uint32_t)(READ_BIT(RTCx
->CALR
, RTC_CALR_CALM
));
4013 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
4017 #if defined(RTC_ISR_ITSF)
4019 * @brief Get Internal Time-stamp flag
4020 * @rmtoll RTC_ISR ITSF LL_RTC_IsActiveFlag_ITS
4021 * @param RTCx RTC Instance
4022 * @retval State of bit (1 or 0).
4024 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef
*RTCx
)
4026 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_ITSF
) == (RTC_ISR_ITSF
)) ? 1UL : 0UL);
4030 * @brief Get Recalibration pending Flag
4031 * @rmtoll ISR RECALPF LL_RTC_IsActiveFlag_RECALP
4032 * @param RTCx RTC Instance
4033 * @retval State of bit (1 or 0).
4035 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef
*RTCx
)
4037 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_RECALPF
) == (RTC_ISR_RECALPF
)) ? 1UL : 0UL);
4041 * @brief Get RTC_TAMP3 detection flag
4042 * @rmtoll ISR TAMP3F LL_RTC_IsActiveFlag_TAMP3
4043 * @param RTCx RTC Instance
4044 * @retval State of bit (1 or 0).
4046 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef
*RTCx
)
4048 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_TAMP3F
) == (RTC_ISR_TAMP3F
)) ? 1UL : 0UL);
4052 * @brief Get RTC_TAMP2 detection flag
4053 * @rmtoll ISR TAMP2F LL_RTC_IsActiveFlag_TAMP2
4054 * @param RTCx RTC Instance
4055 * @retval State of bit (1 or 0).
4057 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef
*RTCx
)
4059 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_TAMP2F
) == (RTC_ISR_TAMP2F
)) ? 1UL : 0UL);
4063 * @brief Get RTC_TAMP1 detection flag
4064 * @rmtoll ISR TAMP1F LL_RTC_IsActiveFlag_TAMP1
4065 * @param RTCx RTC Instance
4066 * @retval State of bit (1 or 0).
4068 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef
*RTCx
)
4070 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_TAMP1F
) == (RTC_ISR_TAMP1F
)) ? 1UL : 0UL);
4074 * @brief Get Time-stamp overflow flag
4075 * @rmtoll ISR TSOVF LL_RTC_IsActiveFlag_TSOV
4076 * @param RTCx RTC Instance
4077 * @retval State of bit (1 or 0).
4079 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef
*RTCx
)
4081 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_TSOVF
) == (RTC_ISR_TSOVF
)) ? 1UL : 0UL);
4085 * @brief Get Time-stamp flag
4086 * @rmtoll ISR TSF LL_RTC_IsActiveFlag_TS
4087 * @param RTCx RTC Instance
4088 * @retval State of bit (1 or 0).
4090 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef
*RTCx
)
4092 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_TSF
) == (RTC_ISR_TSF
)) ? 1UL : 0UL);
4096 * @brief Get Wakeup timer flag
4097 * @rmtoll ISR WUTF LL_RTC_IsActiveFlag_WUT
4098 * @param RTCx RTC Instance
4099 * @retval State of bit (1 or 0).
4101 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef
*RTCx
)
4103 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_WUTF
) == (RTC_ISR_WUTF
)) ? 1UL : 0UL);
4107 * @brief Get Alarm B flag
4108 * @rmtoll ISR ALRBF LL_RTC_IsActiveFlag_ALRB
4109 * @param RTCx RTC Instance
4110 * @retval State of bit (1 or 0).
4112 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef
*RTCx
)
4114 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_ALRBF
) == (RTC_ISR_ALRBF
)) ? 1UL : 0UL);
4118 * @brief Get Alarm A flag
4119 * @rmtoll ISR ALRAF LL_RTC_IsActiveFlag_ALRA
4120 * @param RTCx RTC Instance
4121 * @retval State of bit (1 or 0).
4123 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef
*RTCx
)
4125 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_ALRAF
) == (RTC_ISR_ALRAF
)) ? 1UL : 0UL);
4129 * @brief Clear Internal Time-stamp flag
4130 * @rmtoll ISR ITSF LL_RTC_ClearFlag_ITS
4131 * @param RTCx RTC Instance
4134 __STATIC_INLINE
void LL_RTC_ClearFlag_ITS(RTC_TypeDef
*RTCx
)
4136 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_ITSF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4140 * @brief Clear RTC_TAMP3 detection flag
4141 * @rmtoll ISR TAMP3F LL_RTC_ClearFlag_TAMP3
4142 * @param RTCx RTC Instance
4145 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef
*RTCx
)
4147 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TAMP3F
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4151 * @brief Clear RTC_TAMP2 detection flag
4152 * @rmtoll ISR TAMP2F LL_RTC_ClearFlag_TAMP2
4153 * @param RTCx RTC Instance
4156 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef
*RTCx
)
4158 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TAMP2F
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4162 * @brief Clear RTC_TAMP1 detection flag
4163 * @rmtoll ISR TAMP1F LL_RTC_ClearFlag_TAMP1
4164 * @param RTCx RTC Instance
4167 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef
*RTCx
)
4169 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TAMP1F
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4173 * @brief Clear Time-stamp overflow flag
4174 * @rmtoll ISR TSOVF LL_RTC_ClearFlag_TSOV
4175 * @param RTCx RTC Instance
4178 __STATIC_INLINE
void LL_RTC_ClearFlag_TSOV(RTC_TypeDef
*RTCx
)
4180 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TSOVF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4184 * @brief Clear Time-stamp flag
4185 * @rmtoll ISR TSF LL_RTC_ClearFlag_TS
4186 * @param RTCx RTC Instance
4189 __STATIC_INLINE
void LL_RTC_ClearFlag_TS(RTC_TypeDef
*RTCx
)
4191 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_TSF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4195 * @brief Clear Wakeup timer flag
4196 * @rmtoll ISR WUTF LL_RTC_ClearFlag_WUT
4197 * @param RTCx RTC Instance
4200 __STATIC_INLINE
void LL_RTC_ClearFlag_WUT(RTC_TypeDef
*RTCx
)
4202 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_WUTF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4206 * @brief Clear Alarm B flag
4207 * @rmtoll ISR ALRBF LL_RTC_ClearFlag_ALRB
4208 * @param RTCx RTC Instance
4211 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRB(RTC_TypeDef
*RTCx
)
4213 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_ALRBF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4217 * @brief Clear Alarm A flag
4218 * @rmtoll ISR ALRAF LL_RTC_ClearFlag_ALRA
4219 * @param RTCx RTC Instance
4222 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRA(RTC_TypeDef
*RTCx
)
4224 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_ALRAF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4228 * @brief Get Initialization flag
4229 * @rmtoll ISR INITF LL_RTC_IsActiveFlag_INIT
4230 * @param RTCx RTC Instance
4231 * @retval State of bit (1 or 0).
4233 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef
*RTCx
)
4235 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_INITF
) == (RTC_ISR_INITF
)) ? 1UL : 0UL);
4239 * @brief Get Registers synchronization flag
4240 * @rmtoll ISR RSF LL_RTC_IsActiveFlag_RS
4241 * @param RTCx RTC Instance
4242 * @retval State of bit (1 or 0).
4244 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef
*RTCx
)
4246 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_RSF
) == (RTC_ISR_RSF
)) ? 1UL : 0UL);
4250 * @brief Clear Registers synchronization flag
4251 * @rmtoll ISR RSF LL_RTC_ClearFlag_RS
4252 * @param RTCx RTC Instance
4255 __STATIC_INLINE
void LL_RTC_ClearFlag_RS(RTC_TypeDef
*RTCx
)
4257 WRITE_REG(RTCx
->ISR
, (~((RTC_ISR_RSF
| RTC_ISR_INIT
) & 0x0000FFFFU
) | (RTCx
->ISR
& RTC_ISR_INIT
)));
4261 * @brief Get Initialization status flag
4262 * @rmtoll ISR INITS LL_RTC_IsActiveFlag_INITS
4263 * @param RTCx RTC Instance
4264 * @retval State of bit (1 or 0).
4266 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef
*RTCx
)
4268 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_INITS
) == (RTC_ISR_INITS
)) ? 1UL : 0UL);
4272 * @brief Get Shift operation pending flag
4273 * @rmtoll ISR SHPF LL_RTC_IsActiveFlag_SHP
4274 * @param RTCx RTC Instance
4275 * @retval State of bit (1 or 0).
4277 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef
*RTCx
)
4279 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_SHPF
) == (RTC_ISR_SHPF
)) ? 1UL : 0UL);
4283 * @brief Get Wakeup timer write flag
4284 * @rmtoll ISR WUTWF LL_RTC_IsActiveFlag_WUTW
4285 * @param RTCx RTC Instance
4286 * @retval State of bit (1 or 0).
4288 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef
*RTCx
)
4290 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_WUTWF
) == (RTC_ISR_WUTWF
)) ? 1UL : 0UL);
4294 * @brief Get Alarm B write flag
4295 * @rmtoll ISR ALRBWF LL_RTC_IsActiveFlag_ALRBW
4296 * @param RTCx RTC Instance
4297 * @retval State of bit (1 or 0).
4299 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef
*RTCx
)
4301 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_ALRBWF
) == (RTC_ISR_ALRBWF
)) ? 1UL : 0UL);
4305 * @brief Get Alarm A write flag
4306 * @rmtoll ISR ALRAWF LL_RTC_IsActiveFlag_ALRAW
4307 * @param RTCx RTC Instance
4308 * @retval State of bit (1 or 0).
4310 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef
*RTCx
)
4312 return ((READ_BIT(RTCx
->ISR
, RTC_ISR_ALRAWF
) == (RTC_ISR_ALRAWF
)) ? 1UL : 0UL);
4314 #endif /* RTC_ISR_ITSF */
4316 #if defined(RTC_SR_ITSF)
4318 * @brief Get Internal Time-stamp flag
4319 * @rmtoll RTC_SR ITSF LL_RTC_IsActiveFlag_ITS
4320 * @param RTCx RTC Instance
4321 * @retval State of bit (1 or 0).
4323 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef
*RTCx
)
4325 return ((READ_BIT(RTCx
->SR
, RTC_SR_ITSF
) == (RTC_SR_ITSF
)) ? 1UL : 0UL);
4329 * @brief Get Time-stamp overflow flag
4330 * @rmtoll RTC_SR TSOVF LL_RTC_IsActiveFlag_TSOV
4331 * @param RTCx RTC Instance
4332 * @retval State of bit (1 or 0).
4334 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef
*RTCx
)
4336 return ((READ_BIT(RTCx
->SR
, RTC_SR_TSOVF
) == (RTC_SR_TSOVF
)) ? 1UL : 0UL);
4340 * @brief Get Time-stamp flag
4341 * @rmtoll RTC_SR TSF LL_RTC_IsActiveFlag_TS
4342 * @param RTCx RTC Instance
4343 * @retval State of bit (1 or 0).
4345 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef
*RTCx
)
4347 return ((READ_BIT(RTCx
->SR
, RTC_SR_TSF
) == (RTC_SR_TSF
)) ? 1UL : 0UL);
4351 * @brief Get Wakeup timer flag
4352 * @rmtoll RTC_SR WUTF LL_RTC_IsActiveFlag_WUT
4353 * @param RTCx RTC Instance
4354 * @retval State of bit (1 or 0).
4356 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef
*RTCx
)
4358 return ((READ_BIT(RTCx
->SR
, RTC_SR_WUTF
) == (RTC_SR_WUTF
)) ? 1UL : 0UL);
4362 * @brief Get Alarm B flag
4363 * @rmtoll RTC_SR ALRBF LL_RTC_IsActiveFlag_ALRB
4364 * @param RTCx RTC Instance
4365 * @retval State of bit (1 or 0).
4367 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef
*RTCx
)
4369 return ((READ_BIT(RTCx
->SR
, RTC_SR_ALRBF
) == (RTC_SR_ALRBF
)) ? 1UL : 0UL);
4373 * @brief Get Alarm A flag
4374 * @rmtoll RTC_SR ALRAF LL_RTC_IsActiveFlag_ALRA
4375 * @param RTCx RTC Instance
4376 * @retval State of bit (1 or 0).
4378 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef
*RTCx
)
4380 return ((READ_BIT(RTCx
->SR
, RTC_SR_ALRAF
) == (RTC_SR_ALRAF
)) ? 1UL : 0UL);
4382 #endif /* RTC_SR_ITSF */
4384 #if defined(RTC_SCR_CITSF)
4386 * @brief Clear Internal Time-stamp flag
4387 * @rmtoll RTC_SCR CITSF LL_RTC_ClearFlag_ITS
4388 * @param RTCx RTC Instance
4391 __STATIC_INLINE
void LL_RTC_ClearFlag_ITS(RTC_TypeDef
*RTCx
)
4393 SET_BIT(RTCx
->SCR
, RTC_SCR_CITSF
);
4397 * @brief Clear Time-stamp overflow flag
4398 * @rmtoll RTC_SCR CTSOVF LL_RTC_ClearFlag_TSOV
4399 * @param RTCx RTC Instance
4402 __STATIC_INLINE
void LL_RTC_ClearFlag_TSOV(RTC_TypeDef
*RTCx
)
4404 SET_BIT(RTCx
->SCR
, RTC_SCR_CTSOVF
);
4408 * @brief Clear Time-stamp flag
4409 * @rmtoll RTC_SCR CTSF LL_RTC_ClearFlag_TS
4410 * @param RTCx RTC Instance
4413 __STATIC_INLINE
void LL_RTC_ClearFlag_TS(RTC_TypeDef
*RTCx
)
4415 SET_BIT(RTCx
->SCR
, RTC_SCR_CTSF
);
4419 * @brief Clear Wakeup timer flag
4420 * @rmtoll RTC_SCR CWUTF LL_RTC_ClearFlag_WUT
4421 * @param RTCx RTC Instance
4424 __STATIC_INLINE
void LL_RTC_ClearFlag_WUT(RTC_TypeDef
*RTCx
)
4426 SET_BIT(RTCx
->SCR
, RTC_SCR_CWUTF
);
4430 * @brief Clear Alarm B flag
4431 * @rmtoll RTC_SCR CALRBF LL_RTC_ClearFlag_ALRB
4432 * @param RTCx RTC Instance
4435 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRB(RTC_TypeDef
*RTCx
)
4437 SET_BIT(RTCx
->SCR
, RTC_SCR_CALRBF
);
4441 * @brief Clear Alarm A flag
4442 * @rmtoll RTC_SCR CALRAF LL_RTC_ClearFlag_ALRA
4443 * @param RTCx RTC Instance
4446 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRA(RTC_TypeDef
*RTCx
)
4448 SET_BIT(RTCx
->SCR
, RTC_SCR_CALRAF
);
4450 #endif /* RTC_SCR_CITSF */
4452 #if defined(RTC_ICSR_RECALPF)
4454 * @brief Get Recalibration pending Flag
4455 * @rmtoll RTC_ICSR RECALPF LL_RTC_IsActiveFlag_RECALP
4456 * @param RTCx RTC Instance
4457 * @retval State of bit (1 or 0).
4459 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef
*RTCx
)
4461 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_RECALPF
) == (RTC_ICSR_RECALPF
)) ? 1UL : 0UL);
4465 * @brief Get Initialization flag
4466 * @rmtoll RTC_ICSR INITF LL_RTC_IsActiveFlag_INIT
4467 * @param RTCx RTC Instance
4468 * @retval State of bit (1 or 0).
4470 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef
*RTCx
)
4472 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_INITF
) == (RTC_ICSR_INITF
)) ? 1UL : 0UL);
4476 * @brief Get Registers synchronization flag
4477 * @rmtoll RTC_ICSR RSF LL_RTC_IsActiveFlag_RS
4478 * @param RTCx RTC Instance
4479 * @retval State of bit (1 or 0).
4481 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef
*RTCx
)
4483 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_RSF
) == (RTC_ICSR_RSF
)) ? 1UL : 0UL);
4487 * @brief Clear Registers synchronization flag
4488 * @rmtoll RTC_ICSR RSF LL_RTC_ClearFlag_RS
4489 * @param RTCx RTC Instance
4492 __STATIC_INLINE
void LL_RTC_ClearFlag_RS(RTC_TypeDef
*RTCx
)
4494 WRITE_REG(RTCx
->ICSR
, (~((RTC_ICSR_RSF
| RTC_ICSR_INIT
) & 0x000000FFU
) | (RTCx
->ICSR
& RTC_ICSR_INIT
)));
4498 * @brief Get Initialization status flag
4499 * @rmtoll RTC_ICSR INITS LL_RTC_IsActiveFlag_INITS
4500 * @param RTCx RTC Instance
4501 * @retval State of bit (1 or 0).
4503 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef
*RTCx
)
4505 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_INITS
) == (RTC_ICSR_INITS
)) ? 1UL : 0UL);
4509 * @brief Get Shift operation pending flag
4510 * @rmtoll RTC_ICSR SHPF LL_RTC_IsActiveFlag_SHP
4511 * @param RTCx RTC Instance
4512 * @retval State of bit (1 or 0).
4514 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef
*RTCx
)
4516 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_SHPF
) == (RTC_ICSR_SHPF
)) ? 1UL : 0UL);
4520 * @brief Get Wakeup timer write flag
4521 * @rmtoll RTC_ICSR WUTWF LL_RTC_IsActiveFlag_WUTW
4522 * @param RTCx RTC Instance
4523 * @retval State of bit (1 or 0).
4525 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef
*RTCx
)
4527 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_WUTWF
) == (RTC_ICSR_WUTWF
)) ? 1UL : 0UL);
4531 * @brief Get Alarm B write flag
4532 * @rmtoll RTC_ICSR ALRBWF LL_RTC_IsActiveFlag_ALRBW
4533 * @param RTCx RTC Instance
4534 * @retval State of bit (1 or 0).
4536 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef
*RTCx
)
4538 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_ALRBWF
) == (RTC_ICSR_ALRBWF
)) ? 1UL : 0UL);
4542 * @brief Get Alarm A write flag
4543 * @rmtoll RTC_ICSR ALRAWF LL_RTC_IsActiveFlag_ALRAW
4544 * @param RTCx RTC Instance
4545 * @retval State of bit (1 or 0).
4547 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef
*RTCx
)
4549 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_ALRAWF
) == (RTC_ICSR_ALRAWF
)) ? 1UL : 0UL);
4551 #endif /* RTC_ICSR_RECALPF */
4553 #if defined(RTC_MISR_ALRAMF)
4555 * @brief Get Alarm A masked flag.
4556 * @rmtoll RTC_MISR ALRAMF LL_RTC_IsActiveFlag_ALRAM
4557 * @param RTCx RTC Instance
4558 * @retval State of bit (1 or 0).
4560 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRAM(RTC_TypeDef
*RTCx
)
4562 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_ALRAMF
) == (RTC_MISR_ALRAMF
)) ? 1UL : 0UL);
4566 * @brief Get Alarm B masked flag.
4567 * @rmtoll RTC_MISR ALRBMF LL_RTC_IsActiveFlag_ALRBM
4568 * @param RTCx RTC Instance
4569 * @retval State of bit (1 or 0).
4571 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRBM(RTC_TypeDef
*RTCx
)
4573 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_ALRBMF
) == (RTC_MISR_ALRBMF
)) ? 1UL : 0UL);
4577 * @brief Get Wakeup timer masked flag.
4578 * @rmtoll RTC_MISR WUTMF LL_RTC_IsActiveFlag_WUTM
4579 * @param RTCx RTC Instance
4580 * @retval State of bit (1 or 0).
4582 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUTM(RTC_TypeDef
*RTCx
)
4584 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_WUTMF
) == (RTC_MISR_WUTMF
)) ? 1UL : 0UL);
4588 * @brief Get Time-stamp masked flag.
4589 * @rmtoll RTC_MISR TSMF LL_RTC_IsActiveFlag_TSM
4590 * @param RTCx RTC Instance
4591 * @retval State of bit (1 or 0).
4593 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSM(RTC_TypeDef
*RTCx
)
4595 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_TSMF
) == (RTC_MISR_TSMF
)) ? 1UL : 0UL);
4599 * @brief Get Time-stamp overflow masked flag.
4600 * @rmtoll RTC_MISR TSOVMF LL_RTC_IsActiveFlag_TSOVM
4601 * @param RTCx RTC Instance
4602 * @retval State of bit (1 or 0).
4604 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSOVM(RTC_TypeDef
*RTCx
)
4606 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_TSOVMF
) == (RTC_MISR_TSOVMF
)) ? 1UL : 0UL);
4610 * @brief Get Internal Time-stamp masked flag.
4611 * @rmtoll RTC_MISR ITSMF LL_RTC_IsActiveFlag_ITSM
4612 * @param RTCx RTC Instance
4613 * @retval State of bit (1 or 0).
4615 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITSM(RTC_TypeDef
*RTCx
)
4617 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_ITSMF
) == (RTC_MISR_ITSMF
)) ? 1UL : 0UL);
4619 #endif /* RTC_MISR_ALRAMF */
4621 #if defined(TAMP_CR1_TAMP1E)
4623 * @brief Get tamper 1 detection flag.
4624 * @rmtoll TAMP_SR TAMP1F LL_RTC_IsActiveFlag_TAMP1
4625 * @param TAMPx TAMP Instance
4626 * @retval State of bit (1 or 0).
4628 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP1(TAMP_TypeDef
*TAMPx
)
4630 return ((READ_BIT(TAMPx
->SR
, TAMP_SR_TAMP1F
) == (TAMP_SR_TAMP1F
)) ? 1UL : 0UL);
4632 #endif /* TAMP_CR1_TAMP1E */
4634 #if defined(TAMP_CR1_TAMP2E)
4636 * @brief Get tamper 2 detection flag.
4637 * @rmtoll TAMP_SR TAMP2F LL_RTC_IsActiveFlag_TAMP2
4638 * @param TAMPx TAMP Instance
4639 * @retval State of bit (1 or 0).
4641 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP2(TAMP_TypeDef
*TAMPx
)
4643 return ((READ_BIT(TAMPx
->SR
, TAMP_SR_TAMP2F
) == (TAMP_SR_TAMP2F
)) ? 1UL : 0UL);
4645 #endif /* TAMP_CR1_TAMP2E */
4647 #if defined(TAMP_CR1_TAMP3E)
4649 * @brief Get tamper 3 detection flag.
4650 * @rmtoll TAMP_SR TAMP3F LL_RTC_IsActiveFlag_TAMP3
4651 * @param TAMPx TAMP Instance
4652 * @retval State of bit (1 or 0).
4654 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3(TAMP_TypeDef
*TAMPx
)
4656 return ((READ_BIT(TAMPx
->SR
, TAMP_SR_TAMP3F
) == (TAMP_SR_TAMP3F
)) ? 1UL : 0UL);
4658 #endif /* TAMP_CR1_TAMP3E */
4660 #if defined(TAMP_CR1_TAMP1E)
4662 * @brief Get tamper 1 interrupt masked flag.
4663 * @rmtoll TAMP_MISR TAMP1MF LL_RTC_IsActiveFlag_TAMP1M
4664 * @param TAMPx TAMP Instance
4665 * @retval State of bit (1 or 0).
4667 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP1M(TAMP_TypeDef
*TAMPx
)
4669 return ((READ_BIT(TAMPx
->MISR
, TAMP_MISR_TAMP1MF
) == (TAMP_MISR_TAMP1MF
)) ? 1UL : 0UL);
4671 #endif /* TAMP_CR1_TAMP1E */
4673 #if defined(TAMP_CR1_TAMP2E)
4675 * @brief Get tamper 2 interrupt masked flag.
4676 * @rmtoll TAMP_MISR TAMP2MF LL_RTC_IsActiveFlag_TAMP2M
4677 * @param TAMPx TAMP Instance
4678 * @retval State of bit (1 or 0).
4680 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP2M(TAMP_TypeDef
*TAMPx
)
4682 return ((READ_BIT(TAMPx
->MISR
, TAMP_MISR_TAMP2MF
) == (TAMP_MISR_TAMP2MF
)) ? 1UL : 0UL);
4684 #endif /* TAMP_CR1_TAMP2E */
4686 #if defined(TAMP_CR1_TAMP3E)
4688 * @brief Get tamper 3 interrupt masked flag.
4689 * @rmtoll TAMP_MISR TAMP3MF LL_RTC_IsActiveFlag_TAMP3M
4690 * @param TAMPx TAMP Instance
4691 * @retval State of bit (1 or 0).
4693 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3M(TAMP_TypeDef
*TAMPx
)
4695 return ((READ_BIT(TAMPx
->MISR
, TAMP_MISR_TAMP3MF
) == (TAMP_MISR_TAMP3MF
)) ? 1UL : 0UL);
4697 #endif /* TAMP_CR1_TAMP3E */
4699 #if defined(TAMP_CR1_TAMP1E)
4701 * @brief Clear tamper 1 detection flag.
4702 * @rmtoll TAMP_SCR CTAMP1F LL_RTC_ClearFlag_TAMP1
4703 * @param TAMPx TAMP Instance
4706 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP1(TAMP_TypeDef
*TAMPx
)
4708 SET_BIT(TAMPx
->SCR
, TAMP_SCR_CTAMP1F
);
4710 #endif /* TAMP_CR1_TAMP1E */
4712 #if defined(TAMP_CR1_TAMP2E)
4714 * @brief Clear tamper 2 detection flag.
4715 * @rmtoll TAMP_SCR CTAMP2F LL_RTC_ClearFlag_TAMP2
4716 * @param TAMPx TAMP Instance
4719 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP2(TAMP_TypeDef
*TAMPx
)
4721 SET_BIT(TAMPx
->SCR
, TAMP_SCR_CTAMP2F
);
4723 #endif /* TAMP_CR1_TAMP2E */
4725 #if defined(TAMP_CR1_TAMP3E)
4727 * @brief Clear tamper 3 detection flag.
4728 * @rmtoll TAMP_SCR CTAMP3F LL_RTC_ClearFlag_TAMP3
4729 * @param TAMPx TAMP Instance
4732 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP3(TAMP_TypeDef
*TAMPx
)
4734 SET_BIT(TAMPx
->SCR
, TAMP_SCR_CTAMP3F
);
4736 #endif /* TAMP_CR1_TAMP3E */
4742 /** @defgroup RTC_LL_EF_IT_Management IT_Management
4747 * @brief Enable Time-stamp interrupt
4748 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4749 * @rmtoll RTC_CR TSIE LL_RTC_EnableIT_TS
4750 * @param RTCx RTC Instance
4753 __STATIC_INLINE
void LL_RTC_EnableIT_TS(RTC_TypeDef
*RTCx
)
4755 SET_BIT(RTCx
->CR
, RTC_CR_TSIE
);
4759 * @brief Disable Time-stamp interrupt
4760 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4761 * @rmtoll RTC_CR TSIE LL_RTC_DisableIT_TS
4762 * @param RTCx RTC Instance
4765 __STATIC_INLINE
void LL_RTC_DisableIT_TS(RTC_TypeDef
*RTCx
)
4767 CLEAR_BIT(RTCx
->CR
, RTC_CR_TSIE
);
4771 * @brief Enable Wakeup timer interrupt
4772 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4773 * @rmtoll RTC_CR WUTIE LL_RTC_EnableIT_WUT
4774 * @param RTCx RTC Instance
4777 __STATIC_INLINE
void LL_RTC_EnableIT_WUT(RTC_TypeDef
*RTCx
)
4779 SET_BIT(RTCx
->CR
, RTC_CR_WUTIE
);
4783 * @brief Disable Wakeup timer interrupt
4784 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4785 * @rmtoll RTC_CR WUTIE LL_RTC_DisableIT_WUT
4786 * @param RTCx RTC Instance
4789 __STATIC_INLINE
void LL_RTC_DisableIT_WUT(RTC_TypeDef
*RTCx
)
4791 CLEAR_BIT(RTCx
->CR
, RTC_CR_WUTIE
);
4795 * @brief Enable Alarm B interrupt
4796 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4797 * @rmtoll RTC_CR ALRBIE LL_RTC_EnableIT_ALRB
4798 * @param RTCx RTC Instance
4801 __STATIC_INLINE
void LL_RTC_EnableIT_ALRB(RTC_TypeDef
*RTCx
)
4803 SET_BIT(RTCx
->CR
, RTC_CR_ALRBIE
);
4807 * @brief Disable Alarm B interrupt
4808 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4809 * @rmtoll RTC_CR ALRBIE LL_RTC_DisableIT_ALRB
4810 * @param RTCx RTC Instance
4813 __STATIC_INLINE
void LL_RTC_DisableIT_ALRB(RTC_TypeDef
*RTCx
)
4815 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRBIE
);
4819 * @brief Enable Alarm A interrupt
4820 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4821 * @rmtoll RTC_CR ALRAIE LL_RTC_EnableIT_ALRA
4822 * @param RTCx RTC Instance
4825 __STATIC_INLINE
void LL_RTC_EnableIT_ALRA(RTC_TypeDef
*RTCx
)
4827 SET_BIT(RTCx
->CR
, RTC_CR_ALRAIE
);
4831 * @brief Disable Alarm A interrupt
4832 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4833 * @rmtoll RTC_CR ALRAIE LL_RTC_DisableIT_ALRA
4834 * @param RTCx RTC Instance
4837 __STATIC_INLINE
void LL_RTC_DisableIT_ALRA(RTC_TypeDef
*RTCx
)
4839 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRAIE
);
4842 #if defined(RTC_TAMPCR_TAMP3E)
4844 * @brief Enable Tamper 3 interrupt
4845 * @rmtoll TAMPCR TAMP3IE LL_RTC_EnableIT_TAMP3
4846 * @param RTCx RTC Instance
4849 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP3(RTC_TypeDef
*RTCx
)
4851 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP3IE
);
4855 * @brief Disable Tamper 3 interrupt
4856 * @rmtoll TAMPCR TAMP3IE LL_RTC_DisableIT_TAMP3
4857 * @param RTCx RTC Instance
4860 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP3(RTC_TypeDef
*RTCx
)
4862 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP3IE
);
4864 #endif /* RTC_TAMPCR_TAMP3E */
4866 #if defined(RTC_TAMPCR_TAMP2E)
4868 * @brief Enable Tamper 2 interrupt
4869 * @rmtoll TAMPCR TAMP2IE LL_RTC_EnableIT_TAMP2
4870 * @param RTCx RTC Instance
4873 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP2(RTC_TypeDef
*RTCx
)
4875 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP2IE
);
4879 * @brief Disable Tamper 2 interrupt
4880 * @rmtoll TAMPCR TAMP2IE LL_RTC_DisableIT_TAMP2
4881 * @param RTCx RTC Instance
4884 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP2(RTC_TypeDef
*RTCx
)
4886 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP2IE
);
4888 #endif /* RTC_TAMPCR_TAMP2E */
4890 #if defined(RTC_TAMPCR_TAMP1E)
4892 * @brief Enable Tamper 1 interrupt
4893 * @rmtoll TAMPCR TAMP1IE LL_RTC_EnableIT_TAMP1
4894 * @param RTCx RTC Instance
4897 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP1(RTC_TypeDef
*RTCx
)
4899 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP1IE
);
4903 * @brief Disable Tamper 1 interrupt
4904 * @rmtoll TAMPCR TAMP1IE LL_RTC_DisableIT_TAMP1
4905 * @param RTCx RTC Instance
4908 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP1(RTC_TypeDef
*RTCx
)
4910 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP1IE
);
4912 #endif /* RTC_TAMPCR_TAMP1E */
4914 #if defined(RTC_TAMPCR_TAMPIE)
4916 * @brief Enable all Tamper Interrupt
4917 * @rmtoll TAMPCR TAMPIE LL_RTC_EnableIT_TAMP
4918 * @param RTCx RTC Instance
4921 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP(RTC_TypeDef
*RTCx
)
4923 SET_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPIE
);
4927 * @brief Disable all Tamper Interrupt
4928 * @rmtoll TAMPCR TAMPIE LL_RTC_DisableIT_TAMP
4929 * @param RTCx RTC Instance
4932 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP(RTC_TypeDef
*RTCx
)
4934 CLEAR_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPIE
);
4936 #endif /* RTC_TAMPCR_TAMPIE */
4939 * @brief Check if Time-stamp interrupt is enabled or not
4940 * @rmtoll CR TSIE LL_RTC_IsEnabledIT_TS
4941 * @param RTCx RTC Instance
4942 * @retval State of bit (1 or 0).
4944 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef
*RTCx
)
4946 return ((READ_BIT(RTCx
->CR
, RTC_CR_TSIE
) == (RTC_CR_TSIE
)) ? 1UL : 0UL);
4950 * @brief Check if Wakeup timer interrupt is enabled or not
4951 * @rmtoll CR WUTIE LL_RTC_IsEnabledIT_WUT
4952 * @param RTCx RTC Instance
4953 * @retval State of bit (1 or 0).
4955 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef
*RTCx
)
4957 return ((READ_BIT(RTCx
->CR
, RTC_CR_WUTIE
) == (RTC_CR_WUTIE
)) ? 1UL : 0UL);
4961 * @brief Check if Alarm B interrupt is enabled or not
4962 * @rmtoll CR ALRBIE LL_RTC_IsEnabledIT_ALRB
4963 * @param RTCx RTC Instance
4964 * @retval State of bit (1 or 0).
4966 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef
*RTCx
)
4968 return ((READ_BIT(RTCx
->CR
, RTC_CR_ALRBIE
) == (RTC_CR_ALRBIE
)) ? 1UL : 0UL);
4972 * @brief Check if Alarm A interrupt is enabled or not
4973 * @rmtoll CR ALRAIE LL_RTC_IsEnabledIT_ALRA
4974 * @param RTCx RTC Instance
4975 * @retval State of bit (1 or 0).
4977 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef
*RTCx
)
4979 return ((READ_BIT(RTCx
->CR
, RTC_CR_ALRAIE
) == (RTC_CR_ALRAIE
)) ? 1UL : 0UL);
4982 #if defined(RTC_TAMPCR_TAMP3E)
4984 * @brief Check if Tamper 3 interrupt is enabled or not
4985 * @rmtoll TAMPCR TAMP3IE LL_RTC_IsEnabledIT_TAMP3
4986 * @param RTCx RTC Instance
4987 * @retval State of bit (1 or 0).
4989 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef
*RTCx
)
4991 return ((READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP3IE
) == (RTC_TAMPCR_TAMP3IE
)) ? 1UL : 0UL);
4993 #endif /* RTC_TAMPCR_TAMP3E */
4995 #if defined(RTC_TAMPCR_TAMP2E)
4997 * @brief Check if Tamper 2 interrupt is enabled or not
4998 * @rmtoll TAMPCR TAMP2IE LL_RTC_IsEnabledIT_TAMP2
4999 * @param RTCx RTC Instance
5000 * @retval State of bit (1 or 0).
5002 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP2(RTC_TypeDef
*RTCx
)
5004 return ((READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP2IE
) == (RTC_TAMPCR_TAMP2IE
)) ? 1UL : 0UL);
5007 #endif /* RTC_TAMPCR_TAMP2E */
5009 #if defined(RTC_TAMPCR_TAMP1E)
5011 * @brief Check if Tamper 1 interrupt is enabled or not
5012 * @rmtoll TAMPCR TAMP1IE LL_RTC_IsEnabledIT_TAMP1
5013 * @param RTCx RTC Instance
5014 * @retval State of bit (1 or 0).
5016 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP1(RTC_TypeDef
*RTCx
)
5018 return ((READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMP1IE
) == (RTC_TAMPCR_TAMP1IE
)) ? 1UL : 0UL);
5020 #endif /* RTC_TAMPCR_TAMP1E */
5022 #if defined(RTC_TAMPCR_TAMPIE)
5024 * @brief Check if all the TAMPER interrupts are enabled or not
5025 * @rmtoll TAMPCR TAMPIE LL_RTC_IsEnabledIT_TAMP
5026 * @param RTCx RTC Instance
5027 * @retval State of bit (1 or 0).
5029 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef
*RTCx
)
5031 return ((READ_BIT(RTCx
->TAMPCR
, RTC_TAMPCR_TAMPIE
) == (RTC_TAMPCR_TAMPIE
)) ? 1UL : 0UL);
5033 #endif /* RTC_TAMPCR_TAMPIE */
5035 #if defined(TAMP_CR1_TAMP1E)
5037 * @brief Enable tamper 1 interrupt.
5038 * @rmtoll TAMP_IER TAMP1IE LL_RTC_EnableIT_TAMP1
5039 * @param TAMPx TAMP Instance
5042 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP1(TAMP_TypeDef
*TAMPx
)
5044 SET_BIT(TAMPx
->IER
, TAMP_IER_TAMP1IE
);
5048 * @brief Disable tamper 1 interrupt.
5049 * @rmtoll TAMP_IER TAMP1IE LL_RTC_DisableIT_TAMP1
5050 * @param TAMPx TAMP Instance
5053 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP1(TAMP_TypeDef
*TAMPx
)
5055 CLEAR_BIT(TAMPx
->IER
, TAMP_IER_TAMP1IE
);
5057 #endif /* TAMP_CR1_TAMP1E */
5059 #if defined(TAMP_CR1_TAMP2E)
5061 * @brief Enable tamper 2 interrupt.
5062 * @rmtoll TAMP_IER TAMP2IE LL_RTC_EnableIT_TAMP2
5063 * @param TAMPx TAMP Instance
5066 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP2(TAMP_TypeDef
*TAMPx
)
5068 SET_BIT(TAMPx
->IER
, TAMP_IER_TAMP2IE
);
5072 * @brief Disable tamper 2 interrupt.
5073 * @rmtoll TAMP_IER TAMP2IE LL_RTC_DisableIT_TAMP2
5074 * @param TAMPx TAMP Instance
5077 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP2(TAMP_TypeDef
*TAMPx
)
5079 CLEAR_BIT(TAMPx
->IER
, TAMP_IER_TAMP2IE
);
5081 #endif /* TAMP_CR1_TAMP2E */
5083 #if defined(TAMP_CR1_TAMP3E)
5085 * @brief Enable tamper 3 interrupt.
5086 * @rmtoll TAMP_IER TAMP3IE LL_RTC_EnableIT_TAMP3
5087 * @param TAMPx TAMP Instance
5090 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP3(TAMP_TypeDef
*TAMPx
)
5092 SET_BIT(TAMPx
->IER
, TAMP_IER_TAMP3IE
);
5096 * @brief Disable tamper 3 interrupt.
5097 * @rmtoll TAMP_IER TAMP3IE LL_RTC_DisableIT_TAMP3
5098 * @param TAMPx TAMP Instance
5101 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP3(TAMP_TypeDef
*TAMPx
)
5103 CLEAR_BIT(TAMPx
->IER
, TAMP_IER_TAMP3IE
);
5105 #endif /* TAMP_CR1_TAMP3E */
5107 #if defined(TAMP_CR1_TAMP1E)
5109 * @brief Check if tamper 1 interrupt is enabled or not.
5110 * @rmtoll TAMP_IER TAMP1IE LL_RTC_IsEnabledIT_TAMP1
5111 * @param TAMPx TAMP Instance
5112 * @retval State of bit (1 or 0).
5114 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP1(TAMP_TypeDef
*TAMPx
)
5116 return ((READ_BIT(TAMPx
->IER
, TAMP_IER_TAMP1IE
) == (TAMP_IER_TAMP1IE
)) ? 1UL : 0UL);
5118 #endif /* TAMP_CR1_TAMP1E */
5120 #if defined(TAMP_CR1_TAMP2E)
5122 * @brief Check if tamper 2 interrupt is enabled or not.
5123 * @rmtoll TAMP_IER TAMP2IE LL_RTC_IsEnabledIT_TAMP2
5124 * @param TAMPx TAMP Instance
5125 * @retval State of bit (1 or 0).
5127 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP2(TAMP_TypeDef
*TAMPx
)
5129 return ((READ_BIT(TAMPx
->IER
, TAMP_IER_TAMP2IE
) == (TAMP_IER_TAMP2IE
)) ? 1UL : 0UL);
5131 #endif /* TAMP_CR1_TAMP2E */
5133 #if defined(TAMP_CR1_TAMP3E)
5135 * @brief Check if tamper 3 interrupt is enabled or not.
5136 * @rmtoll TAMP_IER TAMP3IE LL_RTC_IsEnabledIT_TAMP3
5137 * @param TAMPx TAMP Instance
5138 * @retval State of bit (1 or 0).
5140 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP3(TAMP_TypeDef
*TAMPx
)
5142 return ((READ_BIT(TAMPx
->IER
, TAMP_IER_TAMP3IE
) == (TAMP_IER_TAMP3IE
)) ? 1UL : 0UL);
5144 #endif /* TAMP_CR1_TAMP3E */
5150 #if defined (TAMP_ATCR1_TAMP1AM)
5151 /** @defgroup RTC_LL_EF_Active_Tamper Active Tamper
5155 * @brief Enable tamper active mode.
5156 * @rmtoll TAMP_ATCR1 TAMP1AM LL_RTC_TAMPER_ATAMP_EnableActiveMode
5157 * @rmtoll TAMP_ATCR1 TAMP2AM LL_RTC_TAMPER_ATAMP_EnableActiveMode
5158 * @rmtoll TAMP_ATCR1 TAMPxAM LL_RTC_TAMPER_ATAMP_EnableActiveMode
5159 * @param Tamper to configure as active. This parameter can be a combination of the following values:
5160 * @arg @ref RTC_LL_EC_ACTIVE_MODE
5164 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_EnableActiveMode(uint32_t Tamper
)
5166 SET_BIT(TAMP
->ATCR1
, Tamper
);
5170 * @brief Disable tamper active mode.
5171 * @rmtoll TAMP_ATCR1 TAMP1AM LL_RTC_TAMPER_ATAMP_DisableActiveMode
5172 * @rmtoll TAMP_ATCR1 TAMP2AM LL_RTC_TAMPER_ATAMP_DisableActiveMode
5173 * @rmtoll TAMP_ATCR1 TAMPxAM LL_RTC_TAMPER_ATAMP_DisableActiveMode
5174 * @param Tamper to configure as active. This parameter can be a combination of the following values:
5175 * @arg @ref RTC_LL_EC_ACTIVE_MODE
5179 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_DisableActiveMode(uint32_t Tamper
)
5181 CLEAR_BIT(TAMP
->ATCR1
, Tamper
);
5185 * @brief Enable active tamper filter.
5186 * @rmtoll TAMP_ATCR1 FLTEN LL_RTC_TAMPER_ATAMP_EnableFilter
5189 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_EnableFilter(void)
5191 SET_BIT(TAMP
->ATCR1
, TAMP_ATCR1_FLTEN
);
5195 * @brief Disable active tamper filter.
5196 * @rmtoll TAMP_ATCR1 FLTEN LL_RTC_TAMPER_ATAMP_DisableFilter
5199 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_DisableFilter(void)
5201 CLEAR_BIT(TAMP
->ATCR1
, TAMP_ATCR1_FLTEN
);
5205 * @brief Set Active tamper output change period.
5206 * @rmtoll TAMP_ATCR1 ATPER LL_RTC_TAMPER_ATAMP_SetOutputChangePeriod
5207 * @param ActiveOutputChangePeriod This parameter can be a value from 0 to 7
5210 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_SetOutputChangePeriod(uint32_t ActiveOutputChangePeriod
)
5212 MODIFY_REG(TAMP
->ATCR1
, TAMP_ATCR1_ATPER
, (ActiveOutputChangePeriod
<< TAMP_ATCR1_ATPER_Pos
));
5216 * @brief Get Active tamper output change period.
5217 * @rmtoll TAMP_ATCR1 ATPER LL_RTC_TAMPER_ATAMP_GetOutputChangePeriod
5218 * @retval Output change period. This parameter can be a value from 0 to 7.
5220 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_ATAMP_GetOutputChangePeriod(void)
5222 return (READ_BIT(TAMP
->ATCR1
, TAMP_ATCR1_ATPER
) >> TAMP_ATCR1_ATPER_Pos
);
5226 * @brief Set Active tamper asynchronous prescaler clock selection.
5227 * @rmtoll TAMP_ATCR1 ATCKSEL LL_RTC_TAMPER_ATAMP_SetAsyncPrescaler
5228 * @param ActiveAsynvPrescaler Specifies the Active Tamper asynchronous Prescaler clock.
5229 This parameter can be a value of the following values:
5230 * @arg @ref RTC_LL_EC_ACTIVE_ASYNC_PRESCALER
5233 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_SetAsyncPrescaler(uint32_t ActiveAsynvPrescaler
)
5235 MODIFY_REG(TAMP
->ATCR1
, TAMP_ATCR1_ATCKSEL
, ActiveAsynvPrescaler
);
5239 * @brief Get Active tamper asynchronous prescaler clock selection.
5240 * @rmtoll TAMP_ATCR1 ATCKSEL LL_RTC_TAMPER_ATAMP_GetAsyncPrescaler
5241 * @retval One of @arg @ref RTC_LL_EC_ACTIVE_ASYNC_PRESCALER
5243 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_ATAMP_GetAsyncPrescaler(void)
5245 return (READ_BIT(TAMP
->ATCR1
, TAMP_ATCR1_ATCKSEL
));
5249 * @brief Enable active tamper output sharing.
5250 * @rmtoll TAMP_ATCR1 ATOSHARE LL_RTC_TAMPER_ATAMP_EnableOutputSharing
5253 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_EnableOutputSharing(void)
5255 SET_BIT(TAMP
->ATCR1
, TAMP_ATCR1_ATOSHARE
);
5259 * @brief Disable active tamper output sharing.
5260 * @rmtoll TAMP_ATCR1 ATOSHARE LL_RTC_TAMPER_ATAMP_DisableOutputSharing
5263 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_DisableOutputSharing(void)
5265 CLEAR_BIT(TAMP
->ATCR1
, TAMP_ATCR1_ATOSHARE
);
5269 * @brief Set Active tamper output selection.
5270 * @rmtoll TAMP_ATCR1 ATCKSEL LL_RTC_TAMPER_ATAMP_SetSharedOuputSelection
5271 * @param OutputSelection Specifies all the output selection of the Active Tamper.
5272 This parameter is a combinasation of the following values:
5273 * One of @arg @ref RTC_LL_EC_ACTIVE_OUTPUT_SELECTION
5276 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_SetSharedOuputSelection(uint32_t OutputSelection
)
5278 MODIFY_REG(TAMP
->ATCR1
, (TAMP_ATCR1_ATOSEL1
| TAMP_ATCR1_ATOSEL2
| TAMP_ATCR1_ATOSEL3
), \
5283 * @brief Get Active tamper asynchronous prescaler clock selection.
5284 * @rmtoll TAMP_ATCR2 ATCKSEL LL_RTC_TAMPER_ATAMP_GetAsyncPrescaler
5285 * @retval A combination of @arg @ref RTC_LL_EC_ACTIVE_OUTPUT_SELECTION
5287 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_ATAMP_GetSharedOuputSelection(void)
5289 return (READ_BIT(TAMP
->ATCR1
, (TAMP_ATCR1_ATOSEL1
| TAMP_ATCR1_ATOSEL2
| TAMP_ATCR1_ATOSEL3
)));
5291 #endif /* TAMP_ATCR1_TAMP1AM */
5293 #if defined(ATSEEDR)
5295 * @brief Write active tamper seed.
5296 * @rmtoll TAMP_ATSEEDR SEED LL_RTC_TAMPER_ATAMP_WriteSeed
5300 __STATIC_INLINE
void LL_RTC_TAMPER_ATAMP_WriteSeed(uint32_t Seed
)
5302 WRITE_REG(TAMP
->ATSEEDR
, Seed
);
5304 #endif /* ATSEEDR */
5306 #if defined(TAMP_ATOR_INITS)
5308 * @brief Get active tamper initialization status flag.
5309 * @rmtoll TAMP_ATOR INITS LL_RTC_IsActiveFlag_ATAMP_INITS
5310 * @retval State of bit (1 or 0).
5312 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ATAMP_INITS(void)
5314 return ((READ_BIT(TAMP
->ATOR
, TAMP_ATOR_INITS
) == (TAMP_ATOR_INITS
)) ? 1U : 0U);
5318 * @brief Get active tamper seed running status flag.
5319 * @rmtoll TAMP_ATOR INITS LL_RTC_IsActiveFlag_ATAMP_INITS
5320 * @retval State of bit (1 or 0).
5322 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ATAMP_SEEDF(void)
5324 return ((READ_BIT(TAMP
->ATOR
, TAMP_ATOR_SEEDF
) == (TAMP_ATOR_SEEDF
)) ? 1U : 0U);
5326 #endif /* TAMP_ATOR_INITS */
5333 #if defined(USE_FULL_LL_DRIVER)
5334 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
5338 ErrorStatus
LL_RTC_DeInit(RTC_TypeDef
*RTCx
);
5339 ErrorStatus
LL_RTC_Init(RTC_TypeDef
*RTCx
, LL_RTC_InitTypeDef
*RTC_InitStruct
);
5340 void LL_RTC_StructInit(LL_RTC_InitTypeDef
*RTC_InitStruct
);
5341 ErrorStatus
LL_RTC_TIME_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_TimeTypeDef
*RTC_TimeStruct
);
5342 void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef
*RTC_TimeStruct
);
5343 ErrorStatus
LL_RTC_DATE_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_DateTypeDef
*RTC_DateStruct
);
5344 void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef
*RTC_DateStruct
);
5345 ErrorStatus
LL_RTC_ALMA_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5346 ErrorStatus
LL_RTC_ALMB_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5347 void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5348 void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5349 ErrorStatus
LL_RTC_EnterInitMode(RTC_TypeDef
*RTCx
);
5350 ErrorStatus
LL_RTC_ExitInitMode(RTC_TypeDef
*RTCx
);
5351 ErrorStatus
LL_RTC_WaitForSynchro(RTC_TypeDef
*RTCx
);
5356 #endif /* USE_FULL_LL_DRIVER */
5366 #endif /* defined(RTC) */
5376 #endif /* STM32H7xx_LL_RTC_H */
5378 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/