Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / lib / main / STM32F3 / Drivers / STM32F3xx_HAL_Driver / Inc / stm32f3xx_ll_rtc.h
blobe0d43c6ca90d2df1704b21ab0eb411c372237acd
1 /**
2 ******************************************************************************
3 * @file stm32f3xx_ll_rtc.h
4 * @author MCD Application Team
5 * @brief Header file of RTC LL module.
6 ******************************************************************************
7 * @attention
9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 ******************************************************************************
36 /* Define to prevent recursive inclusion -------------------------------------*/
37 #ifndef __STM32F3xx_LL_RTC_H
38 #define __STM32F3xx_LL_RTC_H
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 /* Includes ------------------------------------------------------------------*/
45 #include "stm32f3xx.h"
47 /** @addtogroup STM32F3xx_LL_Driver
48 * @{
51 #if defined(RTC)
53 /** @defgroup RTC_LL RTC
54 * @{
57 /* Private types -------------------------------------------------------------*/
58 /* Private variables ---------------------------------------------------------*/
59 /* Private constants ---------------------------------------------------------*/
60 /** @defgroup RTC_LL_Private_Constants RTC Private Constants
61 * @{
63 /* Masks Definition */
64 #define RTC_INIT_MASK 0xFFFFFFFFU
65 #define RTC_RSF_MASK 0xFFFFFF5FU
67 /* Write protection defines */
68 #define RTC_WRITE_PROTECTION_DISABLE ((uint8_t)0xFFU)
69 #define RTC_WRITE_PROTECTION_ENABLE_1 ((uint8_t)0xCAU)
70 #define RTC_WRITE_PROTECTION_ENABLE_2 ((uint8_t)0x53U)
72 /* Defines used to combine date & time */
73 #define RTC_OFFSET_WEEKDAY 24U
74 #define RTC_OFFSET_DAY 16U
75 #define RTC_OFFSET_MONTH 8U
76 #define RTC_OFFSET_HOUR 16U
77 #define RTC_OFFSET_MINUTE 8U
79 /**
80 * @}
83 /* Private macros ------------------------------------------------------------*/
84 #if defined(USE_FULL_LL_DRIVER)
85 /** @defgroup RTC_LL_Private_Macros RTC Private Macros
86 * @{
88 /**
89 * @}
91 #endif /*USE_FULL_LL_DRIVER*/
93 /* Exported types ------------------------------------------------------------*/
94 #if defined(USE_FULL_LL_DRIVER)
95 /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure
96 * @{
99 /**
100 * @brief RTC Init structures definition
102 typedef struct
104 uint32_t HourFormat; /*!< Specifies the RTC Hours Format.
105 This parameter can be a value of @ref RTC_LL_EC_HOURFORMAT
107 This feature can be modified afterwards using unitary function
108 @ref LL_RTC_SetHourFormat(). */
110 uint32_t AsynchPrescaler; /*!< Specifies the RTC Asynchronous Predivider value.
111 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F
113 This feature can be modified afterwards using unitary function
114 @ref LL_RTC_SetAsynchPrescaler(). */
116 uint32_t SynchPrescaler; /*!< Specifies the RTC Synchronous Predivider value.
117 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF
119 This feature can be modified afterwards using unitary function
120 @ref LL_RTC_SetSynchPrescaler(). */
121 } LL_RTC_InitTypeDef;
124 * @brief RTC Time structure definition
126 typedef struct
128 uint32_t TimeFormat; /*!< Specifies the RTC AM/PM Time.
129 This parameter can be a value of @ref RTC_LL_EC_TIME_FORMAT
131 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetFormat(). */
133 uint8_t Hours; /*!< Specifies the RTC Time Hours.
134 This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the @ref LL_RTC_TIME_FORMAT_PM is selected.
135 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.
137 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetHour(). */
139 uint8_t Minutes; /*!< Specifies the RTC Time Minutes.
140 This parameter must be a number between Min_Data = 0 and Max_Data = 59
142 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetMinute(). */
144 uint8_t Seconds; /*!< Specifies the RTC Time Seconds.
145 This parameter must be a number between Min_Data = 0 and Max_Data = 59
147 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetSecond(). */
148 } LL_RTC_TimeTypeDef;
151 * @brief RTC Date structure definition
153 typedef struct
155 uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay.
156 This parameter can be a value of @ref RTC_LL_EC_WEEKDAY
158 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetWeekDay(). */
160 uint8_t Month; /*!< Specifies the RTC Date Month.
161 This parameter can be a value of @ref RTC_LL_EC_MONTH
163 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetMonth(). */
165 uint8_t Day; /*!< Specifies the RTC Date Day.
166 This parameter must be a number between Min_Data = 1 and Max_Data = 31
168 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetDay(). */
170 uint8_t Year; /*!< Specifies the RTC Date Year.
171 This parameter must be a number between Min_Data = 0 and Max_Data = 99
173 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetYear(). */
174 } LL_RTC_DateTypeDef;
177 * @brief RTC Alarm structure definition
179 typedef struct
181 LL_RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members. */
183 uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks.
184 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.
186 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetMask() for ALARM A
187 or @ref LL_RTC_ALMB_SetMask() for ALARM B
190 uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on day or WeekDay.
191 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
193 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_EnableWeekday() or @ref LL_RTC_ALMA_DisableWeekday()
194 for ALARM A or @ref LL_RTC_ALMB_EnableWeekday() or @ref LL_RTC_ALMB_DisableWeekday() for ALARM B
197 uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Day/WeekDay.
198 If AlarmDateWeekDaySel set to day, this parameter must be a number between Min_Data = 1 and Max_Data = 31.
200 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetDay()
201 for ALARM A or @ref LL_RTC_ALMB_SetDay() for ALARM B.
203 If AlarmDateWeekDaySel set to Weekday, this parameter can be a value of @ref RTC_LL_EC_WEEKDAY.
205 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetWeekDay()
206 for ALARM A or @ref LL_RTC_ALMB_SetWeekDay() for ALARM B.
208 } LL_RTC_AlarmTypeDef;
211 * @}
213 #endif /* USE_FULL_LL_DRIVER */
215 /* Exported constants --------------------------------------------------------*/
216 /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants
217 * @{
220 #if defined(USE_FULL_LL_DRIVER)
221 /** @defgroup RTC_LL_EC_FORMAT FORMAT
222 * @{
224 #define LL_RTC_FORMAT_BIN 0x000000000U /*!< Binary data format */
225 #define LL_RTC_FORMAT_BCD 0x000000001U /*!< BCD data format */
227 * @}
230 /** @defgroup RTC_LL_EC_ALMA_WEEKDAY_SELECTION RTC Alarm A Date WeekDay
231 * @{
233 #define LL_RTC_ALMA_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm A Date is selected */
234 #define LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL /*!< Alarm A WeekDay is selected */
236 * @}
239 /** @defgroup RTC_LL_EC_ALMB_WEEKDAY_SELECTION RTC Alarm B Date WeekDay
240 * @{
242 #define LL_RTC_ALMB_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm B Date is selected */
243 #define LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMBR_WDSEL /*!< Alarm B WeekDay is selected */
245 * @}
248 #endif /* USE_FULL_LL_DRIVER */
250 /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines
251 * @brief Flags defines which can be used with LL_RTC_ReadReg function
252 * @{
254 #define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF
255 #define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F
256 #define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F
257 #define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F
258 #define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF
259 #define LL_RTC_ISR_TSF RTC_ISR_TSF
260 #define LL_RTC_ISR_WUTF RTC_ISR_WUTF
261 #define LL_RTC_ISR_ALRBF RTC_ISR_ALRBF
262 #define LL_RTC_ISR_ALRAF RTC_ISR_ALRAF
263 #define LL_RTC_ISR_INITF RTC_ISR_INITF
264 #define LL_RTC_ISR_RSF RTC_ISR_RSF
265 #define LL_RTC_ISR_INITS RTC_ISR_INITS
266 #define LL_RTC_ISR_SHPF RTC_ISR_SHPF
267 #define LL_RTC_ISR_WUTWF RTC_ISR_WUTWF
268 #define LL_RTC_ISR_ALRBWF RTC_ISR_ALRBWF
269 #define LL_RTC_ISR_ALRAWF RTC_ISR_ALRAWF
271 * @}
274 /** @defgroup RTC_LL_EC_IT IT Defines
275 * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions
276 * @{
278 #define LL_RTC_CR_TSIE RTC_CR_TSIE
279 #define LL_RTC_CR_WUTIE RTC_CR_WUTIE
280 #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE
281 #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE
282 #define LL_RTC_TAFCR_TAMPIE RTC_TAFCR_TAMPIE
284 * @}
287 /** @defgroup RTC_LL_EC_WEEKDAY WEEK DAY
288 * @{
290 #define LL_RTC_WEEKDAY_MONDAY ((uint8_t)0x01U) /*!< Monday */
291 #define LL_RTC_WEEKDAY_TUESDAY ((uint8_t)0x02U) /*!< Tuesday */
292 #define LL_RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03U) /*!< Wednesday */
293 #define LL_RTC_WEEKDAY_THURSDAY ((uint8_t)0x04U) /*!< Thrusday */
294 #define LL_RTC_WEEKDAY_FRIDAY ((uint8_t)0x05U) /*!< Friday */
295 #define LL_RTC_WEEKDAY_SATURDAY ((uint8_t)0x06U) /*!< Saturday */
296 #define LL_RTC_WEEKDAY_SUNDAY ((uint8_t)0x07U) /*!< Sunday */
298 * @}
301 /** @defgroup RTC_LL_EC_MONTH MONTH
302 * @{
304 #define LL_RTC_MONTH_JANUARY ((uint8_t)0x01U) /*!< January */
305 #define LL_RTC_MONTH_FEBRUARY ((uint8_t)0x02U) /*!< February */
306 #define LL_RTC_MONTH_MARCH ((uint8_t)0x03U) /*!< March */
307 #define LL_RTC_MONTH_APRIL ((uint8_t)0x04U) /*!< April */
308 #define LL_RTC_MONTH_MAY ((uint8_t)0x05U) /*!< May */
309 #define LL_RTC_MONTH_JUNE ((uint8_t)0x06U) /*!< June */
310 #define LL_RTC_MONTH_JULY ((uint8_t)0x07U) /*!< July */
311 #define LL_RTC_MONTH_AUGUST ((uint8_t)0x08U) /*!< August */
312 #define LL_RTC_MONTH_SEPTEMBER ((uint8_t)0x09U) /*!< September */
313 #define LL_RTC_MONTH_OCTOBER ((uint8_t)0x10U) /*!< October */
314 #define LL_RTC_MONTH_NOVEMBER ((uint8_t)0x11U) /*!< November */
315 #define LL_RTC_MONTH_DECEMBER ((uint8_t)0x12U) /*!< December */
317 * @}
320 /** @defgroup RTC_LL_EC_HOURFORMAT HOUR FORMAT
321 * @{
323 #define LL_RTC_HOURFORMAT_24HOUR 0x00000000U /*!< 24 hour/day format */
324 #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */
326 * @}
329 /** @defgroup RTC_LL_EC_ALARMOUT ALARM OUTPUT
330 * @{
332 #define LL_RTC_ALARMOUT_DISABLE 0x00000000U /*!< Output disabled */
333 #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */
334 #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */
335 #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */
337 * @}
340 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUT TYPE
341 * @{
343 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 0x00000000U /*!< RTC_ALARM, when mapped on PC13, is open-drain output */
344 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_TAFCR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */
346 * @}
349 /** @defgroup RTC_LL_EC_PIN PIN
350 * @{
352 #define LL_RTC_PIN_PC13 RTC_TAFCR_PC13MODE /*!< PC13 is forced to push-pull output if all RTC alternate functions are disabled */
353 #define LL_RTC_PIN_PC14 RTC_TAFCR_PC14MODE /*!< PC14 is forced to push-pull output if LSE is disabled */
354 #define LL_RTC_PIN_PC15 RTC_TAFCR_PC15MODE /*!< PC15 is forced to push-pull output if LSE is disabled */
356 * @}
359 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUT POLARITY PIN
360 * @{
362 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH 0x00000000U /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/
363 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */
365 * @}
368 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT
369 * @{
371 #define LL_RTC_TIME_FORMAT_AM_OR_24 0x00000000U /*!< AM or 24-hour format */
372 #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */
374 * @}
377 /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND
378 * @{
380 #define LL_RTC_SHIFT_SECOND_DELAY 0x00000000U /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */
381 #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */
383 * @}
386 /** @defgroup RTC_LL_EC_ALMA_MASK ALARMA MASK
387 * @{
389 #define LL_RTC_ALMA_MASK_NONE 0x00000000U /*!< No masks applied on Alarm A*/
390 #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */
391 #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */
392 #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */
393 #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */
394 #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */
396 * @}
399 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALARMA TIME FORMAT
400 * @{
402 #define LL_RTC_ALMA_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
403 #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */
405 * @}
408 /** @defgroup RTC_LL_EC_ALMB_MASK ALARMB MASK
409 * @{
411 #define LL_RTC_ALMB_MASK_NONE 0x00000000U /*!< No masks applied on Alarm B*/
412 #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */
413 #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */
414 #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */
415 #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */
416 #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */
418 * @}
421 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALARMB TIME FORMAT
422 * @{
424 #define LL_RTC_ALMB_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
425 #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */
427 * @}
430 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE
431 * @{
433 #define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
434 #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */
436 * @}
439 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TIMESTAMP TIME FORMAT
440 * @{
442 #define LL_RTC_TS_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
443 #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */
445 * @}
448 /** @defgroup RTC_LL_EC_TAMPER TAMPER
449 * @{
451 #if defined(RTC_TAMPER1_SUPPORT)
452 #define LL_RTC_TAMPER_1 RTC_TAFCR_TAMP1E /*!< RTC_TAMP1 input detection */
453 #endif /* RTC_TAMPER1_SUPPORT */
454 #if defined(RTC_TAMPER2_SUPPORT)
455 #define LL_RTC_TAMPER_2 RTC_TAFCR_TAMP2E /*!< RTC_TAMP2 input detection */
456 #endif /* RTC_TAMPER2_SUPPORT */
457 #if defined(RTC_TAMPER3_SUPPORT)
458 #define LL_RTC_TAMPER_3 RTC_TAFCR_TAMP3E /*!< RTC_TAMP3 input detection */
459 #endif /* RTC_TAMPER3_SUPPORT */
461 * @}
464 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK
465 * @{
467 #if defined(RTC_TAMPER1_SUPPORT)
468 #define LL_RTC_TAMPER_MASK_TAMPER1 RTC_TAFCR_TAMP1MF /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
469 #endif /* RTC_TAMPER1_SUPPORT */
470 #if defined(RTC_TAMPER2_SUPPORT)
471 #define LL_RTC_TAMPER_MASK_TAMPER2 RTC_TAFCR_TAMP2MF /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
472 #endif /* RTC_TAMPER2_SUPPORT */
473 #if defined(RTC_TAMPER3_SUPPORT)
474 #define LL_RTC_TAMPER_MASK_TAMPER3 RTC_TAFCR_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased */
475 #endif /* RTC_TAMPER3_SUPPORT */
477 * @}
480 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE
481 * @{
483 #if defined(RTC_TAMPER1_SUPPORT)
484 #define LL_RTC_TAMPER_NOERASE_TAMPER1 RTC_TAFCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
485 #endif /* RTC_TAMPER1_SUPPORT */
486 #if defined(RTC_TAMPER2_SUPPORT)
487 #define LL_RTC_TAMPER_NOERASE_TAMPER2 RTC_TAFCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
488 #endif /* RTC_TAMPER2_SUPPORT */
489 #if defined(RTC_TAMPER3_SUPPORT)
490 #define LL_RTC_TAMPER_NOERASE_TAMPER3 RTC_TAFCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
491 #endif /* RTC_TAMPER3_SUPPORT */
493 * @}
496 #if defined(RTC_TAFCR_TAMPPRCH)
497 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION
498 * @{
500 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */
501 #define LL_RTC_TAMPER_DURATION_2RTCCLK RTC_TAFCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
502 #define LL_RTC_TAMPER_DURATION_4RTCCLK RTC_TAFCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
503 #define LL_RTC_TAMPER_DURATION_8RTCCLK RTC_TAFCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
505 * @}
507 #endif /* RTC_TAFCR_TAMPPRCH */
509 #if defined(RTC_TAFCR_TAMPFLT)
510 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER
511 * @{
513 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */
514 #define LL_RTC_TAMPER_FILTER_2SAMPLE RTC_TAFCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */
515 #define LL_RTC_TAMPER_FILTER_4SAMPLE RTC_TAFCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */
516 #define LL_RTC_TAMPER_FILTER_8SAMPLE RTC_TAFCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */
518 * @}
520 #endif /* RTC_TAFCR_TAMPFLT */
522 #if defined(RTC_TAFCR_TAMPFREQ)
523 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER
524 * @{
526 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */
527 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 RTC_TAFCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */
528 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 RTC_TAFCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */
529 #define LL_RTC_TAMPER_SAMPLFREQDIV_4096 (RTC_TAFCR_TAMPFREQ_1 | RTC_TAFCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */
530 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 RTC_TAFCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */
531 #define LL_RTC_TAMPER_SAMPLFREQDIV_1024 (RTC_TAFCR_TAMPFREQ_2 | RTC_TAFCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */
532 #define LL_RTC_TAMPER_SAMPLFREQDIV_512 (RTC_TAFCR_TAMPFREQ_2 | RTC_TAFCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */
533 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 RTC_TAFCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */
535 * @}
537 #endif /* RTC_TAFCR_TAMPFREQ */
539 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL
540 * @{
542 #if defined(RTC_TAMPER1_SUPPORT)
543 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 RTC_TAFCR_TAMP1TRG /*!< RTC_TAMP1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
544 #endif /* RTC_TAMPER1_SUPPORT */
545 #if defined(RTC_TAMPER2_SUPPORT)
546 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 RTC_TAFCR_TAMP2TRG /*!< RTC_TAMP2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
547 #endif /* RTC_TAMPER2_SUPPORT */
548 #if defined(RTC_TAMPER3_SUPPORT)
549 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 RTC_TAFCR_TAMP3TRG /*!< RTC_TAMP3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
550 #endif /* RTC_TAMPER3_SUPPORT */
552 * @}
555 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUP CLOCK DIV
556 * @{
558 #define LL_RTC_WAKEUPCLOCK_DIV_16 0x00000000U /*!< RTC/16 clock is selected */
559 #define LL_RTC_WAKEUPCLOCK_DIV_8 (RTC_CR_WUCKSEL_0) /*!< RTC/8 clock is selected */
560 #define LL_RTC_WAKEUPCLOCK_DIV_4 (RTC_CR_WUCKSEL_1) /*!< RTC/4 clock is selected */
561 #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */
562 #define LL_RTC_WAKEUPCLOCK_CKSPRE (RTC_CR_WUCKSEL_2) /*!< ck_spre (usually 1 Hz) clock is selected */
563 #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*/
565 * @}
568 #if defined(RTC_BACKUP_SUPPORT)
569 /** @defgroup RTC_LL_EC_BKP BACKUP
570 * @{
572 #define LL_RTC_BKP_DR0 0x00000000U
573 #define LL_RTC_BKP_DR1 0x00000001U
574 #define LL_RTC_BKP_DR2 0x00000002U
575 #define LL_RTC_BKP_DR3 0x00000003U
576 #define LL_RTC_BKP_DR4 0x00000004U
577 #if RTC_BKP_NUMBER > 5
578 #define LL_RTC_BKP_DR5 0x00000005U
579 #define LL_RTC_BKP_DR6 0x00000006U
580 #define LL_RTC_BKP_DR7 0x00000007U
581 #define LL_RTC_BKP_DR8 0x00000008U
582 #define LL_RTC_BKP_DR9 0x00000009U
583 #define LL_RTC_BKP_DR10 0x0000000AU
584 #define LL_RTC_BKP_DR11 0x0000000BU
585 #define LL_RTC_BKP_DR12 0x0000000CU
586 #define LL_RTC_BKP_DR13 0x0000000DU
587 #define LL_RTC_BKP_DR14 0x0000000EU
588 #define LL_RTC_BKP_DR15 0x0000000FU
589 #endif /* RTC_BKP_NUMBER > 5 */
591 #if RTC_BKP_NUMBER > 16
592 #define LL_RTC_BKP_DR16 0x00000010U
593 #define LL_RTC_BKP_DR17 0x00000011U
594 #define LL_RTC_BKP_DR18 0x00000012U
595 #define LL_RTC_BKP_DR19 0x00000013U
596 #endif /* RTC_BKP_NUMBER > 16 */
598 #if RTC_BKP_NUMBER > 20
599 #define LL_RTC_BKP_DR20 0x00000014U
600 #define LL_RTC_BKP_DR21 0x00000015U
601 #define LL_RTC_BKP_DR22 0x00000016U
602 #define LL_RTC_BKP_DR23 0x00000017U
603 #define LL_RTC_BKP_DR24 0x00000018U
604 #define LL_RTC_BKP_DR25 0x00000019U
605 #define LL_RTC_BKP_DR26 0x0000001AU
606 #define LL_RTC_BKP_DR27 0x0000001BU
607 #define LL_RTC_BKP_DR28 0x0000001CU
608 #define LL_RTC_BKP_DR29 0x0000001DU
609 #define LL_RTC_BKP_DR30 0x0000001EU
610 #define LL_RTC_BKP_DR31 0x0000001FU
611 #endif /* RTC_BKP_NUMBER > 20 */
613 * @}
615 #endif /* RTC_BACKUP_SUPPORT */
617 /** @defgroup RTC_LL_EC_CALIB_OUTPUT Calibration output
618 * @{
620 #define LL_RTC_CALIB_OUTPUT_NONE 0x00000000U /*!< Calibration output disabled */
621 #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */
622 #define LL_RTC_CALIB_OUTPUT_512HZ (RTC_CR_COE) /*!< Calibration output is 512 Hz */
624 * @}
627 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE Calibration pulse insertion
628 * @{
630 #define LL_RTC_CALIB_INSERTPULSE_NONE 0x00000000U /*!< No RTCCLK pulses are added */
631 #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */
633 * @}
636 /** @defgroup RTC_LL_EC_CALIB_PERIOD Calibration period
637 * @{
639 #define LL_RTC_CALIB_PERIOD_32SEC 0x00000000U /*!< Use a 32-second calibration cycle period */
640 #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */
641 #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */
643 * @}
647 * @}
650 /* Exported macro ------------------------------------------------------------*/
651 /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros
652 * @{
655 /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros
656 * @{
660 * @brief Write a value in RTC register
661 * @param __INSTANCE__ RTC Instance
662 * @param __REG__ Register to be written
663 * @param __VALUE__ Value to be written in the register
664 * @retval None
666 #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
669 * @brief Read a value in RTC register
670 * @param __INSTANCE__ RTC Instance
671 * @param __REG__ Register to be read
672 * @retval Register value
674 #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
676 * @}
679 /** @defgroup RTC_LL_EM_Convert Convert helper Macros
680 * @{
684 * @brief Helper macro to convert a value from 2 digit decimal format to BCD format
685 * @param __VALUE__ Byte to be converted
686 * @retval Converted byte
688 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
691 * @brief Helper macro to convert a value from BCD format to 2 digit decimal format
692 * @param __VALUE__ BCD value to be converted
693 * @retval Converted byte
695 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U + ((__VALUE__) & (uint8_t)0x0FU))
698 * @}
701 /** @defgroup RTC_LL_EM_Date Date helper Macros
702 * @{
706 * @brief Helper macro to retrieve weekday.
707 * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function.
708 * @retval Returned value can be one of the following values:
709 * @arg @ref LL_RTC_WEEKDAY_MONDAY
710 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
711 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
712 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
713 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
714 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
715 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
717 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU)
720 * @brief Helper macro to retrieve Year in BCD format
721 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
722 * @retval Year in BCD format (0x00 . . . 0x99)
724 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU)
727 * @brief Helper macro to retrieve Month in BCD format
728 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
729 * @retval Returned value can be one of the following values:
730 * @arg @ref LL_RTC_MONTH_JANUARY
731 * @arg @ref LL_RTC_MONTH_FEBRUARY
732 * @arg @ref LL_RTC_MONTH_MARCH
733 * @arg @ref LL_RTC_MONTH_APRIL
734 * @arg @ref LL_RTC_MONTH_MAY
735 * @arg @ref LL_RTC_MONTH_JUNE
736 * @arg @ref LL_RTC_MONTH_JULY
737 * @arg @ref LL_RTC_MONTH_AUGUST
738 * @arg @ref LL_RTC_MONTH_SEPTEMBER
739 * @arg @ref LL_RTC_MONTH_OCTOBER
740 * @arg @ref LL_RTC_MONTH_NOVEMBER
741 * @arg @ref LL_RTC_MONTH_DECEMBER
743 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU)
746 * @brief Helper macro to retrieve Day in BCD format
747 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
748 * @retval Day in BCD format (0x01 . . . 0x31)
750 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU)
753 * @}
756 /** @defgroup RTC_LL_EM_Time Time helper Macros
757 * @{
761 * @brief Helper macro to retrieve hour in BCD format
762 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
763 * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23)
765 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU)
768 * @brief Helper macro to retrieve minute in BCD format
769 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
770 * @retval Minutes in BCD format (0x00. . .0x59)
772 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU)
775 * @brief Helper macro to retrieve second in BCD format
776 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
777 * @retval Seconds in format (0x00. . .0x59)
779 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU)
782 * @}
786 * @}
789 /* Exported functions --------------------------------------------------------*/
790 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
791 * @{
794 /** @defgroup RTC_LL_EF_Configuration Configuration
795 * @{
799 * @brief Set Hours format (24 hour/day or AM/PM hour format)
800 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
801 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
802 * @rmtoll CR FMT LL_RTC_SetHourFormat
803 * @param RTCx RTC Instance
804 * @param HourFormat This parameter can be one of the following values:
805 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
806 * @arg @ref LL_RTC_HOURFORMAT_AMPM
807 * @retval None
809 __STATIC_INLINE void LL_RTC_SetHourFormat(RTC_TypeDef *RTCx, uint32_t HourFormat)
811 MODIFY_REG(RTCx->CR, RTC_CR_FMT, HourFormat);
815 * @brief Get Hours format (24 hour/day or AM/PM hour format)
816 * @rmtoll CR FMT LL_RTC_GetHourFormat
817 * @param RTCx RTC Instance
818 * @retval Returned value can be one of the following values:
819 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
820 * @arg @ref LL_RTC_HOURFORMAT_AMPM
822 __STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx)
824 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_FMT));
828 * @brief Select the flag to be routed to RTC_ALARM output
829 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
830 * @rmtoll CR OSEL LL_RTC_SetAlarmOutEvent
831 * @param RTCx RTC Instance
832 * @param AlarmOutput This parameter can be one of the following values:
833 * @arg @ref LL_RTC_ALARMOUT_DISABLE
834 * @arg @ref LL_RTC_ALARMOUT_ALMA
835 * @arg @ref LL_RTC_ALARMOUT_ALMB
836 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
837 * @retval None
839 __STATIC_INLINE void LL_RTC_SetAlarmOutEvent(RTC_TypeDef *RTCx, uint32_t AlarmOutput)
841 MODIFY_REG(RTCx->CR, RTC_CR_OSEL, AlarmOutput);
845 * @brief Get the flag to be routed to RTC_ALARM output
846 * @rmtoll CR OSEL LL_RTC_GetAlarmOutEvent
847 * @param RTCx RTC Instance
848 * @retval Returned value can be one of the following values:
849 * @arg @ref LL_RTC_ALARMOUT_DISABLE
850 * @arg @ref LL_RTC_ALARMOUT_ALMA
851 * @arg @ref LL_RTC_ALARMOUT_ALMB
852 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
854 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef *RTCx)
856 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_OSEL));
860 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
861 * @note Used only when RTC_ALARM is mapped on PC13
862 * @note If all RTC alternate functions are disabled and PC13MODE = 1, PC13VALUE configures the
863 * PC13 output data
864 * @rmtoll TAFCR ALARMOUTTYPE LL_RTC_SetAlarmOutputType
865 * @param RTCx RTC Instance
866 * @param Output This parameter can be one of the following values:
867 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
868 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
869 * @retval None
871 __STATIC_INLINE void LL_RTC_SetAlarmOutputType(RTC_TypeDef *RTCx, uint32_t Output)
873 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_ALARMOUTTYPE, Output);
877 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
878 * @note used only when RTC_ALARM is mapped on PC13
879 * @note If all RTC alternate functions are disabled and PC13MODE = 1, PC13VALUE configures the
880 * PC13 output data
881 * @rmtoll TAFCR ALARMOUTTYPE LL_RTC_GetAlarmOutputType
882 * @param RTCx RTC Instance
883 * @retval Returned value can be one of the following values:
884 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
885 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
887 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef *RTCx)
889 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_ALARMOUTTYPE));
893 * @brief Enable push-pull output on PC13, PC14 and/or PC15
894 * @note PC13 forced to push-pull output if all RTC alternate functions are disabled
895 * @note PC14 and PC15 forced to push-pull output if LSE is disabled
896 * @rmtoll TAFCR PC13MODE LL_RTC_EnablePushPullMode\n
897 * @rmtoll TAFCR PC14MODE LL_RTC_EnablePushPullMode\n
898 * @rmtoll TAFCR PC15MODE LL_RTC_EnablePushPullMode
899 * @param RTCx RTC Instance
900 * @param PinMask This parameter can be a combination of the following values:
901 * @arg @ref LL_RTC_PIN_PC13
902 * @arg @ref LL_RTC_PIN_PC14
903 * @arg @ref LL_RTC_PIN_PC15
904 * @retval None
906 __STATIC_INLINE void LL_RTC_EnablePushPullMode(RTC_TypeDef *RTCx, uint32_t PinMask)
908 SET_BIT(RTCx->TAFCR, PinMask);
912 * @brief Disable push-pull output on PC13, PC14 and/or PC15
913 * @note PC13, PC14 and/or PC15 are controlled by the GPIO configuration registers.
914 * Consequently PC13, PC14 and/or PC15 are floating in Standby mode.
915 * @rmtoll TAFCR PC13MODE LL_RTC_DisablePushPullMode\n
916 * TAFCR PC14MODE LL_RTC_DisablePushPullMode\n
917 * TAFCR PC15MODE LL_RTC_DisablePushPullMode
918 * @param RTCx RTC Instance
919 * @param PinMask This parameter can be a combination of the following values:
920 * @arg @ref LL_RTC_PIN_PC13
921 * @arg @ref LL_RTC_PIN_PC14
922 * @arg @ref LL_RTC_PIN_PC15
923 * @retval None
925 __STATIC_INLINE void LL_RTC_DisablePushPullMode(RTC_TypeDef* RTCx, uint32_t PinMask)
927 CLEAR_BIT(RTCx->TAFCR, PinMask);
931 * @brief Set PC14 and/or PC15 to high level.
932 * @note Output data configuration is possible if the LSE is disabled and PushPull output is enabled (through @ref LL_RTC_EnablePushPullMode)
933 * @rmtoll TAFCR PC14VALUE LL_RTC_SetOutputPin\n
934 * TAFCR PC15VALUE LL_RTC_SetOutputPin
935 * @param RTCx RTC Instance
936 * @param PinMask This parameter can be a combination of the following values:
937 * @arg @ref LL_RTC_PIN_PC14
938 * @arg @ref LL_RTC_PIN_PC15
939 * @retval None
941 __STATIC_INLINE void LL_RTC_SetOutputPin(RTC_TypeDef* RTCx, uint32_t PinMask)
943 SET_BIT(RTCx->TAFCR, (PinMask >> 1));
947 * @brief Set PC14 and/or PC15 to low level.
948 * @note Output data configuration is possible if the LSE is disabled and PushPull output is enabled (through @ref LL_RTC_EnablePushPullMode)
949 * @rmtoll TAFCR PC14VALUE LL_RTC_ResetOutputPin\n
950 * TAFCR PC15VALUE LL_RTC_ResetOutputPin
951 * @param RTCx RTC Instance
952 * @param PinMask This parameter can be a combination of the following values:
953 * @arg @ref LL_RTC_PIN_PC14
954 * @arg @ref LL_RTC_PIN_PC15
955 * @retval None
957 __STATIC_INLINE void LL_RTC_ResetOutputPin(RTC_TypeDef* RTCx, uint32_t PinMask)
959 CLEAR_BIT(RTCx->TAFCR, (PinMask >> 1));
963 * @brief Enable initialization mode
964 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
965 * and prescaler register (RTC_PRER).
966 * Counters are stopped and start counting from the new value when INIT is reset.
967 * @rmtoll ISR INIT LL_RTC_EnableInitMode
968 * @param RTCx RTC Instance
969 * @retval None
971 __STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx)
973 /* Set the Initialization mode */
974 WRITE_REG(RTCx->ISR, RTC_INIT_MASK);
978 * @brief Disable initialization mode (Free running mode)
979 * @rmtoll ISR INIT LL_RTC_DisableInitMode
980 * @param RTCx RTC Instance
981 * @retval None
983 __STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
985 /* Exit Initialization mode */
986 WRITE_REG(RTCx->ISR, (uint32_t)~RTC_ISR_INIT);
990 * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted)
991 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
992 * @rmtoll CR POL LL_RTC_SetOutputPolarity
993 * @param RTCx RTC Instance
994 * @param Polarity This parameter can be one of the following values:
995 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
996 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
997 * @retval None
999 __STATIC_INLINE void LL_RTC_SetOutputPolarity(RTC_TypeDef *RTCx, uint32_t Polarity)
1001 MODIFY_REG(RTCx->CR, RTC_CR_POL, Polarity);
1005 * @brief Get Output polarity
1006 * @rmtoll CR POL LL_RTC_GetOutputPolarity
1007 * @param RTCx RTC Instance
1008 * @retval Returned value can be one of the following values:
1009 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
1010 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
1012 __STATIC_INLINE uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef *RTCx)
1014 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_POL));
1018 * @brief Enable Bypass the shadow registers
1019 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1020 * @rmtoll CR BYPSHAD LL_RTC_EnableShadowRegBypass
1021 * @param RTCx RTC Instance
1022 * @retval None
1024 __STATIC_INLINE void LL_RTC_EnableShadowRegBypass(RTC_TypeDef *RTCx)
1026 SET_BIT(RTCx->CR, RTC_CR_BYPSHAD);
1030 * @brief Disable Bypass the shadow registers
1031 * @rmtoll CR BYPSHAD LL_RTC_DisableShadowRegBypass
1032 * @param RTCx RTC Instance
1033 * @retval None
1035 __STATIC_INLINE void LL_RTC_DisableShadowRegBypass(RTC_TypeDef *RTCx)
1037 CLEAR_BIT(RTCx->CR, RTC_CR_BYPSHAD);
1041 * @brief Check if Shadow registers bypass is enabled or not.
1042 * @rmtoll CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled
1043 * @param RTCx RTC Instance
1044 * @retval State of bit (1 or 0).
1046 __STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx)
1048 return (READ_BIT(RTCx->CR, RTC_CR_BYPSHAD) == (RTC_CR_BYPSHAD));
1052 * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz)
1053 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1054 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1055 * @rmtoll CR REFCKON LL_RTC_EnableRefClock
1056 * @param RTCx RTC Instance
1057 * @retval None
1059 __STATIC_INLINE void LL_RTC_EnableRefClock(RTC_TypeDef *RTCx)
1061 SET_BIT(RTCx->CR, RTC_CR_REFCKON);
1065 * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz)
1066 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1067 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1068 * @rmtoll CR REFCKON LL_RTC_DisableRefClock
1069 * @param RTCx RTC Instance
1070 * @retval None
1072 __STATIC_INLINE void LL_RTC_DisableRefClock(RTC_TypeDef *RTCx)
1074 CLEAR_BIT(RTCx->CR, RTC_CR_REFCKON);
1078 * @brief Set Asynchronous prescaler factor
1079 * @rmtoll PRER PREDIV_A LL_RTC_SetAsynchPrescaler
1080 * @param RTCx RTC Instance
1081 * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F
1082 * @retval None
1084 __STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler)
1086 MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_A, AsynchPrescaler << RTC_PRER_PREDIV_A_Pos);
1090 * @brief Set Synchronous prescaler factor
1091 * @rmtoll PRER PREDIV_S LL_RTC_SetSynchPrescaler
1092 * @param RTCx RTC Instance
1093 * @param SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF
1094 * @retval None
1096 __STATIC_INLINE void LL_RTC_SetSynchPrescaler(RTC_TypeDef *RTCx, uint32_t SynchPrescaler)
1098 MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_S, SynchPrescaler);
1102 * @brief Get Asynchronous prescaler factor
1103 * @rmtoll PRER PREDIV_A LL_RTC_GetAsynchPrescaler
1104 * @param RTCx RTC Instance
1105 * @retval Value between Min_Data = 0 and Max_Data = 0x7F
1107 __STATIC_INLINE uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef *RTCx)
1109 return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_A) >> RTC_PRER_PREDIV_A_Pos);
1113 * @brief Get Synchronous prescaler factor
1114 * @rmtoll PRER PREDIV_S LL_RTC_GetSynchPrescaler
1115 * @param RTCx RTC Instance
1116 * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF
1118 __STATIC_INLINE uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef *RTCx)
1120 return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_S));
1124 * @brief Enable the write protection for RTC registers.
1125 * @rmtoll WPR KEY LL_RTC_EnableWriteProtection
1126 * @param RTCx RTC Instance
1127 * @retval None
1129 __STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
1131 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_DISABLE);
1135 * @brief Disable the write protection for RTC registers.
1136 * @rmtoll WPR KEY LL_RTC_DisableWriteProtection
1137 * @param RTCx RTC Instance
1138 * @retval None
1140 __STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
1142 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_1);
1143 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_2);
1147 * @}
1150 /** @defgroup RTC_LL_EF_Time Time
1151 * @{
1155 * @brief Set time format (AM/24-hour or PM notation)
1156 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1157 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1158 * @rmtoll TR PM LL_RTC_TIME_SetFormat
1159 * @param RTCx RTC Instance
1160 * @param TimeFormat This parameter can be one of the following values:
1161 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1162 * @arg @ref LL_RTC_TIME_FORMAT_PM
1163 * @retval None
1165 __STATIC_INLINE void LL_RTC_TIME_SetFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
1167 MODIFY_REG(RTCx->TR, RTC_TR_PM, TimeFormat);
1171 * @brief Get time format (AM or PM notation)
1172 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1173 * before reading this bit
1174 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1175 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1176 * @rmtoll TR PM LL_RTC_TIME_GetFormat
1177 * @param RTCx RTC Instance
1178 * @retval Returned value can be one of the following values:
1179 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1180 * @arg @ref LL_RTC_TIME_FORMAT_PM
1182 __STATIC_INLINE uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef *RTCx)
1184 return (uint32_t)(READ_BIT(RTCx->TR, RTC_TR_PM));
1188 * @brief Set Hours in BCD format
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 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format
1192 * @rmtoll TR HT LL_RTC_TIME_SetHour\n
1193 * TR HU LL_RTC_TIME_SetHour
1194 * @param RTCx RTC Instance
1195 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1196 * @retval None
1198 __STATIC_INLINE void LL_RTC_TIME_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
1200 MODIFY_REG(RTCx->TR, (RTC_TR_HT | RTC_TR_HU),
1201 (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos)));
1205 * @brief Get Hours in BCD format
1206 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1207 * before reading this bit
1208 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1209 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1210 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to
1211 * Binary format
1212 * @rmtoll TR HT LL_RTC_TIME_GetHour\n
1213 * TR HU LL_RTC_TIME_GetHour
1214 * @param RTCx RTC Instance
1215 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1217 __STATIC_INLINE uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef *RTCx)
1219 register uint32_t temp = 0U;
1221 temp = READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU));
1222 return (uint32_t)((((temp & RTC_TR_HT) >> RTC_TR_HT_Pos) << 4U) | ((temp & RTC_TR_HU) >> RTC_TR_HU_Pos));
1226 * @brief Set Minutes in BCD format
1227 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1228 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1229 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1230 * @rmtoll TR MNT LL_RTC_TIME_SetMinute\n
1231 * TR MNU LL_RTC_TIME_SetMinute
1232 * @param RTCx RTC Instance
1233 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1234 * @retval None
1236 __STATIC_INLINE void LL_RTC_TIME_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
1238 MODIFY_REG(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU),
1239 (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)));
1243 * @brief Get Minutes in BCD format
1244 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1245 * before reading this bit
1246 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1247 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1248 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD
1249 * to Binary format
1250 * @rmtoll TR MNT LL_RTC_TIME_GetMinute\n
1251 * TR MNU LL_RTC_TIME_GetMinute
1252 * @param RTCx RTC Instance
1253 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1255 __STATIC_INLINE uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef *RTCx)
1257 register uint32_t temp = 0U;
1259 temp = READ_BIT(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU));
1260 return (uint32_t)((((temp & RTC_TR_MNT) >> RTC_TR_MNT_Pos) << 4U) | ((temp & RTC_TR_MNU) >> RTC_TR_MNU_Pos));
1264 * @brief Set Seconds in BCD format
1265 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1266 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1267 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1268 * @rmtoll TR ST LL_RTC_TIME_SetSecond\n
1269 * TR SU LL_RTC_TIME_SetSecond
1270 * @param RTCx RTC Instance
1271 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1272 * @retval None
1274 __STATIC_INLINE void LL_RTC_TIME_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
1276 MODIFY_REG(RTCx->TR, (RTC_TR_ST | RTC_TR_SU),
1277 (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos)));
1281 * @brief Get Seconds in BCD format
1282 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1283 * before reading this bit
1284 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1285 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1286 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD
1287 * to Binary format
1288 * @rmtoll TR ST LL_RTC_TIME_GetSecond\n
1289 * TR SU LL_RTC_TIME_GetSecond
1290 * @param RTCx RTC Instance
1291 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1293 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef *RTCx)
1295 register uint32_t temp = 0U;
1297 temp = READ_BIT(RTCx->TR, (RTC_TR_ST | RTC_TR_SU));
1298 return (uint32_t)((((temp & RTC_TR_ST) >> RTC_TR_ST_Pos) << 4U) | ((temp & RTC_TR_SU) >> RTC_TR_SU_Pos));
1302 * @brief Set time (hour, minute and second) in BCD format
1303 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1304 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
1305 * @note TimeFormat and Hours should follow the same format
1306 * @rmtoll TR PM LL_RTC_TIME_Config\n
1307 * TR HT LL_RTC_TIME_Config\n
1308 * TR HU LL_RTC_TIME_Config\n
1309 * TR MNT LL_RTC_TIME_Config\n
1310 * TR MNU LL_RTC_TIME_Config\n
1311 * TR ST LL_RTC_TIME_Config\n
1312 * TR SU LL_RTC_TIME_Config
1313 * @param RTCx RTC Instance
1314 * @param Format12_24 This parameter can be one of the following values:
1315 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
1316 * @arg @ref LL_RTC_TIME_FORMAT_PM
1317 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1318 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1319 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1320 * @retval None
1322 __STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
1324 register uint32_t temp = 0U;
1326 temp = Format12_24 | \
1327 (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos)) | \
1328 (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)) | \
1329 (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos));
1330 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);
1334 * @brief Get time (hour, minute and second) in BCD format
1335 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1336 * before reading this bit
1337 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
1338 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
1339 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
1340 * are available to get independently each parameter.
1341 * @rmtoll TR HT LL_RTC_TIME_Get\n
1342 * TR HU LL_RTC_TIME_Get\n
1343 * TR MNT LL_RTC_TIME_Get\n
1344 * TR MNU LL_RTC_TIME_Get\n
1345 * TR ST LL_RTC_TIME_Get\n
1346 * TR SU LL_RTC_TIME_Get
1347 * @param RTCx RTC Instance
1348 * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
1350 __STATIC_INLINE uint32_t LL_RTC_TIME_Get(RTC_TypeDef *RTCx)
1352 register uint32_t temp = 0U;
1354 temp = READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU | RTC_TR_ST | RTC_TR_SU));
1355 return (uint32_t)((((((temp & RTC_TR_HT) >> RTC_TR_HT_Pos) << 4U) | ((temp & RTC_TR_HU) >> RTC_TR_HU_Pos)) << RTC_OFFSET_HOUR) | \
1356 (((((temp & RTC_TR_MNT) >> RTC_TR_MNT_Pos) << 4U) | ((temp & RTC_TR_MNU) >> RTC_TR_MNU_Pos)) << RTC_OFFSET_MINUTE) | \
1357 ((((temp & RTC_TR_ST) >> RTC_TR_ST_Pos) << 4U) | ((temp & RTC_TR_SU) >> RTC_TR_SU_Pos)));
1361 * @brief Memorize whether the daylight saving time change has been performed
1362 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1363 * @rmtoll CR BKP LL_RTC_TIME_EnableDayLightStore
1364 * @param RTCx RTC Instance
1365 * @retval None
1367 __STATIC_INLINE void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef *RTCx)
1369 SET_BIT(RTCx->CR, RTC_CR_BKP);
1373 * @brief Disable memorization whether the daylight saving time change has been performed.
1374 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1375 * @rmtoll CR BKP LL_RTC_TIME_DisableDayLightStore
1376 * @param RTCx RTC Instance
1377 * @retval None
1379 __STATIC_INLINE void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef *RTCx)
1381 CLEAR_BIT(RTCx->CR, RTC_CR_BKP);
1385 * @brief Check if RTC Day Light Saving stored operation has been enabled or not
1386 * @rmtoll CR BKP LL_RTC_TIME_IsDayLightStoreEnabled
1387 * @param RTCx RTC Instance
1388 * @retval State of bit (1 or 0).
1390 __STATIC_INLINE uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef *RTCx)
1392 return (READ_BIT(RTCx->CR, RTC_CR_BKP) == (RTC_CR_BKP));
1396 * @brief Subtract 1 hour (winter time change)
1397 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1398 * @rmtoll CR SUB1H LL_RTC_TIME_DecHour
1399 * @param RTCx RTC Instance
1400 * @retval None
1402 __STATIC_INLINE void LL_RTC_TIME_DecHour(RTC_TypeDef *RTCx)
1404 SET_BIT(RTCx->CR, RTC_CR_SUB1H);
1408 * @brief Add 1 hour (summer time change)
1409 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1410 * @rmtoll CR ADD1H LL_RTC_TIME_IncHour
1411 * @param RTCx RTC Instance
1412 * @retval None
1414 __STATIC_INLINE void LL_RTC_TIME_IncHour(RTC_TypeDef *RTCx)
1416 SET_BIT(RTCx->CR, RTC_CR_ADD1H);
1420 * @brief Get Sub second value in the synchronous prescaler counter.
1421 * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through
1422 * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar
1423 * SubSeconds value in second fraction ratio with time unit following
1424 * generic formula:
1425 * ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit
1426 * This conversion can be performed only if no shift operation is pending
1427 * (ie. SHFP=0) when PREDIV_S >= SS.
1428 * @rmtoll SSR SS LL_RTC_TIME_GetSubSecond
1429 * @param RTCx RTC Instance
1430 * @retval Sub second value (number between 0 and 65535)
1432 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef *RTCx)
1434 return (uint32_t)(READ_BIT(RTCx->SSR, RTC_SSR_SS));
1438 * @brief Synchronize to a remote clock with a high degree of precision.
1439 * @note This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
1440 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1441 * @note When REFCKON is set, firmware must not write to Shift control register.
1442 * @rmtoll SHIFTR ADD1S LL_RTC_TIME_Synchronize\n
1443 * SHIFTR SUBFS LL_RTC_TIME_Synchronize
1444 * @param RTCx RTC Instance
1445 * @param ShiftSecond This parameter can be one of the following values:
1446 * @arg @ref LL_RTC_SHIFT_SECOND_DELAY
1447 * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE
1448 * @param Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF)
1449 * @retval None
1451 __STATIC_INLINE void LL_RTC_TIME_Synchronize(RTC_TypeDef *RTCx, uint32_t ShiftSecond, uint32_t Fraction)
1453 WRITE_REG(RTCx->SHIFTR, ShiftSecond | Fraction);
1457 * @}
1460 /** @defgroup RTC_LL_EF_Date Date
1461 * @{
1465 * @brief Set Year in BCD format
1466 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format
1467 * @rmtoll DR YT LL_RTC_DATE_SetYear\n
1468 * DR YU LL_RTC_DATE_SetYear
1469 * @param RTCx RTC Instance
1470 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1471 * @retval None
1473 __STATIC_INLINE void LL_RTC_DATE_SetYear(RTC_TypeDef *RTCx, uint32_t Year)
1475 MODIFY_REG(RTCx->DR, (RTC_DR_YT | RTC_DR_YU),
1476 (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos)));
1480 * @brief Get Year in BCD format
1481 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1482 * before reading this bit
1483 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
1484 * @rmtoll DR YT LL_RTC_DATE_GetYear\n
1485 * DR YU LL_RTC_DATE_GetYear
1486 * @param RTCx RTC Instance
1487 * @retval Value between Min_Data=0x00 and Max_Data=0x99
1489 __STATIC_INLINE uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef *RTCx)
1491 register uint32_t temp = 0U;
1493 temp = READ_BIT(RTCx->DR, (RTC_DR_YT | RTC_DR_YU));
1494 return (uint32_t)((((temp & RTC_DR_YT) >> RTC_DR_YT_Pos) << 4U) | ((temp & RTC_DR_YU) >> RTC_DR_YU_Pos));
1498 * @brief Set Week day
1499 * @rmtoll DR WDU LL_RTC_DATE_SetWeekDay
1500 * @param RTCx RTC Instance
1501 * @param WeekDay This parameter can be one of the following values:
1502 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1503 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1504 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1505 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1506 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1507 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1508 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1509 * @retval None
1511 __STATIC_INLINE void LL_RTC_DATE_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
1513 MODIFY_REG(RTCx->DR, RTC_DR_WDU, WeekDay << RTC_DR_WDU_Pos);
1517 * @brief Get Week day
1518 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1519 * before reading this bit
1520 * @rmtoll DR WDU LL_RTC_DATE_GetWeekDay
1521 * @param RTCx RTC Instance
1522 * @retval Returned value can be one of the following values:
1523 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1524 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1525 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1526 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1527 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1528 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1529 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1531 __STATIC_INLINE uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef *RTCx)
1533 return (uint32_t)(READ_BIT(RTCx->DR, RTC_DR_WDU) >> RTC_DR_WDU_Pos);
1537 * @brief Set Month in BCD format
1538 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format
1539 * @rmtoll DR MT LL_RTC_DATE_SetMonth\n
1540 * DR MU LL_RTC_DATE_SetMonth
1541 * @param RTCx RTC Instance
1542 * @param Month This parameter can be one of the following values:
1543 * @arg @ref LL_RTC_MONTH_JANUARY
1544 * @arg @ref LL_RTC_MONTH_FEBRUARY
1545 * @arg @ref LL_RTC_MONTH_MARCH
1546 * @arg @ref LL_RTC_MONTH_APRIL
1547 * @arg @ref LL_RTC_MONTH_MAY
1548 * @arg @ref LL_RTC_MONTH_JUNE
1549 * @arg @ref LL_RTC_MONTH_JULY
1550 * @arg @ref LL_RTC_MONTH_AUGUST
1551 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1552 * @arg @ref LL_RTC_MONTH_OCTOBER
1553 * @arg @ref LL_RTC_MONTH_NOVEMBER
1554 * @arg @ref LL_RTC_MONTH_DECEMBER
1555 * @retval None
1557 __STATIC_INLINE void LL_RTC_DATE_SetMonth(RTC_TypeDef *RTCx, uint32_t Month)
1559 MODIFY_REG(RTCx->DR, (RTC_DR_MT | RTC_DR_MU),
1560 (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)));
1564 * @brief Get Month in BCD format
1565 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1566 * before reading this bit
1567 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
1568 * @rmtoll DR MT LL_RTC_DATE_GetMonth\n
1569 * DR MU LL_RTC_DATE_GetMonth
1570 * @param RTCx RTC Instance
1571 * @retval Returned value can be one of the following values:
1572 * @arg @ref LL_RTC_MONTH_JANUARY
1573 * @arg @ref LL_RTC_MONTH_FEBRUARY
1574 * @arg @ref LL_RTC_MONTH_MARCH
1575 * @arg @ref LL_RTC_MONTH_APRIL
1576 * @arg @ref LL_RTC_MONTH_MAY
1577 * @arg @ref LL_RTC_MONTH_JUNE
1578 * @arg @ref LL_RTC_MONTH_JULY
1579 * @arg @ref LL_RTC_MONTH_AUGUST
1580 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1581 * @arg @ref LL_RTC_MONTH_OCTOBER
1582 * @arg @ref LL_RTC_MONTH_NOVEMBER
1583 * @arg @ref LL_RTC_MONTH_DECEMBER
1585 __STATIC_INLINE uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef *RTCx)
1587 register uint32_t temp = 0U;
1589 temp = READ_BIT(RTCx->DR, (RTC_DR_MT | RTC_DR_MU));
1590 return (uint32_t)((((temp & RTC_DR_MT) >> RTC_DR_MT_Pos) << 4U) | ((temp & RTC_DR_MU) >> RTC_DR_MU_Pos));
1594 * @brief Set Day in BCD format
1595 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1596 * @rmtoll DR DT LL_RTC_DATE_SetDay\n
1597 * DR DU LL_RTC_DATE_SetDay
1598 * @param RTCx RTC Instance
1599 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1600 * @retval None
1602 __STATIC_INLINE void LL_RTC_DATE_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
1604 MODIFY_REG(RTCx->DR, (RTC_DR_DT | RTC_DR_DU),
1605 (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos)));
1609 * @brief Get Day in BCD format
1610 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1611 * before reading this bit
1612 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1613 * @rmtoll DR DT LL_RTC_DATE_GetDay\n
1614 * DR DU LL_RTC_DATE_GetDay
1615 * @param RTCx RTC Instance
1616 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1618 __STATIC_INLINE uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef *RTCx)
1620 register uint32_t temp = 0U;
1622 temp = READ_BIT(RTCx->DR, (RTC_DR_DT | RTC_DR_DU));
1623 return (uint32_t)((((temp & RTC_DR_DT) >> RTC_DR_DT_Pos) << 4U) | ((temp & RTC_DR_DU) >> RTC_DR_DU_Pos));
1627 * @brief Set date (WeekDay, Day, Month and Year) in BCD format
1628 * @rmtoll DR WDU LL_RTC_DATE_Config\n
1629 * DR MT LL_RTC_DATE_Config\n
1630 * DR MU LL_RTC_DATE_Config\n
1631 * DR DT LL_RTC_DATE_Config\n
1632 * DR DU LL_RTC_DATE_Config\n
1633 * DR YT LL_RTC_DATE_Config\n
1634 * DR YU LL_RTC_DATE_Config
1635 * @param RTCx RTC Instance
1636 * @param WeekDay This parameter can be one of the following values:
1637 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1638 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1639 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1640 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1641 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1642 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1643 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1644 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1645 * @param Month This parameter can be one of the following values:
1646 * @arg @ref LL_RTC_MONTH_JANUARY
1647 * @arg @ref LL_RTC_MONTH_FEBRUARY
1648 * @arg @ref LL_RTC_MONTH_MARCH
1649 * @arg @ref LL_RTC_MONTH_APRIL
1650 * @arg @ref LL_RTC_MONTH_MAY
1651 * @arg @ref LL_RTC_MONTH_JUNE
1652 * @arg @ref LL_RTC_MONTH_JULY
1653 * @arg @ref LL_RTC_MONTH_AUGUST
1654 * @arg @ref LL_RTC_MONTH_SEPTEMBER
1655 * @arg @ref LL_RTC_MONTH_OCTOBER
1656 * @arg @ref LL_RTC_MONTH_NOVEMBER
1657 * @arg @ref LL_RTC_MONTH_DECEMBER
1658 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
1659 * @retval None
1661 __STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uint32_t Day, uint32_t Month, uint32_t Year)
1663 register uint32_t temp = 0U;
1665 temp = (WeekDay << RTC_DR_WDU_Pos) | \
1666 (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos)) | \
1667 (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)) | \
1668 (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos));
1670 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);
1674 * @brief Get date (WeekDay, Day, Month and Year) in BCD format
1675 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
1676 * before reading this bit
1677 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
1678 * and __LL_RTC_GET_DAY are available to get independently each parameter.
1679 * @rmtoll DR WDU LL_RTC_DATE_Get\n
1680 * DR MT LL_RTC_DATE_Get\n
1681 * DR MU LL_RTC_DATE_Get\n
1682 * DR DT LL_RTC_DATE_Get\n
1683 * DR DU LL_RTC_DATE_Get\n
1684 * DR YT LL_RTC_DATE_Get\n
1685 * DR YU LL_RTC_DATE_Get
1686 * @param RTCx RTC Instance
1687 * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY).
1689 __STATIC_INLINE uint32_t LL_RTC_DATE_Get(RTC_TypeDef *RTCx)
1691 register uint32_t temp = 0U;
1693 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));
1694 return (uint32_t)((((temp & RTC_DR_WDU) >> RTC_DR_WDU_Pos) << RTC_OFFSET_WEEKDAY) | \
1695 (((((temp & RTC_DR_DT) >> RTC_DR_DT_Pos) << 4U) | ((temp & RTC_DR_DU) >> RTC_DR_DU_Pos)) << RTC_OFFSET_DAY) | \
1696 (((((temp & RTC_DR_MT) >> RTC_DR_MT_Pos) << 4U) | ((temp & RTC_DR_MU) >> RTC_DR_MU_Pos)) << RTC_OFFSET_MONTH) | \
1697 ((((temp & RTC_DR_YT) >> RTC_DR_YT_Pos) << 4U) | ((temp & RTC_DR_YU) >> RTC_DR_YU_Pos)));
1701 * @}
1704 /** @defgroup RTC_LL_EF_ALARMA ALARMA
1705 * @{
1709 * @brief Enable Alarm A
1710 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1711 * @rmtoll CR ALRAE LL_RTC_ALMA_Enable
1712 * @param RTCx RTC Instance
1713 * @retval None
1715 __STATIC_INLINE void LL_RTC_ALMA_Enable(RTC_TypeDef *RTCx)
1717 SET_BIT(RTCx->CR, RTC_CR_ALRAE);
1721 * @brief Disable Alarm A
1722 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
1723 * @rmtoll CR ALRAE LL_RTC_ALMA_Disable
1724 * @param RTCx RTC Instance
1725 * @retval None
1727 __STATIC_INLINE void LL_RTC_ALMA_Disable(RTC_TypeDef *RTCx)
1729 CLEAR_BIT(RTCx->CR, RTC_CR_ALRAE);
1733 * @brief Specify the Alarm A masks.
1734 * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_SetMask\n
1735 * ALRMAR MSK3 LL_RTC_ALMA_SetMask\n
1736 * ALRMAR MSK2 LL_RTC_ALMA_SetMask\n
1737 * ALRMAR MSK1 LL_RTC_ALMA_SetMask
1738 * @param RTCx RTC Instance
1739 * @param Mask This parameter can be a combination of the following values:
1740 * @arg @ref LL_RTC_ALMA_MASK_NONE
1741 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
1742 * @arg @ref LL_RTC_ALMA_MASK_HOURS
1743 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
1744 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
1745 * @arg @ref LL_RTC_ALMA_MASK_ALL
1746 * @retval None
1748 __STATIC_INLINE void LL_RTC_ALMA_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
1750 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1, Mask);
1754 * @brief Get the Alarm A masks.
1755 * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_GetMask\n
1756 * ALRMAR MSK3 LL_RTC_ALMA_GetMask\n
1757 * ALRMAR MSK2 LL_RTC_ALMA_GetMask\n
1758 * ALRMAR MSK1 LL_RTC_ALMA_GetMask
1759 * @param RTCx RTC Instance
1760 * @retval Returned value can be can be a combination of the following values:
1761 * @arg @ref LL_RTC_ALMA_MASK_NONE
1762 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
1763 * @arg @ref LL_RTC_ALMA_MASK_HOURS
1764 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
1765 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
1766 * @arg @ref LL_RTC_ALMA_MASK_ALL
1768 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef *RTCx)
1770 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1));
1774 * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
1775 * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday
1776 * @param RTCx RTC Instance
1777 * @retval None
1779 __STATIC_INLINE void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef *RTCx)
1781 SET_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL);
1785 * @brief Disable AlarmA Week day selection (DU[3:0] represents the date )
1786 * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday
1787 * @param RTCx RTC Instance
1788 * @retval None
1790 __STATIC_INLINE void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef *RTCx)
1792 CLEAR_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL);
1796 * @brief Set ALARM A Day in BCD format
1797 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
1798 * @rmtoll ALRMAR DT LL_RTC_ALMA_SetDay\n
1799 * ALRMAR DU LL_RTC_ALMA_SetDay
1800 * @param RTCx RTC Instance
1801 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
1802 * @retval None
1804 __STATIC_INLINE void LL_RTC_ALMA_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
1806 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU),
1807 (((Day & 0xF0U) << (RTC_ALRMAR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMAR_DU_Pos)));
1811 * @brief Get ALARM A Day in BCD format
1812 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
1813 * @rmtoll ALRMAR DT LL_RTC_ALMA_GetDay\n
1814 * ALRMAR DU LL_RTC_ALMA_GetDay
1815 * @param RTCx RTC Instance
1816 * @retval Value between Min_Data=0x01 and Max_Data=0x31
1818 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef *RTCx)
1820 register uint32_t temp = 0U;
1822 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU));
1823 return (uint32_t)((((temp & RTC_ALRMAR_DT) >> RTC_ALRMAR_DT_Pos) << 4U) | ((temp & RTC_ALRMAR_DU) >> RTC_ALRMAR_DU_Pos));
1827 * @brief Set ALARM A Weekday
1828 * @rmtoll ALRMAR DU LL_RTC_ALMA_SetWeekDay
1829 * @param RTCx RTC Instance
1830 * @param WeekDay This parameter can be one of the following values:
1831 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1832 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1833 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1834 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1835 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1836 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1837 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1838 * @retval None
1840 __STATIC_INLINE void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
1842 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_DU, WeekDay << RTC_ALRMAR_DU_Pos);
1846 * @brief Get ALARM A Weekday
1847 * @rmtoll ALRMAR DU LL_RTC_ALMA_GetWeekDay
1848 * @param RTCx RTC Instance
1849 * @retval Returned value can be one of the following values:
1850 * @arg @ref LL_RTC_WEEKDAY_MONDAY
1851 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
1852 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
1853 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
1854 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
1855 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
1856 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
1858 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef *RTCx)
1860 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_DU) >> RTC_ALRMAR_DU_Pos);
1864 * @brief Set Alarm A time format (AM/24-hour or PM notation)
1865 * @rmtoll ALRMAR PM LL_RTC_ALMA_SetTimeFormat
1866 * @param RTCx RTC Instance
1867 * @param TimeFormat This parameter can be one of the following values:
1868 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1869 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1870 * @retval None
1872 __STATIC_INLINE void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
1874 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM, TimeFormat);
1878 * @brief Get Alarm A time format (AM or PM notation)
1879 * @rmtoll ALRMAR PM LL_RTC_ALMA_GetTimeFormat
1880 * @param RTCx RTC Instance
1881 * @retval Returned value can be one of the following values:
1882 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1883 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1885 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef *RTCx)
1887 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_PM));
1891 * @brief Set ALARM A Hours in BCD format
1892 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
1893 * @rmtoll ALRMAR HT LL_RTC_ALMA_SetHour\n
1894 * ALRMAR HU LL_RTC_ALMA_SetHour
1895 * @param RTCx RTC Instance
1896 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1897 * @retval None
1899 __STATIC_INLINE void LL_RTC_ALMA_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
1901 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU),
1902 (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos)));
1906 * @brief Get ALARM A Hours in BCD format
1907 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
1908 * @rmtoll ALRMAR HT LL_RTC_ALMA_GetHour\n
1909 * ALRMAR HU LL_RTC_ALMA_GetHour
1910 * @param RTCx RTC Instance
1911 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1913 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef *RTCx)
1915 register uint32_t temp = 0U;
1917 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU));
1918 return (uint32_t)((((temp & RTC_ALRMAR_HT) >> RTC_ALRMAR_HT_Pos) << 4U) | ((temp & RTC_ALRMAR_HU) >> RTC_ALRMAR_HU_Pos));
1922 * @brief Set ALARM A Minutes in BCD format
1923 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
1924 * @rmtoll ALRMAR MNT LL_RTC_ALMA_SetMinute\n
1925 * ALRMAR MNU LL_RTC_ALMA_SetMinute
1926 * @param RTCx RTC Instance
1927 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1928 * @retval None
1930 __STATIC_INLINE void LL_RTC_ALMA_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
1932 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU),
1933 (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)));
1937 * @brief Get ALARM A Minutes in BCD format
1938 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
1939 * @rmtoll ALRMAR MNT LL_RTC_ALMA_GetMinute\n
1940 * ALRMAR MNU LL_RTC_ALMA_GetMinute
1941 * @param RTCx RTC Instance
1942 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1944 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef *RTCx)
1946 register uint32_t temp = 0U;
1948 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU));
1949 return (uint32_t)((((temp & RTC_ALRMAR_MNT) >> RTC_ALRMAR_MNT_Pos) << 4U) | ((temp & RTC_ALRMAR_MNU) >> RTC_ALRMAR_MNU_Pos));
1953 * @brief Set ALARM A Seconds in BCD format
1954 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
1955 * @rmtoll ALRMAR ST LL_RTC_ALMA_SetSecond\n
1956 * ALRMAR SU LL_RTC_ALMA_SetSecond
1957 * @param RTCx RTC Instance
1958 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1959 * @retval None
1961 __STATIC_INLINE void LL_RTC_ALMA_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
1963 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU),
1964 (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos)));
1968 * @brief Get ALARM A Seconds in BCD format
1969 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
1970 * @rmtoll ALRMAR ST LL_RTC_ALMA_GetSecond\n
1971 * ALRMAR SU LL_RTC_ALMA_GetSecond
1972 * @param RTCx RTC Instance
1973 * @retval Value between Min_Data=0x00 and Max_Data=0x59
1975 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef *RTCx)
1977 register uint32_t temp = 0U;
1979 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU));
1980 return (uint32_t)((((temp & RTC_ALRMAR_ST) >> RTC_ALRMAR_ST_Pos) << 4U) | ((temp & RTC_ALRMAR_SU) >> RTC_ALRMAR_SU_Pos));
1984 * @brief Set Alarm A Time (hour, minute and second) in BCD format
1985 * @rmtoll ALRMAR PM LL_RTC_ALMA_ConfigTime\n
1986 * ALRMAR HT LL_RTC_ALMA_ConfigTime\n
1987 * ALRMAR HU LL_RTC_ALMA_ConfigTime\n
1988 * ALRMAR MNT LL_RTC_ALMA_ConfigTime\n
1989 * ALRMAR MNU LL_RTC_ALMA_ConfigTime\n
1990 * ALRMAR ST LL_RTC_ALMA_ConfigTime\n
1991 * ALRMAR SU LL_RTC_ALMA_ConfigTime
1992 * @param RTCx RTC Instance
1993 * @param Format12_24 This parameter can be one of the following values:
1994 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
1995 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
1996 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
1997 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
1998 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
1999 * @retval None
2001 __STATIC_INLINE void LL_RTC_ALMA_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
2003 register uint32_t temp = 0U;
2005 temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos)) | \
2006 (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)) | \
2007 (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos));
2009 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM | RTC_ALRMAR_HT | RTC_ALRMAR_HU | RTC_ALRMAR_MNT | RTC_ALRMAR_MNU | RTC_ALRMAR_ST | RTC_ALRMAR_SU, temp);
2013 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2014 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2015 * are available to get independently each parameter.
2016 * @rmtoll ALRMAR HT LL_RTC_ALMA_GetTime\n
2017 * ALRMAR HU LL_RTC_ALMA_GetTime\n
2018 * ALRMAR MNT LL_RTC_ALMA_GetTime\n
2019 * ALRMAR MNU LL_RTC_ALMA_GetTime\n
2020 * ALRMAR ST LL_RTC_ALMA_GetTime\n
2021 * ALRMAR SU LL_RTC_ALMA_GetTime
2022 * @param RTCx RTC Instance
2023 * @retval Combination of hours, minutes and seconds.
2025 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef *RTCx)
2027 return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMA_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMA_GetSecond(RTCx));
2031 * @brief Set Alarm A Mask the most-significant bits starting at this bit
2032 * @note This register can be written only when ALRAE is reset in RTC_CR register,
2033 * or in initialization mode.
2034 * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask
2035 * @param RTCx RTC Instance
2036 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2037 * @retval None
2039 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask)
2041 MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS, Mask << RTC_ALRMASSR_MASKSS_Pos);
2045 * @brief Get Alarm A Mask the most-significant bits starting at this bit
2046 * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask
2047 * @param RTCx RTC Instance
2048 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2050 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef *RTCx)
2052 return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS) >> RTC_ALRMASSR_MASKSS_Pos);
2056 * @brief Set Alarm A Sub seconds value
2057 * @rmtoll ALRMASSR SS LL_RTC_ALMA_SetSubSecond
2058 * @param RTCx RTC Instance
2059 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2060 * @retval None
2062 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond)
2064 MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_SS, Subsecond);
2068 * @brief Get Alarm A Sub seconds value
2069 * @rmtoll ALRMASSR SS LL_RTC_ALMA_GetSubSecond
2070 * @param RTCx RTC Instance
2071 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2073 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef *RTCx)
2075 return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_SS));
2079 * @}
2082 /** @defgroup RTC_LL_EF_ALARMB ALARMB
2083 * @{
2087 * @brief Enable Alarm B
2088 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2089 * @rmtoll CR ALRBE LL_RTC_ALMB_Enable
2090 * @param RTCx RTC Instance
2091 * @retval None
2093 __STATIC_INLINE void LL_RTC_ALMB_Enable(RTC_TypeDef *RTCx)
2095 SET_BIT(RTCx->CR, RTC_CR_ALRBE);
2099 * @brief Disable Alarm B
2100 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2101 * @rmtoll CR ALRBE LL_RTC_ALMB_Disable
2102 * @param RTCx RTC Instance
2103 * @retval None
2105 __STATIC_INLINE void LL_RTC_ALMB_Disable(RTC_TypeDef *RTCx)
2107 CLEAR_BIT(RTCx->CR, RTC_CR_ALRBE);
2111 * @brief Specify the Alarm B masks.
2112 * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_SetMask\n
2113 * ALRMBR MSK3 LL_RTC_ALMB_SetMask\n
2114 * ALRMBR MSK2 LL_RTC_ALMB_SetMask\n
2115 * ALRMBR MSK1 LL_RTC_ALMB_SetMask
2116 * @param RTCx RTC Instance
2117 * @param Mask This parameter can be a combination of the following values:
2118 * @arg @ref LL_RTC_ALMB_MASK_NONE
2119 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
2120 * @arg @ref LL_RTC_ALMB_MASK_HOURS
2121 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
2122 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
2123 * @arg @ref LL_RTC_ALMB_MASK_ALL
2124 * @retval None
2126 __STATIC_INLINE void LL_RTC_ALMB_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
2128 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1, Mask);
2132 * @brief Get the Alarm B masks.
2133 * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_GetMask\n
2134 * ALRMBR MSK3 LL_RTC_ALMB_GetMask\n
2135 * ALRMBR MSK2 LL_RTC_ALMB_GetMask\n
2136 * ALRMBR MSK1 LL_RTC_ALMB_GetMask
2137 * @param RTCx RTC Instance
2138 * @retval Returned value can be can be a combination of the following values:
2139 * @arg @ref LL_RTC_ALMB_MASK_NONE
2140 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
2141 * @arg @ref LL_RTC_ALMB_MASK_HOURS
2142 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
2143 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
2144 * @arg @ref LL_RTC_ALMB_MASK_ALL
2146 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef *RTCx)
2148 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1));
2152 * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
2153 * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday
2154 * @param RTCx RTC Instance
2155 * @retval None
2157 __STATIC_INLINE void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef *RTCx)
2159 SET_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL);
2163 * @brief Disable AlarmB Week day selection (DU[3:0] represents the date )
2164 * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday
2165 * @param RTCx RTC Instance
2166 * @retval None
2168 __STATIC_INLINE void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef *RTCx)
2170 CLEAR_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL);
2174 * @brief Set ALARM B Day in BCD format
2175 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
2176 * @rmtoll ALRMBR DT LL_RTC_ALMB_SetDay\n
2177 * ALRMBR DU LL_RTC_ALMB_SetDay
2178 * @param RTCx RTC Instance
2179 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
2180 * @retval None
2182 __STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
2184 MODIFY_REG(RTC->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU),
2185 (((Day & 0xF0U) << (RTC_ALRMBR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMBR_DU_Pos)));
2189 * @brief Get ALARM B Day in BCD format
2190 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2191 * @rmtoll ALRMBR DT LL_RTC_ALMB_GetDay\n
2192 * ALRMBR DU LL_RTC_ALMB_GetDay
2193 * @param RTCx RTC Instance
2194 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2196 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef *RTCx)
2198 register uint32_t temp = 0U;
2200 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU));
2201 return (uint32_t)((((temp & RTC_ALRMBR_DT) >> RTC_ALRMBR_DT_Pos) << 4U) | ((temp & RTC_ALRMBR_DU) >> RTC_ALRMBR_DU_Pos));
2205 * @brief Set ALARM B Weekday
2206 * @rmtoll ALRMBR DU LL_RTC_ALMB_SetWeekDay
2207 * @param RTCx RTC Instance
2208 * @param WeekDay This parameter can be one of the following values:
2209 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2210 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2211 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2212 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2213 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2214 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2215 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2216 * @retval None
2218 __STATIC_INLINE void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
2220 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_DU, WeekDay << RTC_ALRMBR_DU_Pos);
2224 * @brief Get ALARM B Weekday
2225 * @rmtoll ALRMBR DU LL_RTC_ALMB_GetWeekDay
2226 * @param RTCx RTC Instance
2227 * @retval Returned value can be one of the following values:
2228 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2229 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2230 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2231 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2232 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2233 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2234 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2236 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef *RTCx)
2238 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_DU) >> RTC_ALRMBR_DU_Pos);
2242 * @brief Set ALARM B time format (AM/24-hour or PM notation)
2243 * @rmtoll ALRMBR PM LL_RTC_ALMB_SetTimeFormat
2244 * @param RTCx RTC Instance
2245 * @param TimeFormat This parameter can be one of the following values:
2246 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2247 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2248 * @retval None
2250 __STATIC_INLINE void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
2252 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM, TimeFormat);
2256 * @brief Get ALARM B time format (AM or PM notation)
2257 * @rmtoll ALRMBR PM LL_RTC_ALMB_GetTimeFormat
2258 * @param RTCx RTC Instance
2259 * @retval Returned value can be one of the following values:
2260 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2261 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2263 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef *RTCx)
2265 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_PM));
2269 * @brief Set ALARM B Hours in BCD format
2270 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
2271 * @rmtoll ALRMBR HT LL_RTC_ALMB_SetHour\n
2272 * ALRMBR HU LL_RTC_ALMB_SetHour
2273 * @param RTCx RTC Instance
2274 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2275 * @retval None
2277 __STATIC_INLINE void LL_RTC_ALMB_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
2279 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU),
2280 (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos)));
2284 * @brief Get ALARM B Hours in BCD format
2285 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2286 * @rmtoll ALRMBR HT LL_RTC_ALMB_GetHour\n
2287 * ALRMBR HU LL_RTC_ALMB_GetHour
2288 * @param RTCx RTC Instance
2289 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2291 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef *RTCx)
2293 register uint32_t temp = 0U;
2295 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU));
2296 return (uint32_t)((((temp & RTC_ALRMBR_HT) >> RTC_ALRMBR_HT_Pos) << 4U) | ((temp & RTC_ALRMBR_HU) >> RTC_ALRMBR_HU_Pos));
2300 * @brief Set ALARM B Minutes in BCD format
2301 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
2302 * @rmtoll ALRMBR MNT LL_RTC_ALMB_SetMinute\n
2303 * ALRMBR MNU LL_RTC_ALMB_SetMinute
2304 * @param RTCx RTC Instance
2305 * @param Minutes between Min_Data=0x00 and Max_Data=0x59
2306 * @retval None
2308 __STATIC_INLINE void LL_RTC_ALMB_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
2310 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU),
2311 (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)));
2315 * @brief Get ALARM B Minutes in BCD format
2316 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2317 * @rmtoll ALRMBR MNT LL_RTC_ALMB_GetMinute\n
2318 * ALRMBR MNU LL_RTC_ALMB_GetMinute
2319 * @param RTCx RTC Instance
2320 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2322 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef *RTCx)
2324 register uint32_t temp = 0U;
2326 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU));
2327 return (uint32_t)((((temp & RTC_ALRMBR_MNT) >> RTC_ALRMBR_MNT_Pos) << 4U) | ((temp & RTC_ALRMBR_MNU) >> RTC_ALRMBR_MNU_Pos));
2331 * @brief Set ALARM B Seconds in BCD format
2332 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
2333 * @rmtoll ALRMBR ST LL_RTC_ALMB_SetSecond\n
2334 * ALRMBR SU LL_RTC_ALMB_SetSecond
2335 * @param RTCx RTC Instance
2336 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2337 * @retval None
2339 __STATIC_INLINE void LL_RTC_ALMB_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
2341 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU),
2342 (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos)));
2346 * @brief Get ALARM B Seconds in BCD format
2347 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2348 * @rmtoll ALRMBR ST LL_RTC_ALMB_GetSecond\n
2349 * ALRMBR SU LL_RTC_ALMB_GetSecond
2350 * @param RTCx RTC Instance
2351 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2353 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef *RTCx)
2355 register uint32_t temp = 0U;
2357 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU));
2358 return (uint32_t)((((temp & RTC_ALRMBR_ST) >> RTC_ALRMBR_ST_Pos) << 4U) | ((temp & RTC_ALRMBR_SU) >> RTC_ALRMBR_SU_Pos));
2362 * @brief Set Alarm B Time (hour, minute and second) in BCD format
2363 * @rmtoll ALRMBR PM LL_RTC_ALMB_ConfigTime\n
2364 * ALRMBR HT LL_RTC_ALMB_ConfigTime\n
2365 * ALRMBR HU LL_RTC_ALMB_ConfigTime\n
2366 * ALRMBR MNT LL_RTC_ALMB_ConfigTime\n
2367 * ALRMBR MNU LL_RTC_ALMB_ConfigTime\n
2368 * ALRMBR ST LL_RTC_ALMB_ConfigTime\n
2369 * ALRMBR SU LL_RTC_ALMB_ConfigTime
2370 * @param RTCx RTC Instance
2371 * @param Format12_24 This parameter can be one of the following values:
2372 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
2373 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
2374 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2375 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
2376 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
2377 * @retval None
2379 __STATIC_INLINE void LL_RTC_ALMB_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
2381 register uint32_t temp = 0U;
2383 temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos)) | \
2384 (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)) | \
2385 (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos));
2387 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM| RTC_ALRMBR_HT | RTC_ALRMBR_HU | RTC_ALRMBR_MNT | RTC_ALRMBR_MNU | RTC_ALRMBR_ST | RTC_ALRMBR_SU, temp);
2391 * @brief Get Alarm B Time (hour, minute and second) in BCD format
2392 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2393 * are available to get independently each parameter.
2394 * @rmtoll ALRMBR HT LL_RTC_ALMB_GetTime\n
2395 * ALRMBR HU LL_RTC_ALMB_GetTime\n
2396 * ALRMBR MNT LL_RTC_ALMB_GetTime\n
2397 * ALRMBR MNU LL_RTC_ALMB_GetTime\n
2398 * ALRMBR ST LL_RTC_ALMB_GetTime\n
2399 * ALRMBR SU LL_RTC_ALMB_GetTime
2400 * @param RTCx RTC Instance
2401 * @retval Combination of hours, minutes and seconds.
2403 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef *RTCx)
2405 return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMB_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMB_GetSecond(RTCx));
2409 * @brief Set Alarm B Mask the most-significant bits starting at this bit
2410 * @note This register can be written only when ALRBE is reset in RTC_CR register,
2411 * or in initialization mode.
2412 * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask
2413 * @param RTCx RTC Instance
2414 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
2415 * @retval None
2417 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask)
2419 MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS, Mask << RTC_ALRMBSSR_MASKSS_Pos);
2423 * @brief Get Alarm B Mask the most-significant bits starting at this bit
2424 * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask
2425 * @param RTCx RTC Instance
2426 * @retval Value between Min_Data=0x00 and Max_Data=0xF
2428 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef *RTCx)
2430 return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS) >> RTC_ALRMBSSR_MASKSS_Pos);
2434 * @brief Set Alarm B Sub seconds value
2435 * @rmtoll ALRMBSSR SS LL_RTC_ALMB_SetSubSecond
2436 * @param RTCx RTC Instance
2437 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
2438 * @retval None
2440 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond)
2442 MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS, Subsecond);
2446 * @brief Get Alarm B Sub seconds value
2447 * @rmtoll ALRMBSSR SS LL_RTC_ALMB_GetSubSecond
2448 * @param RTCx RTC Instance
2449 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
2451 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef *RTCx)
2453 return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS));
2457 * @}
2460 /** @defgroup RTC_LL_EF_Timestamp Timestamp
2461 * @{
2465 * @brief Enable Timestamp
2466 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2467 * @rmtoll CR TSE LL_RTC_TS_Enable
2468 * @param RTCx RTC Instance
2469 * @retval None
2471 __STATIC_INLINE void LL_RTC_TS_Enable(RTC_TypeDef *RTCx)
2473 SET_BIT(RTCx->CR, RTC_CR_TSE);
2477 * @brief Disable Timestamp
2478 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2479 * @rmtoll CR TSE LL_RTC_TS_Disable
2480 * @param RTCx RTC Instance
2481 * @retval None
2483 __STATIC_INLINE void LL_RTC_TS_Disable(RTC_TypeDef *RTCx)
2485 CLEAR_BIT(RTCx->CR, RTC_CR_TSE);
2489 * @brief Set Time-stamp event active edge
2490 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2491 * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting
2492 * @rmtoll CR TSEDGE LL_RTC_TS_SetActiveEdge
2493 * @param RTCx RTC Instance
2494 * @param Edge This parameter can be one of the following values:
2495 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2496 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2497 * @retval None
2499 __STATIC_INLINE void LL_RTC_TS_SetActiveEdge(RTC_TypeDef *RTCx, uint32_t Edge)
2501 MODIFY_REG(RTCx->CR, RTC_CR_TSEDGE, Edge);
2505 * @brief Get Time-stamp event active edge
2506 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2507 * @rmtoll CR TSEDGE LL_RTC_TS_GetActiveEdge
2508 * @param RTCx RTC Instance
2509 * @retval Returned value can be one of the following values:
2510 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
2511 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
2513 __STATIC_INLINE uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef *RTCx)
2515 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_TSEDGE));
2519 * @brief Get Timestamp AM/PM notation (AM or 24-hour format)
2520 * @rmtoll TSTR PM LL_RTC_TS_GetTimeFormat
2521 * @param RTCx RTC Instance
2522 * @retval Returned value can be one of the following values:
2523 * @arg @ref LL_RTC_TS_TIME_FORMAT_AM
2524 * @arg @ref LL_RTC_TS_TIME_FORMAT_PM
2526 __STATIC_INLINE uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef *RTCx)
2528 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_PM));
2532 * @brief Get Timestamp Hours in BCD format
2533 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
2534 * @rmtoll TSTR HT LL_RTC_TS_GetHour\n
2535 * TSTR HU LL_RTC_TS_GetHour
2536 * @param RTCx RTC Instance
2537 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
2539 __STATIC_INLINE uint32_t LL_RTC_TS_GetHour(RTC_TypeDef *RTCx)
2541 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_HT | RTC_TSTR_HU) >> RTC_TSTR_HU_Pos);
2545 * @brief Get Timestamp Minutes in BCD format
2546 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
2547 * @rmtoll TSTR MNT LL_RTC_TS_GetMinute\n
2548 * TSTR MNU LL_RTC_TS_GetMinute
2549 * @param RTCx RTC Instance
2550 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2552 __STATIC_INLINE uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef *RTCx)
2554 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_MNT | RTC_TSTR_MNU) >> RTC_TSTR_MNU_Pos);
2558 * @brief Get Timestamp Seconds in BCD format
2559 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
2560 * @rmtoll TSTR ST LL_RTC_TS_GetSecond\n
2561 * TSTR SU LL_RTC_TS_GetSecond
2562 * @param RTCx RTC Instance
2563 * @retval Value between Min_Data=0x00 and Max_Data=0x59
2565 __STATIC_INLINE uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef *RTCx)
2567 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_ST | RTC_TSTR_SU));
2571 * @brief Get Timestamp time (hour, minute and second) in BCD format
2572 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
2573 * are available to get independently each parameter.
2574 * @rmtoll TSTR HT LL_RTC_TS_GetTime\n
2575 * TSTR HU LL_RTC_TS_GetTime\n
2576 * TSTR MNT LL_RTC_TS_GetTime\n
2577 * TSTR MNU LL_RTC_TS_GetTime\n
2578 * TSTR ST LL_RTC_TS_GetTime\n
2579 * TSTR SU LL_RTC_TS_GetTime
2580 * @param RTCx RTC Instance
2581 * @retval Combination of hours, minutes and seconds.
2583 __STATIC_INLINE uint32_t LL_RTC_TS_GetTime(RTC_TypeDef *RTCx)
2585 return (uint32_t)(READ_BIT(RTCx->TSTR,
2586 RTC_TSTR_HT | RTC_TSTR_HU | RTC_TSTR_MNT | RTC_TSTR_MNU | RTC_TSTR_ST | RTC_TSTR_SU));
2590 * @brief Get Timestamp Week day
2591 * @rmtoll TSDR WDU LL_RTC_TS_GetWeekDay
2592 * @param RTCx RTC Instance
2593 * @retval Returned value can be one of the following values:
2594 * @arg @ref LL_RTC_WEEKDAY_MONDAY
2595 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
2596 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
2597 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
2598 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
2599 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
2600 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
2602 __STATIC_INLINE uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef *RTCx)
2604 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU) >> RTC_TSDR_WDU_Pos);
2608 * @brief Get Timestamp Month in BCD format
2609 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
2610 * @rmtoll TSDR MT LL_RTC_TS_GetMonth\n
2611 * TSDR MU LL_RTC_TS_GetMonth
2612 * @param RTCx RTC Instance
2613 * @retval Returned value can be one of the following values:
2614 * @arg @ref LL_RTC_MONTH_JANUARY
2615 * @arg @ref LL_RTC_MONTH_FEBRUARY
2616 * @arg @ref LL_RTC_MONTH_MARCH
2617 * @arg @ref LL_RTC_MONTH_APRIL
2618 * @arg @ref LL_RTC_MONTH_MAY
2619 * @arg @ref LL_RTC_MONTH_JUNE
2620 * @arg @ref LL_RTC_MONTH_JULY
2621 * @arg @ref LL_RTC_MONTH_AUGUST
2622 * @arg @ref LL_RTC_MONTH_SEPTEMBER
2623 * @arg @ref LL_RTC_MONTH_OCTOBER
2624 * @arg @ref LL_RTC_MONTH_NOVEMBER
2625 * @arg @ref LL_RTC_MONTH_DECEMBER
2627 __STATIC_INLINE uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef *RTCx)
2629 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_MT | RTC_TSDR_MU) >> RTC_TSDR_MU_Pos);
2633 * @brief Get Timestamp Day in BCD format
2634 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
2635 * @rmtoll TSDR DT LL_RTC_TS_GetDay\n
2636 * TSDR DU LL_RTC_TS_GetDay
2637 * @param RTCx RTC Instance
2638 * @retval Value between Min_Data=0x01 and Max_Data=0x31
2640 __STATIC_INLINE uint32_t LL_RTC_TS_GetDay(RTC_TypeDef *RTCx)
2642 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_DT | RTC_TSDR_DU));
2646 * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format
2647 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH,
2648 * and __LL_RTC_GET_DAY are available to get independently each parameter.
2649 * @rmtoll TSDR WDU LL_RTC_TS_GetDate\n
2650 * TSDR MT LL_RTC_TS_GetDate\n
2651 * TSDR MU LL_RTC_TS_GetDate\n
2652 * TSDR DT LL_RTC_TS_GetDate\n
2653 * TSDR DU LL_RTC_TS_GetDate
2654 * @param RTCx RTC Instance
2655 * @retval Combination of Weekday, Day and Month
2657 __STATIC_INLINE uint32_t LL_RTC_TS_GetDate(RTC_TypeDef *RTCx)
2659 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU | RTC_TSDR_MT | RTC_TSDR_MU | RTC_TSDR_DT | RTC_TSDR_DU));
2663 * @brief Get time-stamp sub second value
2664 * @rmtoll TSSSR SS LL_RTC_TS_GetSubSecond
2665 * @param RTCx RTC Instance
2666 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
2668 __STATIC_INLINE uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef *RTCx)
2670 return (uint32_t)(READ_BIT(RTCx->TSSSR, RTC_TSSSR_SS));
2673 #if defined(RTC_TAFCR_TAMPTS)
2675 * @brief Activate timestamp on tamper detection event
2676 * @rmtoll TAFCR TAMPTS LL_RTC_TS_EnableOnTamper
2677 * @param RTCx RTC Instance
2678 * @retval None
2680 __STATIC_INLINE void LL_RTC_TS_EnableOnTamper(RTC_TypeDef *RTCx)
2682 SET_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPTS);
2686 * @brief Disable timestamp on tamper detection event
2687 * @rmtoll TAFCR TAMPTS LL_RTC_TS_DisableOnTamper
2688 * @param RTCx RTC Instance
2689 * @retval None
2691 __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx)
2693 CLEAR_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPTS);
2695 #endif /* RTC_TAFCR_TAMPTS */
2698 * @}
2701 /** @defgroup RTC_LL_EF_Tamper Tamper
2702 * @{
2706 * @brief Enable RTC_TAMPx input detection
2707 * @rmtoll TAFCR TAMP1E LL_RTC_TAMPER_Enable\n
2708 * TAFCR TAMP2E LL_RTC_TAMPER_Enable\n
2709 * TAFCR TAMP3E LL_RTC_TAMPER_Enable
2710 * @param RTCx RTC Instance
2711 * @param Tamper This parameter can be a combination of the following values:
2712 * @arg @ref LL_RTC_TAMPER_1
2713 * @arg @ref LL_RTC_TAMPER_2
2714 * @arg @ref LL_RTC_TAMPER_3 (*)
2716 * (*) value not defined in all devices.
2717 * @retval None
2719 __STATIC_INLINE void LL_RTC_TAMPER_Enable(RTC_TypeDef *RTCx, uint32_t Tamper)
2721 SET_BIT(RTCx->TAFCR, Tamper);
2725 * @brief Clear RTC_TAMPx input detection
2726 * @rmtoll TAFCR TAMP1E LL_RTC_TAMPER_Disable\n
2727 * TAFCR TAMP2E LL_RTC_TAMPER_Disable\n
2728 * TAFCR TAMP3E LL_RTC_TAMPER_Disable
2729 * @param RTCx RTC Instance
2730 * @param Tamper This parameter can be a combination of the following values:
2731 * @arg @ref LL_RTC_TAMPER_1
2732 * @arg @ref LL_RTC_TAMPER_2
2733 * @arg @ref LL_RTC_TAMPER_3 (*)
2735 * (*) value not defined in all devices.
2736 * @retval None
2738 __STATIC_INLINE void LL_RTC_TAMPER_Disable(RTC_TypeDef *RTCx, uint32_t Tamper)
2740 CLEAR_BIT(RTCx->TAFCR, Tamper);
2743 #if defined(RTC_TAFCR_TAMPPUDIS)
2745 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
2746 * @rmtoll TAFCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp
2747 * @param RTCx RTC Instance
2748 * @retval None
2750 __STATIC_INLINE void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef *RTCx)
2752 SET_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPPUDIS);
2756 * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling)
2757 * @rmtoll TAFCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp
2758 * @param RTCx RTC Instance
2759 * @retval None
2761 __STATIC_INLINE void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef *RTCx)
2763 CLEAR_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPPUDIS);
2765 #endif /* RTC_TAFCR_TAMPPUDIS */
2767 #if defined(RTC_TAFCR_TAMPPRCH)
2769 * @brief Set RTC_TAMPx precharge duration
2770 * @rmtoll TAFCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge
2771 * @param RTCx RTC Instance
2772 * @param Duration This parameter can be one of the following values:
2773 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
2774 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
2775 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
2776 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
2777 * @retval None
2779 __STATIC_INLINE void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef *RTCx, uint32_t Duration)
2781 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_TAMPPRCH, Duration);
2785 * @brief Get RTC_TAMPx precharge duration
2786 * @rmtoll TAFCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge
2787 * @param RTCx RTC Instance
2788 * @retval Returned value can be one of the following values:
2789 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
2790 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
2791 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
2792 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
2794 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef *RTCx)
2796 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPPRCH));
2798 #endif /* RTC_TAFCR_TAMPPRCH */
2800 #if defined(RTC_TAFCR_TAMPFLT)
2802 * @brief Set RTC_TAMPx filter count
2803 * @rmtoll TAFCR TAMPFLT LL_RTC_TAMPER_SetFilterCount
2804 * @param RTCx RTC Instance
2805 * @param FilterCount This parameter can be one of the following values:
2806 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
2807 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
2808 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
2809 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
2810 * @retval None
2812 __STATIC_INLINE void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef *RTCx, uint32_t FilterCount)
2814 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_TAMPFLT, FilterCount);
2818 * @brief Get RTC_TAMPx filter count
2819 * @rmtoll TAFCR TAMPFLT LL_RTC_TAMPER_GetFilterCount
2820 * @param RTCx RTC Instance
2821 * @retval Returned value can be one of the following values:
2822 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
2823 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
2824 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
2825 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
2827 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef *RTCx)
2829 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPFLT));
2831 #endif /* RTC_TAFCR_TAMPFLT */
2833 #if defined(RTC_TAFCR_TAMPFREQ)
2835 * @brief Set Tamper sampling frequency
2836 * @rmtoll TAFCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq
2837 * @param RTCx RTC Instance
2838 * @param SamplingFreq This parameter can be one of the following values:
2839 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
2840 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
2841 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
2842 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
2843 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
2844 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
2845 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
2846 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
2847 * @retval None
2849 __STATIC_INLINE void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef *RTCx, uint32_t SamplingFreq)
2851 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_TAMPFREQ, SamplingFreq);
2855 * @brief Get Tamper sampling frequency
2856 * @rmtoll TAFCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq
2857 * @param RTCx RTC Instance
2858 * @retval Returned value can be one of the following values:
2859 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
2860 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
2861 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
2862 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
2863 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
2864 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
2865 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
2866 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
2868 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef *RTCx)
2870 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPFREQ));
2872 #endif /* RTC_TAFCR_TAMPFREQ */
2875 * @brief Enable Active level for Tamper input
2876 * @rmtoll TAFCR TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel\n
2877 * TAFCR TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel\n
2878 * TAFCR TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel
2879 * @param RTCx RTC Instance
2880 * @param Tamper This parameter can be a combination of the following values:
2881 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
2882 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
2883 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 (*)
2885 * (*) value not defined in all devices.
2886 * @retval None
2888 __STATIC_INLINE void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper)
2890 SET_BIT(RTCx->TAFCR, Tamper);
2894 * @brief Disable Active level for Tamper input
2895 * @rmtoll TAFCR TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel\n
2896 * TAFCR TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel\n
2897 * TAFCR TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel
2898 * @param RTCx RTC Instance
2899 * @param Tamper This parameter can be a combination of the following values:
2900 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
2901 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2
2902 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 (*)
2904 * (*) value not defined in all devices.
2905 * @retval None
2907 __STATIC_INLINE void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper)
2909 CLEAR_BIT(RTCx->TAFCR, Tamper);
2913 * @}
2916 #if defined(RTC_WAKEUP_SUPPORT)
2917 /** @defgroup RTC_LL_EF_Wakeup Wakeup
2918 * @{
2922 * @brief Enable Wakeup timer
2923 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2924 * @rmtoll CR WUTE LL_RTC_WAKEUP_Enable
2925 * @param RTCx RTC Instance
2926 * @retval None
2928 __STATIC_INLINE void LL_RTC_WAKEUP_Enable(RTC_TypeDef *RTCx)
2930 SET_BIT(RTCx->CR, RTC_CR_WUTE);
2934 * @brief Disable Wakeup timer
2935 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2936 * @rmtoll CR WUTE LL_RTC_WAKEUP_Disable
2937 * @param RTCx RTC Instance
2938 * @retval None
2940 __STATIC_INLINE void LL_RTC_WAKEUP_Disable(RTC_TypeDef *RTCx)
2942 CLEAR_BIT(RTCx->CR, RTC_CR_WUTE);
2946 * @brief Check if Wakeup timer is enabled or not
2947 * @rmtoll CR WUTE LL_RTC_WAKEUP_IsEnabled
2948 * @param RTCx RTC Instance
2949 * @retval State of bit (1 or 0).
2951 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef *RTCx)
2953 return (READ_BIT(RTCx->CR, RTC_CR_WUTE) == (RTC_CR_WUTE));
2957 * @brief Select Wakeup clock
2958 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
2959 * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1
2960 * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_SetClock
2961 * @param RTCx RTC Instance
2962 * @param WakeupClock This parameter can be one of the following values:
2963 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
2964 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
2965 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
2966 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
2967 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
2968 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
2969 * @retval None
2971 __STATIC_INLINE void LL_RTC_WAKEUP_SetClock(RTC_TypeDef *RTCx, uint32_t WakeupClock)
2973 MODIFY_REG(RTCx->CR, RTC_CR_WUCKSEL, WakeupClock);
2977 * @brief Get Wakeup clock
2978 * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_GetClock
2979 * @param RTCx RTC Instance
2980 * @retval Returned value can be one of the following values:
2981 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
2982 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
2983 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
2984 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
2985 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
2986 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
2988 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef *RTCx)
2990 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_WUCKSEL));
2994 * @brief Set Wakeup auto-reload value
2995 * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR
2996 * @rmtoll WUTR WUT LL_RTC_WAKEUP_SetAutoReload
2997 * @param RTCx RTC Instance
2998 * @param Value Value between Min_Data=0x00 and Max_Data=0xFFFF
2999 * @retval None
3001 __STATIC_INLINE void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef *RTCx, uint32_t Value)
3003 MODIFY_REG(RTCx->WUTR, RTC_WUTR_WUT, Value);
3007 * @brief Get Wakeup auto-reload value
3008 * @rmtoll WUTR WUT LL_RTC_WAKEUP_GetAutoReload
3009 * @param RTCx RTC Instance
3010 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
3012 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef *RTCx)
3014 return (uint32_t)(READ_BIT(RTCx->WUTR, RTC_WUTR_WUT));
3018 * @}
3020 #endif /* RTC_WAKEUP_SUPPORT */
3022 #if defined(RTC_BACKUP_SUPPORT)
3023 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
3024 * @{
3028 * @brief Writes a data in a specified RTC Backup data register.
3029 * @rmtoll BKPxR BKP LL_RTC_BAK_SetRegister
3030 * @param RTCx RTC Instance
3031 * @param BackupRegister This parameter can be one of the following values:
3032 * @arg @ref LL_RTC_BKP_DR0
3033 * @arg @ref LL_RTC_BKP_DR1
3034 * @arg @ref LL_RTC_BKP_DR2
3035 * @arg @ref LL_RTC_BKP_DR3
3036 * @arg @ref LL_RTC_BKP_DR4
3037 * @arg @ref LL_RTC_BKP_DR5 (*)
3038 * @arg @ref LL_RTC_BKP_DR6 (*)
3039 * @arg @ref LL_RTC_BKP_DR7 (*)
3040 * @arg @ref LL_RTC_BKP_DR8 (*)
3041 * @arg @ref LL_RTC_BKP_DR9 (*)
3042 * @arg @ref LL_RTC_BKP_DR10 (*)
3043 * @arg @ref LL_RTC_BKP_DR11 (*)
3044 * @arg @ref LL_RTC_BKP_DR12 (*)
3045 * @arg @ref LL_RTC_BKP_DR13 (*)
3046 * @arg @ref LL_RTC_BKP_DR14 (*)
3047 * @arg @ref LL_RTC_BKP_DR15 (*)
3048 * @arg @ref LL_RTC_BKP_DR16 (*)
3049 * @arg @ref LL_RTC_BKP_DR17 (*)
3050 * @arg @ref LL_RTC_BKP_DR18 (*)
3051 * @arg @ref LL_RTC_BKP_DR19 (*)
3052 * @arg @ref LL_RTC_BKP_DR20 (*)
3053 * @arg @ref LL_RTC_BKP_DR21 (*)
3054 * @arg @ref LL_RTC_BKP_DR22 (*)
3055 * @arg @ref LL_RTC_BKP_DR23 (*)
3056 * @arg @ref LL_RTC_BKP_DR24 (*)
3057 * @arg @ref LL_RTC_BKP_DR25 (*)
3058 * @arg @ref LL_RTC_BKP_DR26 (*)
3059 * @arg @ref LL_RTC_BKP_DR27 (*)
3060 * @arg @ref LL_RTC_BKP_DR28 (*)
3061 * @arg @ref LL_RTC_BKP_DR29 (*)
3062 * @arg @ref LL_RTC_BKP_DR30 (*)
3063 * @arg @ref LL_RTC_BKP_DR31 (*)
3065 * (*) value not defined in all devices.
3066 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3067 * @retval None
3069 __STATIC_INLINE void LL_RTC_BAK_SetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister, uint32_t Data)
3071 register uint32_t tmp = 0U;
3073 tmp = (uint32_t)(&(RTCx->BKP0R));
3074 tmp += (BackupRegister * 4U);
3076 /* Write the specified register */
3077 *(__IO uint32_t *)tmp = (uint32_t)Data;
3081 * @brief Reads data from the specified RTC Backup data Register.
3082 * @rmtoll BKPxR BKP LL_RTC_BAK_GetRegister
3083 * @param RTCx RTC Instance
3084 * @param BackupRegister This parameter can be one of the following values:
3085 * @arg @ref LL_RTC_BKP_DR0
3086 * @arg @ref LL_RTC_BKP_DR1
3087 * @arg @ref LL_RTC_BKP_DR2
3088 * @arg @ref LL_RTC_BKP_DR3
3089 * @arg @ref LL_RTC_BKP_DR4
3090 * @arg @ref LL_RTC_BKP_DR5 (*)
3091 * @arg @ref LL_RTC_BKP_DR6 (*)
3092 * @arg @ref LL_RTC_BKP_DR7 (*)
3093 * @arg @ref LL_RTC_BKP_DR8 (*)
3094 * @arg @ref LL_RTC_BKP_DR9 (*)
3095 * @arg @ref LL_RTC_BKP_DR10 (*)
3096 * @arg @ref LL_RTC_BKP_DR11 (*)
3097 * @arg @ref LL_RTC_BKP_DR12 (*)
3098 * @arg @ref LL_RTC_BKP_DR13 (*)
3099 * @arg @ref LL_RTC_BKP_DR14 (*)
3100 * @arg @ref LL_RTC_BKP_DR15 (*)
3101 * @arg @ref LL_RTC_BKP_DR16 (*)
3102 * @arg @ref LL_RTC_BKP_DR17 (*)
3103 * @arg @ref LL_RTC_BKP_DR18 (*)
3104 * @arg @ref LL_RTC_BKP_DR19 (*)
3105 * @arg @ref LL_RTC_BKP_DR20 (*)
3106 * @arg @ref LL_RTC_BKP_DR21 (*)
3107 * @arg @ref LL_RTC_BKP_DR22 (*)
3108 * @arg @ref LL_RTC_BKP_DR23 (*)
3109 * @arg @ref LL_RTC_BKP_DR24 (*)
3110 * @arg @ref LL_RTC_BKP_DR25 (*)
3111 * @arg @ref LL_RTC_BKP_DR26 (*)
3112 * @arg @ref LL_RTC_BKP_DR27 (*)
3113 * @arg @ref LL_RTC_BKP_DR28 (*)
3114 * @arg @ref LL_RTC_BKP_DR29 (*)
3115 * @arg @ref LL_RTC_BKP_DR30 (*)
3116 * @arg @ref LL_RTC_BKP_DR31 (*)
3118 * (*) value not defined in all devices.
3119 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
3121 __STATIC_INLINE uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister)
3123 register uint32_t tmp = 0U;
3125 tmp = (uint32_t)(&(RTCx->BKP0R));
3126 tmp += (BackupRegister * 4U);
3128 /* Read the specified register */
3129 return (*(__IO uint32_t *)tmp);
3133 * @}
3135 #endif /* RTC_BACKUP_SUPPORT */
3137 /** @defgroup RTC_LL_EF_Calibration Calibration
3138 * @{
3142 * @brief Set Calibration output frequency (1 Hz or 512 Hz)
3143 * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3144 * @rmtoll CR COE LL_RTC_CAL_SetOutputFreq\n
3145 * CR COSEL LL_RTC_CAL_SetOutputFreq
3146 * @param RTCx RTC Instance
3147 * @param Frequency This parameter can be one of the following values:
3148 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3149 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3150 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3151 * @retval None
3153 __STATIC_INLINE void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef *RTCx, uint32_t Frequency)
3155 MODIFY_REG(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL, Frequency);
3159 * @brief Get Calibration output frequency (1 Hz or 512 Hz)
3160 * @rmtoll CR COE LL_RTC_CAL_GetOutputFreq\n
3161 * CR COSEL LL_RTC_CAL_GetOutputFreq
3162 * @param RTCx RTC Instance
3163 * @retval Returned value can be one of the following values:
3164 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
3165 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
3166 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
3168 __STATIC_INLINE uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef *RTCx)
3170 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL));
3174 * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm)
3175 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3176 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3177 * @rmtoll CALR CALP LL_RTC_CAL_SetPulse
3178 * @param RTCx RTC Instance
3179 * @param Pulse This parameter can be one of the following values:
3180 * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE
3181 * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET
3182 * @retval None
3184 __STATIC_INLINE void LL_RTC_CAL_SetPulse(RTC_TypeDef *RTCx, uint32_t Pulse)
3186 MODIFY_REG(RTCx->CALR, RTC_CALR_CALP, Pulse);
3190 * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm)
3191 * @rmtoll CALR CALP LL_RTC_CAL_IsPulseInserted
3192 * @param RTCx RTC Instance
3193 * @retval State of bit (1 or 0).
3195 __STATIC_INLINE uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef *RTCx)
3197 return (READ_BIT(RTCx->CALR, RTC_CALR_CALP) == (RTC_CALR_CALP));
3201 * @brief Set the calibration cycle period
3202 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3203 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3204 * @rmtoll CALR CALW8 LL_RTC_CAL_SetPeriod\n
3205 * CALR CALW16 LL_RTC_CAL_SetPeriod
3206 * @param RTCx RTC Instance
3207 * @param Period This parameter can be one of the following values:
3208 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3209 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3210 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3211 * @retval None
3213 __STATIC_INLINE void LL_RTC_CAL_SetPeriod(RTC_TypeDef *RTCx, uint32_t Period)
3215 MODIFY_REG(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16, Period);
3219 * @brief Get the calibration cycle period
3220 * @rmtoll CALR CALW8 LL_RTC_CAL_GetPeriod\n
3221 * CALR CALW16 LL_RTC_CAL_GetPeriod
3222 * @param RTCx RTC Instance
3223 * @retval Returned value can be one of the following values:
3224 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
3225 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
3226 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
3228 __STATIC_INLINE uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef *RTCx)
3230 return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16));
3234 * @brief Set Calibration minus
3235 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3236 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
3237 * @rmtoll CALR CALM LL_RTC_CAL_SetMinus
3238 * @param RTCx RTC Instance
3239 * @param CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF
3240 * @retval None
3242 __STATIC_INLINE void LL_RTC_CAL_SetMinus(RTC_TypeDef *RTCx, uint32_t CalibMinus)
3244 MODIFY_REG(RTCx->CALR, RTC_CALR_CALM, CalibMinus);
3248 * @brief Get Calibration minus
3249 * @rmtoll CALR CALM LL_RTC_CAL_GetMinus
3250 * @param RTCx RTC Instance
3251 * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF
3253 __STATIC_INLINE uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef *RTCx)
3255 return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALM));
3259 * @}
3262 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
3263 * @{
3267 * @brief Get Recalibration pending Flag
3268 * @rmtoll ISR RECALPF LL_RTC_IsActiveFlag_RECALP
3269 * @param RTCx RTC Instance
3270 * @retval State of bit (1 or 0).
3272 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef *RTCx)
3274 return (READ_BIT(RTCx->ISR, RTC_ISR_RECALPF) == (RTC_ISR_RECALPF));
3277 #if defined(RTC_TAMPER3_SUPPORT)
3279 * @brief Get RTC_TAMP3 detection flag
3280 * @rmtoll ISR TAMP3F LL_RTC_IsActiveFlag_TAMP3
3281 * @param RTCx RTC Instance
3282 * @retval State of bit (1 or 0).
3284 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef *RTCx)
3286 return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP3F) == (RTC_ISR_TAMP3F));
3288 #endif /* RTC_TAMPER3_SUPPORT */
3290 #if defined(RTC_TAMPER2_SUPPORT)
3292 * @brief Get RTC_TAMP2 detection flag
3293 * @rmtoll ISR TAMP2F LL_RTC_IsActiveFlag_TAMP2
3294 * @param RTCx RTC Instance
3295 * @retval State of bit (1 or 0).
3297 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef *RTCx)
3299 return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP2F) == (RTC_ISR_TAMP2F));
3301 #endif /* RTC_TAMPER2_SUPPORT */
3303 #if defined(RTC_TAMPER1_SUPPORT)
3305 * @brief Get RTC_TAMP1 detection flag
3306 * @rmtoll ISR TAMP1F LL_RTC_IsActiveFlag_TAMP1
3307 * @param RTCx RTC Instance
3308 * @retval State of bit (1 or 0).
3310 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef *RTCx)
3312 return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP1F) == (RTC_ISR_TAMP1F));
3314 #endif /* RTC_TAMPER1_SUPPORT */
3317 * @brief Get Time-stamp overflow flag
3318 * @rmtoll ISR TSOVF LL_RTC_IsActiveFlag_TSOV
3319 * @param RTCx RTC Instance
3320 * @retval State of bit (1 or 0).
3322 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef *RTCx)
3324 return (READ_BIT(RTCx->ISR, RTC_ISR_TSOVF) == (RTC_ISR_TSOVF));
3328 * @brief Get Time-stamp flag
3329 * @rmtoll ISR TSF LL_RTC_IsActiveFlag_TS
3330 * @param RTCx RTC Instance
3331 * @retval State of bit (1 or 0).
3333 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef *RTCx)
3335 return (READ_BIT(RTCx->ISR, RTC_ISR_TSF) == (RTC_ISR_TSF));
3338 #if defined(RTC_WAKEUP_SUPPORT)
3340 * @brief Get Wakeup timer flag
3341 * @rmtoll ISR WUTF LL_RTC_IsActiveFlag_WUT
3342 * @param RTCx RTC Instance
3343 * @retval State of bit (1 or 0).
3345 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef *RTCx)
3347 return (READ_BIT(RTCx->ISR, RTC_ISR_WUTF) == (RTC_ISR_WUTF));
3349 #endif /* RTC_WAKEUP_SUPPORT */
3352 * @brief Get Alarm B flag
3353 * @rmtoll ISR ALRBF LL_RTC_IsActiveFlag_ALRB
3354 * @param RTCx RTC Instance
3355 * @retval State of bit (1 or 0).
3357 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef *RTCx)
3359 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBF) == (RTC_ISR_ALRBF));
3363 * @brief Get Alarm A flag
3364 * @rmtoll ISR ALRAF LL_RTC_IsActiveFlag_ALRA
3365 * @param RTCx RTC Instance
3366 * @retval State of bit (1 or 0).
3368 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef *RTCx)
3370 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAF) == (RTC_ISR_ALRAF));
3373 #if defined(RTC_TAMPER3_SUPPORT)
3375 * @brief Clear RTC_TAMP3 detection flag
3376 * @rmtoll ISR TAMP3F LL_RTC_ClearFlag_TAMP3
3377 * @param RTCx RTC Instance
3378 * @retval None
3380 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef *RTCx)
3382 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP3F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3384 #endif /* RTC_TAMPER3_SUPPORT */
3386 #if defined(RTC_TAMPER2_SUPPORT)
3388 * @brief Clear RTC_TAMP2 detection flag
3389 * @rmtoll ISR TAMP2F LL_RTC_ClearFlag_TAMP2
3390 * @param RTCx RTC Instance
3391 * @retval None
3393 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef *RTCx)
3395 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP2F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3397 #endif /* RTC_TAMPER2_SUPPORT */
3399 #if defined(RTC_TAMPER1_SUPPORT)
3401 * @brief Clear RTC_TAMP1 detection flag
3402 * @rmtoll ISR TAMP1F LL_RTC_ClearFlag_TAMP1
3403 * @param RTCx RTC Instance
3404 * @retval None
3406 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef *RTCx)
3408 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP1F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3410 #endif /* RTC_TAMPER1_SUPPORT */
3413 * @brief Clear Time-stamp overflow flag
3414 * @rmtoll ISR TSOVF LL_RTC_ClearFlag_TSOV
3415 * @param RTCx RTC Instance
3416 * @retval None
3418 __STATIC_INLINE void LL_RTC_ClearFlag_TSOV(RTC_TypeDef *RTCx)
3420 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSOVF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3424 * @brief Clear Time-stamp flag
3425 * @rmtoll ISR TSF LL_RTC_ClearFlag_TS
3426 * @param RTCx RTC Instance
3427 * @retval None
3429 __STATIC_INLINE void LL_RTC_ClearFlag_TS(RTC_TypeDef *RTCx)
3431 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3434 #if defined(RTC_WAKEUP_SUPPORT)
3436 * @brief Clear Wakeup timer flag
3437 * @rmtoll ISR WUTF LL_RTC_ClearFlag_WUT
3438 * @param RTCx RTC Instance
3439 * @retval None
3441 __STATIC_INLINE void LL_RTC_ClearFlag_WUT(RTC_TypeDef *RTCx)
3443 WRITE_REG(RTCx->ISR, (~((RTC_ISR_WUTF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3445 #endif /* RTC_WAKEUP_SUPPORT */
3448 * @brief Clear Alarm B flag
3449 * @rmtoll ISR ALRBF LL_RTC_ClearFlag_ALRB
3450 * @param RTCx RTC Instance
3451 * @retval None
3453 __STATIC_INLINE void LL_RTC_ClearFlag_ALRB(RTC_TypeDef *RTCx)
3455 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRBF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3459 * @brief Clear Alarm A flag
3460 * @rmtoll ISR ALRAF LL_RTC_ClearFlag_ALRA
3461 * @param RTCx RTC Instance
3462 * @retval None
3464 __STATIC_INLINE void LL_RTC_ClearFlag_ALRA(RTC_TypeDef *RTCx)
3466 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRAF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3470 * @brief Get Initialization flag
3471 * @rmtoll ISR INITF LL_RTC_IsActiveFlag_INIT
3472 * @param RTCx RTC Instance
3473 * @retval State of bit (1 or 0).
3475 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx)
3477 return (READ_BIT(RTCx->ISR, RTC_ISR_INITF) == (RTC_ISR_INITF));
3481 * @brief Get Registers synchronization flag
3482 * @rmtoll ISR RSF LL_RTC_IsActiveFlag_RS
3483 * @param RTCx RTC Instance
3484 * @retval State of bit (1 or 0).
3486 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx)
3488 return (READ_BIT(RTCx->ISR, RTC_ISR_RSF) == (RTC_ISR_RSF));
3492 * @brief Clear Registers synchronization flag
3493 * @rmtoll ISR RSF LL_RTC_ClearFlag_RS
3494 * @param RTCx RTC Instance
3495 * @retval None
3497 __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx)
3499 WRITE_REG(RTCx->ISR, (~((RTC_ISR_RSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
3503 * @brief Get Initialization status flag
3504 * @rmtoll ISR INITS LL_RTC_IsActiveFlag_INITS
3505 * @param RTCx RTC Instance
3506 * @retval State of bit (1 or 0).
3508 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef *RTCx)
3510 return (READ_BIT(RTCx->ISR, RTC_ISR_INITS) == (RTC_ISR_INITS));
3514 * @brief Get Shift operation pending flag
3515 * @rmtoll ISR SHPF LL_RTC_IsActiveFlag_SHP
3516 * @param RTCx RTC Instance
3517 * @retval State of bit (1 or 0).
3519 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef *RTCx)
3521 return (READ_BIT(RTCx->ISR, RTC_ISR_SHPF) == (RTC_ISR_SHPF));
3524 #if defined(RTC_WAKEUP_SUPPORT)
3526 * @brief Get Wakeup timer write flag
3527 * @rmtoll ISR WUTWF LL_RTC_IsActiveFlag_WUTW
3528 * @param RTCx RTC Instance
3529 * @retval State of bit (1 or 0).
3531 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef *RTCx)
3533 return (READ_BIT(RTCx->ISR, RTC_ISR_WUTWF) == (RTC_ISR_WUTWF));
3535 #endif /* RTC_WAKEUP_SUPPORT */
3538 * @brief Get Alarm B write flag
3539 * @rmtoll ISR ALRBWF LL_RTC_IsActiveFlag_ALRBW
3540 * @param RTCx RTC Instance
3541 * @retval State of bit (1 or 0).
3543 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef *RTCx)
3545 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBWF) == (RTC_ISR_ALRBWF));
3549 * @brief Get Alarm A write flag
3550 * @rmtoll ISR ALRAWF LL_RTC_IsActiveFlag_ALRAW
3551 * @param RTCx RTC Instance
3552 * @retval State of bit (1 or 0).
3554 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef *RTCx)
3556 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAWF) == (RTC_ISR_ALRAWF));
3560 * @}
3563 /** @defgroup RTC_LL_EF_IT_Management IT_Management
3564 * @{
3568 * @brief Enable Time-stamp interrupt
3569 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3570 * @rmtoll CR TSIE LL_RTC_EnableIT_TS
3571 * @param RTCx RTC Instance
3572 * @retval None
3574 __STATIC_INLINE void LL_RTC_EnableIT_TS(RTC_TypeDef *RTCx)
3576 SET_BIT(RTCx->CR, RTC_CR_TSIE);
3580 * @brief Disable Time-stamp interrupt
3581 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3582 * @rmtoll CR TSIE LL_RTC_DisableIT_TS
3583 * @param RTCx RTC Instance
3584 * @retval None
3586 __STATIC_INLINE void LL_RTC_DisableIT_TS(RTC_TypeDef *RTCx)
3588 CLEAR_BIT(RTCx->CR, RTC_CR_TSIE);
3591 #if defined(RTC_WAKEUP_SUPPORT)
3593 * @brief Enable Wakeup timer interrupt
3594 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3595 * @rmtoll CR WUTIE LL_RTC_EnableIT_WUT
3596 * @param RTCx RTC Instance
3597 * @retval None
3599 __STATIC_INLINE void LL_RTC_EnableIT_WUT(RTC_TypeDef *RTCx)
3601 SET_BIT(RTCx->CR, RTC_CR_WUTIE);
3605 * @brief Disable Wakeup timer interrupt
3606 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3607 * @rmtoll CR WUTIE LL_RTC_DisableIT_WUT
3608 * @param RTCx RTC Instance
3609 * @retval None
3611 __STATIC_INLINE void LL_RTC_DisableIT_WUT(RTC_TypeDef *RTCx)
3613 CLEAR_BIT(RTCx->CR, RTC_CR_WUTIE);
3615 #endif /* RTC_WAKEUP_SUPPORT */
3618 * @brief Enable Alarm B interrupt
3619 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3620 * @rmtoll CR ALRBIE LL_RTC_EnableIT_ALRB
3621 * @param RTCx RTC Instance
3622 * @retval None
3624 __STATIC_INLINE void LL_RTC_EnableIT_ALRB(RTC_TypeDef *RTCx)
3626 SET_BIT(RTCx->CR, RTC_CR_ALRBIE);
3630 * @brief Disable Alarm B interrupt
3631 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3632 * @rmtoll CR ALRBIE LL_RTC_DisableIT_ALRB
3633 * @param RTCx RTC Instance
3634 * @retval None
3636 __STATIC_INLINE void LL_RTC_DisableIT_ALRB(RTC_TypeDef *RTCx)
3638 CLEAR_BIT(RTCx->CR, RTC_CR_ALRBIE);
3642 * @brief Enable Alarm A interrupt
3643 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3644 * @rmtoll CR ALRAIE LL_RTC_EnableIT_ALRA
3645 * @param RTCx RTC Instance
3646 * @retval None
3648 __STATIC_INLINE void LL_RTC_EnableIT_ALRA(RTC_TypeDef *RTCx)
3650 SET_BIT(RTCx->CR, RTC_CR_ALRAIE);
3654 * @brief Disable Alarm A interrupt
3655 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
3656 * @rmtoll CR ALRAIE LL_RTC_DisableIT_ALRA
3657 * @param RTCx RTC Instance
3658 * @retval None
3660 __STATIC_INLINE void LL_RTC_DisableIT_ALRA(RTC_TypeDef *RTCx)
3662 CLEAR_BIT(RTCx->CR, RTC_CR_ALRAIE);
3666 * @brief Enable all Tamper Interrupt
3667 * @rmtoll TAFCR TAMPIE LL_RTC_EnableIT_TAMP
3668 * @param RTCx RTC Instance
3669 * @retval None
3671 __STATIC_INLINE void LL_RTC_EnableIT_TAMP(RTC_TypeDef *RTCx)
3673 SET_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPIE);
3677 * @brief Disable all Tamper Interrupt
3678 * @rmtoll TAFCR TAMPIE LL_RTC_DisableIT_TAMP
3679 * @param RTCx RTC Instance
3680 * @retval None
3682 __STATIC_INLINE void LL_RTC_DisableIT_TAMP(RTC_TypeDef *RTCx)
3684 CLEAR_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPIE);
3688 * @brief Check if Time-stamp interrupt is enabled or not
3689 * @rmtoll CR TSIE LL_RTC_IsEnabledIT_TS
3690 * @param RTCx RTC Instance
3691 * @retval State of bit (1 or 0).
3693 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef *RTCx)
3695 return (READ_BIT(RTCx->CR, RTC_CR_TSIE) == (RTC_CR_TSIE));
3698 #if defined(RTC_WAKEUP_SUPPORT)
3700 * @brief Check if Wakeup timer interrupt is enabled or not
3701 * @rmtoll CR WUTIE LL_RTC_IsEnabledIT_WUT
3702 * @param RTCx RTC Instance
3703 * @retval State of bit (1 or 0).
3705 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef *RTCx)
3707 return (READ_BIT(RTCx->CR, RTC_CR_WUTIE) == (RTC_CR_WUTIE));
3709 #endif /* RTC_WAKEUP_SUPPORT */
3712 * @brief Check if Alarm B interrupt is enabled or not
3713 * @rmtoll CR ALRBIE LL_RTC_IsEnabledIT_ALRB
3714 * @param RTCx RTC Instance
3715 * @retval State of bit (1 or 0).
3717 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef *RTCx)
3719 return (READ_BIT(RTCx->CR, RTC_CR_ALRBIE) == (RTC_CR_ALRBIE));
3723 * @brief Check if Alarm A interrupt is enabled or not
3724 * @rmtoll CR ALRAIE LL_RTC_IsEnabledIT_ALRA
3725 * @param RTCx RTC Instance
3726 * @retval State of bit (1 or 0).
3728 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef *RTCx)
3730 return (READ_BIT(RTCx->CR, RTC_CR_ALRAIE) == (RTC_CR_ALRAIE));
3734 * @brief Check if all the TAMPER interrupts are enabled or not
3735 * @rmtoll TAFCR TAMPIE LL_RTC_IsEnabledIT_TAMP
3736 * @param RTCx RTC Instance
3737 * @retval State of bit (1 or 0).
3739 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef *RTCx)
3741 return (READ_BIT(RTCx->TAFCR,
3742 RTC_TAFCR_TAMPIE) == (RTC_TAFCR_TAMPIE));
3746 * @}
3749 #if defined(USE_FULL_LL_DRIVER)
3750 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
3751 * @{
3754 ErrorStatus LL_RTC_DeInit(RTC_TypeDef *RTCx);
3755 ErrorStatus LL_RTC_Init(RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct);
3756 void LL_RTC_StructInit(LL_RTC_InitTypeDef *RTC_InitStruct);
3757 ErrorStatus LL_RTC_TIME_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct);
3758 void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef *RTC_TimeStruct);
3759 ErrorStatus LL_RTC_DATE_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_DateTypeDef *RTC_DateStruct);
3760 void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef *RTC_DateStruct);
3761 ErrorStatus LL_RTC_ALMA_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
3762 ErrorStatus LL_RTC_ALMB_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
3763 void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
3764 void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
3765 ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx);
3766 ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx);
3767 ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx);
3770 * @}
3772 #endif /* USE_FULL_LL_DRIVER */
3775 * @}
3779 * @}
3782 #endif /* defined(RTC) */
3785 * @}
3788 #ifdef __cplusplus
3790 #endif
3792 #endif /* __STM32F3xx_LL_RTC_H */
3794 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/