2 ******************************************************************************
3 * @file stm32g4xx_ll_rtc.h
4 * @author MCD Application Team
5 * @brief Header file of RTC LL module.
6 ******************************************************************************
9 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
11 * This software component is licensed by ST under BSD 3-Clause license,
12 * the "License"; You may not use this file except in compliance with the
13 * License. You may obtain a copy of the License at:
14 * opensource.org/licenses/BSD-3-Clause
16 ******************************************************************************
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32G4xx_LL_RTC_H
21 #define STM32G4xx_LL_RTC_H
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32g4xx.h"
30 /** @addtogroup STM32G4xx_LL_Driver
36 /** @defgroup RTC_LL RTC
40 /* Private types -------------------------------------------------------------*/
41 /* Private variables ---------------------------------------------------------*/
42 /* Private constants ---------------------------------------------------------*/
43 /** @defgroup RTC_LL_Private_Constants RTC Private Constants
46 /* Masks Definition */
47 #define RTC_LL_INIT_MASK 0xFFFFFFFFU
48 #define RTC_LL_RSF_MASK 0xFFFFFF5FU
50 /* Write protection defines */
51 #define RTC_WRITE_PROTECTION_DISABLE (uint8_t)0xFF
52 #define RTC_WRITE_PROTECTION_ENABLE_1 (uint8_t)0xCA
53 #define RTC_WRITE_PROTECTION_ENABLE_2 (uint8_t)0x53
55 /* Defines used to combine date & time */
56 #define RTC_OFFSET_WEEKDAY 24U
57 #define RTC_OFFSET_DAY 16U
58 #define RTC_OFFSET_MONTH 8U
59 #define RTC_OFFSET_HOUR 16U
60 #define RTC_OFFSET_MINUTE 8U
66 /* Private macros ------------------------------------------------------------*/
67 #if defined(USE_FULL_LL_DRIVER)
68 /** @defgroup RTC_LL_Private_Macros RTC Private Macros
74 #endif /*USE_FULL_LL_DRIVER*/
77 #define UNUSED(x) ((void)(x))
80 /* Exported types ------------------------------------------------------------*/
81 #if defined(USE_FULL_LL_DRIVER)
82 /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure
87 * @brief RTC Init structures definition
91 uint32_t HourFormat
; /*!< Specifies the RTC Hours Format.
92 This parameter can be a value of @ref RTC_LL_EC_HOURFORMAT
94 This feature can be modified afterwards using unitary function
95 @ref LL_RTC_SetHourFormat(). */
97 uint32_t AsynchPrescaler
; /*!< Specifies the RTC Asynchronous Predivider value.
98 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F
100 This feature can be modified afterwards using unitary function
101 @ref LL_RTC_SetAsynchPrescaler(). */
103 uint32_t SynchPrescaler
; /*!< Specifies the RTC Synchronous Predivider value.
104 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF
106 This feature can be modified afterwards using unitary function
107 @ref LL_RTC_SetSynchPrescaler(). */
108 } LL_RTC_InitTypeDef
;
111 * @brief RTC Time structure definition
115 uint32_t TimeFormat
; /*!< Specifies the RTC AM/PM Time.
116 This parameter can be a value of @ref RTC_LL_EC_TIME_FORMAT
118 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetFormat(). */
120 uint8_t Hours
; /*!< Specifies the RTC Time Hours.
121 This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the @ref LL_RTC_TIME_FORMAT_PM is selected.
122 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.
124 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetHour(). */
126 uint8_t Minutes
; /*!< Specifies the RTC Time Minutes.
127 This parameter must be a number between Min_Data = 0 and Max_Data = 59
129 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetMinute(). */
131 uint8_t Seconds
; /*!< Specifies the RTC Time Seconds.
132 This parameter must be a number between Min_Data = 0 and Max_Data = 59
134 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetSecond(). */
135 } LL_RTC_TimeTypeDef
;
138 * @brief RTC Date structure definition
142 uint8_t WeekDay
; /*!< Specifies the RTC Date WeekDay.
143 This parameter can be a value of @ref RTC_LL_EC_WEEKDAY
145 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetWeekDay(). */
147 uint8_t Month
; /*!< Specifies the RTC Date Month.
148 This parameter can be a value of @ref RTC_LL_EC_MONTH
150 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetMonth(). */
152 uint8_t Day
; /*!< Specifies the RTC Date Day.
153 This parameter must be a number between Min_Data = 1 and Max_Data = 31
155 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetDay(). */
157 uint8_t Year
; /*!< Specifies the RTC Date Year.
158 This parameter must be a number between Min_Data = 0 and Max_Data = 99
160 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetYear(). */
161 } LL_RTC_DateTypeDef
;
164 * @brief RTC Alarm structure definition
168 LL_RTC_TimeTypeDef AlarmTime
; /*!< Specifies the RTC Alarm Time members. */
170 uint32_t AlarmMask
; /*!< Specifies the RTC Alarm Masks.
171 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.
173 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetMask() for ALARM A
174 or @ref LL_RTC_ALMB_SetMask() for ALARM B
177 uint32_t AlarmDateWeekDaySel
; /*!< Specifies the RTC Alarm is on day or WeekDay.
178 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
180 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_EnableWeekday() or @ref LL_RTC_ALMA_DisableWeekday()
181 for ALARM A or @ref LL_RTC_ALMB_EnableWeekday() or @ref LL_RTC_ALMB_DisableWeekday() for ALARM B
184 uint8_t AlarmDateWeekDay
; /*!< Specifies the RTC Alarm Day/WeekDay.
185 If AlarmDateWeekDaySel set to day, this parameter must be a number between Min_Data = 1 and Max_Data = 31.
187 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetDay()
188 for ALARM A or @ref LL_RTC_ALMB_SetDay() for ALARM B.
190 If AlarmDateWeekDaySel set to Weekday, this parameter can be a value of @ref RTC_LL_EC_WEEKDAY.
192 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetWeekDay()
193 for ALARM A or @ref LL_RTC_ALMB_SetWeekDay() for ALARM B.
195 } LL_RTC_AlarmTypeDef
;
200 #endif /* USE_FULL_LL_DRIVER */
202 /* Exported constants --------------------------------------------------------*/
203 /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants
207 #if defined(USE_FULL_LL_DRIVER)
208 /** @defgroup RTC_LL_EC_FORMAT FORMAT
211 #define LL_RTC_FORMAT_BIN 0x00000000U /*!< Binary data format */
212 #define LL_RTC_FORMAT_BCD 0x00000001U /*!< BCD data format */
217 /** @defgroup RTC_LL_EC_ALMA_WEEKDAY_SELECTION RTC Alarm A Date WeekDay
220 #define LL_RTC_ALMA_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm A Date is selected */
221 #define LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL /*!< Alarm A WeekDay is selected */
226 /** @defgroup RTC_LL_EC_ALMB_WEEKDAY_SELECTION RTC Alarm B Date WeekDay
229 #define LL_RTC_ALMB_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm B Date is selected */
230 #define LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMBR_WDSEL /*!< Alarm B WeekDay is selected */
235 #endif /* USE_FULL_LL_DRIVER */
237 /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines
238 * @brief Flags defines which can be used with LL_RTC_ReadReg function
241 #define LL_RTC_SCR_ITSF RTC_SCR_CITSF
242 #define LL_RTC_SCR_TSOVF RTC_SCR_CTSOVF
243 #define LL_RTC_SCR_TSF RTC_SCR_CTSF
244 #define LL_RTC_SCR_WUTF RTC_SCR_CWUTF
245 #define LL_RTC_SCR_ALRBF RTC_SCR_CALRBF
246 #define LL_RTC_CSR_ALRAF RTC_SCR_CALRAF
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 #define LL_RTC_ICSR_ALRBWF RTC_ICSR_ALRBWF
255 #define LL_RTC_ICSR_ALRAWF RTC_ICSR_ALRAWF
260 /** @defgroup RTC_LL_EC_IT IT Defines
261 * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions
264 #define LL_RTC_CR_TSIE RTC_CR_TSIE
265 #define LL_RTC_CR_WUTIE RTC_CR_WUTIE
266 #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE
267 #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE
272 /** @defgroup RTC_LL_EC_WEEKDAY WEEK DAY
275 #define LL_RTC_WEEKDAY_MONDAY (uint8_t)0x01 /*!< Monday */
276 #define LL_RTC_WEEKDAY_TUESDAY (uint8_t)0x02 /*!< Tuesday */
277 #define LL_RTC_WEEKDAY_WEDNESDAY (uint8_t)0x03 /*!< Wednesday */
278 #define LL_RTC_WEEKDAY_THURSDAY (uint8_t)0x04 /*!< Thrusday */
279 #define LL_RTC_WEEKDAY_FRIDAY (uint8_t)0x05 /*!< Friday */
280 #define LL_RTC_WEEKDAY_SATURDAY (uint8_t)0x06 /*!< Saturday */
281 #define LL_RTC_WEEKDAY_SUNDAY (uint8_t)0x07 /*!< Sunday */
286 /** @defgroup RTC_LL_EC_MONTH MONTH
289 #define LL_RTC_MONTH_JANUARY (uint8_t)0x01 /*!< January */
290 #define LL_RTC_MONTH_FEBRUARY (uint8_t)0x02 /*!< February */
291 #define LL_RTC_MONTH_MARCH (uint8_t)0x03 /*!< March */
292 #define LL_RTC_MONTH_APRIL (uint8_t)0x04 /*!< April */
293 #define LL_RTC_MONTH_MAY (uint8_t)0x05 /*!< May */
294 #define LL_RTC_MONTH_JUNE (uint8_t)0x06 /*!< June */
295 #define LL_RTC_MONTH_JULY (uint8_t)0x07 /*!< July */
296 #define LL_RTC_MONTH_AUGUST (uint8_t)0x08 /*!< August */
297 #define LL_RTC_MONTH_SEPTEMBER (uint8_t)0x09 /*!< September */
298 #define LL_RTC_MONTH_OCTOBER (uint8_t)0x10 /*!< October */
299 #define LL_RTC_MONTH_NOVEMBER (uint8_t)0x11 /*!< November */
300 #define LL_RTC_MONTH_DECEMBER (uint8_t)0x12 /*!< December */
305 /** @defgroup RTC_LL_EC_HOURFORMAT HOUR FORMAT
308 #define LL_RTC_HOURFORMAT_24HOUR 0x00000000U /*!< 24 hour/day format */
309 #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */
314 /** @defgroup RTC_LL_EC_ALARMOUT ALARM OUTPUT
317 #define LL_RTC_ALARMOUT_DISABLE 0x00000000U /*!< Output disabled */
318 #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */
319 #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */
320 #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */
325 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUT TYPE
328 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 0x00000000U /*!< RTC_ALARM is open-drain output */
329 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_CR_TAMPALRM_TYPE /*!< RTC_ALARM is push-pull output */
334 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUT POLARITY PIN
337 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH 0x00000000U /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/
338 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */
343 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT
346 #define LL_RTC_TIME_FORMAT_AM_OR_24 0x00000000U /*!< AM or 24-hour format */
347 #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */
352 /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND
355 #define LL_RTC_SHIFT_SECOND_DELAY 0x00000000U /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */
356 #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */
361 /** @defgroup RTC_LL_EC_ALMA_MASK ALARMA MASK
364 #define LL_RTC_ALMA_MASK_NONE 0x00000000U /*!< No masks applied on Alarm A*/
365 #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */
366 #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */
367 #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */
368 #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */
369 #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */
374 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALARMA TIME FORMAT
377 #define LL_RTC_ALMA_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
378 #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */
383 /** @defgroup RTC_LL_EC_ALMB_MASK ALARMB MASK
386 #define LL_RTC_ALMB_MASK_NONE 0x00000000U /*!< No masks applied on Alarm B*/
387 #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */
388 #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */
389 #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */
390 #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */
391 #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */
396 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALARMB TIME FORMAT
399 #define LL_RTC_ALMB_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
400 #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */
405 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE
408 #define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
409 #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */
414 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TIMESTAMP TIME FORMAT
417 #define LL_RTC_TS_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
418 #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */
423 /** @defgroup RTC_LL_EC_TAMPER TAMPER
426 #define LL_RTC_TAMPER_1 TAMP_CR1_TAMP1E /*!< Tamper 1 input detection */
427 #define LL_RTC_TAMPER_2 TAMP_CR1_TAMP2E /*!< Tamper 2 input detection */
428 #if (RTC_TAMP_NB == 3)
429 #define LL_RTC_TAMPER_3 TAMP_CR1_TAMP3E /*!< Tamper 3 input detection */
430 #elif (RTC_TAMP_NB == 8)
431 #define LL_RTC_TAMPER_3 TAMP_CR1_TAMP3E /*!< Tamper 3 input detection */
432 #define LL_RTC_TAMPER_3 TAMP_CR1_TAMP3E /*!< Tamper 3 input detection */
433 #define LL_RTC_TAMPER_4 TAMP_CR1_TAMP4E /*!< Tamper 4 input detection */
434 #define LL_RTC_TAMPER_5 TAMP_CR1_TAMP5E /*!< Tamper 5 input detection */
435 #define LL_RTC_TAMPER_6 TAMP_CR1_TAMP6E /*!< Tamper 6 input detection */
436 #define LL_RTC_TAMPER_7 TAMP_CR1_TAMP7E /*!< Tamper 7 input detection */
437 #define LL_RTC_TAMPER_8 TAMP_CR1_TAMP8E /*!< Tamper 8 input detection */
439 #warning "RTC_TAMP_NB is not correct"
440 #endif /* (RTC_TAMP_NB) */
445 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK
448 #define LL_RTC_TAMPER_MASK_TAMPER1 TAMP_CR2_TAMP1MF /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
449 #define LL_RTC_TAMPER_MASK_TAMPER2 TAMP_CR2_TAMP2MF /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
450 #if (RTC_TAMP_NB == 3)
451 #define LL_RTC_TAMPER_MASK_TAMPER3 TAMP_CR2_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
452 #elif (RTC_TAMP_NB == 8)
453 #define LL_RTC_TAMPER_MASK_TAMPER3 TAMP_CR2_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
454 #define LL_RTC_TAMPER_MASK_TAMPER4 TAMP_CR2_TAMP4MF /*!< Tamper 4 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
455 #define LL_RTC_TAMPER_MASK_TAMPER5 TAMP_CR2_TAMP5MF /*!< Tamper 5 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
456 #define LL_RTC_TAMPER_MASK_TAMPER6 TAMP_CR2_TAMP6MF /*!< Tamper 6 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
457 #define LL_RTC_TAMPER_MASK_TAMPER7 TAMP_CR2_TAMP7MF /*!< Tamper 7 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
458 #define LL_RTC_TAMPER_MASK_TAMPER8 TAMP_CR2_TAMP8MF /*!< Tamper 8 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
460 #warning "RTC_TAMP_NB is not correct"
461 #endif /* (RTC_TAMP_NB) */
466 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE
469 #define LL_RTC_TAMPER_NOERASE_TAMPER1 TAMP_CR2_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
470 #define LL_RTC_TAMPER_NOERASE_TAMPER2 TAMP_CR2_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
471 #if (RTC_TAMP_NB == 3)
472 #define LL_RTC_TAMPER_NOERASE_TAMPER3 TAMP_CR2_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
473 #elif (RTC_TAMP_NB == 8)
474 #define LL_RTC_TAMPER_NOERASE_TAMPER3 TAMP_CR2_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
475 #define LL_RTC_TAMPER_NOERASE_TAMPER4 TAMP_CR2_TAMP4NOERASE /*!< Tamper 4 event does not erase the backup registers. */
476 #define LL_RTC_TAMPER_NOERASE_TAMPER5 TAMP_CR2_TAMP5NOERASE /*!< Tamper 5 event does not erase the backup registers. */
477 #define LL_RTC_TAMPER_NOERASE_TAMPER6 TAMP_CR2_TAMP6NOERASE /*!< Tamper 6 event does not erase the backup registers. */
478 #define LL_RTC_TAMPER_NOERASE_TAMPER7 TAMP_CR2_TAMP7NOERASE /*!< Tamper 7 event does not erase the backup registers. */
479 #define LL_RTC_TAMPER_NOERASE_TAMPER8 TAMP_CR2_TAMP8NOERASE /*!< Tamper 8 event does not erase the backup registers. */
481 #warning "RTC_TAMP_NB is not correct"
482 #endif /* (RTC_TAMP_NB) */
487 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION
490 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */
491 #define LL_RTC_TAMPER_DURATION_2RTCCLK TAMP_FLTCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
492 #define LL_RTC_TAMPER_DURATION_4RTCCLK TAMP_FLTCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
493 #define LL_RTC_TAMPER_DURATION_8RTCCLK TAMP_FLTCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
498 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER
501 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */
502 #define LL_RTC_TAMPER_FILTER_2SAMPLE TAMP_FLTCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */
503 #define LL_RTC_TAMPER_FILTER_4SAMPLE TAMP_FLTCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */
504 #define LL_RTC_TAMPER_FILTER_8SAMPLE TAMP_FLTCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */
509 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER
512 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */
513 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 TAMP_FLTCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */
514 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 TAMP_FLTCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */
515 #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 */
516 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 TAMP_FLTCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */
517 #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 */
518 #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 */
519 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 TAMP_FLTCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */
524 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL
527 #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 */
528 #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 */
529 #if (RTC_TAMP_NB == 3)
530 #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 */
531 #elif (RTC_TAMP_NB == 8)
532 #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 */
533 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP4 TAMP_CR2_TAMP4TRG /*!< Tamper 4 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
534 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP5 TAMP_CR2_TAMP5TRG /*!< Tamper 5 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
535 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP6 TAMP_CR2_TAMP6TRG /*!< Tamper 6 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
536 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP7 TAMP_CR2_TAMP7TRG /*!< Tamper 7 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
537 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP8 TAMP_CR2_TAMP8TRG /*!< Tamper 8 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */
538 #endif /* (RTC_TAMP_NB) */
544 /** @defgroup RTC_LL_EC_INTERNAL INTERNAL TAMPER
547 #define LL_RTC_TAMPER_ITAMP1 TAMP_CR1_ITAMP1E /*!< Internal tamper 1: RTC supply voltage monitoring */
548 #if defined (RTC_TAMP_INT_2_SUPPORT)
549 #define LL_RTC_TAMPER_ITAMP2 TAMP_CR1_ITAMP2E /*!< Internal tamper 2: temperature monitoring */
550 #endif /* RTC_TAMP_INT_2_SUPPORT */
551 #define LL_RTC_TAMPER_ITAMP3 TAMP_CR1_ITAMP3E /*!< Internal tamper 3: LSE monitoring */
552 #define LL_RTC_TAMPER_ITAMP4 TAMP_CR1_ITAMP4E /*!< Internal tamper 4: HSE monitoring */
553 #define LL_RTC_TAMPER_ITAMP5 TAMP_CR1_ITAMP5E /*!< Internal tamper 5: RTC calendar overflow */
554 #if defined (RTC_TAMP_INT_6_SUPPORT)
555 #define LL_RTC_TAMPER_ITAMP6 TAMP_CR1_ITAMP6E /*!< Internal tamper 6: Test mode entry */
556 #endif /* RTC_TAMP_INT_6_SUPPORT */
557 #if defined (RTC_TAMP_INT_7_SUPPORT)
558 #define LL_RTC_TAMPER_ITAMP7 TAMP_CR1_ITAMP7E /*!< Internal tamper 7: Readout protection level decrease */
559 #endif /* RTC_TAMP_INT_7_SUPPORT */
560 #if defined (RTC_TAMP_INT_8_SUPPORT)
561 #define LL_RTC_TAMPER_ITAMP8 TAMP_CR1_ITAMP8E /*!< Internal tamper 8: Monotonic counter overflow */
562 #endif /* RTC_TAMP_INT_8_SUPPORT */
568 /** @defgroup RTC_LL_EC_BKP BACKUP
571 #define LL_RTC_BKP_NUMBER RTC_BACKUP_NB
572 #if (LL_RTC_BKP_NUMBER == 5)
573 #define LL_RTC_BKP_DR0 0x00U
574 #define LL_RTC_BKP_DR1 0x01U
575 #define LL_RTC_BKP_DR2 0x02U
576 #define LL_RTC_BKP_DR3 0x03U
577 #define LL_RTC_BKP_DR4 0x04U
578 #elif (LL_RTC_BKP_NUMBER == 16)
579 #define LL_RTC_BKP_DR0 0x00U
580 #define LL_RTC_BKP_DR1 0x01U
581 #define LL_RTC_BKP_DR2 0x02U
582 #define LL_RTC_BKP_DR3 0x03U
583 #define LL_RTC_BKP_DR4 0x04U
584 #define LL_RTC_BKP_DR5 0x05U
585 #define LL_RTC_BKP_DR6 0x06U
586 #define LL_RTC_BKP_DR7 0x07U
587 #define LL_RTC_BKP_DR8 0x08U
588 #define LL_RTC_BKP_DR9 0x09U
589 #define LL_RTC_BKP_DR10 0x0AU
590 #define LL_RTC_BKP_DR11 0x0BU
591 #define LL_RTC_BKP_DR12 0x0CU
592 #define LL_RTC_BKP_DR13 0x0DU
593 #define LL_RTC_BKP_DR14 0x0EU
594 #define LL_RTC_BKP_DR15 0x0FU
595 #elif (LL_RTC_BKP_NUMBER == 32)
596 #define LL_RTC_BKP_DR0 0x00U
597 #define LL_RTC_BKP_DR1 0x01U
598 #define LL_RTC_BKP_DR2 0x02U
599 #define LL_RTC_BKP_DR3 0x03U
600 #define LL_RTC_BKP_DR4 0x04U
601 #define LL_RTC_BKP_DR5 0x05U
602 #define LL_RTC_BKP_DR6 0x06U
603 #define LL_RTC_BKP_DR7 0x07U
604 #define LL_RTC_BKP_DR8 0x08U
605 #define LL_RTC_BKP_DR9 0x09U
606 #define LL_RTC_BKP_DR10 0x0AU
607 #define LL_RTC_BKP_DR11 0x0BU
608 #define LL_RTC_BKP_DR12 0x0CU
609 #define LL_RTC_BKP_DR13 0x0DU
610 #define LL_RTC_BKP_DR14 0x0EU
611 #define LL_RTC_BKP_DR15 0x0FU
612 #define LL_RTC_BKP_DR16 0x10U
613 #define LL_RTC_BKP_DR17 0x11U
614 #define LL_RTC_BKP_DR18 0x12U
615 #define LL_RTC_BKP_DR19 0x13U
616 #define LL_RTC_BKP_DR20 0x14U
617 #define LL_RTC_BKP_DR21 0x15U
618 #define LL_RTC_BKP_DR22 0x16U
619 #define LL_RTC_BKP_DR23 0x17U
620 #define LL_RTC_BKP_DR24 0x18U
621 #define LL_RTC_BKP_DR25 0x19U
622 #define LL_RTC_BKP_DR26 0x1AU
623 #define LL_RTC_BKP_DR27 0x1BU
624 #define LL_RTC_BKP_DR28 0x1CU
625 #define LL_RTC_BKP_DR29 0x1DU
626 #define LL_RTC_BKP_DR30 0x1EU
627 #define LL_RTC_BKP_DR31 0x1FU
629 #error "no LL Backup Registers Definition"
630 #endif /* (LL_RTC_BKP_NUMBER) */
636 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUP CLOCK DIV
639 #define LL_RTC_WAKEUPCLOCK_DIV_16 0x00000000U /*!< RTC/16 clock is selected */
640 #define LL_RTC_WAKEUPCLOCK_DIV_8 RTC_CR_WUCKSEL_0 /*!< RTC/8 clock is selected */
641 #define LL_RTC_WAKEUPCLOCK_DIV_4 RTC_CR_WUCKSEL_1 /*!< RTC/4 clock is selected */
642 #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */
643 #define LL_RTC_WAKEUPCLOCK_CKSPRE RTC_CR_WUCKSEL_2 /*!< ck_spre (usually 1 Hz) clock is selected */
644 #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*/
649 /** @defgroup RTC_LL_EC_CALIB_OUTPUT Calibration output
652 #define LL_RTC_CALIB_OUTPUT_NONE 0x00000000U /*!< Calibration output disabled */
653 #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */
654 #define LL_RTC_CALIB_OUTPUT_512HZ RTC_CR_COE /*!< Calibration output is 512 Hz */
659 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE Calibration pulse insertion
662 #define LL_RTC_CALIB_INSERTPULSE_NONE 0x00000000U /*!< No RTCCLK pulses are added */
663 #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */
668 /** @defgroup RTC_LL_EC_CALIB_PERIOD Calibration period
671 #define LL_RTC_CALIB_PERIOD_32SEC 0x00000000U /*!< Use a 32-second calibration cycle period */
672 #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */
673 #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */
682 /* Exported macro ------------------------------------------------------------*/
683 /** @defgroup RTC_LL_EM_Convert Convert helper Macros
688 * @brief Helper macro to convert a value from 2 digit decimal format to BCD format
689 * @param __VALUE__ Byte to be converted
690 * @retval Converted byte
692 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
695 * @brief Helper macro to convert a value from BCD format to 2 digit decimal format
696 * @param __VALUE__ BCD value to be converted
697 * @retval Converted byte
699 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) ((uint8_t)((((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U) + ((__VALUE__) & (uint8_t)0x0FU)))
705 /** @defgroup RTC_LL_EM_Date Date helper Macros
710 * @brief Helper macro to retrieve weekday.
711 * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function.
712 * @retval Returned value can be one of the following values:
713 * @arg @ref LL_RTC_WEEKDAY_MONDAY
714 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
715 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
716 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
717 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
718 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
719 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
721 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU)
724 * @brief Helper macro to retrieve Year in BCD format
725 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
726 * @retval Year in BCD format (0x00 . . . 0x99)
728 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU)
731 * @brief Helper macro to retrieve Month in BCD format
732 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
733 * @retval Returned value can be one of the following values:
734 * @arg @ref LL_RTC_MONTH_JANUARY
735 * @arg @ref LL_RTC_MONTH_FEBRUARY
736 * @arg @ref LL_RTC_MONTH_MARCH
737 * @arg @ref LL_RTC_MONTH_APRIL
738 * @arg @ref LL_RTC_MONTH_MAY
739 * @arg @ref LL_RTC_MONTH_JUNE
740 * @arg @ref LL_RTC_MONTH_JULY
741 * @arg @ref LL_RTC_MONTH_AUGUST
742 * @arg @ref LL_RTC_MONTH_SEPTEMBER
743 * @arg @ref LL_RTC_MONTH_OCTOBER
744 * @arg @ref LL_RTC_MONTH_NOVEMBER
745 * @arg @ref LL_RTC_MONTH_DECEMBER
747 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU)
750 * @brief Helper macro to retrieve Day in BCD format
751 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
752 * @retval Day in BCD format (0x01 . . . 0x31)
754 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU)
760 /** @defgroup RTC_LL_EM_Time Time helper Macros
765 * @brief Helper macro to retrieve hour in BCD format
766 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
767 * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23)
769 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU)
772 * @brief Helper macro to retrieve minute in BCD format
773 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
774 * @retval Minutes in BCD format (0x00. . .0x59)
776 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU)
779 * @brief Helper macro to retrieve second in BCD format
780 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
781 * @retval Seconds in format (0x00. . .0x59)
783 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU)
793 /* Exported functions --------------------------------------------------------*/
794 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
798 /** @defgroup RTC_LL_EF_Configuration Configuration
803 * @brief Set Hours format (24 hour/day or AM/PM hour format)
804 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
805 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
806 * @rmtoll RTC_CR FMT LL_RTC_SetHourFormat
807 * @param RTCx RTC Instance
808 * @param HourFormat This parameter can be one of the following values:
809 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
810 * @arg @ref LL_RTC_HOURFORMAT_AMPM
813 __STATIC_INLINE
void LL_RTC_SetHourFormat(RTC_TypeDef
*RTCx
, uint32_t HourFormat
)
815 MODIFY_REG(RTCx
->CR
, RTC_CR_FMT
, HourFormat
);
819 * @brief Get Hours format (24 hour/day or AM/PM hour format)
820 * @rmtoll RTC_CR FMT LL_RTC_GetHourFormat
821 * @param RTCx RTC Instance
822 * @retval Returned value can be one of the following values:
823 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
824 * @arg @ref LL_RTC_HOURFORMAT_AMPM
826 __STATIC_INLINE
uint32_t LL_RTC_GetHourFormat(RTC_TypeDef
*RTCx
)
828 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_FMT
));
832 * @brief Select the flag to be routed to RTC_ALARM output
833 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
834 * @rmtoll RTC_CR OSEL LL_RTC_SetAlarmOutEvent
835 * @param RTCx RTC Instance
836 * @param AlarmOutput This parameter can be one of the following values:
837 * @arg @ref LL_RTC_ALARMOUT_DISABLE
838 * @arg @ref LL_RTC_ALARMOUT_ALMA
839 * @arg @ref LL_RTC_ALARMOUT_ALMB
840 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
843 __STATIC_INLINE
void LL_RTC_SetAlarmOutEvent(RTC_TypeDef
*RTCx
, uint32_t AlarmOutput
)
845 MODIFY_REG(RTCx
->CR
, RTC_CR_OSEL
, AlarmOutput
);
849 * @brief Get the flag to be routed to RTC_ALARM output
850 * @rmtoll RTC_CR OSEL LL_RTC_GetAlarmOutEvent
851 * @param RTCx RTC Instance
852 * @retval Returned value can be one of the following values:
853 * @arg @ref LL_RTC_ALARMOUT_DISABLE
854 * @arg @ref LL_RTC_ALARMOUT_ALMA
855 * @arg @ref LL_RTC_ALARMOUT_ALMB
856 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
858 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef
*RTCx
)
860 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_OSEL
));
864 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
865 * @rmtoll RTC_CR TAMPALRM_TYPE LL_RTC_SetAlarmOutputType
866 * @param RTCx RTC Instance
867 * @param Output This parameter can be one of the following values:
868 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
869 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
872 __STATIC_INLINE
void LL_RTC_SetAlarmOutputType(RTC_TypeDef
*RTCx
, uint32_t Output
)
874 MODIFY_REG(RTCx
->CR
, RTC_CR_TAMPALRM_TYPE
, Output
);
878 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
879 * @rmtoll RTC_CR TAMPALRM_TYPE LL_RTC_SetAlarmOutputType
880 * @param RTCx RTC Instance
881 * @retval Returned value can be one of the following values:
882 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
883 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
885 __STATIC_INLINE
uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef
*RTCx
)
887 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_TYPE
));
892 * @brief Enable initialization mode
893 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
894 * and prescaler register (RTC_PRER).
895 * Counters are stopped and start counting from the new value when INIT is reset.
896 * @rmtoll RTC_ICSR INIT LL_RTC_EnableInitMode
897 * @param RTCx RTC Instance
900 __STATIC_INLINE
void LL_RTC_EnableInitMode(RTC_TypeDef
*RTCx
)
902 /* Set the Initialization mode */
903 WRITE_REG(RTCx
->ICSR
, RTC_LL_INIT_MASK
);
907 * @brief Disable initialization mode (Free running mode)
908 * @rmtoll RTC_ICSR INIT LL_RTC_DisableInitMode
909 * @param RTCx RTC Instance
912 __STATIC_INLINE
void LL_RTC_DisableInitMode(RTC_TypeDef
*RTCx
)
914 /* Exit Initialization mode */
915 WRITE_REG(RTCx
->ICSR
, (uint32_t)~RTC_ICSR_INIT
);
919 * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted)
920 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
921 * @rmtoll RTC_CR POL LL_RTC_SetOutputPolarity
922 * @param RTCx RTC Instance
923 * @param Polarity This parameter can be one of the following values:
924 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
925 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
928 __STATIC_INLINE
void LL_RTC_SetOutputPolarity(RTC_TypeDef
*RTCx
, uint32_t Polarity
)
930 MODIFY_REG(RTCx
->CR
, RTC_CR_POL
, Polarity
);
934 * @brief Get Output polarity
935 * @rmtoll RTC_CR POL LL_RTC_GetOutputPolarity
936 * @param RTCx RTC Instance
937 * @retval Returned value can be one of the following values:
938 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
939 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
941 __STATIC_INLINE
uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef
*RTCx
)
943 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_POL
));
947 * @brief Enable Bypass the shadow registers
948 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
949 * @rmtoll RTC_CR BYPSHAD LL_RTC_EnableShadowRegBypass
950 * @param RTCx RTC Instance
953 __STATIC_INLINE
void LL_RTC_EnableShadowRegBypass(RTC_TypeDef
*RTCx
)
955 SET_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
);
959 * @brief Disable Bypass the shadow registers
960 * @rmtoll RTC_CR BYPSHAD LL_RTC_DisableShadowRegBypass
961 * @param RTCx RTC Instance
964 __STATIC_INLINE
void LL_RTC_DisableShadowRegBypass(RTC_TypeDef
*RTCx
)
966 CLEAR_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
);
970 * @brief Check if Shadow registers bypass is enabled or not.
971 * @rmtoll RTC_CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled
972 * @param RTCx RTC Instance
973 * @retval State of bit (1 or 0).
975 __STATIC_INLINE
uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef
*RTCx
)
977 return ((READ_BIT(RTCx
->CR
, RTC_CR_BYPSHAD
) == (RTC_CR_BYPSHAD
)) ? 1U : 0U);
981 * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz)
982 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
983 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
984 * @rmtoll RTC_CR REFCKON LL_RTC_EnableRefClock
985 * @param RTCx RTC Instance
988 __STATIC_INLINE
void LL_RTC_EnableRefClock(RTC_TypeDef
*RTCx
)
990 SET_BIT(RTCx
->CR
, RTC_CR_REFCKON
);
994 * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz)
995 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
996 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
997 * @rmtoll RTC_CR REFCKON LL_RTC_DisableRefClock
998 * @param RTCx RTC Instance
1001 __STATIC_INLINE
void LL_RTC_DisableRefClock(RTC_TypeDef
*RTCx
)
1003 CLEAR_BIT(RTCx
->CR
, RTC_CR_REFCKON
);
1007 * @brief Set Asynchronous prescaler factor
1008 * @rmtoll RTC_PRER PREDIV_A LL_RTC_SetAsynchPrescaler
1009 * @param RTCx RTC Instance
1010 * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F
1013 __STATIC_INLINE
void LL_RTC_SetAsynchPrescaler(RTC_TypeDef
*RTCx
, uint32_t AsynchPrescaler
)
1015 MODIFY_REG(RTCx
->PRER
, RTC_PRER_PREDIV_A
, AsynchPrescaler
<< RTC_PRER_PREDIV_A_Pos
);
1019 * @brief Set Synchronous prescaler factor
1020 * @rmtoll RTC_PRER PREDIV_S LL_RTC_SetSynchPrescaler
1021 * @param RTCx RTC Instance
1022 * @param SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF
1025 __STATIC_INLINE
void LL_RTC_SetSynchPrescaler(RTC_TypeDef
*RTCx
, uint32_t SynchPrescaler
)
1027 MODIFY_REG(RTCx
->PRER
, RTC_PRER_PREDIV_S
, SynchPrescaler
);
1031 * @brief Get Asynchronous prescaler factor
1032 * @rmtoll RTC_PRER PREDIV_A LL_RTC_GetAsynchPrescaler
1033 * @param RTCx RTC Instance
1034 * @retval Value between Min_Data = 0 and Max_Data = 0x7F
1036 __STATIC_INLINE
uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef
*RTCx
)
1038 return (uint32_t)(READ_BIT(RTCx
->PRER
, RTC_PRER_PREDIV_A
) >> RTC_PRER_PREDIV_A_Pos
);
1042 * @brief Get Synchronous prescaler factor
1043 * @rmtoll RTC_PRER PREDIV_S LL_RTC_GetSynchPrescaler
1044 * @param RTCx RTC Instance
1045 * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF
1047 __STATIC_INLINE
uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef
*RTCx
)
1049 return (uint32_t)(READ_BIT(RTCx
->PRER
, RTC_PRER_PREDIV_S
));
1053 * @brief Enable the write protection for RTC registers.
1054 * @rmtoll RTC_WPR KEY LL_RTC_EnableWriteProtection
1055 * @param RTCx RTC Instance
1058 __STATIC_INLINE
void LL_RTC_EnableWriteProtection(RTC_TypeDef
*RTCx
)
1060 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_DISABLE
);
1064 * @brief Disable the write protection for RTC registers.
1065 * @rmtoll RTC_WPR KEY LL_RTC_DisableWriteProtection
1066 * @param RTCx RTC Instance
1069 __STATIC_INLINE
void LL_RTC_DisableWriteProtection(RTC_TypeDef
*RTCx
)
1071 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_ENABLE_1
);
1072 WRITE_REG(RTCx
->WPR
, RTC_WRITE_PROTECTION_ENABLE_2
);
1076 * @brief Enable tamper output.
1077 * @note When the tamper output is enabled, all external and internal tamper flags
1078 * are ORed and routed to the TAMPALRM output.
1079 * @rmtoll RTC_CR TAMPOE LL_RTC_EnableTamperOutput
1080 * @param RTCx RTC Instance
1083 __STATIC_INLINE
void LL_RTC_EnableTamperOutput(RTC_TypeDef
*RTCx
)
1085 SET_BIT(RTCx
->CR
, RTC_CR_TAMPOE
);
1089 * @brief Disable tamper output.
1090 * @rmtoll RTC_CR TAMPOE LL_RTC_DisableTamperOutput
1091 * @param RTCx RTC Instance
1094 __STATIC_INLINE
void LL_RTC_DisableTamperOutput(RTC_TypeDef
*RTCx
)
1096 CLEAR_BIT(RTCx
->CR
, RTC_CR_TAMPOE
);
1100 * @brief Check if tamper output is enabled or not.
1101 * @rmtoll RTC_CR TAMPOE LL_RTC_IsTamperOutputEnabled
1102 * @param RTCx RTC Instance
1103 * @retval State of bit (1 or 0).
1105 __STATIC_INLINE
uint32_t LL_RTC_IsTamperOutputEnabled(RTC_TypeDef
*RTCx
)
1107 return ((READ_BIT(RTCx
->CR
, RTC_CR_TAMPOE
) == (RTC_CR_TAMPOE
)) ? 1U : 0U);
1111 * @brief Enable internal pull-up in output mode.
1112 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_EnableAlarmPullUp
1113 * @param RTCx RTC Instance
1116 __STATIC_INLINE
void LL_RTC_EnableAlarmPullUp(RTC_TypeDef
*RTCx
)
1118 SET_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_PU
);
1122 * @brief Disable internal pull-up in output mode.
1123 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_EnableAlarmPullUp
1124 * @param RTCx RTC Instance
1127 __STATIC_INLINE
void LL_RTC_DisableAlarmPullUp(RTC_TypeDef
*RTCx
)
1129 CLEAR_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_PU
);
1133 * @brief Check if internal pull-up in output mode is enabled or not.
1134 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_IsAlarmPullUpEnabled
1135 * @param RTCx RTC Instance
1136 * @retval State of bit (1 or 0).
1138 __STATIC_INLINE
uint32_t LL_RTC_IsAlarmPullUpEnabled(RTC_TypeDef
*RTCx
)
1140 return ((READ_BIT(RTCx
->CR
, RTC_CR_TAMPALRM_PU
) == (RTC_CR_TAMPALRM_PU
)) ? 1U : 0U);
1144 * @brief Enable RTC_OUT2 output
1145 * @note RTC_OUT2 mapping depends on both OSEL (@ref LL_RTC_SetAlarmOutEvent)
1146 * and COE (@ref LL_RTC_CAL_SetOutputFreq) settings.
1147 * @note RTC_OUT2 is not available ins VBAT mode.
1148 * @rmtoll RTC_CR OUT2EN LL_RTC_EnableOutput2
1149 * @param RTCx RTC Instance
1152 __STATIC_INLINE
void LL_RTC_EnableOutput2(RTC_TypeDef
*RTCx
)
1154 SET_BIT(RTCx
->CR
, RTC_CR_OUT2EN
);
1158 * @brief Disable RTC_OUT2 output
1159 * @rmtoll RTC_CR OUT2EN LL_RTC_DisableOutput2
1160 * @param RTCx RTC Instance
1163 __STATIC_INLINE
void LL_RTC_DisableOutput2(RTC_TypeDef
*RTCx
)
1165 CLEAR_BIT(RTCx
->CR
, RTC_CR_OUT2EN
);
1169 * @brief Check if RTC_OUT2 output is enabled or not.
1170 * @rmtoll RTC_CR OUT2EN LL_RTC_IsOutput2Enabled
1171 * @param RTCx RTC Instance
1172 * @retval State of bit (1 or 0).
1174 __STATIC_INLINE
uint32_t LL_RTC_IsOutput2Enabled(RTC_TypeDef
*RTCx
)
1176 return ((READ_BIT(RTCx
->CR
, RTC_CR_OUT2EN
) == (RTC_CR_OUT2EN
)) ? 1U : 0U);
1183 /** @defgroup RTC_LL_EF_Time Time
1188 * @brief Set time format (AM/24-hour or PM notation)
1189 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1190 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1191 * @rmtoll RTC_TR PM LL_RTC_TIME_SetFormat
1192 * @param RTCx RTC Instance
1193 * @param TimeFormat This parameter can be one of the following values:
1194 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1195 * @arg @ref LL_RTC_TIME_FORMAT_PM
1198 __STATIC_INLINE
void LL_RTC_TIME_SetFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
1200 MODIFY_REG(RTCx
->TR
, RTC_TR_PM
, TimeFormat
);
1204 * @brief Get time format (AM or PM notation)
1205 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1206 * before reading this bit
1207 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1208 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1209 * @rmtoll RTC_TR PM LL_RTC_TIME_GetFormat
1210 * @param RTCx RTC Instance
1211 * @retval Returned value can be one of the following values:
1212 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1213 * @arg @ref LL_RTC_TIME_FORMAT_PM
1215 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef
*RTCx
)
1217 return (uint32_t)(READ_BIT(RTCx
->TR
, RTC_TR_PM
));
1221 * @brief Set Hours in BCD format
1222 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1223 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1224 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format
1225 * @rmtoll RTC_TR HT LL_RTC_TIME_SetHour\n
1226 * RTC_TR HU LL_RTC_TIME_SetHour
1227 * @param RTCx RTC Instance
1228 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1231 __STATIC_INLINE
void LL_RTC_TIME_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
1233 MODIFY_REG(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
),
1234 (((Hours
& 0xF0U
) << (RTC_TR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_TR_HU_Pos
)));
1238 * @brief Get Hours in BCD format
1239 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1240 * before reading this bit
1241 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1242 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1243 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to
1245 * @rmtoll RTC_TR HT LL_RTC_TIME_GetHour\n
1246 * RTC_TR HU LL_RTC_TIME_GetHour
1247 * @param RTCx RTC Instance
1248 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1250 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef
*RTCx
)
1252 return (uint32_t)((READ_BIT(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
))) >> RTC_TR_HU_Pos
);
1256 * @brief Set Minutes in BCD format
1257 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1258 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1259 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1260 * @rmtoll RTC_TR MNT LL_RTC_TIME_SetMinute\n
1261 * RTC_TR MNU LL_RTC_TIME_SetMinute
1262 * @param RTCx RTC Instance
1263 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1266 __STATIC_INLINE
void LL_RTC_TIME_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
1268 MODIFY_REG(RTCx
->TR
, (RTC_TR_MNT
| RTC_TR_MNU
),
1269 (((Minutes
& 0xF0U
) << (RTC_TR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_TR_MNU_Pos
)));
1273 * @brief Get Minutes in BCD format
1274 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1275 * before reading this bit
1276 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1277 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1278 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD
1280 * @rmtoll RTC_TR MNT LL_RTC_TIME_GetMinute\n
1281 * RTC_TR MNU LL_RTC_TIME_GetMinute
1282 * @param RTCx RTC Instance
1283 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1285 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef
*RTCx
)
1287 return (uint32_t)(READ_BIT(RTCx
->TR
, (RTC_TR_MNT
| RTC_TR_MNU
)) >> RTC_TR_MNU_Pos
);
1291 * @brief Set Seconds in BCD format
1292 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1293 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1294 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1295 * @rmtoll RTC_TR ST LL_RTC_TIME_SetSecond\n
1296 * RTC_TR SU LL_RTC_TIME_SetSecond
1297 * @param RTCx RTC Instance
1298 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1301 __STATIC_INLINE
void LL_RTC_TIME_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
1303 MODIFY_REG(RTCx
->TR
, (RTC_TR_ST
| RTC_TR_SU
),
1304 (((Seconds
& 0xF0U
) << (RTC_TR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_TR_SU_Pos
)));
1308 * @brief Get Seconds in BCD format
1309 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1310 * before reading this bit
1311 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1312 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1313 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD
1315 * @rmtoll RTC_TR ST LL_RTC_TIME_GetSecond\n
1316 * RTC_TR SU LL_RTC_TIME_GetSecond
1317 * @param RTCx RTC Instance
1318 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1320 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef
*RTCx
)
1322 return (uint32_t)(READ_BIT(RTCx
->TR
, (RTC_TR_ST
| RTC_TR_SU
)) >> RTC_TR_SU_Pos
);
1326 * @brief Set time (hour, minute and second) in BCD format
1327 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1328 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1329 * @note TimeFormat and Hours should follow the same format
1330 * @rmtoll RTC_TR PM LL_RTC_TIME_Config\n
1331 * RTC_TR HT LL_RTC_TIME_Config\n
1332 * RTC_TR HU LL_RTC_TIME_Config\n
1333 * RTC_TR MNT LL_RTC_TIME_Config\n
1334 * RTC_TR MNU LL_RTC_TIME_Config\n
1335 * RTC_TR ST LL_RTC_TIME_Config\n
1336 * RTC_TR SU LL_RTC_TIME_Config
1337 * @param RTCx RTC Instance
1338 * @param Format12_24 This parameter can be one of the following values:
1339 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1340 * @arg @ref LL_RTC_TIME_FORMAT_PM
1341 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1342 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1343 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1346 __STATIC_INLINE
void LL_RTC_TIME_Config(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
,
1349 register uint32_t temp
;
1351 temp
= Format12_24
| \
1352 (((Hours
& 0xF0U
) << (RTC_TR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_TR_HU_Pos
)) | \
1353 (((Minutes
& 0xF0U
) << (RTC_TR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_TR_MNU_Pos
)) | \
1354 (((Seconds
& 0xF0U
) << (RTC_TR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_TR_SU_Pos
));
1355 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
);
1359 * @brief Get time (hour, minute and second) in BCD format
1360 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1361 * before reading this bit
1362 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1363 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1364 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
1365 * are available to get independently each parameter.
1366 * @rmtoll RTC_TR HT LL_RTC_TIME_Get\n
1367 * RTC_TR HU LL_RTC_TIME_Get\n
1368 * RTC_TR MNT LL_RTC_TIME_Get\n
1369 * RTC_TR MNU LL_RTC_TIME_Get\n
1370 * RTC_TR ST LL_RTC_TIME_Get\n
1371 * RTC_TR SU LL_RTC_TIME_Get
1372 * @param RTCx RTC Instance
1373 * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
1375 __STATIC_INLINE
uint32_t LL_RTC_TIME_Get(RTC_TypeDef
*RTCx
)
1377 register uint32_t temp
;
1379 temp
= READ_BIT(RTCx
->TR
, (RTC_TR_HT
| RTC_TR_HU
| RTC_TR_MNT
| RTC_TR_MNU
| RTC_TR_ST
| RTC_TR_SU
));
1380 return (uint32_t)((((((temp
& RTC_TR_HT
) >> RTC_TR_HT_Pos
) << 4U) | ((temp
& RTC_TR_HU
) >> RTC_TR_HU_Pos
)) << RTC_OFFSET_HOUR
) | \
1381 (((((temp
& RTC_TR_MNT
) >> RTC_TR_MNT_Pos
) << 4U) | ((temp
& RTC_TR_MNU
) >> RTC_TR_MNU_Pos
)) << RTC_OFFSET_MINUTE
) | \
1382 ((((temp
& RTC_TR_ST
) >> RTC_TR_ST_Pos
) << 4U) | ((temp
& RTC_TR_SU
) >> RTC_TR_SU_Pos
)));
1386 * @brief Memorize whether the daylight saving time change has been performed
1387 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1388 * @rmtoll RTC_CR BKP LL_RTC_TIME_EnableDayLightStore
1389 * @param RTCx RTC Instance
1392 __STATIC_INLINE
void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef
*RTCx
)
1394 SET_BIT(RTCx
->CR
, RTC_CR_BKP
);
1398 * @brief Disable memorization whether the daylight saving time change has been performed.
1399 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1400 * @rmtoll RTC_CR BKP LL_RTC_TIME_DisableDayLightStore
1401 * @param RTCx RTC Instance
1404 __STATIC_INLINE
void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef
*RTCx
)
1406 CLEAR_BIT(RTCx
->CR
, RTC_CR_BKP
);
1410 * @brief Check if RTC Day Light Saving stored operation has been enabled or not
1411 * @rmtoll RTC_CR BKP LL_RTC_TIME_IsDayLightStoreEnabled
1412 * @param RTCx RTC Instance
1413 * @retval State of bit (1 or 0).
1415 __STATIC_INLINE
uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef
*RTCx
)
1417 return ((READ_BIT(RTCx
->CR
, RTC_CR_BKP
) == (RTC_CR_BKP
)) ? 1U : 0U);
1421 * @brief Subtract 1 hour (winter time change)
1422 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1423 * @rmtoll RTC_CR SUB1H LL_RTC_TIME_DecHour
1424 * @param RTCx RTC Instance
1427 __STATIC_INLINE
void LL_RTC_TIME_DecHour(RTC_TypeDef
*RTCx
)
1429 SET_BIT(RTCx
->CR
, RTC_CR_SUB1H
);
1433 * @brief Add 1 hour (summer time change)
1434 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1435 * @rmtoll RTC_CR ADD1H LL_RTC_TIME_IncHour
1436 * @param RTCx RTC Instance
1439 __STATIC_INLINE
void LL_RTC_TIME_IncHour(RTC_TypeDef
*RTCx
)
1441 SET_BIT(RTCx
->CR
, RTC_CR_ADD1H
);
1445 * @brief Get Sub second value in the synchronous prescaler counter.
1446 * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through
1447 * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar
1448 * SubSeconds value in second fraction ratio with time unit following
1450 * ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit
1451 * This conversion can be performed only if no shift operation is pending
1452 * (ie. SHFP=0) when PREDIV_S >= SS.
1453 * @rmtoll RTC_SSR SS LL_RTC_TIME_GetSubSecond
1454 * @param RTCx RTC Instance
1455 * @retval Sub second value (number between 0 and 65535)
1457 __STATIC_INLINE
uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef
*RTCx
)
1459 return (uint32_t)(READ_BIT(RTCx
->SSR
, RTC_SSR_SS
));
1463 * @brief Synchronize to a remote clock with a high degree of precision.
1464 * @note This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
1465 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1466 * @note When REFCKON is set, firmware must not write to Shift control register.
1467 * @rmtoll RTC_SHIFTR ADD1S LL_RTC_TIME_Synchronize\n
1468 * RTC_SHIFTR SUBFS LL_RTC_TIME_Synchronize
1469 * @param RTCx RTC Instance
1470 * @param ShiftSecond This parameter can be one of the following values:
1471 * @arg @ref LL_RTC_SHIFT_SECOND_DELAY
1472 * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE
1473 * @param Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF)
1476 __STATIC_INLINE
void LL_RTC_TIME_Synchronize(RTC_TypeDef
*RTCx
, uint32_t ShiftSecond
, uint32_t Fraction
)
1478 register uint32_t tmp
= (ShiftSecond
| Fraction
);
1479 WRITE_REG(RTCx
->SHIFTR
, tmp
);
1486 /** @defgroup RTC_LL_EF_Date Date
1491 * @brief Set Year in BCD format
1492 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format
1493 * @rmtoll RTC_DR YT LL_RTC_DATE_SetYear\n
1494 * RTC_DR YU LL_RTC_DATE_SetYear
1495 * @param RTCx RTC Instance
1496 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1499 __STATIC_INLINE
void LL_RTC_DATE_SetYear(RTC_TypeDef
*RTCx
, uint32_t Year
)
1501 MODIFY_REG(RTCx
->DR
, (RTC_DR_YT
| RTC_DR_YU
),
1502 (((Year
& 0xF0U
) << (RTC_DR_YT_Pos
- 4U)) | ((Year
& 0x0FU
) << RTC_DR_YU_Pos
)));
1506 * @brief Get Year in BCD format
1507 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1508 * before reading this bit
1509 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
1510 * @rmtoll RTC_DR YT LL_RTC_DATE_GetYear\n
1511 * RTC_DR YU LL_RTC_DATE_GetYear
1512 * @param RTCx RTC Instance
1513 * @retval Value between Min_Data=0x00 and Max_Data=0x99
1515 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef
*RTCx
)
1517 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_YT
| RTC_DR_YU
))) >> RTC_DR_YU_Pos
);
1521 * @brief Set Week day
1522 * @rmtoll RTC_DR WDU LL_RTC_DATE_SetWeekDay
1523 * @param RTCx RTC Instance
1524 * @param WeekDay This parameter can be one of the following values:
1525 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1526 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1527 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1528 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1529 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1530 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1531 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1534 __STATIC_INLINE
void LL_RTC_DATE_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
1536 MODIFY_REG(RTCx
->DR
, RTC_DR_WDU
, WeekDay
<< RTC_DR_WDU_Pos
);
1540 * @brief Get Week day
1541 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1542 * before reading this bit
1543 * @rmtoll RTC_DR WDU LL_RTC_DATE_GetWeekDay
1544 * @param RTCx RTC Instance
1545 * @retval Returned value can be one of the following values:
1546 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1547 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1548 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1549 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1550 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1551 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1552 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1554 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef
*RTCx
)
1556 return (uint32_t)(READ_BIT(RTCx
->DR
, RTC_DR_WDU
) >> RTC_DR_WDU_Pos
);
1560 * @brief Set Month in BCD format
1561 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format
1562 * @rmtoll RTC_DR MT LL_RTC_DATE_SetMonth\n
1563 * RTC_DR MU LL_RTC_DATE_SetMonth
1564 * @param RTCx RTC Instance
1565 * @param Month This parameter can be one of the following values:
1566 * @arg @ref LL_RTC_MONTH_JANUARY
1567 * @arg @ref LL_RTC_MONTH_FEBRUARY
1568 * @arg @ref LL_RTC_MONTH_MARCH
1569 * @arg @ref LL_RTC_MONTH_APRIL
1570 * @arg @ref LL_RTC_MONTH_MAY
1571 * @arg @ref LL_RTC_MONTH_JUNE
1572 * @arg @ref LL_RTC_MONTH_JULY
1573 * @arg @ref LL_RTC_MONTH_AUGUST
1574 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1575 * @arg @ref LL_RTC_MONTH_OCTOBER
1576 * @arg @ref LL_RTC_MONTH_NOVEMBER
1577 * @arg @ref LL_RTC_MONTH_DECEMBER
1580 __STATIC_INLINE
void LL_RTC_DATE_SetMonth(RTC_TypeDef
*RTCx
, uint32_t Month
)
1582 MODIFY_REG(RTCx
->DR
, (RTC_DR_MT
| RTC_DR_MU
),
1583 (((Month
& 0xF0U
) << (RTC_DR_MT_Pos
- 4U)) | ((Month
& 0x0FU
) << RTC_DR_MU_Pos
)));
1587 * @brief Get Month in BCD format
1588 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1589 * before reading this bit
1590 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
1591 * @rmtoll RTC_DR MT LL_RTC_DATE_GetMonth\n
1592 * RTC_DR MU LL_RTC_DATE_GetMonth
1593 * @param RTCx RTC Instance
1594 * @retval Returned value can be one of the following values:
1595 * @arg @ref LL_RTC_MONTH_JANUARY
1596 * @arg @ref LL_RTC_MONTH_FEBRUARY
1597 * @arg @ref LL_RTC_MONTH_MARCH
1598 * @arg @ref LL_RTC_MONTH_APRIL
1599 * @arg @ref LL_RTC_MONTH_MAY
1600 * @arg @ref LL_RTC_MONTH_JUNE
1601 * @arg @ref LL_RTC_MONTH_JULY
1602 * @arg @ref LL_RTC_MONTH_AUGUST
1603 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1604 * @arg @ref LL_RTC_MONTH_OCTOBER
1605 * @arg @ref LL_RTC_MONTH_NOVEMBER
1606 * @arg @ref LL_RTC_MONTH_DECEMBER
1608 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef
*RTCx
)
1610 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_MT
| RTC_DR_MU
))) >> RTC_DR_MU_Pos
);
1614 * @brief Set Day in BCD format
1615 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1616 * @rmtoll RTC_DR DT LL_RTC_DATE_SetDay\n
1617 * RTC_DR DU LL_RTC_DATE_SetDay
1618 * @param RTCx RTC Instance
1619 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1622 __STATIC_INLINE
void LL_RTC_DATE_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
1624 MODIFY_REG(RTCx
->DR
, (RTC_DR_DT
| RTC_DR_DU
),
1625 (((Day
& 0xF0U
) << (RTC_DR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_DR_DU_Pos
)));
1629 * @brief Get Day in BCD format
1630 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1631 * before reading this bit
1632 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1633 * @rmtoll RTC_DR DT LL_RTC_DATE_GetDay\n
1634 * RTC_DR DU LL_RTC_DATE_GetDay
1635 * @param RTCx RTC Instance
1636 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1638 __STATIC_INLINE
uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef
*RTCx
)
1640 return (uint32_t)((READ_BIT(RTCx
->DR
, (RTC_DR_DT
| RTC_DR_DU
))) >> RTC_DR_DU_Pos
);
1644 * @brief Set date (WeekDay, Day, Month and Year) in BCD format
1645 * @rmtoll RTC_DR WDU LL_RTC_DATE_Config\n
1646 * RTC_DR MT LL_RTC_DATE_Config\n
1647 * RTC_DR MU LL_RTC_DATE_Config\n
1648 * RTC_DR DT LL_RTC_DATE_Config\n
1649 * RTC_DR DU LL_RTC_DATE_Config\n
1650 * RTC_DR YT LL_RTC_DATE_Config\n
1651 * RTC_DR YU LL_RTC_DATE_Config
1652 * @param RTCx RTC Instance
1653 * @param WeekDay This parameter can be one of the following values:
1654 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1655 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1656 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1657 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1658 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1659 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1660 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1661 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1662 * @param Month This parameter can be one of the following values:
1663 * @arg @ref LL_RTC_MONTH_JANUARY
1664 * @arg @ref LL_RTC_MONTH_FEBRUARY
1665 * @arg @ref LL_RTC_MONTH_MARCH
1666 * @arg @ref LL_RTC_MONTH_APRIL
1667 * @arg @ref LL_RTC_MONTH_MAY
1668 * @arg @ref LL_RTC_MONTH_JUNE
1669 * @arg @ref LL_RTC_MONTH_JULY
1670 * @arg @ref LL_RTC_MONTH_AUGUST
1671 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1672 * @arg @ref LL_RTC_MONTH_OCTOBER
1673 * @arg @ref LL_RTC_MONTH_NOVEMBER
1674 * @arg @ref LL_RTC_MONTH_DECEMBER
1675 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1678 __STATIC_INLINE
void LL_RTC_DATE_Config(RTC_TypeDef
*RTCx
, uint32_t WeekDay
, uint32_t Day
, uint32_t Month
,
1681 register uint32_t temp
;
1683 temp
= (WeekDay
<< RTC_DR_WDU_Pos
) | \
1684 (((Year
& 0xF0U
) << (RTC_DR_YT_Pos
- 4U)) | ((Year
& 0x0FU
) << RTC_DR_YU_Pos
)) | \
1685 (((Month
& 0xF0U
) << (RTC_DR_MT_Pos
- 4U)) | ((Month
& 0x0FU
) << RTC_DR_MU_Pos
)) | \
1686 (((Day
& 0xF0U
) << (RTC_DR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_DR_DU_Pos
));
1688 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
);
1692 * @brief Get date (WeekDay, Day, Month and Year) in BCD format
1693 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1694 * before reading this bit
1695 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
1696 * and __LL_RTC_GET_DAY are available to get independently each parameter.
1697 * @rmtoll RTC_DR WDU LL_RTC_DATE_Get\n
1698 * RTC_DR MT LL_RTC_DATE_Get\n
1699 * RTC_DR MU LL_RTC_DATE_Get\n
1700 * RTC_DR DT LL_RTC_DATE_Get\n
1701 * RTC_DR DU LL_RTC_DATE_Get\n
1702 * RTC_DR YT LL_RTC_DATE_Get\n
1703 * RTC_DR YU LL_RTC_DATE_Get
1704 * @param RTCx RTC Instance
1705 * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY).
1707 __STATIC_INLINE
uint32_t LL_RTC_DATE_Get(RTC_TypeDef
*RTCx
)
1709 register uint32_t temp
;
1711 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
));
1712 return (uint32_t)((((temp
& RTC_DR_WDU
) >> RTC_DR_WDU_Pos
) << RTC_OFFSET_WEEKDAY
) | \
1713 (((((temp
& RTC_DR_DT
) >> RTC_DR_DT_Pos
) << 4U) | ((temp
& RTC_DR_DU
) >> RTC_DR_DU_Pos
)) << RTC_OFFSET_DAY
) | \
1714 (((((temp
& RTC_DR_MT
) >> RTC_DR_MT_Pos
) << 4U) | ((temp
& RTC_DR_MU
) >> RTC_DR_MU_Pos
)) << RTC_OFFSET_MONTH
) | \
1715 ((((temp
& RTC_DR_YT
) >> RTC_DR_YT_Pos
) << 4U) | ((temp
& RTC_DR_YU
) >> RTC_DR_YU_Pos
)));
1722 /** @defgroup RTC_LL_EF_ALARMA ALARMA
1727 * @brief Enable Alarm A
1728 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1729 * @rmtoll RTC_CR ALRAE LL_RTC_ALMA_Enable
1730 * @param RTCx RTC Instance
1733 __STATIC_INLINE
void LL_RTC_ALMA_Enable(RTC_TypeDef
*RTCx
)
1735 SET_BIT(RTCx
->CR
, RTC_CR_ALRAE
);
1739 * @brief Disable Alarm A
1740 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1741 * @rmtoll RTC_CR ALRAE LL_RTC_ALMA_Disable
1742 * @param RTCx RTC Instance
1745 __STATIC_INLINE
void LL_RTC_ALMA_Disable(RTC_TypeDef
*RTCx
)
1747 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRAE
);
1751 * @brief Specify the Alarm A masks.
1752 * @rmtoll RTC_ALRMAR MSK4 LL_RTC_ALMA_SetMask\n
1753 * RTC_ALRMAR MSK3 LL_RTC_ALMA_SetMask\n
1754 * RTC_ALRMAR MSK2 LL_RTC_ALMA_SetMask\n
1755 * RTC_ALRMAR MSK1 LL_RTC_ALMA_SetMask
1756 * @param RTCx RTC Instance
1757 * @param Mask This parameter can be a combination of the following values:
1758 * @arg @ref LL_RTC_ALMA_MASK_NONE
1759 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
1760 * @arg @ref LL_RTC_ALMA_MASK_HOURS
1761 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
1762 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
1763 * @arg @ref LL_RTC_ALMA_MASK_ALL
1766 __STATIC_INLINE
void LL_RTC_ALMA_SetMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
1768 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_MSK4
| RTC_ALRMAR_MSK3
| RTC_ALRMAR_MSK2
| RTC_ALRMAR_MSK1
, Mask
);
1772 * @brief Get the Alarm A masks.
1773 * @rmtoll RTC_ALRMAR MSK4 LL_RTC_ALMA_GetMask\n
1774 * RTC_ALRMAR MSK3 LL_RTC_ALMA_GetMask\n
1775 * RTC_ALRMAR MSK2 LL_RTC_ALMA_GetMask\n
1776 * RTC_ALRMAR MSK1 LL_RTC_ALMA_GetMask
1777 * @param RTCx RTC Instance
1778 * @retval Returned value can be can be a combination of the following values:
1779 * @arg @ref LL_RTC_ALMA_MASK_NONE
1780 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
1781 * @arg @ref LL_RTC_ALMA_MASK_HOURS
1782 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
1783 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
1784 * @arg @ref LL_RTC_ALMA_MASK_ALL
1786 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef
*RTCx
)
1788 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_MSK4
| RTC_ALRMAR_MSK3
| RTC_ALRMAR_MSK2
| RTC_ALRMAR_MSK1
));
1792 * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
1793 * @rmtoll RTC_ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday
1794 * @param RTCx RTC Instance
1797 __STATIC_INLINE
void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef
*RTCx
)
1799 SET_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_WDSEL
);
1803 * @brief Disable AlarmA Week day selection (DU[3:0] represents the date )
1804 * @rmtoll RTC_ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday
1805 * @param RTCx RTC Instance
1808 __STATIC_INLINE
void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef
*RTCx
)
1810 CLEAR_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_WDSEL
);
1814 * @brief Set ALARM A Day in BCD format
1815 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1816 * @rmtoll RTC_ALRMAR DT LL_RTC_ALMA_SetDay\n
1817 * RTC_ALRMAR DU LL_RTC_ALMA_SetDay
1818 * @param RTCx RTC Instance
1819 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1822 __STATIC_INLINE
void LL_RTC_ALMA_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
1824 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_DT
| RTC_ALRMAR_DU
),
1825 (((Day
& 0xF0U
) << (RTC_ALRMAR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_ALRMAR_DU_Pos
)));
1829 * @brief Get ALARM A Day in BCD format
1830 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1831 * @rmtoll RTC_ALRMAR DT LL_RTC_ALMA_GetDay\n
1832 * RTC_ALRMAR DU LL_RTC_ALMA_GetDay
1833 * @param RTCx RTC Instance
1834 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1836 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef
*RTCx
)
1838 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_DT
| RTC_ALRMAR_DU
))) >> RTC_ALRMAR_DU_Pos
);
1842 * @brief Set ALARM A Weekday
1843 * @rmtoll RTC_ALRMAR DU LL_RTC_ALMA_SetWeekDay
1844 * @param RTCx RTC Instance
1845 * @param WeekDay This parameter can be one of the following values:
1846 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1847 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1848 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1849 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1850 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1851 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1852 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1855 __STATIC_INLINE
void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
1857 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_DU
, WeekDay
<< RTC_ALRMAR_DU_Pos
);
1861 * @brief Get ALARM A Weekday
1862 * @rmtoll RTC_ALRMAR DU LL_RTC_ALMA_GetWeekDay
1863 * @param RTCx RTC Instance
1864 * @retval Returned value can be one of the following values:
1865 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1866 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1867 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1868 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1869 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1870 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1871 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1873 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef
*RTCx
)
1875 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_DU
) >> RTC_ALRMAR_DU_Pos
);
1879 * @brief Set Alarm A time format (AM/24-hour or PM notation)
1880 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_SetTimeFormat
1881 * @param RTCx RTC Instance
1882 * @param TimeFormat This parameter can be one of the following values:
1883 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1884 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1887 __STATIC_INLINE
void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
1889 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_PM
, TimeFormat
);
1893 * @brief Get Alarm A time format (AM or PM notation)
1894 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_GetTimeFormat
1895 * @param RTCx RTC Instance
1896 * @retval Returned value can be one of the following values:
1897 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1898 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1900 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef
*RTCx
)
1902 return (uint32_t)(READ_BIT(RTCx
->ALRMAR
, RTC_ALRMAR_PM
));
1906 * @brief Set ALARM A Hours in BCD format
1907 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
1908 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_SetHour\n
1909 * RTC_ALRMAR HU LL_RTC_ALMA_SetHour
1910 * @param RTCx RTC Instance
1911 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1914 __STATIC_INLINE
void LL_RTC_ALMA_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
1916 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_HT
| RTC_ALRMAR_HU
),
1917 (((Hours
& 0xF0U
) << (RTC_ALRMAR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMAR_HU_Pos
)));
1921 * @brief Get ALARM A Hours in BCD format
1922 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
1923 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_GetHour\n
1924 * RTC_ALRMAR HU LL_RTC_ALMA_GetHour
1925 * @param RTCx RTC Instance
1926 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1928 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef
*RTCx
)
1930 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_HT
| RTC_ALRMAR_HU
))) >> RTC_ALRMAR_HU_Pos
);
1934 * @brief Set ALARM A Minutes in BCD format
1935 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1936 * @rmtoll RTC_ALRMAR MNT LL_RTC_ALMA_SetMinute\n
1937 * RTC_ALRMAR MNU LL_RTC_ALMA_SetMinute
1938 * @param RTCx RTC Instance
1939 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1942 __STATIC_INLINE
void LL_RTC_ALMA_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
1944 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
),
1945 (((Minutes
& 0xF0U
) << (RTC_ALRMAR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMAR_MNU_Pos
)));
1949 * @brief Get ALARM A Minutes in BCD format
1950 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
1951 * @rmtoll RTC_ALRMAR MNT LL_RTC_ALMA_GetMinute\n
1952 * RTC_ALRMAR MNU LL_RTC_ALMA_GetMinute
1953 * @param RTCx RTC Instance
1954 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1956 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef
*RTCx
)
1958 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
))) >> RTC_ALRMAR_MNU_Pos
);
1962 * @brief Set ALARM A Seconds in BCD format
1963 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1964 * @rmtoll RTC_ALRMAR ST LL_RTC_ALMA_SetSecond\n
1965 * RTC_ALRMAR SU LL_RTC_ALMA_SetSecond
1966 * @param RTCx RTC Instance
1967 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1970 __STATIC_INLINE
void LL_RTC_ALMA_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
1972 MODIFY_REG(RTCx
->ALRMAR
, (RTC_ALRMAR_ST
| RTC_ALRMAR_SU
),
1973 (((Seconds
& 0xF0U
) << (RTC_ALRMAR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMAR_SU_Pos
)));
1977 * @brief Get ALARM A Seconds in BCD format
1978 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
1979 * @rmtoll RTC_ALRMAR ST LL_RTC_ALMA_GetSecond\n
1980 * RTC_ALRMAR SU LL_RTC_ALMA_GetSecond
1981 * @param RTCx RTC Instance
1982 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1984 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef
*RTCx
)
1986 return (uint32_t)((READ_BIT(RTCx
->ALRMAR
, (RTC_ALRMAR_ST
| RTC_ALRMAR_SU
))) >> RTC_ALRMAR_SU_Pos
);
1990 * @brief Set Alarm A Time (hour, minute and second) in BCD format
1991 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_ConfigTime\n
1992 * RTC_ALRMAR HT LL_RTC_ALMA_ConfigTime\n
1993 * RTC_ALRMAR HU LL_RTC_ALMA_ConfigTime\n
1994 * RTC_ALRMAR MNT LL_RTC_ALMA_ConfigTime\n
1995 * RTC_ALRMAR MNU LL_RTC_ALMA_ConfigTime\n
1996 * RTC_ALRMAR ST LL_RTC_ALMA_ConfigTime\n
1997 * RTC_ALRMAR SU LL_RTC_ALMA_ConfigTime
1998 * @param RTCx RTC Instance
1999 * @param Format12_24 This parameter can be one of the following values:
2000 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
2001 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
2002 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2003 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2004 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2007 __STATIC_INLINE
void LL_RTC_ALMA_ConfigTime(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
,
2010 register uint32_t temp
;
2012 temp
= Format12_24
| (((Hours
& 0xF0U
) << (RTC_ALRMAR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMAR_HU_Pos
)) | \
2013 (((Minutes
& 0xF0U
) << (RTC_ALRMAR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMAR_MNU_Pos
)) | \
2014 (((Seconds
& 0xF0U
) << (RTC_ALRMAR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMAR_SU_Pos
));
2016 MODIFY_REG(RTCx
->ALRMAR
, RTC_ALRMAR_PM
| RTC_ALRMAR_HT
| RTC_ALRMAR_HU
| RTC_ALRMAR_MNT
| RTC_ALRMAR_MNU
| RTC_ALRMAR_ST
2017 | RTC_ALRMAR_SU
, temp
);
2021 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2022 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2023 * are available to get independently each parameter.
2024 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_GetTime\n
2025 * RTC_ALRMAR HU LL_RTC_ALMA_GetTime\n
2026 * RTC_ALRMAR MNT LL_RTC_ALMA_GetTime\n
2027 * RTC_ALRMAR MNU LL_RTC_ALMA_GetTime\n
2028 * RTC_ALRMAR ST LL_RTC_ALMA_GetTime\n
2029 * RTC_ALRMAR SU LL_RTC_ALMA_GetTime
2030 * @param RTCx RTC Instance
2031 * @retval Combination of hours, minutes and seconds.
2033 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef
*RTCx
)
2035 return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx
) << RTC_OFFSET_HOUR
) | (LL_RTC_ALMA_GetMinute(RTCx
) << RTC_OFFSET_MINUTE
) | LL_RTC_ALMA_GetSecond(RTCx
));
2039 * @brief Set Alarm A Mask the most-significant bits starting at this bit
2040 * @note This register can be written only when ALRAE is reset in RTC_CR register,
2041 * or in initialization mode.
2042 * @rmtoll RTC_ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask
2043 * @param RTCx RTC Instance
2044 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2047 __STATIC_INLINE
void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2049 MODIFY_REG(RTCx
->ALRMASSR
, RTC_ALRMASSR_MASKSS
, Mask
<< RTC_ALRMASSR_MASKSS_Pos
);
2053 * @brief Get Alarm A Mask the most-significant bits starting at this bit
2054 * @rmtoll RTC_ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask
2055 * @param RTCx RTC Instance
2056 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2058 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef
*RTCx
)
2060 return (uint32_t)(READ_BIT(RTCx
->ALRMASSR
, RTC_ALRMASSR_MASKSS
) >> RTC_ALRMASSR_MASKSS_Pos
);
2064 * @brief Set Alarm A Sub seconds value
2065 * @rmtoll RCT_ALRMASSR SS LL_RTC_ALMA_SetSubSecond
2066 * @param RTCx RTC Instance
2067 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2070 __STATIC_INLINE
void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef
*RTCx
, uint32_t Subsecond
)
2072 MODIFY_REG(RTCx
->ALRMASSR
, RTC_ALRMASSR_SS
, Subsecond
);
2076 * @brief Get Alarm A Sub seconds value
2077 * @rmtoll RCT_ALRMASSR SS LL_RTC_ALMA_GetSubSecond
2078 * @param RTCx RTC Instance
2079 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2081 __STATIC_INLINE
uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef
*RTCx
)
2083 return (uint32_t)(READ_BIT(RTCx
->ALRMASSR
, RTC_ALRMASSR_SS
));
2090 /** @defgroup RTC_LL_EF_ALARMB ALARMB
2095 * @brief Enable Alarm B
2096 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2097 * @rmtoll RTC_CR ALRBE LL_RTC_ALMB_Enable
2098 * @param RTCx RTC Instance
2101 __STATIC_INLINE
void LL_RTC_ALMB_Enable(RTC_TypeDef
*RTCx
)
2103 SET_BIT(RTCx
->CR
, RTC_CR_ALRBE
);
2107 * @brief Disable Alarm B
2108 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2109 * @rmtoll RTC_CR ALRBE LL_RTC_ALMB_Disable
2110 * @param RTCx RTC Instance
2113 __STATIC_INLINE
void LL_RTC_ALMB_Disable(RTC_TypeDef
*RTCx
)
2115 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRBE
);
2119 * @brief Specify the Alarm B masks.
2120 * @rmtoll RTC_ALRMBR MSK4 LL_RTC_ALMB_SetMask\n
2121 * RTC_ALRMBR MSK3 LL_RTC_ALMB_SetMask\n
2122 * RTC_ALRMBR MSK2 LL_RTC_ALMB_SetMask\n
2123 * RTC_ALRMBR MSK1 LL_RTC_ALMB_SetMask
2124 * @param RTCx RTC Instance
2125 * @param Mask This parameter can be a combination of the following values:
2126 * @arg @ref LL_RTC_ALMB_MASK_NONE
2127 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
2128 * @arg @ref LL_RTC_ALMB_MASK_HOURS
2129 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
2130 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
2131 * @arg @ref LL_RTC_ALMB_MASK_ALL
2134 __STATIC_INLINE
void LL_RTC_ALMB_SetMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2136 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_MSK4
| RTC_ALRMBR_MSK3
| RTC_ALRMBR_MSK2
| RTC_ALRMBR_MSK1
, Mask
);
2140 * @brief Get the Alarm B masks.
2141 * @rmtoll RTC_ALRMBR MSK4 LL_RTC_ALMB_GetMask\n
2142 * RTC_ALRMBR MSK3 LL_RTC_ALMB_GetMask\n
2143 * RTC_ALRMBR MSK2 LL_RTC_ALMB_GetMask\n
2144 * RTC_ALRMBR MSK1 LL_RTC_ALMB_GetMask
2145 * @param RTCx RTC Instance
2146 * @retval Returned value can be can be a combination of the following values:
2147 * @arg @ref LL_RTC_ALMB_MASK_NONE
2148 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
2149 * @arg @ref LL_RTC_ALMB_MASK_HOURS
2150 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
2151 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
2152 * @arg @ref LL_RTC_ALMB_MASK_ALL
2154 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef
*RTCx
)
2156 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_MSK4
| RTC_ALRMBR_MSK3
| RTC_ALRMBR_MSK2
| RTC_ALRMBR_MSK1
));
2160 * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
2161 * @rmtoll RTC_ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday
2162 * @param RTCx RTC Instance
2165 __STATIC_INLINE
void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef
*RTCx
)
2167 SET_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_WDSEL
);
2171 * @brief Disable AlarmB Week day selection (DU[3:0] represents the date )
2172 * @rmtoll RTC_ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday
2173 * @param RTCx RTC Instance
2176 __STATIC_INLINE
void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef
*RTCx
)
2178 CLEAR_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_WDSEL
);
2182 * @brief Set ALARM B Day in BCD format
2183 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
2184 * @rmtoll RTC_ALRMBR DT LL_RTC_ALMB_SetDay\n
2185 * RTC_ALRMBR DU LL_RTC_ALMB_SetDay
2186 * @param RTCx RTC Instance
2187 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
2190 __STATIC_INLINE
void LL_RTC_ALMB_SetDay(RTC_TypeDef
*RTCx
, uint32_t Day
)
2192 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_DT
| RTC_ALRMBR_DU
),
2193 (((Day
& 0xF0U
) << (RTC_ALRMBR_DT_Pos
- 4U)) | ((Day
& 0x0FU
) << RTC_ALRMBR_DU_Pos
)));
2197 * @brief Get ALARM B Day in BCD format
2198 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2199 * @rmtoll RTC_ALRMBR DT LL_RTC_ALMB_GetDay\n
2200 * RTC_ALRMBR DU LL_RTC_ALMB_GetDay
2201 * @param RTCx RTC Instance
2202 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2204 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef
*RTCx
)
2206 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_DT
| RTC_ALRMBR_DU
))) >> RTC_ALRMBR_DU_Pos
);
2210 * @brief Set ALARM B Weekday
2211 * @rmtoll RTC_ALRMBR DU LL_RTC_ALMB_SetWeekDay
2212 * @param RTCx RTC Instance
2213 * @param WeekDay This parameter can be one of the following values:
2214 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2215 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2216 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2217 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2218 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2219 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2220 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2223 __STATIC_INLINE
void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef
*RTCx
, uint32_t WeekDay
)
2225 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_DU
, WeekDay
<< RTC_ALRMBR_DU_Pos
);
2229 * @brief Get ALARM B Weekday
2230 * @rmtoll RTC_ALRMBR DU LL_RTC_ALMB_GetWeekDay
2231 * @param RTCx RTC Instance
2232 * @retval Returned value can be one of the following values:
2233 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2234 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2235 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2236 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2237 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2238 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2239 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2241 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef
*RTCx
)
2243 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_DU
) >> RTC_ALRMBR_DU_Pos
);
2247 * @brief Set ALARM B time format (AM/24-hour or PM notation)
2248 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_SetTimeFormat
2249 * @param RTCx RTC Instance
2250 * @param TimeFormat This parameter can be one of the following values:
2251 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2252 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2255 __STATIC_INLINE
void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef
*RTCx
, uint32_t TimeFormat
)
2257 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_PM
, TimeFormat
);
2261 * @brief Get ALARM B time format (AM or PM notation)
2262 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_GetTimeFormat
2263 * @param RTCx RTC Instance
2264 * @retval Returned value can be one of the following values:
2265 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2266 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2268 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef
*RTCx
)
2270 return (uint32_t)(READ_BIT(RTCx
->ALRMBR
, RTC_ALRMBR_PM
));
2274 * @brief Set ALARM B Hours in BCD format
2275 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
2276 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_SetHour\n
2277 * RTC_ALRMBR HU LL_RTC_ALMB_SetHour
2278 * @param RTCx RTC Instance
2279 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2282 __STATIC_INLINE
void LL_RTC_ALMB_SetHour(RTC_TypeDef
*RTCx
, uint32_t Hours
)
2284 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_HT
| RTC_ALRMBR_HU
),
2285 (((Hours
& 0xF0U
) << (RTC_ALRMBR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMBR_HU_Pos
)));
2289 * @brief Get ALARM B Hours in BCD format
2290 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2291 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_GetHour\n
2292 * RTC_ALRMBR HU LL_RTC_ALMB_GetHour
2293 * @param RTCx RTC Instance
2294 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2296 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef
*RTCx
)
2298 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_HT
| RTC_ALRMBR_HU
))) >> RTC_ALRMBR_HU_Pos
);
2302 * @brief Set ALARM B Minutes in BCD format
2303 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
2304 * @rmtoll RTC_ALRMBR MNT LL_RTC_ALMB_SetMinute\n
2305 * RTC_ALRMBR MNU LL_RTC_ALMB_SetMinute
2306 * @param RTCx RTC Instance
2307 * @param Minutes between Min_Data=0x00 and Max_Data=0x59
2310 __STATIC_INLINE
void LL_RTC_ALMB_SetMinute(RTC_TypeDef
*RTCx
, uint32_t Minutes
)
2312 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
),
2313 (((Minutes
& 0xF0U
) << (RTC_ALRMBR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMBR_MNU_Pos
)));
2317 * @brief Get ALARM B Minutes in BCD format
2318 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2319 * @rmtoll RTC_ALRMBR MNT LL_RTC_ALMB_GetMinute\n
2320 * RTC_ALRMBR MNU LL_RTC_ALMB_GetMinute
2321 * @param RTCx RTC Instance
2322 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2324 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef
*RTCx
)
2326 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
))) >> RTC_ALRMBR_MNU_Pos
);
2330 * @brief Set ALARM B Seconds in BCD format
2331 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
2332 * @rmtoll RTC_ALRMBR ST LL_RTC_ALMB_SetSecond\n
2333 * RTC_ALRMBR SU LL_RTC_ALMB_SetSecond
2334 * @param RTCx RTC Instance
2335 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2338 __STATIC_INLINE
void LL_RTC_ALMB_SetSecond(RTC_TypeDef
*RTCx
, uint32_t Seconds
)
2340 MODIFY_REG(RTCx
->ALRMBR
, (RTC_ALRMBR_ST
| RTC_ALRMBR_SU
),
2341 (((Seconds
& 0xF0U
) << (RTC_ALRMBR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMBR_SU_Pos
)));
2345 * @brief Get ALARM B Seconds in BCD format
2346 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2347 * @rmtoll RTC_ALRMBR ST LL_RTC_ALMB_GetSecond\n
2348 * RTC_ALRMBR SU LL_RTC_ALMB_GetSecond
2349 * @param RTCx RTC Instance
2350 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2352 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef
*RTCx
)
2354 return (uint32_t)((READ_BIT(RTCx
->ALRMBR
, (RTC_ALRMBR_ST
| RTC_ALRMBR_SU
))) >> RTC_ALRMBR_SU_Pos
);
2358 * @brief Set Alarm B Time (hour, minute and second) in BCD format
2359 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_ConfigTime\n
2360 * RTC_ALRMBR HT LL_RTC_ALMB_ConfigTime\n
2361 * RTC_ALRMBR HU LL_RTC_ALMB_ConfigTime\n
2362 * RTC_ALRMBR MNT LL_RTC_ALMB_ConfigTime\n
2363 * RTC_ALRMBR MNU LL_RTC_ALMB_ConfigTime\n
2364 * RTC_ALRMBR ST LL_RTC_ALMB_ConfigTime\n
2365 * RTC_ALRMBR SU LL_RTC_ALMB_ConfigTime
2366 * @param RTCx RTC Instance
2367 * @param Format12_24 This parameter can be one of the following values:
2368 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2369 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2370 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2371 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2372 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2375 __STATIC_INLINE
void LL_RTC_ALMB_ConfigTime(RTC_TypeDef
*RTCx
, uint32_t Format12_24
, uint32_t Hours
, uint32_t Minutes
,
2378 register uint32_t temp
;
2380 temp
= Format12_24
| (((Hours
& 0xF0U
) << (RTC_ALRMBR_HT_Pos
- 4U)) | ((Hours
& 0x0FU
) << RTC_ALRMBR_HU_Pos
)) | \
2381 (((Minutes
& 0xF0U
) << (RTC_ALRMBR_MNT_Pos
- 4U)) | ((Minutes
& 0x0FU
) << RTC_ALRMBR_MNU_Pos
)) | \
2382 (((Seconds
& 0xF0U
) << (RTC_ALRMBR_ST_Pos
- 4U)) | ((Seconds
& 0x0FU
) << RTC_ALRMBR_SU_Pos
));
2384 MODIFY_REG(RTCx
->ALRMBR
, RTC_ALRMBR_PM
| RTC_ALRMBR_HT
| RTC_ALRMBR_HU
| RTC_ALRMBR_MNT
| RTC_ALRMBR_MNU
| RTC_ALRMBR_ST
2385 | RTC_ALRMBR_SU
, temp
);
2389 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2390 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2391 * are available to get independently each parameter.
2392 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_GetTime\n
2393 * RTC_ALRMBR HU LL_RTC_ALMB_GetTime\n
2394 * RTC_ALRMBR MNT LL_RTC_ALMB_GetTime\n
2395 * RTC_ALRMBR MNU LL_RTC_ALMB_GetTime\n
2396 * RTC_ALRMBR ST LL_RTC_ALMB_GetTime\n
2397 * RTC_ALRMBR SU LL_RTC_ALMB_GetTime
2398 * @param RTCx RTC Instance
2399 * @retval Combination of hours, minutes and seconds.
2401 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef
*RTCx
)
2403 return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx
) << RTC_OFFSET_HOUR
) | (LL_RTC_ALMB_GetMinute(RTCx
) << RTC_OFFSET_MINUTE
) | LL_RTC_ALMB_GetSecond(RTCx
));
2407 * @brief Set Alarm B Mask the most-significant bits starting at this bit
2408 * @note This register can be written only when ALRBE is reset in RTC_CR register,
2409 * or in initialization mode.
2410 * @rmtoll RTC_ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask
2411 * @param RTCx RTC Instance
2412 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2415 __STATIC_INLINE
void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2417 MODIFY_REG(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_MASKSS
, Mask
<< RTC_ALRMBSSR_MASKSS_Pos
);
2421 * @brief Get Alarm B Mask the most-significant bits starting at this bit
2422 * @rmtoll RTC_ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask
2423 * @param RTCx RTC Instance
2424 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2426 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef
*RTCx
)
2428 return (uint32_t)(READ_BIT(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_MASKSS
) >> RTC_ALRMBSSR_MASKSS_Pos
);
2432 * @brief Set Alarm B Sub seconds value
2433 * @rmtoll RTC_ALRMBSSR SS LL_RTC_ALMB_SetSubSecond
2434 * @param RTCx RTC Instance
2435 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2438 __STATIC_INLINE
void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef
*RTCx
, uint32_t Subsecond
)
2440 MODIFY_REG(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_SS
, Subsecond
);
2444 * @brief Get Alarm B Sub seconds value
2445 * @rmtoll RTC_ALRMBSSR SS LL_RTC_ALMB_GetSubSecond
2446 * @param RTCx RTC Instance
2447 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2449 __STATIC_INLINE
uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef
*RTCx
)
2451 return (uint32_t)(READ_BIT(RTCx
->ALRMBSSR
, RTC_ALRMBSSR_SS
));
2458 /** @defgroup RTC_LL_EF_Timestamp Timestamp
2463 * @brief Enable internal event timestamp
2464 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2465 * @rmtoll RTC_CR ITSE LL_RTC_TS_EnableInternalEvent
2466 * @param RTCx RTC Instance
2469 __STATIC_INLINE
void LL_RTC_TS_EnableInternalEvent(RTC_TypeDef
*RTCx
)
2471 SET_BIT(RTCx
->CR
, RTC_CR_ITSE
);
2475 * @brief Disable internal event timestamp
2476 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2477 * @rmtoll RTC_CR ITSE LL_RTC_TS_DisableInternalEvent
2478 * @param RTCx RTC Instance
2481 __STATIC_INLINE
void LL_RTC_TS_DisableInternalEvent(RTC_TypeDef
*RTCx
)
2483 CLEAR_BIT(RTCx
->CR
, RTC_CR_ITSE
);
2487 * @brief Enable Timestamp
2488 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2489 * @rmtoll RTC_CR ITSE LL_RTC_TS_Enable
2490 * @param RTCx RTC Instance
2493 __STATIC_INLINE
void LL_RTC_TS_Enable(RTC_TypeDef
*RTCx
)
2495 SET_BIT(RTCx
->CR
, RTC_CR_TSE
);
2499 * @brief Disable Timestamp
2500 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2501 * @rmtoll RTC_CR ITSE LL_RTC_TS_Disable
2502 * @param RTCx RTC Instance
2505 __STATIC_INLINE
void LL_RTC_TS_Disable(RTC_TypeDef
*RTCx
)
2507 CLEAR_BIT(RTCx
->CR
, RTC_CR_TSE
);
2511 * @brief Set Time-stamp event active edge
2512 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2513 * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting
2514 * @rmtoll RTC_CR ITSEDGE LL_RTC_TS_SetActiveEdge
2515 * @param RTCx RTC Instance
2516 * @param Edge This parameter can be one of the following values:
2517 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2518 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2521 __STATIC_INLINE
void LL_RTC_TS_SetActiveEdge(RTC_TypeDef
*RTCx
, uint32_t Edge
)
2523 MODIFY_REG(RTCx
->CR
, RTC_CR_TSEDGE
, Edge
);
2527 * @brief Get Time-stamp event active edge
2528 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2529 * @rmtoll RTC_CR ITSEDGE LL_RTC_TS_GetActiveEdge
2530 * @param RTCx RTC Instance
2531 * @retval Returned value can be one of the following values:
2532 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2533 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2535 __STATIC_INLINE
uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef
*RTCx
)
2537 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_TSEDGE
));
2541 * @brief Get Timestamp AM/PM notation (AM or 24-hour format)
2542 * @rmtoll RTC_TSTR PM LL_RTC_TS_GetTimeFormat
2543 * @param RTCx RTC Instance
2544 * @retval Returned value can be one of the following values:
2545 * @arg @ref LL_RTC_TS_TIME_FORMAT_AM
2546 * @arg @ref LL_RTC_TS_TIME_FORMAT_PM
2548 __STATIC_INLINE
uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef
*RTCx
)
2550 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_PM
));
2554 * @brief Get Timestamp Hours in BCD format
2555 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2556 * @rmtoll RTC_TSTR HT LL_RTC_TS_GetHour\n
2557 * RTC_TSTR HU LL_RTC_TS_GetHour
2558 * @param RTCx RTC Instance
2559 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2561 __STATIC_INLINE
uint32_t LL_RTC_TS_GetHour(RTC_TypeDef
*RTCx
)
2563 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_HT
| RTC_TSTR_HU
) >> RTC_TSTR_HU_Pos
);
2567 * @brief Get Timestamp Minutes in BCD format
2568 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2569 * @rmtoll RTC_TSTR MNT LL_RTC_TS_GetMinute\n
2570 * RTC_TSTR HU LL_RTC_TS_GetMinute
2571 * @param RTCx RTC Instance
2572 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2574 __STATIC_INLINE
uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef
*RTCx
)
2576 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_MNT
| RTC_TSTR_MNU
) >> RTC_TSTR_MNU_Pos
);
2580 * @brief Get Timestamp Seconds in BCD format
2581 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2582 * @rmtoll RTC_TSTR ST LL_RTC_TS_GetSecond\n
2583 * RTC_TSTR HU LL_RTC_TS_GetSecond
2584 * @param RTCx RTC Instance
2585 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2587 __STATIC_INLINE
uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef
*RTCx
)
2589 return (uint32_t)(READ_BIT(RTCx
->TSTR
, RTC_TSTR_ST
| RTC_TSTR_SU
));
2593 * @brief Get Timestamp time (hour, minute and second) in BCD format
2594 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2595 * are available to get independently each parameter.
2596 * @rmtoll RTC_TSTR HT LL_RTC_TS_GetTime\n
2597 * RTC_TSTR HU LL_RTC_TS_GetTime\n
2598 * RTC_TSTR MNT LL_RTC_TS_GetTime\n
2599 * RTC_TSTR MNU LL_RTC_TS_GetTime\n
2600 * RTC_TSTR ST LL_RTC_TS_GetTime\n
2601 * RTC_TSTR SU LL_RTC_TS_GetTime
2602 * @param RTCx RTC Instance
2603 * @retval Combination of hours, minutes and seconds.
2605 __STATIC_INLINE
uint32_t LL_RTC_TS_GetTime(RTC_TypeDef
*RTCx
)
2607 return (uint32_t)(READ_BIT(RTCx
->TSTR
,
2608 RTC_TSTR_HT
| RTC_TSTR_HU
| RTC_TSTR_MNT
| RTC_TSTR_MNU
| RTC_TSTR_ST
| RTC_TSTR_SU
));
2612 * @brief Get Timestamp Week day
2613 * @rmtoll RTC_TSDR WDU LL_RTC_TS_GetWeekDay
2614 * @param RTCx RTC Instance
2615 * @retval Returned value can be one of the following values:
2616 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2617 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2618 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2619 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2620 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2621 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2622 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2624 __STATIC_INLINE
uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef
*RTCx
)
2626 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_WDU
) >> RTC_TSDR_WDU_Pos
);
2630 * @brief Get Timestamp Month in BCD format
2631 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
2632 * @rmtoll RTC_TSDR MT LL_RTC_TS_GetMonth\n
2633 * RTC_TSDR MU LL_RTC_TS_GetMonth
2634 * @param RTCx RTC Instance
2635 * @retval Returned value can be one of the following values:
2636 * @arg @ref LL_RTC_MONTH_JANUARY
2637 * @arg @ref LL_RTC_MONTH_FEBRUARY
2638 * @arg @ref LL_RTC_MONTH_MARCH
2639 * @arg @ref LL_RTC_MONTH_APRIL
2640 * @arg @ref LL_RTC_MONTH_MAY
2641 * @arg @ref LL_RTC_MONTH_JUNE
2642 * @arg @ref LL_RTC_MONTH_JULY
2643 * @arg @ref LL_RTC_MONTH_AUGUST
2644 * @arg @ref LL_RTC_MONTH_SEPTEMBER
2645 * @arg @ref LL_RTC_MONTH_OCTOBER
2646 * @arg @ref LL_RTC_MONTH_NOVEMBER
2647 * @arg @ref LL_RTC_MONTH_DECEMBER
2649 __STATIC_INLINE
uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef
*RTCx
)
2651 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_MT
| RTC_TSDR_MU
) >> RTC_TSDR_MU_Pos
);
2655 * @brief Get Timestamp Day in BCD format
2656 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2657 * @rmtoll RTC_TSDR DT LL_RTC_TS_GetDay\n
2658 * RTC_TSDR DU LL_RTC_TS_GetDay
2659 * @param RTCx RTC Instance
2660 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2662 __STATIC_INLINE
uint32_t LL_RTC_TS_GetDay(RTC_TypeDef
*RTCx
)
2664 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_DT
| RTC_TSDR_DU
));
2668 * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format
2669 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH,
2670 * and __LL_RTC_GET_DAY are available to get independently each parameter.
2671 * @rmtoll RTC_TSDR WDU LL_RTC_TS_GetDate\n
2672 * RTC_TSDR MT LL_RTC_TS_GetDate\n
2673 * RTC_TSDR MU LL_RTC_TS_GetDate\n
2674 * RTC_TSDR DT LL_RTC_TS_GetDate\n
2675 * RTC_TSDR DU LL_RTC_TS_GetDate
2676 * @param RTCx RTC Instance
2677 * @retval Combination of Weekday, Day and Month
2679 __STATIC_INLINE
uint32_t LL_RTC_TS_GetDate(RTC_TypeDef
*RTCx
)
2681 return (uint32_t)(READ_BIT(RTCx
->TSDR
, RTC_TSDR_WDU
| RTC_TSDR_MT
| RTC_TSDR_MU
| RTC_TSDR_DT
| RTC_TSDR_DU
));
2685 * @brief Get time-stamp sub second value
2686 * @rmtoll RTC_TSDR SS LL_RTC_TS_GetSubSecond
2687 * @param RTCx RTC Instance
2688 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
2690 __STATIC_INLINE
uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef
*RTCx
)
2692 return (uint32_t)(READ_BIT(RTCx
->TSSSR
, RTC_TSSSR_SS
));
2696 * @brief Activate timestamp on tamper detection event
2697 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_EnableOnTamper
2698 * @param RTCx RTC Instance
2701 __STATIC_INLINE
void LL_RTC_TS_EnableOnTamper(RTC_TypeDef
*RTCx
)
2703 SET_BIT(RTCx
->CR
, RTC_CR_TAMPTS
);
2707 * @brief Disable timestamp on tamper detection event
2708 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_DisableOnTamper
2709 * @param RTCx RTC Instance
2712 __STATIC_INLINE
void LL_RTC_TS_DisableOnTamper(RTC_TypeDef
*RTCx
)
2714 CLEAR_BIT(RTCx
->CR
, RTC_CR_TAMPTS
);
2722 /** @defgroup RTC_LL_EF_Tamper Tamper
2727 * @brief Enable TAMPx input detection
2728 * @rmtoll TAMP_CR1 TAMP1E LL_RTC_TAMPER_Enable\n
2729 * TAMP_CR1 TAMP2E... LL_RTC_TAMPER_Enable
2730 * @param RTCx RTC Instance
2731 * @param Tamper This parameter can be a combination of the following values:
2732 * @arg @ref LL_RTC_TAMPER_1
2733 * @arg @ref LL_RTC_TAMPER_2
2737 __STATIC_INLINE
void LL_RTC_TAMPER_Enable(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2740 SET_BIT(TAMP
->CR1
, Tamper
);
2744 * @brief Clear TAMPx input detection
2745 * @rmtoll TAMP_CR1 TAMP1E LL_RTC_TAMPER_Disable\n
2746 * TAMP_CR1 TAMP2E... LL_RTC_TAMPER_Disable
2747 * @param RTCx RTC Instance
2748 * @param Tamper This parameter can be a combination of the following values:
2749 * @arg @ref LL_RTC_TAMPER_1
2750 * @arg @ref LL_RTC_TAMPER_2
2754 __STATIC_INLINE
void LL_RTC_TAMPER_Disable(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2757 CLEAR_BIT(TAMP
->CR1
, Tamper
);
2761 * @brief Enable Tamper mask flag
2762 * @note Associated Tamper IT must not enabled when tamper mask is set.
2763 * @rmtoll TAMP_CR2 TAMP1MF LL_RTC_TAMPER_EnableMask\n
2764 * TAMP_CR2 TAMP2MF... LL_RTC_TAMPER_EnableMask
2765 * @param RTCx RTC Instance
2766 * @param Mask This parameter can be a combination of the following values:
2767 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
2768 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
2772 __STATIC_INLINE
void LL_RTC_TAMPER_EnableMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2775 SET_BIT(TAMP
->CR2
, Mask
);
2779 * @brief Disable Tamper mask flag
2780 * @rmtoll TAMP_CR2 TAMP1MF LL_RTC_TAMPER_DisableMask\n
2781 * TAMP_CR2 TAMP2MF... LL_RTC_TAMPER_DisableMask
2782 * @param RTCx RTC Instance
2783 * @param Mask This parameter can be a combination of the following values:
2784 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1
2785 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2
2789 __STATIC_INLINE
void LL_RTC_TAMPER_DisableMask(RTC_TypeDef
*RTCx
, uint32_t Mask
)
2792 CLEAR_BIT(TAMP
->CR2
, Mask
);
2796 * @brief Enable backup register erase after Tamper event detection
2797 * @rmtoll TAMP_CR2 TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP\n
2798 * TAMP_CR2 TAMP2NOERASE... LL_RTC_TAMPER_EnableEraseBKP
2799 * @param RTCx RTC Instance
2800 * @param Tamper This parameter can be a combination of the following values:
2801 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
2802 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
2806 __STATIC_INLINE
void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2809 CLEAR_BIT(TAMP
->CR2
, Tamper
);
2813 * @brief Disable backup register erase after Tamper event detection
2814 * @rmtoll TAMP_CR2 TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP\n
2815 * TAMP_CR2 TAMP2NOERASE... LL_RTC_TAMPER_DisableEraseBKP
2816 * @param RTCx RTC Instance
2817 * @param Tamper This parameter can be a combination of the following values:
2818 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1
2819 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2
2823 __STATIC_INLINE
void LL_RTC_TAMPER_DisableEraseBKP(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2826 SET_BIT(TAMP
->CR2
, Tamper
);
2830 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
2831 * @rmtoll TAMP_FLTCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp
2832 * @param RTCx RTC Instance
2835 __STATIC_INLINE
void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef
*RTCx
)
2838 SET_BIT(TAMP
->FLTCR
, TAMP_FLTCR_TAMPPUDIS
);
2842 * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling)
2843 * @rmtoll TAMP_FLTCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp
2844 * @param RTCx RTC Instance
2847 __STATIC_INLINE
void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef
*RTCx
)
2850 CLEAR_BIT(TAMP
->FLTCR
, TAMP_FLTCR_TAMPPUDIS
);
2854 * @brief Set RTC_TAMPx precharge duration
2855 * @rmtoll TAMP_FLTCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge
2856 * @param RTCx RTC Instance
2857 * @param Duration This parameter can be one of the following values:
2858 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
2859 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
2860 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
2861 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
2864 __STATIC_INLINE
void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef
*RTCx
, uint32_t Duration
)
2867 MODIFY_REG(TAMP
->FLTCR
, TAMP_FLTCR_TAMPPRCH
, Duration
);
2871 * @brief Get RTC_TAMPx precharge duration
2872 * @rmtoll TAMP_FLTCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge
2873 * @param RTCx RTC Instance
2874 * @retval Returned value can be one of the following values:
2875 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
2876 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
2877 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
2878 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
2880 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef
*RTCx
)
2883 return (uint32_t)(READ_BIT(TAMP
->FLTCR
, TAMP_FLTCR_TAMPPRCH
));
2887 * @brief Set RTC_TAMPx filter count
2888 * @rmtoll TAMP_FLTCR TAMPFLT LL_RTC_TAMPER_SetFilterCount
2889 * @param RTCx RTC Instance
2890 * @param FilterCount This parameter can be one of the following values:
2891 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
2892 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
2893 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
2894 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
2897 __STATIC_INLINE
void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef
*RTCx
, uint32_t FilterCount
)
2900 MODIFY_REG(TAMP
->FLTCR
, TAMP_FLTCR_TAMPFLT
, FilterCount
);
2904 * @brief Get RTC_TAMPx filter count
2905 * @rmtoll TAMP_FLTCR TAMPFLT LL_RTC_TAMPER_GetFilterCount
2906 * @param RTCx RTC Instance
2907 * @retval Returned value can be one of the following values:
2908 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
2909 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
2910 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
2911 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
2913 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef
*RTCx
)
2916 return (uint32_t)(READ_BIT(TAMP
->FLTCR
, TAMP_FLTCR_TAMPFLT
));
2920 * @brief Set Tamper sampling frequency
2921 * @rmtoll TAMP_FLTCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq
2922 * @param RTCx RTC Instance
2923 * @param SamplingFreq This parameter can be one of the following values:
2924 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
2925 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
2926 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
2927 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
2928 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
2929 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
2930 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
2931 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
2934 __STATIC_INLINE
void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef
*RTCx
, uint32_t SamplingFreq
)
2937 MODIFY_REG(TAMP
->FLTCR
, TAMP_FLTCR_TAMPFREQ
, SamplingFreq
);
2941 * @brief Get Tamper sampling frequency
2942 * @rmtoll TAMP_FLTCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq
2943 * @param RTCx RTC Instance
2944 * @retval Returned value can be one of the following values:
2945 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
2946 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
2947 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
2948 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
2949 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
2950 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
2951 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
2952 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
2954 __STATIC_INLINE
uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef
*RTCx
)
2957 return (uint32_t)(READ_BIT(TAMP
->FLTCR
, TAMP_FLTCR_TAMPFREQ
));
2961 * @brief Enable Active level for Tamper input
2962 * @rmtoll TAMP_CR2 TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel\n
2963 * TAMP_CR2 TAMP2TRG... LL_RTC_TAMPER_EnableActiveLevel
2964 * @param RTCx RTC Instance
2965 * @param Tamper This parameter can be a combination of the following values:
2966 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
2967 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
2971 __STATIC_INLINE
void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2974 SET_BIT(TAMP
->CR2
, Tamper
);
2978 * @brief Disable Active level for Tamper input
2979 * @rmtoll TAMP_CR2 TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel\n
2980 * TAMP_CR2 TAMP2TRG... LL_RTC_TAMPER_DisableActiveLevel
2981 * @param RTCx RTC Instance
2982 * @param Tamper This parameter can be a combination of the following values:
2983 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
2984 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
2988 __STATIC_INLINE
void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef
*RTCx
, uint32_t Tamper
)
2991 CLEAR_BIT(TAMP
->CR2
, Tamper
);
2998 /** @defgroup RTC_LL_EF_Internal_Tamper Internal Tamper
3003 * @brief Enable internal tamper detection.
3004 * @rmtoll TAMP_CR1 ITAMP1E LL_RTC_TAMPER_ITAMP_Enable\n
3005 * TAMP_CR1 ITAMP3E LL_RTC_TAMPER_ITAMP_Enable\n
3006 * TAMP_CR1 ITAMP4E LL_RTC_TAMPER_ITAMP_Enable\n
3007 * TAMP_CR1 ITAMP5E LL_RTC_TAMPER_ITAMP_Enable\n
3008 * TAMP_CR1 ITAMP6E LL_RTC_TAMPER_ITAMP_Enable\n
3009 * TAMP_CR1 ITAMP7E... LL_RTC_TAMPER_ITAMP_Enable
3010 * @param RTCx RTC Instance
3011 * @param InternalTamper This parameter can be a combination of the following values:
3012 * @arg @ref LL_RTC_TAMPER_ITAMP1
3013 * @arg @ref LL_RTC_TAMPER_ITAMP3
3014 * @arg @ref LL_RTC_TAMPER_ITAMP4
3015 * @arg @ref LL_RTC_TAMPER_ITAMP5
3016 * @arg @ref LL_RTC_TAMPER_ITAMP6
3017 @if RTC_TAMP_INT_7_SUPPORT
3018 * @arg @ref LL_RTC_TAMPER_ITAMP7
3023 __STATIC_INLINE
void LL_RTC_TAMPER_ITAMP_Enable(RTC_TypeDef
*RTCx
, uint32_t InternalTamper
)
3026 SET_BIT(TAMP
->CR1
, InternalTamper
);
3030 * @brief Disable internal tamper detection.
3031 * @rmtoll TAMP_CR1 ITAMP1E LL_RTC_TAMPER_ITAMP_Disable\n
3032 * TAMP_CR1 ITAMP3E LL_RTC_TAMPER_ITAMP_Disable\n
3033 * TAMP_CR1 ITAMP4E LL_RTC_TAMPER_ITAMP_Disable\n
3034 * TAMP_CR1 ITAMP5E LL_RTC_TAMPER_ITAMP_Disable\n
3035 * TAMP_CR1 ITAMP6E LL_RTC_TAMPER_ITAMP_Disable\n
3036 * TAMP_CR1 ITAMP7E... LL_RTC_TAMPER_ITAMP_Disable
3037 * @param RTCx RTC Instance
3038 * @param InternalTamper This parameter can be a combination of the following values:
3039 * @arg @ref LL_RTC_TAMPER_ITAMP1
3040 * @arg @ref LL_RTC_TAMPER_ITAMP3
3041 * @arg @ref LL_RTC_TAMPER_ITAMP4
3042 * @arg @ref LL_RTC_TAMPER_ITAMP5
3043 * @arg @ref LL_RTC_TAMPER_ITAMP6
3044 @if RTC_TAMP_INT_7_SUPPORT
3045 * @arg @ref LL_RTC_TAMPER_ITAMP7
3050 __STATIC_INLINE
void LL_RTC_TAMPER_ITAMP_Disable(RTC_TypeDef
*RTCx
, uint32_t InternalTamper
)
3053 CLEAR_BIT(TAMP
->CR1
, InternalTamper
);
3061 /** @defgroup RTC_LL_EF_Wakeup Wakeup
3066 * @brief Enable Wakeup timer
3067 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3068 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_Enable
3069 * @param RTCx RTC Instance
3072 __STATIC_INLINE
void LL_RTC_WAKEUP_Enable(RTC_TypeDef
*RTCx
)
3074 SET_BIT(RTCx
->CR
, RTC_CR_WUTE
);
3078 * @brief Disable Wakeup timer
3079 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3080 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_Disable
3081 * @param RTCx RTC Instance
3084 __STATIC_INLINE
void LL_RTC_WAKEUP_Disable(RTC_TypeDef
*RTCx
)
3086 CLEAR_BIT(RTCx
->CR
, RTC_CR_WUTE
);
3090 * @brief Check if Wakeup timer is enabled or not
3091 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_IsEnabled
3092 * @param RTCx RTC Instance
3093 * @retval State of bit (1 or 0).
3095 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef
*RTCx
)
3097 return ((READ_BIT(RTCx
->CR
, RTC_CR_WUTE
) == (RTC_CR_WUTE
)) ? 1U : 0U);
3101 * @brief Select Wakeup clock
3102 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3103 * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ICSR WUTWF bit = 1
3104 * @rmtoll RTC_CR WUCKSEL LL_RTC_WAKEUP_SetClock
3105 * @param RTCx RTC Instance
3106 * @param WakeupClock This parameter can be one of the following values:
3107 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
3108 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
3109 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
3110 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
3111 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
3112 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
3115 __STATIC_INLINE
void LL_RTC_WAKEUP_SetClock(RTC_TypeDef
*RTCx
, uint32_t WakeupClock
)
3117 MODIFY_REG(RTCx
->CR
, RTC_CR_WUCKSEL
, WakeupClock
);
3121 * @brief Get Wakeup clock
3122 * @rmtoll RTC_CR WUCKSEL LL_RTC_WAKEUP_GetClock
3123 * @param RTCx RTC Instance
3124 * @retval Returned value can be one of the following values:
3125 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
3126 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
3127 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
3128 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
3129 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
3130 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
3132 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef
*RTCx
)
3134 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_WUCKSEL
));
3138 * @brief Set Wakeup auto-reload value
3139 * @note Bit can be written only when WUTWF is set to 1 in RTC_ICSR
3140 * @rmtoll RTC_WUTR WUT LL_RTC_WAKEUP_SetAutoReload
3141 * @param RTCx RTC Instance
3142 * @param Value Value between Min_Data=0x00 and Max_Data=0xFFFF
3145 __STATIC_INLINE
void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef
*RTCx
, uint32_t Value
)
3147 MODIFY_REG(RTCx
->WUTR
, RTC_WUTR_WUT
, Value
);
3151 * @brief Get Wakeup auto-reload value
3152 * @rmtoll RTC_WUTR WUT LL_RTC_WAKEUP_GetAutoReload
3153 * @param RTCx RTC Instance
3154 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
3156 __STATIC_INLINE
uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef
*RTCx
)
3158 return (uint32_t)(READ_BIT(RTCx
->WUTR
, RTC_WUTR_WUT
));
3165 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
3170 * @brief Writes a data in a specified Backup data register.
3171 * @rmtoll TAMP_BKPxR BKP LL_RTC_BKP_SetRegister
3172 * @param RTCx RTC Instance
3173 * @param BackupRegister This parameter can be one of the following values:
3174 * @arg @ref LL_RTC_BKP_DR0
3175 * @arg @ref LL_RTC_BKP_DR1
3176 * @arg @ref LL_RTC_BKP_DR2
3177 * @arg @ref LL_RTC_BKP_DR3
3179 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3182 __STATIC_INLINE
void LL_RTC_BKP_SetRegister(RTC_TypeDef
*RTCx
, uint32_t BackupRegister
, uint32_t Data
)
3184 register uint32_t tmp
;
3188 tmp
= (uint32_t)(&(TAMP
->BKP0R
));
3189 tmp
+= (BackupRegister
* 4U);
3191 /* Write the specified register */
3192 *(__IO
uint32_t *)tmp
= (uint32_t)Data
;
3196 * @brief Reads data from the specified RTC Backup data Register.
3197 * @rmtoll TAMP_BKPxR BKP LL_RTC_BKP_GetRegister
3198 * @param RTCx RTC Instance
3199 * @param BackupRegister This parameter can be one of the following values:
3200 * @arg @ref LL_RTC_BKP_DR0
3201 * @arg @ref LL_RTC_BKP_DR1
3202 * @arg @ref LL_RTC_BKP_DR2
3203 * @arg @ref LL_RTC_BKP_DR3
3205 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3207 __STATIC_INLINE
uint32_t LL_RTC_BKP_GetRegister(RTC_TypeDef
*RTCx
, uint32_t BackupRegister
)
3209 register uint32_t tmp
;
3213 tmp
= (uint32_t)(&(TAMP
->BKP0R
));
3214 tmp
+= (BackupRegister
* 4U);
3216 /* Read the specified register */
3217 return (*(__IO
uint32_t *)tmp
);
3224 /** @defgroup RTC_LL_EF_Calibration Calibration
3229 * @brief Set Calibration output frequency (1 Hz or 512 Hz)
3230 * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3231 * @rmtoll RTC_CR COE LL_RTC_CAL_SetOutputFreq\n
3232 * RTC_CR COSEL LL_RTC_CAL_SetOutputFreq
3233 * @param RTCx RTC Instance
3234 * @param Frequency This parameter can be one of the following values:
3235 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3236 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3237 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3240 __STATIC_INLINE
void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef
*RTCx
, uint32_t Frequency
)
3242 MODIFY_REG(RTCx
->CR
, RTC_CR_COE
| RTC_CR_COSEL
, Frequency
);
3246 * @brief Get Calibration output frequency (1 Hz or 512 Hz)
3247 * @rmtoll RTC_CR COE LL_RTC_CAL_GetOutputFreq\n
3248 * RTC_CR COSEL LL_RTC_CAL_GetOutputFreq
3249 * @param RTCx RTC Instance
3250 * @retval Returned value can be one of the following values:
3251 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3252 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3253 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3255 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef
*RTCx
)
3257 return (uint32_t)(READ_BIT(RTCx
->CR
, RTC_CR_COE
| RTC_CR_COSEL
));
3261 * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm)
3262 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3263 * @note Bit can be written only when RECALPF is set to 0 in RTC_ICSR
3264 * @rmtoll RTC_CALR CALP LL_RTC_CAL_SetPulse
3265 * @param RTCx RTC Instance
3266 * @param Pulse This parameter can be one of the following values:
3267 * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE
3268 * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET
3271 __STATIC_INLINE
void LL_RTC_CAL_SetPulse(RTC_TypeDef
*RTCx
, uint32_t Pulse
)
3273 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALP
, Pulse
);
3277 * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm)
3278 * @rmtoll RTC_CALR CALP LL_RTC_CAL_IsPulseInserted
3279 * @param RTCx RTC Instance
3280 * @retval State of bit (1 or 0).
3282 __STATIC_INLINE
uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef
*RTCx
)
3284 return ((READ_BIT(RTCx
->CALR
, RTC_CALR_CALP
) == (RTC_CALR_CALP
)) ? 1U : 0U);
3288 * @brief Set the calibration cycle period
3289 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3290 * @note Bit can be written only when RECALPF is set to 0 in RTC_ICSR
3291 * @rmtoll RTC_CALR CALW8 LL_RTC_CAL_SetPeriod\n
3292 * RTC_CALR CALW16 LL_RTC_CAL_SetPeriod
3293 * @param RTCx RTC Instance
3294 * @param Period This parameter can be one of the following values:
3295 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3296 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3297 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3300 __STATIC_INLINE
void LL_RTC_CAL_SetPeriod(RTC_TypeDef
*RTCx
, uint32_t Period
)
3302 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALW8
| RTC_CALR_CALW16
, Period
);
3306 * @brief Get the calibration cycle period
3307 * @rmtoll RTC_CALR CALW8 LL_RTC_CAL_GetPeriod\n
3308 * RTC_CALR CALW16 LL_RTC_CAL_GetPeriod
3309 * @param RTCx RTC Instance
3310 * @retval Returned value can be one of the following values:
3311 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3312 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3313 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3315 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef
*RTCx
)
3317 return (uint32_t)(READ_BIT(RTCx
->CALR
, RTC_CALR_CALW8
| RTC_CALR_CALW16
));
3321 * @brief Set Calibration minus
3322 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3323 * @note Bit can be written only when RECALPF is set to 0 in RTC_ICSR
3324 * @rmtoll RTC_CALR CALM LL_RTC_CAL_SetMinus
3325 * @param RTCx RTC Instance
3326 * @param CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF
3329 __STATIC_INLINE
void LL_RTC_CAL_SetMinus(RTC_TypeDef
*RTCx
, uint32_t CalibMinus
)
3331 MODIFY_REG(RTCx
->CALR
, RTC_CALR_CALM
, CalibMinus
);
3335 * @brief Get Calibration minus
3336 * @rmtoll RTC_CALR CALM LL_RTC_CAL_GetMinus
3337 * @param RTCx RTC Instance
3338 * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF
3340 __STATIC_INLINE
uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef
*RTCx
)
3342 return (uint32_t)(READ_BIT(RTCx
->CALR
, RTC_CALR_CALM
));
3349 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
3354 * @brief Get Internal Time-stamp flag
3355 * @rmtoll RTC_SR ITSF LL_RTC_IsActiveFlag_ITS
3356 * @param RTCx RTC Instance
3357 * @retval State of bit (1 or 0).
3359 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef
*RTCx
)
3361 return ((READ_BIT(RTCx
->SR
, RTC_SR_ITSF
) == (RTC_SR_ITSF
)) ? 1U : 0U);
3365 * @brief Get Recalibration pending Flag
3366 * @rmtoll RTC_ICSR RECALPF LL_RTC_IsActiveFlag_RECALP
3367 * @param RTCx RTC Instance
3368 * @retval State of bit (1 or 0).
3370 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef
*RTCx
)
3372 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_RECALPF
) == (RTC_ICSR_RECALPF
)) ? 1U : 0U);
3376 * @brief Get Time-stamp overflow flag
3377 * @rmtoll RTC_SR TSOVF LL_RTC_IsActiveFlag_TSOV
3378 * @param RTCx RTC Instance
3379 * @retval State of bit (1 or 0).
3381 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef
*RTCx
)
3383 return ((READ_BIT(RTCx
->SR
, RTC_SR_TSOVF
) == (RTC_SR_TSOVF
)) ? 1U : 0U);
3387 * @brief Get Time-stamp flag
3388 * @rmtoll RTC_SR TSF LL_RTC_IsActiveFlag_TS
3389 * @param RTCx RTC Instance
3390 * @retval State of bit (1 or 0).
3392 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef
*RTCx
)
3394 return ((READ_BIT(RTCx
->SR
, RTC_SR_TSF
) == (RTC_SR_TSF
)) ? 1U : 0U);
3398 * @brief Get Wakeup timer flag
3399 * @rmtoll RTC_SR WUTF LL_RTC_IsActiveFlag_WUT
3400 * @param RTCx RTC Instance
3401 * @retval State of bit (1 or 0).
3403 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef
*RTCx
)
3405 return ((READ_BIT(RTCx
->SR
, RTC_SR_WUTF
) == (RTC_SR_WUTF
)) ? 1U : 0U);
3409 * @brief Get Alarm B flag
3410 * @rmtoll RTC_SR ALRBF LL_RTC_IsActiveFlag_ALRB
3411 * @param RTCx RTC Instance
3412 * @retval State of bit (1 or 0).
3414 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef
*RTCx
)
3416 return ((READ_BIT(RTCx
->SR
, RTC_SR_ALRBF
) == (RTC_SR_ALRBF
)) ? 1U : 0U);
3420 * @brief Get Alarm A flag
3421 * @rmtoll RTC_SR ALRAF LL_RTC_IsActiveFlag_ALRA
3422 * @param RTCx RTC Instance
3423 * @retval State of bit (1 or 0).
3425 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef
*RTCx
)
3427 return ((READ_BIT(RTCx
->SR
, RTC_SR_ALRAF
) == (RTC_SR_ALRAF
)) ? 1U : 0U);
3431 * @brief Clear Internal Time-stamp flag
3432 * @rmtoll RTC_SCR CITSF LL_RTC_ClearFlag_ITS
3433 * @param RTCx RTC Instance
3436 __STATIC_INLINE
void LL_RTC_ClearFlag_ITS(RTC_TypeDef
*RTCx
)
3438 SET_BIT(RTCx
->SCR
, RTC_SCR_CITSF
);
3442 * @brief Clear Time-stamp overflow flag
3443 * @rmtoll RTC_SCR CTSOVF LL_RTC_ClearFlag_TSOV
3444 * @param RTCx RTC Instance
3447 __STATIC_INLINE
void LL_RTC_ClearFlag_TSOV(RTC_TypeDef
*RTCx
)
3449 SET_BIT(RTCx
->SCR
, RTC_SCR_CTSOVF
);
3453 * @brief Clear Time-stamp flag
3454 * @rmtoll RTC_SCR CTSF LL_RTC_ClearFlag_TS
3455 * @param RTCx RTC Instance
3458 __STATIC_INLINE
void LL_RTC_ClearFlag_TS(RTC_TypeDef
*RTCx
)
3460 SET_BIT(RTCx
->SCR
, RTC_SCR_CTSF
);
3464 * @brief Clear Wakeup timer flag
3465 * @rmtoll RTC_SCR CWUTF LL_RTC_ClearFlag_WUT
3466 * @param RTCx RTC Instance
3469 __STATIC_INLINE
void LL_RTC_ClearFlag_WUT(RTC_TypeDef
*RTCx
)
3471 SET_BIT(RTCx
->SCR
, RTC_SCR_CWUTF
);
3475 * @brief Clear Alarm B flag
3476 * @rmtoll RTC_SCR CALRBF LL_RTC_ClearFlag_ALRB
3477 * @param RTCx RTC Instance
3480 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRB(RTC_TypeDef
*RTCx
)
3482 SET_BIT(RTCx
->SCR
, RTC_SCR_CALRBF
);
3486 * @brief Clear Alarm A flag
3487 * @rmtoll RTC_SCR CALRAF LL_RTC_ClearFlag_ALRA
3488 * @param RTCx RTC Instance
3491 __STATIC_INLINE
void LL_RTC_ClearFlag_ALRA(RTC_TypeDef
*RTCx
)
3493 SET_BIT(RTCx
->SCR
, RTC_SCR_CALRAF
);
3497 * @brief Get Initialization flag
3498 * @rmtoll RTC_ICSR INITF LL_RTC_IsActiveFlag_INIT
3499 * @param RTCx RTC Instance
3500 * @retval State of bit (1 or 0).
3502 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef
*RTCx
)
3504 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_INITF
) == (RTC_ICSR_INITF
)) ? 1U : 0U);
3508 * @brief Get Registers synchronization flag
3509 * @rmtoll RTC_ICSR RSF LL_RTC_IsActiveFlag_RS
3510 * @param RTCx RTC Instance
3511 * @retval State of bit (1 or 0).
3513 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef
*RTCx
)
3515 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_RSF
) == (RTC_ICSR_RSF
)) ? 1U : 0U);
3519 * @brief Clear Registers synchronization flag
3520 * @rmtoll RTC_ICSR RSF LL_RTC_ClearFlag_RS
3521 * @param RTCx RTC Instance
3524 __STATIC_INLINE
void LL_RTC_ClearFlag_RS(RTC_TypeDef
*RTCx
)
3526 WRITE_REG(RTCx
->ICSR
, (~((RTC_ICSR_RSF
| RTC_ICSR_INIT
) & 0x000000FFU
) | (RTCx
->ICSR
& RTC_ICSR_INIT
)));
3530 * @brief Get Initialization status flag
3531 * @rmtoll RTC_ICSR INITS LL_RTC_IsActiveFlag_INITS
3532 * @param RTCx RTC Instance
3533 * @retval State of bit (1 or 0).
3535 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef
*RTCx
)
3537 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_INITS
) == (RTC_ICSR_INITS
)) ? 1U : 0U);
3541 * @brief Get Shift operation pending flag
3542 * @rmtoll RTC_ICSR SHPF LL_RTC_IsActiveFlag_SHP
3543 * @param RTCx RTC Instance
3544 * @retval State of bit (1 or 0).
3546 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef
*RTCx
)
3548 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_SHPF
) == (RTC_ICSR_SHPF
)) ? 1U : 0U);
3552 * @brief Get Wakeup timer write flag
3553 * @rmtoll RTC_ICSR WUTWF LL_RTC_IsActiveFlag_WUTW
3554 * @param RTCx RTC Instance
3555 * @retval State of bit (1 or 0).
3557 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef
*RTCx
)
3559 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_WUTWF
) == (RTC_ICSR_WUTWF
)) ? 1U : 0U);
3563 * @brief Get Alarm B write flag
3564 * @rmtoll RTC_ICSR ALRBWF LL_RTC_IsActiveFlag_ALRBW
3565 * @param RTCx RTC Instance
3566 * @retval State of bit (1 or 0).
3568 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef
*RTCx
)
3570 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_ALRBWF
) == (RTC_ICSR_ALRBWF
)) ? 1U : 0U);
3574 * @brief Get Alarm A write flag
3575 * @rmtoll RTC_ICSR ALRAWF LL_RTC_IsActiveFlag_ALRAW
3576 * @param RTCx RTC Instance
3577 * @retval State of bit (1 or 0).
3579 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef
*RTCx
)
3581 return ((READ_BIT(RTCx
->ICSR
, RTC_ICSR_ALRAWF
) == (RTC_ICSR_ALRAWF
)) ? 1U : 0U);
3585 * @brief Get Alarm A masked flag.
3586 * @rmtoll RTC_MISR ALRAMF LL_RTC_IsActiveFlag_ALRAM
3587 * @param RTCx RTC Instance
3588 * @retval State of bit (1 or 0).
3590 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRAM(RTC_TypeDef
*RTCx
)
3592 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_ALRAMF
) == (RTC_MISR_ALRAMF
)) ? 1U : 0U);
3596 * @brief Get Alarm B masked flag.
3597 * @rmtoll RTC_MISR ALRBMF LL_RTC_IsActiveFlag_ALRBM
3598 * @param RTCx RTC Instance
3599 * @retval State of bit (1 or 0).
3601 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ALRBM(RTC_TypeDef
*RTCx
)
3603 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_ALRBMF
) == (RTC_MISR_ALRBMF
)) ? 1U : 0U);
3607 * @brief Get Wakeup timer masked flag.
3608 * @rmtoll RTC_MISR WUTMF LL_RTC_IsActiveFlag_WUTM
3609 * @param RTCx RTC Instance
3610 * @retval State of bit (1 or 0).
3612 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_WUTM(RTC_TypeDef
*RTCx
)
3614 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_WUTMF
) == (RTC_MISR_WUTMF
)) ? 1U : 0U);
3618 * @brief Get Time-stamp masked flag.
3619 * @rmtoll RTC_MISR TSMF LL_RTC_IsActiveFlag_TSM
3620 * @param RTCx RTC Instance
3621 * @retval State of bit (1 or 0).
3623 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSM(RTC_TypeDef
*RTCx
)
3625 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_TSMF
) == (RTC_MISR_TSMF
)) ? 1U : 0U);
3629 * @brief Get Time-stamp overflow masked flag.
3630 * @rmtoll RTC_MISR TSOVMF LL_RTC_IsActiveFlag_TSOVM
3631 * @param RTCx RTC Instance
3632 * @retval State of bit (1 or 0).
3634 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TSOVM(RTC_TypeDef
*RTCx
)
3636 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_TSOVMF
) == (RTC_MISR_TSOVMF
)) ? 1U : 0U);
3640 * @brief Get Internal Time-stamp masked flag.
3641 * @rmtoll RTC_MISR ITSMF LL_RTC_IsActiveFlag_ITSM
3642 * @param RTCx RTC Instance
3643 * @retval State of bit (1 or 0).
3645 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITSM(RTC_TypeDef
*RTCx
)
3647 return ((READ_BIT(RTCx
->MISR
, RTC_MISR_ITSMF
) == (RTC_MISR_ITSMF
)) ? 1U : 0U);
3651 * @brief Get tamper 1 detection flag.
3652 * @rmtoll TAMP_SR TAMP1F LL_RTC_IsActiveFlag_TAMP1
3653 * @param RTCx RTC Instance
3654 * @retval State of bit (1 or 0).
3656 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef
*RTCx
)
3659 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP1F
) == (TAMP_SR_TAMP1F
)) ? 1U : 0U);
3663 * @brief Get tamper 2 detection flag.
3664 * @rmtoll TAMP_SR TAMP2F LL_RTC_IsActiveFlag_TAMP2
3665 * @param RTCx RTC Instance
3666 * @retval State of bit (1 or 0).
3668 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef
*RTCx
)
3671 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP2F
) == (TAMP_SR_TAMP2F
)) ? 1U : 0U);
3674 #if (RTC_TAMP_NB==3)
3676 * @brief Get tamper 3 detection flag.
3677 * @rmtoll TAMP_SR TAMP3F LL_RTC_IsActiveFlag_TAMP3
3678 * @param RTCx RTC Instance
3679 * @retval State of bit (1 or 0).
3681 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef
*RTCx
)
3684 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP3F
) == (TAMP_SR_TAMP3F
)) ? 1U : 0U);
3686 #elif (RTC_TAMP_NB==8)
3689 * @brief Get tamper 3 detection flag.
3690 * @rmtoll TAMP_SR TAMP3F LL_RTC_IsActiveFlag_TAMP3
3691 * @param RTCx RTC Instance
3692 * @retval State of bit (1 or 0).
3694 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef
*RTCx
)
3697 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP3F
) == (TAMP_SR_TAMP3F
)) ? 1U : 0U);
3700 * @brief Get tamper 4 detection flag.
3701 * @rmtoll TAMP_SR TAMP4F LL_RTC_IsActiveFlag_TAMP4
3702 * @param RTCx RTC Instance
3703 * @retval State of bit (1 or 0).
3705 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP4(RTC_TypeDef
*RTCx
)
3708 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP4F
) == (TAMP_SR_TAMP4F
)) ? 1U : 0U);
3711 * @brief Get tamper 5 detection flag.
3712 * @rmtoll TAMP_SR TAMP5F LL_RTC_IsActiveFlag_TAMP5
3713 * @param RTCx RTC Instance
3714 * @retval State of bit (1 or 0).
3716 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP5(RTC_TypeDef
*RTCx
)
3719 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP5F
) == (TAMP_SR_TAMP5F
)) ? 1U : 0U);
3722 * @brief Get tamper 6 detection flag.
3723 * @rmtoll TAMP_SR TAMP6F LL_RTC_IsActiveFlag_TAMP6
3724 * @param RTCx RTC Instance
3725 * @retval State of bit (1 or 0).
3727 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP6(RTC_TypeDef
*RTCx
)
3730 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP6F
) == (TAMP_SR_TAMP6F
)) ? 1U : 0U);
3733 * @brief Get tamper 7 detection flag.
3734 * @rmtoll TAMP_SR TAMP7F LL_RTC_IsActiveFlag_TAMP7
3735 * @param RTCx RTC Instance
3736 * @retval State of bit (1 or 0).
3738 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP7(RTC_TypeDef
*RTCx
)
3741 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP7F
) == (TAMP_SR_TAMP7F
)) ? 1U : 0U);
3744 * @brief Get tamper 8 detection flag.
3745 * @rmtoll TAMP_SR TAMP8F LL_RTC_IsActiveFlag_TAMP8
3746 * @param RTCx RTC Instance
3747 * @retval State of bit (1 or 0).
3749 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP8(RTC_TypeDef
*RTCx
)
3752 return ((READ_BIT(TAMP
->SR
, TAMP_SR_TAMP8F
) == (TAMP_SR_TAMP8F
)) ? 1U : 0U);
3754 #endif /* RTC_TAMP_NB */
3756 #if defined (RTC_TAMP_INT_1_SUPPORT)
3758 * @brief Get internal tamper 1 detection flag.
3759 * @rmtoll TAMP_SR ITAMP1F LL_RTC_IsActiveFlag_ITAMP1
3760 * @param RTCx RTC Instance
3761 * @retval State of bit (1 or 0).
3763 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP1(RTC_TypeDef
*RTCx
)
3766 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP1F
) == (TAMP_SR_ITAMP1F
)) ? 1U : 0U);
3769 #endif /* RTC_TAMP_INT_1_SUPPORT */
3770 #if defined (RTC_TAMP_INT_2_SUPPORT)
3772 * @brief Get internal tamper 2 detection flag.
3773 * @rmtoll TAMP_SR ITAMP2F LL_RTC_IsActiveFlag_ITAMP2
3774 * @param RTCx RTC Instance
3775 * @retval State of bit (1 or 0).
3777 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP2(RTC_TypeDef
*RTCx
)
3780 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP2F
) == (TAMP_SR_ITAMP2F
)) ? 1U : 0U);
3783 #endif /* RTC_TAMP_INT_2_SUPPORT */
3785 * @brief Get internal tamper 3 detection flag.
3786 * @rmtoll TAMP_SR ITAMP3F LL_RTC_IsActiveFlag_ITAMP3
3787 * @param RTCx RTC Instance
3788 * @retval State of bit (1 or 0).
3790 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP3(RTC_TypeDef
*RTCx
)
3793 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP3F
) == (TAMP_SR_ITAMP3F
)) ? 1U : 0U);
3797 * @brief Get internal tamper 4 detection flag.
3798 * @rmtoll TAMP_SR ITAMP4F LL_RTC_IsActiveFlag_ITAMP4
3799 * @param RTCx RTC Instance
3800 * @retval State of bit (1 or 0).
3802 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP4(RTC_TypeDef
*RTCx
)
3805 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP4F
) == (TAMP_SR_ITAMP4F
)) ? 1U : 0U);
3808 * @brief Get internal tamper 5 detection flag.
3809 * @rmtoll TAMP_SR ITAMP5F LL_RTC_IsActiveFlag_ITAMP5
3810 * @param RTCx RTC Instance
3811 * @retval State of bit (1 or 0).
3813 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP5(RTC_TypeDef
*RTCx
)
3816 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP5F
) == (TAMP_SR_ITAMP5F
)) ? 1U : 0U);
3819 #if defined (RTC_TAMP_INT_6_SUPPORT)
3821 * @brief Get internal tamper 6 detection flag.
3822 * @rmtoll TAMP_SR ITAMP6F LL_RTC_IsActiveFlag_ITAMP6
3823 * @param RTCx RTC Instance
3824 * @retval State of bit (1 or 0).
3826 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP6(RTC_TypeDef
*RTCx
)
3829 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP6F
) == (TAMP_SR_ITAMP6F
)) ? 1U : 0U);
3831 #endif /* RTC_TAMP_INT_6_SUPPORT */
3833 #if defined (RTC_TAMP_INT_7_SUPPORT)
3835 * @brief Get internal tamper 7 detection flag.
3836 * @rmtoll TAMP_SR ITAMP7F LL_RTC_IsActiveFlag_ITAMP7
3837 * @param RTCx RTC Instance
3838 * @retval State of bit (1 or 0).
3840 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP7(RTC_TypeDef
*RTCx
)
3843 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP7F
) == (TAMP_SR_ITAMP7F
)) ? 1U : 0U);
3845 #endif /* RTC_TAMP_INT_7_SUPPORT */
3847 #if defined (RTC_TAMP_INT_8_SUPPORT)
3849 * @brief Get internal tamper 8 detection flag.
3850 * @rmtoll TAMP_SR ITAMP8F LL_RTC_IsActiveFlag_ITAMP8
3851 * @param RTCx RTC Instance
3852 * @retval State of bit (1 or 0).
3854 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP8(RTC_TypeDef
*RTCx
)
3857 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP8F
) == (TAMP_SR_ITAMP8F
)) ? 1U : 0U);
3859 #endif /* RTC_TAMP_INT_8_SUPPORT */
3863 * @brief Get internal tamper 9 detection flag.
3864 * @rmtoll TAMP_SR ITAMP9F LL_RTC_IsActiveFlag_ITAMP9
3865 * @param RTCx RTC Instance
3866 * @retval State of bit (1 or 0).
3868 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP9(RTC_TypeDef
*RTCx
)
3871 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP9F
) == (TAMP_SR_ITAMP9F
)) ? 1U : 0U);
3875 * @brief Get internal tamper 10 detection flag.
3876 * @rmtoll TAMP_SR ITAMP10F LL_RTC_IsActiveFlag_ITAMP10
3877 * @param RTCx RTC Instance
3878 * @retval State of bit (1 or 0).
3880 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP10(RTC_TypeDef
*RTCx
)
3883 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP10F
) == (TAMP_SR_ITAMP10F
)) ? 1U : 0U);
3887 * @brief Get internal tamper 11 detection flag.
3888 * @rmtoll TAMP_SR ITAMP11F LL_RTC_IsActiveFlag_ITAMP11
3889 * @param RTCx RTC Instance
3890 * @retval State of bit (1 or 0).
3892 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP11(RTC_TypeDef
*RTCx
)
3895 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP11F
) == (TAMP_SR_ITAMP11F
)) ? 1U : 0U);
3899 * @brief Get internal tamper 12 detection flag.
3900 * @rmtoll TAMP_SR ITAMP7F LL_RTC_IsActiveFlag_ITAMP12
3901 * @param RTCx RTC Instance
3902 * @retval State of bit (1 or 0).
3904 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP12(RTC_TypeDef
*RTCx
)
3907 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP12F
) == (TAMP_SR_ITAMP12F
)) ? 1U : 0U);
3911 * @brief Get internal tamper 13 detection flag.
3912 * @rmtoll TAMP_SR ITAMP13F LL_RTC_IsActiveFlag_ITAMP13
3913 * @param RTCx RTC Instance
3914 * @retval State of bit (1 or 0).
3916 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP13(RTC_TypeDef
*RTCx
)
3919 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP13F
) == (TAMP_SR_ITAMP13F
)) ? 1U : 0U);
3923 * @brief Get internal tamper 14 detection flag.
3924 * @rmtoll TAMP_SR ITAMP14F LL_RTC_IsActiveFlag_ITAMP14
3925 * @param RTCx RTC Instance
3926 * @retval State of bit (1 or 0).
3928 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP14(RTC_TypeDef
*RTCx
)
3931 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP14F
) == (TAMP_SR_ITAMP14F
)) ? 1U : 0U);
3935 * @brief Get internal tamper 15 detection flag.
3936 * @rmtoll TAMP_SR ITAMP15F LL_RTC_IsActiveFlag_ITAMP15
3937 * @param RTCx RTC Instance
3938 * @retval State of bit (1 or 0).
3940 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP15(RTC_TypeDef
*RTCx
)
3943 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP15F
) == (TAMP_SR_ITAMP15F
)) ? 1U : 0U);
3947 * @brief Get internal tamper 16 detection flag.
3948 * @rmtoll TAMP_SR ITAMP7F LL_RTC_IsActiveFlag_ITAMP16
3949 * @param RTCx RTC Instance
3950 * @retval State of bit (1 or 0).
3952 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP16(RTC_TypeDef
*RTCx
)
3955 return ((READ_BIT(TAMP
->SR
, TAMP_SR_ITAMP16F
) == (TAMP_SR_ITAMP16F
)) ? 1U : 0U);
3960 * @brief Get tamper 1 interrupt masked flag.
3961 * @rmtoll TAMP_MISR TAMP1MF LL_RTC_IsActiveFlag_TAMP1M
3962 * @param RTCx RTC Instance
3963 * @retval State of bit (1 or 0).
3965 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP1M(RTC_TypeDef
*RTCx
)
3968 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP1MF
) == (TAMP_MISR_TAMP1MF
)) ? 1U : 0U);
3972 * @brief Get tamper 2 interrupt masked flag.
3973 * @rmtoll TAMP_MISR TAMP2MF LL_RTC_IsActiveFlag_TAMP2M
3974 * @param RTCx RTC Instance
3975 * @retval State of bit (1 or 0).
3977 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP2M(RTC_TypeDef
*RTCx
)
3980 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP2MF
) == (TAMP_MISR_TAMP2MF
)) ? 1U : 0U);
3983 #if (RTC_TAMP_NB ==3)
3985 * @brief Get tamper 3 interrupt masked flag.
3986 * @rmtoll TAMP_MISR TAMP3MF LL_RTC_IsActiveFlag_TAMP3M
3987 * @param RTCx RTC Instance
3988 * @retval State of bit (1 or 0).
3990 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3M(RTC_TypeDef
*RTCx
)
3993 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP3MF
) == (TAMP_MISR_TAMP3MF
)) ? 1U : 0U);
3995 #elif (RTC_TAMP_NB==8)
3997 * @brief Get tamper 3 interrupt masked flag.
3998 * @rmtoll TAMP_MISR TAMP3MF LL_RTC_IsActiveFlag_TAMP3M
3999 * @param RTCx RTC Instance
4000 * @retval State of bit (1 or 0).
4002 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP3M(RTC_TypeDef
*RTCx
)
4005 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP3MF
) == (TAMP_MISR_TAMP3MF
)) ? 1U : 0U);
4008 * @brief Get tamper 4 interrupt masked flag.
4009 * @rmtoll TAMP_MISR TAMP4MF LL_RTC_IsActiveFlag_TAMP4M
4010 * @param RTCx RTC Instance
4011 * @retval State of bit (1 or 0).
4013 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP4M(RTC_TypeDef
*RTCx
)
4016 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP4MF
) == (TAMP_MISR_TAMP4MF
)) ? 1U : 0U);
4019 * @brief Get tamper 5 interrupt masked flag.
4020 * @rmtoll TAMP_MISR TAMP5MF LL_RTC_IsActiveFlag_TAMP5M
4021 * @param RTCx RTC Instance
4022 * @retval State of bit (1 or 0).
4024 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP5M(RTC_TypeDef
*RTCx
)
4027 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP5MF
) == (TAMP_MISR_TAMP5MF
)) ? 1U : 0U);
4030 * @brief Get tamper 6 interrupt masked flag.
4031 * @rmtoll TAMP_MISR TAMP3MF LL_RTC_IsActiveFlag_TAMP6M
4032 * @param RTCx RTC Instance
4033 * @retval State of bit (1 or 0).
4035 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP6M(RTC_TypeDef
*RTCx
)
4038 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP6MF
) == (TAMP_MISR_TAMP6MF
)) ? 1U : 0U);
4041 * @brief Get tamper 7 interrupt masked flag.
4042 * @rmtoll TAMP_MISR TAMP7MF LL_RTC_IsActiveFlag_TAMP7M
4043 * @param RTCx RTC Instance
4044 * @retval State of bit (1 or 0).
4046 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP7M(RTC_TypeDef
*RTCx
)
4049 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP7MF
) == (TAMP_MISR_TAMP7MF
)) ? 1U : 0U);
4052 * @brief Get tamper 8 interrupt masked flag.
4053 * @rmtoll TAMP_MISR TAMP8MF LL_RTC_IsActiveFlag_TAMP8M
4054 * @param RTCx RTC Instance
4055 * @retval State of bit (1 or 0).
4057 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_TAMP8M(RTC_TypeDef
*RTCx
)
4060 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_TAMP8MF
) == (TAMP_MISR_TAMP8MF
)) ? 1U : 0U);
4062 #endif /* RTC_TAMP_NB */
4064 #if defined (RTC_TAMP_INT_1_SUPPORT)
4066 * @brief Get internal tamper 1 interrupt masked flag.
4067 * @rmtoll TAMP_MISR ITAMP1MF LL_RTC_IsActiveFlag_ITAMP1M
4068 * @param RTCx RTC Instance
4069 * @retval State of bit (1 or 0).
4071 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP1M(RTC_TypeDef
*RTCx
)
4074 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP1MF
) == (TAMP_MISR_ITAMP1MF
)) ? 1U : 0U);
4077 #endif /* RTC_TAMP_INT_1_SUPPORT */
4078 #if defined (RTC_TAMP_INT_2_SUPPORT)
4080 * @brief Get internal tamper 2 interrupt masked flag.
4081 * @rmtoll TAMP_MISR ITAMP2MF LL_RTC_IsActiveFlag_ITAMP2M
4082 * @param RTCx RTC Instance
4083 * @retval State of bit (1 or 0).
4085 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP2M(RTC_TypeDef
*RTCx
)
4088 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP2MF
) == (TAMP_MISR_ITAMP2MF
)) ? 1U : 0U);
4091 #endif /* RTC_TAMP_INT_2_SUPPORT */
4093 * @brief Get internal tamper 3 interrupt masked flag.
4094 * @rmtoll TAMP_MISR ITAMP3MF LL_RTC_IsActiveFlag_ITAMP3M
4095 * @param RTCx RTC Instance
4096 * @retval State of bit (1 or 0).
4098 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP3M(RTC_TypeDef
*RTCx
)
4101 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP3MF
) == (TAMP_MISR_ITAMP3MF
)) ? 1U : 0U);
4105 * @brief Get internal tamper 4 interrupt masked flag.
4106 * @rmtoll TAMP_MISR ITAMP4MF LL_RTC_IsActiveFlag_ITAMP4M
4107 * @param RTCx RTC Instance
4108 * @retval State of bit (1 or 0).
4110 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP4M(RTC_TypeDef
*RTCx
)
4113 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP4MF
) == (TAMP_MISR_ITAMP4MF
)) ? 1U : 0U);
4117 * @brief Get internal tamper 5 interrupt masked flag.
4118 * @rmtoll TAMP_MISR ITAMP5MF LL_RTC_IsActiveFlag_ITAMP5M
4119 * @param RTCx RTC Instance
4120 * @retval State of bit (1 or 0).
4122 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP5M(RTC_TypeDef
*RTCx
)
4125 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP5MF
) == (TAMP_MISR_ITAMP5MF
)) ? 1U : 0U);
4128 #if defined (RTC_TAMP_INT_6_SUPPORT)
4130 * @brief Get internal tamper 6 interrupt masked flag.
4131 * @rmtoll TAMP_MISR ITAMP6MF LL_RTC_IsActiveFlag_ITAMP6M
4132 * @param RTCx RTC Instance
4133 * @retval State of bit (1 or 0).
4135 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP6M(RTC_TypeDef
*RTCx
)
4138 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP6MF
) == (TAMP_MISR_ITAMP6MF
)) ? 1U : 0U);
4140 #endif /* RTC_TAMP_INT_6_SUPPORT */
4142 #if defined (RTC_TAMP_INT_7_SUPPORT)
4144 * @brief Get internal tamper 7 interrupt masked flag.
4145 * @rmtoll TAMP_MISR ITAMP7MF LL_RTC_IsActiveFlag_ITAMP7M
4146 * @param RTCx RTC Instance
4147 * @retval State of bit (1 or 0).
4149 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP7M(RTC_TypeDef
*RTCx
)
4152 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP7MF
) == (TAMP_MISR_ITAMP7MF
)) ? 1U : 0U);
4154 #endif /* RTC_TAMP_INT_7_SUPPORT */
4156 #if defined (RTC_TAMP_INT_8_SUPPORT)
4158 * @brief Get internal tamper 8 interrupt masked flag.
4159 * @rmtoll TAMP_MISR ITAMP8MF LL_RTC_IsActiveFlag_ITAMP8M
4160 * @param RTCx RTC Instance
4161 * @retval State of bit (1 or 0).
4163 __STATIC_INLINE
uint32_t LL_RTC_IsActiveFlag_ITAMP8M(RTC_TypeDef
*RTCx
)
4166 return ((READ_BIT(TAMP
->MISR
, TAMP_MISR_ITAMP8MF
) == (TAMP_MISR_ITAMP8MF
)) ? 1U : 0U);
4168 #endif /* RTC_TAMP_INT_8_SUPPORT */
4171 * @brief Clear tamper 1 detection flag.
4172 * @rmtoll TAMP_SCR CTAMP1F LL_RTC_ClearFlag_TAMP1
4173 * @param RTCx RTC Instance
4176 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef
*RTCx
)
4179 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP1F
);
4183 * @brief Clear tamper 2 detection flag.
4184 * @rmtoll TAMP_SCR CTAMP2F LL_RTC_ClearFlag_TAMP2
4185 * @param RTCx RTC Instance
4188 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef
*RTCx
)
4191 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP2F
);
4194 #if (RTC_TAMP_NB == 3)
4196 * @brief Clear tamper 3 detection flag.
4197 * @rmtoll TAMP_SCR CTAMP3F LL_RTC_ClearFlag_TAMP3
4198 * @param RTCx RTC Instance
4201 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef
*RTCx
)
4204 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP3F
);
4206 #elif (RTC_TAMP_NB == 8)
4208 * @brief Clear tamper 3 detection flag.
4209 * @rmtoll TAMP_SCR CTAMP3F LL_RTC_ClearFlag_TAMP3
4210 * @param RTCx RTC Instance
4213 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef
*RTCx
)
4216 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP3F
);
4219 * @brief Clear tamper 4 detection flag.
4220 * @rmtoll TAMP_SCR CTAMP3F LL_RTC_ClearFlag_TAMP4
4221 * @param RTCx RTC Instance
4224 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP4(RTC_TypeDef
*RTCx
)
4227 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP4F
);
4230 * @brief Clear tamper 5 detection flag.
4231 * @rmtoll TAMP_SCR CTAMP5F LL_RTC_ClearFlag_TAMP5
4232 * @param RTCx RTC Instance
4235 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP5(RTC_TypeDef
*RTCx
)
4238 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP5F
);
4241 * @brief Clear tamper 6 detection flag.
4242 * @rmtoll TAMP_SCR CTAMP6F LL_RTC_ClearFlag_TAMP6
4243 * @param RTCx RTC Instance
4246 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP6(RTC_TypeDef
*RTCx
)
4249 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP6F
);
4252 * @brief Clear tamper 7 detection flag.
4253 * @rmtoll TAMP_SCR CTAMP7F LL_RTC_ClearFlag_TAMP7
4254 * @param RTCx RTC Instance
4257 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP7(RTC_TypeDef
*RTCx
)
4260 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP7F
);
4263 * @brief Clear tamper 8 detection flag.
4264 * @rmtoll TAMP_SCR CTAMP8F LL_RTC_ClearFlag_TAMP8
4265 * @param RTCx RTC Instance
4268 __STATIC_INLINE
void LL_RTC_ClearFlag_TAMP8(RTC_TypeDef
*RTCx
)
4271 SET_BIT(TAMP
->SCR
, TAMP_SCR_CTAMP8F
);
4274 #endif /* RTC_TAMP_NB */
4276 #if defined (RTC_TAMP_INT_1_SUPPORT)
4278 * @brief Clear internal tamper 1 detection flag.
4279 * @rmtoll TAMP_SCR CITAMP1F LL_RTC_ClearFlag_ITAMP1
4280 * @param RTCx RTC Instance
4283 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP1(RTC_TypeDef
*RTCx
)
4286 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP1F
);
4289 #endif /* RTC_TAMP_INT_1_SUPPORT */
4290 #if defined (RTC_TAMP_INT_2_SUPPORT)
4292 * @brief Clear internal tamper 2 detection flag.
4293 * @rmtoll TAMP_SCR CITAMP2F LL_RTC_ClearFlag_ITAMP2
4294 * @param RTCx RTC Instance
4297 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP2(RTC_TypeDef
*RTCx
)
4300 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP2F
);
4303 #endif /* RTC_TAMP_INT_2_SUPPORT */
4305 * @brief Clear internal tamper 3 detection flag.
4306 * @rmtoll TAMP_SCR CITAMP3F LL_RTC_ClearFlag_ITAMP3
4307 * @param RTCx RTC Instance
4310 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP3(RTC_TypeDef
*RTCx
)
4313 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP3F
);
4317 * @brief Clear internal tamper 4 detection flag.
4318 * @rmtoll TAMP_SCR CITAMP4F LL_RTC_ClearFlag_ITAMP4
4319 * @param RTCx RTC Instance
4322 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP4(RTC_TypeDef
*RTCx
)
4325 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP4F
);
4329 * @brief Clear internal tamper 5 detection flag.
4330 * @rmtoll TAMP_SCR CITAMP5F LL_RTC_ClearFlag_ITAMP5
4331 * @param RTCx RTC Instance
4334 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP5(RTC_TypeDef
*RTCx
)
4337 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP5F
);
4340 #if defined (RTC_TAMP_INT_6_SUPPORT)
4342 * @brief Clear internal tamper 6 detection flag.
4343 * @rmtoll TAMP_SCR CITAMP6F LL_RTC_ClearFlag_ITAMP6
4344 * @param RTCx RTC Instance
4347 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP6(RTC_TypeDef
*RTCx
)
4350 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP6F
);
4352 #endif /* (RTC_TAMP_INT_2_SUPPORT)*/
4354 #if defined (RTC_TAMP_INT_7_SUPPORT)
4356 * @brief Clear internal tamper 7 detection flag.
4357 * @rmtoll TAMP_SCR CITAMP7F LL_RTC_ClearFlag_ITAMP7
4358 * @param RTCx RTC Instance
4361 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP7(RTC_TypeDef
*RTCx
)
4364 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP7F
);
4366 #endif /* (RTC_TAMP_INT_7_SUPPORT) */
4368 #if defined (RTC_TAMP_INT_8_SUPPORT)
4370 * @brief Clear internal tamper 8 detection flag.
4371 * @rmtoll TAMP_SCR CITAMP8F LL_RTC_ClearFlag_ITAMP8
4372 * @param RTCx RTC Instance
4375 __STATIC_INLINE
void LL_RTC_ClearFlag_ITAMP8(RTC_TypeDef
*RTCx
)
4378 SET_BIT(TAMP
->SCR
, TAMP_SCR_CITAMP8F
);
4380 #endif /* (RTC_TAMP_INT_8_SUPPORT) */
4386 /** @defgroup RTC_LL_EF_IT_Management IT_Management
4391 * @brief Enable Time-stamp interrupt
4392 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4393 * @rmtoll RTC_CR LL_RTC_EnableIT_TS
4394 * @param RTCx RTC Instance
4397 __STATIC_INLINE
void LL_RTC_EnableIT_TS(RTC_TypeDef
*RTCx
)
4399 SET_BIT(RTCx
->CR
, RTC_CR_TSIE
);
4403 * @brief Disable Time-stamp interrupt
4404 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4405 * @rmtoll RTC_CR LL_RTC_DisableIT_TS
4406 * @param RTCx RTC Instance
4409 __STATIC_INLINE
void LL_RTC_DisableIT_TS(RTC_TypeDef
*RTCx
)
4411 CLEAR_BIT(RTCx
->CR
, RTC_CR_TSIE
);
4415 * @brief Enable Wakeup timer interrupt
4416 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4417 * @rmtoll RTC_CR LL_RTC_EnableIT_WUT
4418 * @param RTCx RTC Instance
4421 __STATIC_INLINE
void LL_RTC_EnableIT_WUT(RTC_TypeDef
*RTCx
)
4423 SET_BIT(RTCx
->CR
, RTC_CR_WUTIE
);
4427 * @brief Disable Wakeup timer interrupt
4428 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4429 * @rmtoll RTC_CR LL_RTC_DisableIT_WUT
4430 * @param RTCx RTC Instance
4433 __STATIC_INLINE
void LL_RTC_DisableIT_WUT(RTC_TypeDef
*RTCx
)
4435 CLEAR_BIT(RTCx
->CR
, RTC_CR_WUTIE
);
4439 * @brief Enable Alarm B interrupt
4440 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4441 * @rmtoll RTC_CR ALRBIE LL_RTC_EnableIT_ALRB
4442 * @param RTCx RTC Instance
4445 __STATIC_INLINE
void LL_RTC_EnableIT_ALRB(RTC_TypeDef
*RTCx
)
4447 SET_BIT(RTCx
->CR
, RTC_CR_ALRBIE
);
4451 * @brief Disable Alarm B interrupt
4452 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4453 * @rmtoll RTC_CR ALRBIE LL_RTC_DisableIT_ALRB
4454 * @param RTCx RTC Instance
4457 __STATIC_INLINE
void LL_RTC_DisableIT_ALRB(RTC_TypeDef
*RTCx
)
4459 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRBIE
);
4463 * @brief Enable Alarm A interrupt
4464 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4465 * @rmtoll RTC_CR ALRAIE LL_RTC_EnableIT_ALRA
4466 * @param RTCx RTC Instance
4469 __STATIC_INLINE
void LL_RTC_EnableIT_ALRA(RTC_TypeDef
*RTCx
)
4471 SET_BIT(RTCx
->CR
, RTC_CR_ALRAIE
);
4475 * @brief Disable Alarm A interrupt
4476 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
4477 * @rmtoll RTC_CR ALRAIE LL_RTC_DisableIT_ALRA
4478 * @param RTCx RTC Instance
4481 __STATIC_INLINE
void LL_RTC_DisableIT_ALRA(RTC_TypeDef
*RTCx
)
4483 CLEAR_BIT(RTCx
->CR
, RTC_CR_ALRAIE
);
4487 * @brief Check if Time-stamp interrupt is enabled or not
4488 * @rmtoll RTC_CR TSIE LL_RTC_IsEnabledIT_TS
4489 * @param RTCx RTC Instance
4490 * @retval State of bit (1 or 0).
4492 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef
*RTCx
)
4494 return ((READ_BIT(RTCx
->CR
, RTC_CR_TSIE
) == (RTC_CR_TSIE
)) ? 1U : 0U);
4498 * @brief Check if Wakeup timer interrupt is enabled or not
4499 * @rmtoll RTC_CR WUTIE LL_RTC_IsEnabledIT_WUT
4500 * @param RTCx RTC Instance
4501 * @retval State of bit (1 or 0).
4503 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef
*RTCx
)
4505 return ((READ_BIT(RTCx
->CR
, RTC_CR_WUTIE
) == (RTC_CR_WUTIE
)) ? 1U : 0U);
4509 * @brief Check if Alarm B interrupt is enabled or not
4510 * @rmtoll RTC_CR ALRBIE LL_RTC_IsEnabledIT_ALRB
4511 * @param RTCx RTC Instance
4512 * @retval State of bit (1 or 0).
4514 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef
*RTCx
)
4516 return ((READ_BIT(RTCx
->CR
, RTC_CR_ALRBIE
) == (RTC_CR_ALRBIE
)) ? 1U : 0U);
4520 * @brief Check if Alarm A interrupt is enabled or not
4521 * @rmtoll RTC_CR ALRAIE LL_RTC_IsEnabledIT_ALRA
4522 * @param RTCx RTC Instance
4523 * @retval State of bit (1 or 0).
4525 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef
*RTCx
)
4527 return ((READ_BIT(RTCx
->CR
, RTC_CR_ALRAIE
) == (RTC_CR_ALRAIE
)) ? 1U : 0U);
4531 * @brief Enable tamper 1 interrupt.
4532 * @rmtoll TAMP_IER TAMP1IE LL_RTC_EnableIT_TAMP1
4533 * @param RTCx RTC Instance
4536 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP1(RTC_TypeDef
*RTCx
)
4539 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP1IE
);
4543 * @brief Disable tamper 1 interrupt.
4544 * @rmtoll TAMP_IER TAMP1IE LL_RTC_DisableIT_TAMP1
4545 * @param RTCx RTC Instance
4548 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP1(RTC_TypeDef
*RTCx
)
4551 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP1IE
);
4555 * @brief Enable tamper 2 interrupt.
4556 * @rmtoll TAMP_IER TAMP2IE LL_RTC_EnableIT_TAMP2
4557 * @param RTCx RTC Instance
4560 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP2(RTC_TypeDef
*RTCx
)
4563 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP2IE
);
4567 * @brief Disable tamper 2 interrupt.
4568 * @rmtoll TAMP_IER TAMP2IE LL_RTC_DisableIT_TAMP2
4569 * @param RTCx RTC Instance
4572 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP2(RTC_TypeDef
*RTCx
)
4575 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP2IE
);
4578 #if (RTC_TAMP_NB == 3)
4580 * @brief Enable tamper 3 interrupt.
4581 * @rmtoll TAMP_IER TAMP3IE LL_RTC_EnableIT_TAMP3
4582 * @param RTCx RTC Instance
4585 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP3(RTC_TypeDef
*RTCx
)
4588 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP3IE
);
4591 * @brief Disable tamper 3 interrupt.
4592 * @rmtoll TAMP_IER TAMP3IE LL_RTC_DisableIT_TAMP3
4593 * @param RTCx RTC Instance
4596 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP3(RTC_TypeDef
*RTCx
)
4599 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP3IE
);
4601 #elif (RTC_TAMP_NB == 8)
4603 * @brief Enable tamper 3 interrupt.
4604 * @rmtoll TAMP_IER TAMP3IE LL_RTC_EnableIT_TAMP3
4605 * @param RTCx RTC Instance
4608 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP3(RTC_TypeDef
*RTCx
)
4611 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP3IE
);
4614 * @brief Disable tamper 3 interrupt.
4615 * @rmtoll TAMP_IER TAMP3IE LL_RTC_DisableIT_TAMP3
4616 * @param RTCx RTC Instance
4619 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP3(RTC_TypeDef
*RTCx
)
4622 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP3IE
);
4625 * @brief Enable tamper 4 interrupt.
4626 * @rmtoll TAMP_IER TAMP4IE LL_RTC_EnableIT_TAMP4
4627 * @param RTCx RTC Instance
4630 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP4(RTC_TypeDef
*RTCx
)
4633 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP4IE
);
4636 * @brief Disable tamper 4 interrupt.
4637 * @rmtoll TAMP_IER TAMP4IE LL_RTC_DisableIT_TAMP4
4638 * @param RTCx RTC Instance
4641 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP4(RTC_TypeDef
*RTCx
)
4644 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP4IE
);
4648 * @brief Enable tamper 5 interrupt.
4649 * @rmtoll TAMP_IER TAMP5IE LL_RTC_EnableIT_TAMP5
4650 * @param RTCx RTC Instance
4653 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP5(RTC_TypeDef
*RTCx
)
4656 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP5IE
);
4659 * @brief Disable tamper 5 interrupt.
4660 * @rmtoll TAMP_IER TAMP5IE LL_RTC_DisableIT_TAMP5
4661 * @param RTCx RTC Instance
4664 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP5(RTC_TypeDef
*RTCx
)
4667 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP5IE
);
4671 * @brief Enable tamper 6 interrupt.
4672 * @rmtoll TAMP_IER TAMP6IE LL_RTC_EnableIT_TAMP6
4673 * @param RTCx RTC Instance
4676 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP6(RTC_TypeDef
*RTCx
)
4679 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP6IE
);
4682 * @brief Disable tamper 6 interrupt.
4683 * @rmtoll TAMP_IER TAMP6IE LL_RTC_DisableIT_TAMP6
4684 * @param RTCx RTC Instance
4687 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP6(RTC_TypeDef
*RTCx
)
4690 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP6IE
);
4694 * @brief Enable tamper 7 interrupt.
4695 * @rmtoll TAMP_IER TAMP7IE LL_RTC_EnableIT_TAMP7
4696 * @param RTCx RTC Instance
4699 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP7(RTC_TypeDef
*RTCx
)
4702 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP7IE
);
4705 * @brief Disable tamper 7 interrupt.
4706 * @rmtoll TAMP_IER TAMP7IE LL_RTC_DisableIT_TAMP7
4707 * @param RTCx RTC Instance
4710 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP7(RTC_TypeDef
*RTCx
)
4713 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP7IE
);
4717 * @brief Enable tamper 8 interrupt.
4718 * @rmtoll TAMP_IER TAMP8IE LL_RTC_EnableIT_TAMP8
4719 * @param RTCx RTC Instance
4722 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP8(RTC_TypeDef
*RTCx
)
4725 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP8IE
);
4728 * @brief Disable tamper 8 interrupt.
4729 * @rmtoll TAMP_IER TAMP8IE LL_RTC_DisableIT_TAMP8
4730 * @param RTCx RTC Instance
4733 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP8(RTC_TypeDef
*RTCx
)
4736 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP8IE
);
4738 #endif /* RTC_TAMP_NB */
4742 * @brief Enable tamper 92 interrupt.
4743 * @rmtoll TAMP_IER TAMP9IE LL_RTC_EnableIT_TAMP9
4744 * @param RTCx RTC Instance
4747 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP9(RTC_TypeDef
*RTCx
)
4750 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP9IE
);
4754 * @brief Disable tamper 9 interrupt.
4755 * @rmtoll TAMP_IER TAMP9IE LL_RTC_DisableIT_TAMP9
4756 * @param RTCx RTC Instance
4759 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP9(RTC_TypeDef
*RTCx
)
4762 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP9IE
);
4765 * @brief Enable tamper 10 interrupt.
4766 * @rmtoll TAMP_IER TAMP10IE LL_RTC_EnableIT_TAMP10
4767 * @param RTCx RTC Instance
4770 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP10(RTC_TypeDef
*RTCx
)
4773 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP10IE
);
4777 * @brief Disable tamper 10 interrupt.
4778 * @rmtoll TAMP_IER TAMP10IE LL_RTC_DisableIT_TAMP10
4779 * @param RTCx RTC Instance
4782 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP10(RTC_TypeDef
*RTCx
)
4785 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP10IE
);
4788 * @brief Enable tamper 11 interrupt.
4789 * @rmtoll TAMP_IER TAMP11IE LL_RTC_EnableIT_TAMP11
4790 * @param RTCx RTC Instance
4793 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP11(RTC_TypeDef
*RTCx
)
4796 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP11IE
);
4800 * @brief Disable tamper 11 interrupt.
4801 * @rmtoll TAMP_IER TAMP11IE LL_RTC_DisableIT_TAMP11
4802 * @param RTCx RTC Instance
4805 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP11(RTC_TypeDef
*RTCx
)
4808 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP11IE
);
4811 * @brief Enable tamper 12 interrupt.
4812 * @rmtoll TAMP_IER TAMP12IE LL_RTC_EnableIT_TAMP12
4813 * @param RTCx RTC Instance
4816 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP12(RTC_TypeDef
*RTCx
)
4819 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP12IE
);
4823 * @brief Disable tamper 12 interrupt.
4824 * @rmtoll TAMP_IER TAMP12IE LL_RTC_DisableIT_TAMP12
4825 * @param RTCx RTC Instance
4828 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP12(RTC_TypeDef
*RTCx
)
4831 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP12IE
);
4834 * @brief Enable tamper 13 interrupt.
4835 * @rmtoll TAMP_IER TAMP13IE LL_RTC_EnableIT_TAMP13
4836 * @param RTCx RTC Instance
4839 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP13(RTC_TypeDef
*RTCx
)
4842 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP13IE
);
4846 * @brief Disable tamper 13 interrupt.
4847 * @rmtoll TAMP_IER TAMP13IE LL_RTC_DisableIT_TAMP13
4848 * @param RTCx RTC Instance
4851 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP13(RTC_TypeDef
*RTCx
)
4854 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP13IE
);
4857 * @brief Enable tamper 14 interrupt.
4858 * @rmtoll TAMP_IER TAMP14IE LL_RTC_EnableIT_TAMP14
4859 * @param RTCx RTC Instance
4862 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP14(RTC_TypeDef
*RTCx
)
4865 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP14IE
);
4869 * @brief Disable tamper 14 interrupt.
4870 * @rmtoll TAMP_IER TAMP14IE LL_RTC_DisableIT_TAMP14
4871 * @param RTCx RTC Instance
4874 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP14(RTC_TypeDef
*RTCx
)
4877 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP14IE
);
4880 * @brief Enable tamper 15 interrupt.
4881 * @rmtoll TAMP_IER TAMP15IE LL_RTC_EnableIT_TAMP15
4882 * @param RTCx RTC Instance
4885 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP15(RTC_TypeDef
*RTCx
)
4888 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP15IE
);
4892 * @brief Disable tamper 15 interrupt.
4893 * @rmtoll TAMP_IER TAMP15IE LL_RTC_DisableIT_TAMP15
4894 * @param RTCx RTC Instance
4897 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP15(RTC_TypeDef
*RTCx
)
4900 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP15IE
);
4903 * @brief Enable tamper 16 interrupt.
4904 * @rmtoll TAMP_IER TAMP16IE LL_RTC_EnableIT_TAMP16
4905 * @param RTCx RTC Instance
4908 __STATIC_INLINE
void LL_RTC_EnableIT_TAMP16(RTC_TypeDef
*RTCx
)
4911 SET_BIT(TAMP
->IER
, TAMP_IER_TAMP16IE
);
4915 * @brief Disable tamper 16 interrupt.
4916 * @rmtoll TAMP_IER TAMP16IE LL_RTC_DisableIT_TAMP16
4917 * @param RTCx RTC Instance
4920 __STATIC_INLINE
void LL_RTC_DisableIT_TAMP16(RTC_TypeDef
*RTCx
)
4923 CLEAR_BIT(TAMP
->IER
, TAMP_IER_TAMP16IE
);
4927 #if defined (RTC_TAMP_INT_1_SUPPORT)
4929 * @brief Enable internal tamper 1 interrupt.
4930 * @rmtoll TAMP_IER ITAMP1IE LL_RTC_EnableIT_ITAMP1
4931 * @param RTCx RTC Instance
4934 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP1(RTC_TypeDef
*RTCx
)
4937 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP1IE
);
4940 * @brief Disable internal tamper 1 interrupt.
4941 * @rmtoll TAMP_IER TAMP1IE LL_RTC_DisableIT_ITAMP1
4942 * @param RTCx RTC Instance
4945 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP1(RTC_TypeDef
*RTCx
)
4948 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP1IE
);
4950 #endif /* RTC_TAMP_INT_1_SUPPORT */
4952 #if defined (RTC_TAMP_INT_2_SUPPORT)
4954 * @brief Enable internal tamper 2 interrupt.
4955 * @rmtoll TAMP_IER ITAMP2IE LL_RTC_EnableIT_ITAMP2
4956 * @param RTCx RTC Instance
4959 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP2(RTC_TypeDef
*RTCx
)
4962 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP2IE
);
4965 * @brief Disable internal tamper 2 interrupt.
4966 * @rmtoll TAMP_IER TAMP2IE LL_RTC_DisableIT_ITAMP2
4967 * @param RTCx RTC Instance
4970 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP2(RTC_TypeDef
*RTCx
)
4973 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP2IE
);
4975 #endif /* RTC_TAMP_INT_2_SUPPORT */
4978 * @brief Enable internal tamper 3 interrupt.
4979 * @rmtoll TAMP_IER ITAMP3IE LL_RTC_EnableIT_ITAMP3
4980 * @param RTCx RTC Instance
4983 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP3(RTC_TypeDef
*RTCx
)
4986 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP3IE
);
4989 * @brief Disable internal tamper 3 interrupt.
4990 * @rmtoll TAMP_IER TAMP3IE LL_RTC_DisableIT_ITAMP3
4991 * @param RTCx RTC Instance
4994 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP3(RTC_TypeDef
*RTCx
)
4997 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP3IE
);
5001 * @brief Enable internal tamper 4 interrupt.
5002 * @rmtoll TAMP_IER ITAMP4IE LL_RTC_EnableIT_ITAMP4
5003 * @param RTCx RTC Instance
5006 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP4(RTC_TypeDef
*RTCx
)
5009 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP4IE
);
5012 * @brief Disable internal tamper 4 interrupt.
5013 * @rmtoll TAMP_IER TAMP4IE LL_RTC_DisableIT_ITAMP4
5014 * @param RTCx RTC Instance
5017 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP4(RTC_TypeDef
*RTCx
)
5020 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP4IE
);
5024 * @brief Enable internal tamper 5 interrupt.
5025 * @rmtoll TAMP_IER ITAMP5IE LL_RTC_EnableIT_ITAMP5
5026 * @param RTCx RTC Instance
5029 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP5(RTC_TypeDef
*RTCx
)
5032 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP5IE
);
5035 * @brief Disable internal tamper 5 interrupt.
5036 * @rmtoll TAMP_IER TAMP5IE LL_RTC_DisableIT_ITAMP5
5037 * @param RTCx RTC Instance
5040 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP5(RTC_TypeDef
*RTCx
)
5043 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP5IE
);
5045 #if defined (RTC_TAMP_INT_6_SUPPORT)
5048 * @brief Enable internal tamper 6 interrupt.
5049 * @rmtoll TAMP_IER ITAMP6IE LL_RTC_EnableIT_ITAMP6
5050 * @param RTCx RTC Instance
5053 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP6(RTC_TypeDef
*RTCx
)
5056 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP6IE
);
5059 * @brief Disable internal tamper 6 interrupt.
5060 * @rmtoll TAMP_IER TAMP6IE LL_RTC_DisableIT_ITAMP6
5061 * @param RTCx RTC Instance
5064 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP6(RTC_TypeDef
*RTCx
)
5067 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP6IE
);
5069 #endif /* (RTC_TAMP_INT_2_SUPPORT) */
5071 #if defined (RTC_TAMP_INT_7_SUPPORT)
5074 * @brief Enable internal tamper 7 interrupt.
5075 * @rmtoll TAMP_IER ITAMP7IE LL_RTC_EnableIT_ITAMP7
5076 * @param RTCx RTC Instance
5079 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP7(RTC_TypeDef
*RTCx
)
5082 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP7IE
);
5085 * @brief Disable internal tamper 7 interrupt.
5086 * @rmtoll TAMP_IER TAMP7IE LL_RTC_DisableIT_ITAMP7
5087 * @param RTCx RTC Instance
5090 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP7(RTC_TypeDef
*RTCx
)
5093 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP7IE
);
5095 #endif /* (RTC_TAMP_INT_7_SUPPORT)*/
5097 #if defined (RTC_TAMP_INT_8_SUPPORT)
5100 * @brief Enable internal tamper 8 interrupt.
5101 * @rmtoll TAMP_IER ITAMP8IE LL_RTC_EnableIT_ITAMP8
5102 * @param RTCx RTC Instance
5105 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP8(RTC_TypeDef
*RTCx
)
5108 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP8IE
);
5111 * @brief Disable internal tamper 8 interrupt.
5112 * @rmtoll TAMP_IER TAMP8IE LL_RTC_DisableIT_ITAMP8
5113 * @param RTCx RTC Instance
5116 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP8(RTC_TypeDef
*RTCx
)
5119 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP8IE
);
5121 #endif /* (RTC_TAMP_INT_8_SUPPORT)*/
5125 * @brief Enable internal tamper 9 interrupt.
5126 * @rmtoll TAMP_IER ITAMP7IE LL_RTC_EnableIT_ITAMP9
5127 * @param RTCx RTC Instance
5130 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP9(RTC_TypeDef
*RTCx
)
5133 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP9IE
);
5136 * @brief Disable internal tamper 9 interrupt.
5137 * @rmtoll TAMP_IER TAMP9IE LL_RTC_DisableIT_ITAMP9
5138 * @param RTCx RTC Instance
5141 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP9(RTC_TypeDef
*RTCx
)
5144 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP9IE
);
5148 * @brief Enable internal tamper 10 interrupt.
5149 * @rmtoll TAMP_IER ITAMP10IE LL_RTC_EnableIT_ITAMP10
5150 * @param RTCx RTC Instance
5153 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP10(RTC_TypeDef
*RTCx
)
5156 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP10IE
);
5159 * @brief Disable internal tamper 10 interrupt.
5160 * @rmtoll TAMP_IER TAMP10IE LL_RTC_DisableIT_ITAMP10
5161 * @param RTCx RTC Instance
5164 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP10(RTC_TypeDef
*RTCx
)
5167 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP10IE
);
5171 * @brief Enable internal tamper 11 interrupt.
5172 * @rmtoll TAMP_IER ITAMP11IE LL_RTC_EnableIT_ITAMP11
5173 * @param RTCx RTC Instance
5176 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP11(RTC_TypeDef
*RTCx
)
5179 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP11IE
);
5182 * @brief Disable internal tamper 11 interrupt.
5183 * @rmtoll TAMP_IER TAMP11IE LL_RTC_DisableIT_ITAMP11
5184 * @param RTCx RTC Instance
5187 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP11(RTC_TypeDef
*RTCx
)
5190 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP11IE
);
5194 * @brief Enable internal tamper 12 interrupt.
5195 * @rmtoll TAMP_IER ITAMP12IE LL_RTC_EnableIT_ITAMP12
5196 * @param RTCx RTC Instance
5199 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP12(RTC_TypeDef
*RTCx
)
5202 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP12IE
);
5205 * @brief Disable internal tamper 12 interrupt.
5206 * @rmtoll TAMP_IER TAMP12IE LL_RTC_DisableIT_ITAMP12
5207 * @param RTCx RTC Instance
5210 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP12(RTC_TypeDef
*RTCx
)
5213 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP12IE
);
5217 * @brief Enable internal tamper 13 interrupt.
5218 * @rmtoll TAMP_IER ITAMP13IE LL_RTC_EnableIT_ITAMP13
5219 * @param RTCx RTC Instance
5222 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP13(RTC_TypeDef
*RTCx
)
5225 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP13IE
);
5228 * @brief Disable internal tamper 13 interrupt.
5229 * @rmtoll TAMP_IER TAMP13IE LL_RTC_DisableIT_ITAMP13
5230 * @param RTCx RTC Instance
5233 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP13(RTC_TypeDef
*RTCx
)
5236 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP13IE
);
5240 * @brief Enable internal tamper 14 interrupt.
5241 * @rmtoll TAMP_IER ITAMP14IE LL_RTC_EnableIT_ITAMP14
5242 * @param RTCx RTC Instance
5245 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP14(RTC_TypeDef
*RTCx
)
5248 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP14IE
);
5251 * @brief Disable internal tamper 14 interrupt.
5252 * @rmtoll TAMP_IER TAMP14IE LL_RTC_DisableIT_ITAMP14
5253 * @param RTCx RTC Instance
5256 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP14(RTC_TypeDef
*RTCx
)
5259 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP14IE
);
5263 * @brief Enable internal tamper 15 interrupt.
5264 * @rmtoll TAMP_IER ITAMP15IE LL_RTC_EnableIT_ITAMP15
5265 * @param RTCx RTC Instance
5268 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP15(RTC_TypeDef
*RTCx
)
5271 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP15IE
);
5274 * @brief Disable internal tamper 15 interrupt.
5275 * @rmtoll TAMP_IER TAMP15IE LL_RTC_DisableIT_ITAMP15
5276 * @param RTCx RTC Instance
5279 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP15(RTC_TypeDef
*RTCx
)
5282 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP15IE
);
5286 * @brief Enable internal tamper 16 interrupt.
5287 * @rmtoll TAMP_IER ITAMP16IE LL_RTC_EnableIT_ITAMP16
5288 * @param RTCx RTC Instance
5291 __STATIC_INLINE
void LL_RTC_EnableIT_ITAMP16(RTC_TypeDef
*RTCx
)
5294 SET_BIT(TAMP
->IER
, TAMP_IER_ITAMP16IE
);
5297 * @brief Disable internal tamper 16 interrupt.
5298 * @rmtoll TAMP_IER TAMP16IE LL_RTC_DisableIT_ITAMP16
5299 * @param RTCx RTC Instance
5302 __STATIC_INLINE
void LL_RTC_DisableIT_ITAMP16(RTC_TypeDef
*RTCx
)
5305 CLEAR_BIT(TAMP
->IER
, TAMP_IER_ITAMP16IE
);
5310 * @brief Check if tamper 1 interrupt is enabled or not.
5311 * @rmtoll TAMP_IER TAMP1IE LL_RTC_IsEnabledIT_TAMP1
5312 * @param RTCx RTC Instance
5313 * @retval State of bit (1 or 0).
5315 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP1(RTC_TypeDef
*RTCx
)
5318 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP1IE
) == (TAMP_IER_TAMP1IE
)) ? 1U : 0U);
5322 * @brief Check if tamper 2 interrupt is enabled or not.
5323 * @rmtoll TAMP_IER TAMP2IE LL_RTC_IsEnabledIT_TAMP2
5324 * @param RTCx RTC Instance
5325 * @retval State of bit (1 or 0).
5327 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP2(RTC_TypeDef
*RTCx
)
5330 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP2IE
) == (TAMP_IER_TAMP2IE
)) ? 1U : 0U);
5333 #if (RTC_TAMP_NB == 3)
5336 * @brief Check if tamper 3 interrupt is enabled or not.
5337 * @rmtoll TAMP_IER TAMP3IE LL_RTC_IsEnabledIT_TAMP3
5338 * @param RTCx RTC Instance
5339 * @retval State of bit (1 or 0).
5341 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef
*RTCx
)
5344 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP3IE
) == (TAMP_IER_TAMP3IE
)) ? 1U : 0U);
5346 #elif (RTC_TAMP_NB == 8)
5349 * @brief Check if tamper 3 interrupt is enabled or not.
5350 * @rmtoll TAMP_IER TAMP3IE LL_RTC_IsEnabledIT_TAMP3
5351 * @param RTCx RTC Instance
5352 * @retval State of bit (1 or 0).
5354 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef
*RTCx
)
5357 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP3IE
) == (TAMP_IER_TAMP3IE
)) ? 1U : 0U);
5360 * @brief Check if tamper 4 interrupt is enabled or not.
5361 * @rmtoll TAMP_IER TAMP4IE LL_RTC_IsEnabledIT_TAMP4
5362 * @param RTCx RTC Instance
5363 * @retval State of bit (1 or 0).
5365 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP4(RTC_TypeDef
*RTCx
)
5368 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP4IE
) == (TAMP_IER_TAMP4IE
)) ? 1U : 0U);
5371 * @brief Check if tamper 5 interrupt is enabled or not.
5372 * @rmtoll TAMP_IER TAMP1IE LL_RTC_IsEnabledIT_TAMP5
5373 * @param RTCx RTC Instance
5374 * @retval State of bit (1 or 0).
5376 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP5(RTC_TypeDef
*RTCx
)
5379 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP5IE
) == (TAMP_IER_TAMP5IE
)) ? 1U : 0U);
5382 * @brief Check if tamper 6 interrupt is enabled or not.
5383 * @rmtoll TAMP_IER TAMP6IE LL_RTC_IsEnabledIT_TAMP6
5384 * @param RTCx RTC Instance
5385 * @retval State of bit (1 or 0).
5387 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP6(RTC_TypeDef
*RTCx
)
5390 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP6IE
) == (TAMP_IER_TAMP6IE
)) ? 1U : 0U);
5393 * @brief Check if tamper 7 interrupt is enabled or not.
5394 * @rmtoll TAMP_IER TAMP1IE LL_RTC_IsEnabledIT_TAMP7
5395 * @param RTCx RTC Instance
5396 * @retval State of bit (1 or 0).
5398 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP7(RTC_TypeDef
*RTCx
)
5401 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP7IE
) == (TAMP_IER_TAMP7IE
)) ? 1U : 0U);
5404 * @brief Check if tamper 8 interrupt is enabled or not.
5405 * @rmtoll TAMP_IER TAMP8IE LL_RTC_IsEnabledIT_TAMP8
5406 * @param RTCx RTC Instance
5407 * @retval State of bit (1 or 0).
5409 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_TAMP8(RTC_TypeDef
*RTCx
)
5412 return ((READ_BIT(TAMP
->IER
, TAMP_IER_TAMP8IE
) == (TAMP_IER_TAMP8IE
)) ? 1U : 0U);
5415 #endif /* RTC_TAMP_NB */
5418 #if defined (RTC_TAMP_INT_1_SUPPORT)
5420 * @brief Check if internal tamper 1 interrupt is enabled or not.
5421 * @rmtoll TAMP_IER ITAMP1IE LL_RTC_IsEnabledIT_ITAMP1
5422 * @param RTCx RTC Instance
5423 * @retval State of bit (1 or 0).
5425 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP1(RTC_TypeDef
*RTCx
)
5428 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP1IE
) == (TAMP_IER_ITAMP1IE
)) ? 1U : 0U);
5430 #endif /* RTC_TAMP_INT_1_SUPPORT */
5431 #if defined (RTC_TAMP_INT_2_SUPPORT)
5434 * @brief Check if internal tamper 2 interrupt is enabled or not.
5435 * @rmtoll TAMP_IER ITAMP2IE LL_RTC_IsEnabledIT_ITAMP2
5436 * @param RTCx RTC Instance
5437 * @retval State of bit (1 or 0).
5439 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP2(RTC_TypeDef
*RTCx
)
5442 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP2IE
) == (TAMP_IER_ITAMP2IE
)) ? 1U : 0U);
5444 #endif /* RTC_TAMP_INT_2_SUPPORT */
5447 * @brief Check if internal tamper 3 interrupt is enabled or not.
5448 * @rmtoll TAMP_IER ITAMP3IE LL_RTC_IsEnabledIT_ITAMP3
5449 * @param RTCx RTC Instance
5450 * @retval State of bit (1 or 0).
5452 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP3(RTC_TypeDef
*RTCx
)
5455 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP3IE
) == (TAMP_IER_ITAMP3IE
)) ? 1U : 0U);
5458 * @brief Check if internal tamper 4 interrupt is enabled or not.
5459 * @rmtoll TAMP_IER ITAMP4IE LL_RTC_IsEnabledIT_ITAMP4
5460 * @param RTCx RTC Instance
5461 * @retval State of bit (1 or 0).
5463 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP4(RTC_TypeDef
*RTCx
)
5466 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP4IE
) == (TAMP_IER_ITAMP4IE
)) ? 1U : 0U);
5470 * @brief Check if internal tamper 5 interrupt is enabled or not.
5471 * @rmtoll TAMP_IER ITAMP5IE LL_RTC_IsEnabledIT_ITAMP5
5472 * @param RTCx RTC Instance
5473 * @retval State of bit (1 or 0).
5475 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP5(RTC_TypeDef
*RTCx
)
5478 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP5IE
) == (TAMP_IER_ITAMP5IE
)) ? 1U : 0U);
5481 #if defined (RTC_TAMP_INT_6_SUPPORT)
5483 * @brief Check if internal tamper 6 interrupt is enabled or not.
5484 * @rmtoll TAMP_IER ITAMP6IE LL_RTC_IsEnabledIT_ITAMP6
5485 * @param RTCx RTC Instance
5486 * @retval State of bit (1 or 0).
5488 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP6(RTC_TypeDef
*RTCx
)
5491 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP6IE
) == (TAMP_IER_ITAMP6IE
)) ? 1U : 0U);
5493 #endif /* RTC_TAMP_INT_6_SUPPORT */
5496 #if defined (RTC_TAMP_INT_7_SUPPORT)
5499 * @brief Check if internal tamper 7 interrupt is enabled or not.
5500 * @rmtoll TAMP_IER ITAMP7IE LL_RTC_IsEnabledIT_ITAMP7
5501 * @param RTCx RTC Instance
5502 * @retval State of bit (1 or 0).
5504 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP7(RTC_TypeDef
*RTCx
)
5507 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP7IE
) == (TAMP_IER_ITAMP7IE
)) ? 1U : 0U);
5509 #endif /* RTC_TAMP_INT_7_SUPPORT */
5511 #if defined (RTC_TAMP_INT_8_SUPPORT)
5514 * @brief Check if internal tamper 7 interrupt is enabled or not.
5515 * @rmtoll TAMP_IER ITAMP7IE LL_RTC_IsEnabledIT_ITAMP7
5516 * @param RTCx RTC Instance
5517 * @retval State of bit (1 or 0).
5519 __STATIC_INLINE
uint32_t LL_RTC_IsEnabledIT_ITAMP7(RTC_TypeDef
*RTCx
)
5522 return ((READ_BIT(TAMP
->IER
, TAMP_IER_ITAMP7IE
) == (TAMP_IER_ITAMP7IE
)) ? 1U : 0U);
5524 #endif /* RTC_TAMP_INT_8_SUPPORT */
5530 #if defined(USE_FULL_LL_DRIVER)
5531 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
5535 ErrorStatus
LL_RTC_DeInit(RTC_TypeDef
*RTCx
);
5536 ErrorStatus
LL_RTC_Init(RTC_TypeDef
*RTCx
, LL_RTC_InitTypeDef
*RTC_InitStruct
);
5537 void LL_RTC_StructInit(LL_RTC_InitTypeDef
*RTC_InitStruct
);
5538 ErrorStatus
LL_RTC_TIME_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_TimeTypeDef
*RTC_TimeStruct
);
5539 void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef
*RTC_TimeStruct
);
5540 ErrorStatus
LL_RTC_DATE_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_DateTypeDef
*RTC_DateStruct
);
5541 void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef
*RTC_DateStruct
);
5542 ErrorStatus
LL_RTC_ALMA_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5543 ErrorStatus
LL_RTC_ALMB_Init(RTC_TypeDef
*RTCx
, uint32_t RTC_Format
, LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5544 void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5545 void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef
*RTC_AlarmStruct
);
5546 ErrorStatus
LL_RTC_EnterInitMode(RTC_TypeDef
*RTCx
);
5547 ErrorStatus
LL_RTC_ExitInitMode(RTC_TypeDef
*RTCx
);
5548 ErrorStatus
LL_RTC_WaitForSynchro(RTC_TypeDef
*RTCx
);
5553 #endif /* USE_FULL_LL_DRIVER */
5563 #endif /* defined(RTC) */
5573 #endif /* STM32G4xx_LL_RTC_H */
5575 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/