STM32L486xx HAL User Manual
stm32l4xx_ll_rtc.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l4xx_ll_rtc.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of RTC LL module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
00010   *
00011   * Redistribution and use in source and binary forms, with or without modification,
00012   * are permitted provided that the following conditions are met:
00013   *   1. Redistributions of source code must retain the above copyright notice,
00014   *      this list of conditions and the following disclaimer.
00015   *   2. Redistributions in binary form must reproduce the above copyright notice,
00016   *      this list of conditions and the following disclaimer in the documentation
00017   *      and/or other materials provided with the distribution.
00018   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00019   *      may be used to endorse or promote products derived from this software
00020   *      without specific prior written permission.
00021   *
00022   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00023   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00025   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00026   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00028   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032   *
00033   ******************************************************************************
00034   */
00035 
00036 /* Define to prevent recursive inclusion -------------------------------------*/
00037 #ifndef __STM32L4xx_LL_RTC_H
00038 #define __STM32L4xx_LL_RTC_H
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 /* Includes ------------------------------------------------------------------*/
00045 #include "stm32l4xx.h"
00046 
00047 /** @addtogroup STM32L4xx_LL_Driver
00048   * @{
00049   */
00050 
00051 #if defined(RTC)
00052 
00053 /** @defgroup RTC_LL RTC
00054   * @{
00055   */
00056 
00057 /* Private types -------------------------------------------------------------*/
00058 /* Private variables ---------------------------------------------------------*/
00059 /* Private constants ---------------------------------------------------------*/
00060 /** @defgroup RTC_LL_Private_Constants RTC Private Constants
00061   * @{
00062   */
00063 /* Masks Definition */
00064 #define RTC_INIT_MASK                 0xFFFFFFFFU
00065 #define RTC_RSF_MASK                  0xFFFFFF5FU
00066 
00067 /* Write protection defines */
00068 #define RTC_WRITE_PROTECTION_DISABLE  ((uint8_t)0xFFU)
00069 #define RTC_WRITE_PROTECTION_ENABLE_1 ((uint8_t)0xCAU)
00070 #define RTC_WRITE_PROTECTION_ENABLE_2 ((uint8_t)0x53U)
00071 
00072 /* Defines used to combine date & time */
00073 #define RTC_OFFSET_WEEKDAY            24U
00074 #define RTC_OFFSET_DAY                16U
00075 #define RTC_OFFSET_MONTH              8U
00076 #define RTC_OFFSET_HOUR               16U
00077 #define RTC_OFFSET_MINUTE             8U
00078 
00079 /**
00080   * @}
00081   */
00082 
00083 /* Private macros ------------------------------------------------------------*/
00084 #if defined(USE_FULL_LL_DRIVER)
00085 /** @defgroup RTC_LL_Private_Macros RTC Private Macros
00086   * @{
00087   */
00088 /**
00089   * @}
00090   */
00091 #endif /*USE_FULL_LL_DRIVER*/
00092 
00093 /* Exported types ------------------------------------------------------------*/
00094 #if defined(USE_FULL_LL_DRIVER)
00095 /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure
00096   * @{
00097   */
00098 
00099 /**
00100   * @brief  RTC Init structures definition
00101   */
00102 typedef struct
00103 {
00104   uint32_t HourFormat;   /*!< Specifies the RTC Hours Format.
00105                               This parameter can be a value of @ref RTC_LL_EC_HOURFORMAT
00106                               
00107                               This feature can be modified afterwards using unitary function
00108                               @ref LL_RTC_SetHourFormat(). */
00109 
00110   uint32_t AsynchPrescaler; /*!< Specifies the RTC Asynchronous Predivider value.
00111                               This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F
00112                               
00113                               This feature can be modified afterwards using unitary function
00114                               @ref LL_RTC_SetAsynchPrescaler(). */
00115 
00116   uint32_t SynchPrescaler;  /*!< Specifies the RTC Synchronous Predivider value.
00117                               This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF
00118                               
00119                               This feature can be modified afterwards using unitary function
00120                               @ref LL_RTC_SetSynchPrescaler(). */
00121 } LL_RTC_InitTypeDef;
00122 
00123 /**
00124   * @brief  RTC Time structure definition
00125   */
00126 typedef struct
00127 {
00128   uint32_t TimeFormat; /*!< Specifies the RTC AM/PM Time.
00129                             This parameter can be a value of @ref RTC_LL_EC_TIME_FORMAT
00130 
00131                             This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetFormat(). */
00132 
00133   uint8_t Hours;       /*!< Specifies the RTC Time Hours.
00134                             This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the @ref LL_RTC_TIME_FORMAT_PM is selected.
00135                             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.
00136 
00137                             This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetHour(). */
00138 
00139   uint8_t Minutes;     /*!< Specifies the RTC Time Minutes.
00140                             This parameter must be a number between Min_Data = 0 and Max_Data = 59
00141 
00142                             This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetMinute(). */
00143 
00144   uint8_t Seconds;     /*!< Specifies the RTC Time Seconds.
00145                             This parameter must be a number between Min_Data = 0 and Max_Data = 59
00146 
00147                             This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetSecond(). */
00148 } LL_RTC_TimeTypeDef;
00149 
00150 /**
00151   * @brief  RTC Date structure definition
00152   */
00153 typedef struct
00154 {
00155   uint8_t WeekDay;  /*!< Specifies the RTC Date WeekDay.
00156                          This parameter can be a value of @ref RTC_LL_EC_WEEKDAY
00157 
00158                          This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetWeekDay(). */
00159 
00160   uint8_t Month;    /*!< Specifies the RTC Date Month.
00161                          This parameter can be a value of @ref RTC_LL_EC_MONTH
00162 
00163                          This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetMonth(). */
00164 
00165   uint8_t Day;      /*!< Specifies the RTC Date Day.
00166                          This parameter must be a number between Min_Data = 1 and Max_Data = 31
00167 
00168                          This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetDay(). */
00169 
00170   uint8_t Year;     /*!< Specifies the RTC Date Year.
00171                          This parameter must be a number between Min_Data = 0 and Max_Data = 99
00172 
00173                          This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetYear(). */
00174 } LL_RTC_DateTypeDef;
00175 
00176 /**
00177   * @brief  RTC Alarm structure definition
00178   */
00179 typedef struct
00180 {
00181   LL_RTC_TimeTypeDef AlarmTime;  /*!< Specifies the RTC Alarm Time members. */
00182 
00183   uint32_t AlarmMask;            /*!< Specifies the RTC Alarm Masks.
00184                                       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.
00185 
00186                                       This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetMask() for ALARM A 
00187                                       or @ref LL_RTC_ALMB_SetMask() for ALARM B
00188                                  */
00189 
00190   uint32_t AlarmDateWeekDaySel;  /*!< Specifies the RTC Alarm is on day or WeekDay.
00191                                       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
00192 
00193                                       This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_EnableWeekday() or @ref LL_RTC_ALMA_DisableWeekday()
00194                                       for ALARM A or @ref LL_RTC_ALMB_EnableWeekday() or @ref LL_RTC_ALMB_DisableWeekday() for ALARM B
00195                                  */
00196 
00197   uint8_t AlarmDateWeekDay;      /*!< Specifies the RTC Alarm Day/WeekDay.
00198                                       If AlarmDateWeekDaySel set to day, this parameter  must be a number between Min_Data = 1 and Max_Data = 31.
00199 
00200                                       This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetDay()
00201                                       for ALARM A or @ref LL_RTC_ALMB_SetDay() for ALARM B.
00202 
00203                                       If AlarmDateWeekDaySel set to Weekday, this parameter can be a value of @ref RTC_LL_EC_WEEKDAY.
00204 
00205                                       This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetWeekDay()
00206                                       for ALARM A or @ref LL_RTC_ALMB_SetWeekDay() for ALARM B.
00207                                  */
00208 } LL_RTC_AlarmTypeDef;
00209 
00210 /**
00211   * @}
00212   */
00213 #endif /* USE_FULL_LL_DRIVER */
00214 
00215 /* Exported constants --------------------------------------------------------*/
00216 /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants
00217   * @{
00218   */
00219 
00220 #if defined(USE_FULL_LL_DRIVER)
00221 /** @defgroup RTC_LL_EC_FORMAT FORMAT
00222   * @{
00223   */
00224 #define LL_RTC_FORMAT_BIN                  0x00000000U /*!< Binary data format */
00225 #define LL_RTC_FORMAT_BCD                  0x00000001U /*!< BCD data format */
00226 /**
00227   * @}
00228   */
00229 
00230 /** @defgroup RTC_LL_EC_ALMA_WEEKDAY_SELECTION RTC Alarm A Date WeekDay
00231   * @{
00232   */
00233 #define LL_RTC_ALMA_DATEWEEKDAYSEL_DATE    0x00000000U             /*!< Alarm A Date is selected */
00234 #define LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL        /*!< Alarm A WeekDay is selected */
00235 /**
00236   * @}
00237   */
00238 
00239 /** @defgroup RTC_LL_EC_ALMB_WEEKDAY_SELECTION RTC Alarm B Date WeekDay
00240   * @{
00241   */
00242 #define LL_RTC_ALMB_DATEWEEKDAYSEL_DATE    0x00000000U             /*!< Alarm B Date is selected */
00243 #define LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMBR_WDSEL        /*!< Alarm B WeekDay is selected */
00244 /**
00245   * @}
00246   */
00247 
00248 #endif /* USE_FULL_LL_DRIVER */
00249 
00250 /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines
00251   * @brief    Flags defines which can be used with LL_RTC_ReadReg function
00252   * @{
00253   */
00254 #define LL_RTC_ISR_ITSF                    RTC_ISR_ITSF
00255 #define LL_RTC_ISR_RECALPF                 RTC_ISR_RECALPF
00256 #define LL_RTC_ISR_TAMP3F                  RTC_ISR_TAMP3F
00257 #define LL_RTC_ISR_TAMP2F                  RTC_ISR_TAMP2F
00258 #define LL_RTC_ISR_TAMP1F                  RTC_ISR_TAMP1F
00259 #define LL_RTC_ISR_TSOVF                   RTC_ISR_TSOVF
00260 #define LL_RTC_ISR_TSF                     RTC_ISR_TSF
00261 #define LL_RTC_ISR_WUTF                    RTC_ISR_WUTF
00262 #define LL_RTC_ISR_ALRBF                   RTC_ISR_ALRBF
00263 #define LL_RTC_ISR_ALRAF                   RTC_ISR_ALRAF
00264 #define LL_RTC_ISR_INITF                   RTC_ISR_INITF
00265 #define LL_RTC_ISR_RSF                     RTC_ISR_RSF
00266 #define LL_RTC_ISR_INITS                   RTC_ISR_INITS
00267 #define LL_RTC_ISR_SHPF                    RTC_ISR_SHPF
00268 #define LL_RTC_ISR_WUTWF                   RTC_ISR_WUTWF
00269 #define LL_RTC_ISR_ALRBWF                  RTC_ISR_ALRBWF
00270 #define LL_RTC_ISR_ALRAWF                  RTC_ISR_ALRAWF
00271 /**
00272   * @}
00273   */
00274 
00275 /** @defgroup RTC_LL_EC_IT IT Defines
00276   * @brief    IT defines which can be used with LL_RTC_ReadReg and  LL_RTC_WriteReg functions
00277   * @{
00278   */
00279 #define LL_RTC_CR_TSIE                     RTC_CR_TSIE
00280 #define LL_RTC_CR_WUTIE                    RTC_CR_WUTIE
00281 #define LL_RTC_CR_ALRBIE                   RTC_CR_ALRBIE
00282 #define LL_RTC_CR_ALRAIE                   RTC_CR_ALRAIE
00283 #define LL_RTC_TAMPCR_TAMP3IE              RTC_TAMPCR_TAMP3IE
00284 #define LL_RTC_TAMPCR_TAMP2IE              RTC_TAMPCR_TAMP2IE
00285 #define LL_RTC_TAMPCR_TAMP1IE              RTC_TAMPCR_TAMP1IE
00286 #define LL_RTC_TAMPCR_TAMPIE               RTC_TAMPCR_TAMPIE
00287 /**
00288   * @}
00289   */
00290 
00291 /** @defgroup RTC_LL_EC_WEEKDAY  WEEK DAY
00292   * @{
00293   */
00294 #define LL_RTC_WEEKDAY_MONDAY              ((uint8_t)0x01U) /*!< Monday    */
00295 #define LL_RTC_WEEKDAY_TUESDAY             ((uint8_t)0x02U) /*!< Tuesday   */
00296 #define LL_RTC_WEEKDAY_WEDNESDAY           ((uint8_t)0x03U) /*!< Wednesday */
00297 #define LL_RTC_WEEKDAY_THURSDAY            ((uint8_t)0x04U) /*!< Thrusday  */
00298 #define LL_RTC_WEEKDAY_FRIDAY              ((uint8_t)0x05U) /*!< Friday    */
00299 #define LL_RTC_WEEKDAY_SATURDAY            ((uint8_t)0x06U) /*!< Saturday  */
00300 #define LL_RTC_WEEKDAY_SUNDAY              ((uint8_t)0x07U) /*!< Sunday    */
00301 /**
00302   * @}
00303   */
00304 
00305 /** @defgroup RTC_LL_EC_MONTH  MONTH
00306   * @{
00307   */
00308 #define LL_RTC_MONTH_JANUARY               ((uint8_t)0x01U)  /*!< January   */
00309 #define LL_RTC_MONTH_FEBRUARY              ((uint8_t)0x02U)  /*!< February  */
00310 #define LL_RTC_MONTH_MARCH                 ((uint8_t)0x03U)  /*!< March     */
00311 #define LL_RTC_MONTH_APRIL                 ((uint8_t)0x04U)  /*!< April     */
00312 #define LL_RTC_MONTH_MAY                   ((uint8_t)0x05U)  /*!< May       */
00313 #define LL_RTC_MONTH_JUNE                  ((uint8_t)0x06U)  /*!< June      */
00314 #define LL_RTC_MONTH_JULY                  ((uint8_t)0x07U)  /*!< July      */
00315 #define LL_RTC_MONTH_AUGUST                ((uint8_t)0x08U)  /*!< August    */
00316 #define LL_RTC_MONTH_SEPTEMBER             ((uint8_t)0x09U)  /*!< September */
00317 #define LL_RTC_MONTH_OCTOBER               ((uint8_t)0x10U)  /*!< October   */
00318 #define LL_RTC_MONTH_NOVEMBER              ((uint8_t)0x11U)  /*!< November  */
00319 #define LL_RTC_MONTH_DECEMBER              ((uint8_t)0x12U)  /*!< December  */
00320 /**
00321   * @}
00322   */
00323 
00324 /** @defgroup RTC_LL_EC_HOURFORMAT  HOUR FORMAT
00325   * @{
00326   */
00327 #define LL_RTC_HOURFORMAT_24HOUR           0x00000000U           /*!< 24 hour/day format */
00328 #define LL_RTC_HOURFORMAT_AMPM             RTC_CR_FMT            /*!< AM/PM hour format */
00329 /**
00330   * @}
00331   */
00332 
00333 /** @defgroup RTC_LL_EC_ALARMOUT  ALARM OUTPUT
00334   * @{
00335   */
00336 #define LL_RTC_ALARMOUT_DISABLE            0x00000000U             /*!< Output disabled */
00337 #define LL_RTC_ALARMOUT_ALMA               RTC_CR_OSEL_0           /*!< Alarm A output enabled */
00338 #define LL_RTC_ALARMOUT_ALMB               RTC_CR_OSEL_1           /*!< Alarm B output enabled */
00339 #define LL_RTC_ALARMOUT_WAKEUP             RTC_CR_OSEL             /*!< Wakeup output enabled */
00340 /**
00341   * @}
00342   */
00343 
00344 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE  ALARM OUTPUT TYPE
00345   * @{
00346   */
00347 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN  0x00000000U                          /*!< RTC_ALARM, when mapped on PC13, is open-drain output */
00348 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL   RTC_OR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */
00349 /**
00350   * @}
00351   */
00352 
00353 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN  OUTPUT POLARITY PIN
00354   * @{
00355   */
00356 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH     0x00000000U           /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/
00357 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW      RTC_CR_POL            /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */
00358 /**
00359   * @}
00360   */
00361 
00362 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT
00363   * @{
00364   */
00365 #define LL_RTC_TIME_FORMAT_AM_OR_24        0x00000000U           /*!< AM or 24-hour format */
00366 #define LL_RTC_TIME_FORMAT_PM              RTC_TR_PM             /*!< PM */
00367 /**
00368   * @}
00369   */
00370 
00371 /** @defgroup RTC_LL_EC_SHIFT_SECOND  SHIFT SECOND
00372   * @{
00373   */
00374 #define LL_RTC_SHIFT_SECOND_DELAY          0x00000000U           /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */
00375 #define LL_RTC_SHIFT_SECOND_ADVANCE        RTC_SHIFTR_ADD1S      /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */
00376 /**
00377   * @}
00378   */
00379 
00380 /** @defgroup RTC_LL_EC_ALMA_MASK  ALARMA MASK
00381   * @{
00382   */
00383 #define LL_RTC_ALMA_MASK_NONE              0x00000000U             /*!< No masks applied on Alarm A*/
00384 #define LL_RTC_ALMA_MASK_DATEWEEKDAY       RTC_ALRMAR_MSK4         /*!< Date/day do not care in Alarm A comparison */
00385 #define LL_RTC_ALMA_MASK_HOURS             RTC_ALRMAR_MSK3         /*!< Hours do not care in Alarm A comparison */
00386 #define LL_RTC_ALMA_MASK_MINUTES           RTC_ALRMAR_MSK2         /*!< Minutes do not care in Alarm A comparison */
00387 #define LL_RTC_ALMA_MASK_SECONDS           RTC_ALRMAR_MSK1         /*!< Seconds do not care in Alarm A comparison */
00388 #define LL_RTC_ALMA_MASK_ALL               (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */
00389 /**
00390   * @}
00391   */
00392 
00393 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT  ALARMA TIME FORMAT
00394   * @{
00395   */
00396 #define LL_RTC_ALMA_TIME_FORMAT_AM         0x00000000U           /*!< AM or 24-hour format */
00397 #define LL_RTC_ALMA_TIME_FORMAT_PM         RTC_ALRMAR_PM         /*!< PM */
00398 /**
00399   * @}
00400   */
00401 
00402 /** @defgroup RTC_LL_EC_ALMB_MASK  ALARMB MASK
00403   * @{
00404   */
00405 #define LL_RTC_ALMB_MASK_NONE              0x00000000U             /*!< No masks applied on Alarm B*/
00406 #define LL_RTC_ALMB_MASK_DATEWEEKDAY       RTC_ALRMBR_MSK4         /*!< Date/day do not care in Alarm B comparison */
00407 #define LL_RTC_ALMB_MASK_HOURS             RTC_ALRMBR_MSK3         /*!< Hours do not care in Alarm B comparison */
00408 #define LL_RTC_ALMB_MASK_MINUTES           RTC_ALRMBR_MSK2         /*!< Minutes do not care in Alarm B comparison */
00409 #define LL_RTC_ALMB_MASK_SECONDS           RTC_ALRMBR_MSK1         /*!< Seconds do not care in Alarm B comparison */
00410 #define LL_RTC_ALMB_MASK_ALL               (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */
00411 /**
00412   * @}
00413   */
00414 
00415 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT  ALARMB TIME FORMAT
00416   * @{
00417   */
00418 #define LL_RTC_ALMB_TIME_FORMAT_AM         0x00000000U           /*!< AM or 24-hour format */
00419 #define LL_RTC_ALMB_TIME_FORMAT_PM         RTC_ALRMBR_PM         /*!< PM */
00420 /**
00421   * @}
00422   */
00423 
00424 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE  TIMESTAMP EDGE
00425   * @{
00426   */
00427 #define LL_RTC_TIMESTAMP_EDGE_RISING       0x00000000U           /*!< RTC_TS input rising edge generates a time-stamp event */
00428 #define LL_RTC_TIMESTAMP_EDGE_FALLING      RTC_CR_TSEDGE         /*!< RTC_TS input falling edge generates a time-stamp even */
00429 /**
00430   * @}
00431   */
00432 
00433 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT  TIMESTAMP TIME FORMAT
00434   * @{
00435   */
00436 #define LL_RTC_TS_TIME_FORMAT_AM           0x00000000U           /*!< AM or 24-hour format */
00437 #define LL_RTC_TS_TIME_FORMAT_PM           RTC_TSTR_PM           /*!< PM */
00438 /**
00439   * @}
00440   */
00441 
00442 /** @defgroup RTC_LL_EC_TAMPER  TAMPER
00443   * @{
00444   */
00445 #if defined(RTC_TAMPER1_SUPPORT)
00446 #define LL_RTC_TAMPER_1                    RTC_TAMPCR_TAMP1E /*!< RTC_TAMP1 input detection */
00447 #endif /* RTC_TAMPER1_SUPPORT */
00448 #if defined(RTC_TAMPER2_SUPPORT)
00449 #define LL_RTC_TAMPER_2                    RTC_TAMPCR_TAMP2E /*!< RTC_TAMP2 input detection */
00450 #endif /* RTC_TAMPER2_SUPPORT */
00451 #if defined(RTC_TAMPER3_SUPPORT)
00452 #define LL_RTC_TAMPER_3                    RTC_TAMPCR_TAMP3E /*!< RTC_TAMP3 input detection */
00453 #endif /* RTC_TAMPER3_SUPPORT */
00454 /**
00455   * @}
00456   */
00457 
00458 /** @defgroup RTC_LL_EC_TAMPER_MASK  TAMPER MASK
00459   * @{
00460   */
00461 #if defined(RTC_TAMPER1_SUPPORT)
00462 #define LL_RTC_TAMPER_MASK_TAMPER1         RTC_TAMPCR_TAMP1MF /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
00463 #endif /* RTC_TAMPER1_SUPPORT */
00464 #if defined(RTC_TAMPER2_SUPPORT)
00465 #define LL_RTC_TAMPER_MASK_TAMPER2         RTC_TAMPCR_TAMP2MF /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
00466 #endif /* RTC_TAMPER2_SUPPORT */
00467 #if defined(RTC_TAMPER3_SUPPORT)
00468 #define LL_RTC_TAMPER_MASK_TAMPER3         RTC_TAMPCR_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased */
00469 #endif /* RTC_TAMPER3_SUPPORT */
00470 /**
00471   * @}
00472   */
00473 
00474 /** @defgroup RTC_LL_EC_TAMPER_NOERASE  TAMPER NO ERASE
00475   * @{
00476   */
00477 #if defined(RTC_TAMPER1_SUPPORT)
00478 #define LL_RTC_TAMPER_NOERASE_TAMPER1      RTC_TAMPCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
00479 #endif /* RTC_TAMPER1_SUPPORT */
00480 #if defined(RTC_TAMPER2_SUPPORT)
00481 #define LL_RTC_TAMPER_NOERASE_TAMPER2      RTC_TAMPCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
00482 #endif /* RTC_TAMPER2_SUPPORT */
00483 #if defined(RTC_TAMPER3_SUPPORT)
00484 #define LL_RTC_TAMPER_NOERASE_TAMPER3      RTC_TAMPCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
00485 #endif /* RTC_TAMPER3_SUPPORT */
00486 /**
00487   * @}
00488   */
00489 
00490 #if defined(RTC_TAMPCR_TAMPPRCH)
00491 /** @defgroup RTC_LL_EC_TAMPER_DURATION  TAMPER DURATION
00492   * @{
00493   */
00494 #define LL_RTC_TAMPER_DURATION_1RTCCLK     0x00000000U                             /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle  */
00495 #define LL_RTC_TAMPER_DURATION_2RTCCLK     RTC_TAMPCR_TAMPPRCH_0  /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
00496 #define LL_RTC_TAMPER_DURATION_4RTCCLK     RTC_TAMPCR_TAMPPRCH_1  /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
00497 #define LL_RTC_TAMPER_DURATION_8RTCCLK     RTC_TAMPCR_TAMPPRCH    /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
00498 /**
00499   * @}
00500   */
00501 #endif /* RTC_TAMPCR_TAMPPRCH */
00502 
00503 #if defined(RTC_TAMPCR_TAMPFLT)
00504 /** @defgroup RTC_LL_EC_TAMPER_FILTER  TAMPER FILTER
00505   * @{
00506   */
00507 #define LL_RTC_TAMPER_FILTER_DISABLE       0x00000000U                              /*!< Tamper filter is disabled */
00508 #define LL_RTC_TAMPER_FILTER_2SAMPLE       RTC_TAMPCR_TAMPFLT_0    /*!< Tamper is activated after 2 consecutive samples at the active level */
00509 #define LL_RTC_TAMPER_FILTER_4SAMPLE       RTC_TAMPCR_TAMPFLT_1    /*!< Tamper is activated after 4 consecutive samples at the active level */
00510 #define LL_RTC_TAMPER_FILTER_8SAMPLE       RTC_TAMPCR_TAMPFLT      /*!< Tamper is activated after 8 consecutive samples at the active level. */
00511 /**
00512   * @}
00513   */
00514 #endif /* RTC_TAMPCR_TAMPFLT */
00515 
00516 #if defined(RTC_TAMPCR_TAMPFREQ)
00517 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV  TAMPER SAMPLING FREQUENCY DIVIDER
00518   * @{
00519   */
00520 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768   0x00000000U                                                      /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 32768 */
00521 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384   RTC_TAMPCR_TAMPFREQ_0                           /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 16384 */
00522 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192    RTC_TAMPCR_TAMPFREQ_1                           /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 8192 */
00523 #define LL_RTC_TAMPER_SAMPLFREQDIV_4096    (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 4096 */
00524 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048    RTC_TAMPCR_TAMPFREQ_2                           /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 2048 */
00525 #define LL_RTC_TAMPER_SAMPLFREQDIV_1024    (RTC_TAMPCR_TAMPFREQ_2 | RTC_TAMPCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 1024 */
00526 #define LL_RTC_TAMPER_SAMPLFREQDIV_512     (RTC_TAMPCR_TAMPFREQ_2 | RTC_TAMPCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 512 */
00527 #define LL_RTC_TAMPER_SAMPLFREQDIV_256     RTC_TAMPCR_TAMPFREQ                             /*!< Each of the tamper inputs are sampled with a frequency =  RTCCLK / 256 */
00528 /**
00529   * @}
00530   */
00531 #endif /* RTC_TAMPCR_TAMPFREQ */
00532 
00533 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL  TAMPER ACTIVE LEVEL
00534   * @{
00535   */
00536 #if defined(RTC_TAMPER1_SUPPORT)
00537 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1    RTC_TAMPCR_TAMP1TRG /*!< RTC_TAMP1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
00538 #endif /* RTC_TAMPER1_SUPPORT */
00539 #if defined(RTC_TAMPER2_SUPPORT)
00540 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2    RTC_TAMPCR_TAMP2TRG /*!< RTC_TAMP2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
00541 #endif /* RTC_TAMPER2_SUPPORT */
00542 #if defined(RTC_TAMPER3_SUPPORT)
00543 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3    RTC_TAMPCR_TAMP3TRG /*!< RTC_TAMP3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
00544 #endif /* RTC_TAMPER3_SUPPORT */
00545 /**
00546   * @}
00547   */
00548 
00549 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV  WAKEUP CLOCK DIV
00550   * @{
00551   */
00552 #define LL_RTC_WAKEUPCLOCK_DIV_16          0x00000000U                           /*!< RTC/16 clock is selected */
00553 #define LL_RTC_WAKEUPCLOCK_DIV_8           (RTC_CR_WUCKSEL_0)                    /*!< RTC/8 clock is selected */
00554 #define LL_RTC_WAKEUPCLOCK_DIV_4           (RTC_CR_WUCKSEL_1)                    /*!< RTC/4 clock is selected */
00555 #define LL_RTC_WAKEUPCLOCK_DIV_2           (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */
00556 #define LL_RTC_WAKEUPCLOCK_CKSPRE          (RTC_CR_WUCKSEL_2)                    /*!< ck_spre (usually 1 Hz) clock is selected */
00557 #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*/
00558 /**
00559   * @}
00560   */
00561 
00562 #if defined(RTC_BACKUP_SUPPORT)
00563 /** @defgroup RTC_LL_EC_BKP  BACKUP
00564   * @{
00565   */
00566 #define LL_RTC_BKP_DR0                     0x00000000U
00567 #define LL_RTC_BKP_DR1                     0x00000001U
00568 #define LL_RTC_BKP_DR2                     0x00000002U
00569 #define LL_RTC_BKP_DR3                     0x00000003U
00570 #define LL_RTC_BKP_DR4                     0x00000004U
00571 #if RTC_BKP_NUMBER > 5
00572 #define LL_RTC_BKP_DR5                     0x00000005U
00573 #define LL_RTC_BKP_DR6                     0x00000006U
00574 #define LL_RTC_BKP_DR7                     0x00000007U
00575 #define LL_RTC_BKP_DR8                     0x00000008U
00576 #define LL_RTC_BKP_DR9                     0x00000009U
00577 #define LL_RTC_BKP_DR10                    0x0000000AU
00578 #define LL_RTC_BKP_DR11                    0x0000000BU
00579 #define LL_RTC_BKP_DR12                    0x0000000CU
00580 #define LL_RTC_BKP_DR13                    0x0000000DU
00581 #define LL_RTC_BKP_DR14                    0x0000000EU
00582 #define LL_RTC_BKP_DR15                    0x0000000FU
00583 #endif /* RTC_BKP_NUMBER > 5 */
00584 
00585 #if RTC_BKP_NUMBER > 16
00586 #define LL_RTC_BKP_DR16                    0x00000010U
00587 #define LL_RTC_BKP_DR17                    0x00000011U
00588 #define LL_RTC_BKP_DR18                    0x00000012U
00589 #define LL_RTC_BKP_DR19                    0x00000013U
00590 #endif /* RTC_BKP_NUMBER > 16 */
00591 
00592 #if RTC_BKP_NUMBER > 20
00593 #define LL_RTC_BKP_DR20                    0x00000014U
00594 #define LL_RTC_BKP_DR21                    0x00000015U
00595 #define LL_RTC_BKP_DR22                    0x00000016U
00596 #define LL_RTC_BKP_DR23                    0x00000017U
00597 #define LL_RTC_BKP_DR24                    0x00000018U
00598 #define LL_RTC_BKP_DR25                    0x00000019U
00599 #define LL_RTC_BKP_DR26                    0x0000001AU
00600 #define LL_RTC_BKP_DR27                    0x0000001BU
00601 #define LL_RTC_BKP_DR28                    0x0000001CU
00602 #define LL_RTC_BKP_DR29                    0x0000001DU
00603 #define LL_RTC_BKP_DR30                    0x0000001EU
00604 #define LL_RTC_BKP_DR31                    0x0000001FU
00605 #endif /* RTC_BKP_NUMBER > 20 */
00606 /**
00607   * @}
00608   */
00609 #endif /* RTC_BACKUP_SUPPORT */
00610 
00611 /** @defgroup RTC_LL_EC_CALIB_OUTPUT  Calibration output
00612   * @{
00613   */
00614 #define LL_RTC_CALIB_OUTPUT_NONE           0x00000000U                 /*!< Calibration output disabled */
00615 #define LL_RTC_CALIB_OUTPUT_1HZ            (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */
00616 #define LL_RTC_CALIB_OUTPUT_512HZ          (RTC_CR_COE)                /*!< Calibration output is 512 Hz */
00617 /**
00618   * @}
00619   */
00620 
00621 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE  Calibration pulse insertion 
00622   * @{
00623   */
00624 #define LL_RTC_CALIB_INSERTPULSE_NONE      0x00000000U           /*!< No RTCCLK pulses are added */
00625 #define LL_RTC_CALIB_INSERTPULSE_SET       RTC_CALR_CALP         /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */
00626 /**
00627   * @}
00628   */
00629 
00630 /** @defgroup RTC_LL_EC_CALIB_PERIOD  Calibration period
00631   * @{
00632   */
00633 #define LL_RTC_CALIB_PERIOD_32SEC          0x00000000U           /*!< Use a 32-second calibration cycle period */
00634 #define LL_RTC_CALIB_PERIOD_16SEC          RTC_CALR_CALW16       /*!< Use a 16-second calibration cycle period */
00635 #define LL_RTC_CALIB_PERIOD_8SEC           RTC_CALR_CALW8        /*!< Use a 8-second calibration cycle period */
00636 /**
00637   * @}
00638   */
00639 
00640 /**
00641   * @}
00642   */
00643 
00644 /* Exported macro ------------------------------------------------------------*/
00645 /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros
00646   * @{
00647   */
00648 
00649 /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros
00650   * @{
00651   */
00652 
00653 /**
00654   * @brief  Write a value in RTC register
00655   * @param  __INSTANCE__ RTC Instance
00656   * @param  __REG__ Register to be written
00657   * @param  __VALUE__ Value to be written in the register
00658   * @retval None
00659   */
00660 #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
00661 
00662 /**
00663   * @brief  Read a value in RTC register
00664   * @param  __INSTANCE__ RTC Instance
00665   * @param  __REG__ Register to be read
00666   * @retval Register value
00667   */
00668 #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
00669 /**
00670   * @}
00671   */
00672 
00673 /** @defgroup RTC_LL_EM_Convert Convert helper Macros
00674   * @{
00675   */
00676 
00677 /**
00678   * @brief  Helper macro to convert a value from 2 digit decimal format to BCD format
00679   * @param  __VALUE__ Byte to be converted
00680   * @retval Converted byte
00681   */
00682 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
00683 
00684 /**
00685   * @brief  Helper macro to convert a value from BCD format to 2 digit decimal format
00686   * @param  __VALUE__ BCD value to be converted
00687   * @retval Converted byte
00688   */
00689 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U + ((__VALUE__) & (uint8_t)0x0FU))
00690 
00691 /**
00692   * @}
00693   */
00694 
00695 /** @defgroup RTC_LL_EM_Date Date helper Macros
00696   * @{
00697   */
00698 
00699 /**
00700   * @brief  Helper macro to retrieve weekday.
00701   * @param  __RTC_DATE__ Date returned by @ref  LL_RTC_DATE_Get function.
00702   * @retval Returned value can be one of the following values:
00703   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
00704   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
00705   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
00706   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
00707   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
00708   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
00709   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
00710   */
00711 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU)
00712 
00713 /**
00714   * @brief  Helper macro to retrieve Year in BCD format
00715   * @param  __RTC_DATE__ Value returned by @ref  LL_RTC_DATE_Get
00716   * @retval Year in BCD format (0x00 . . . 0x99)
00717   */
00718 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU)
00719 
00720 /**
00721   * @brief  Helper macro to retrieve Month in BCD format
00722   * @param  __RTC_DATE__ Value returned by @ref  LL_RTC_DATE_Get
00723   * @retval Returned value can be one of the following values:
00724   *         @arg @ref LL_RTC_MONTH_JANUARY
00725   *         @arg @ref LL_RTC_MONTH_FEBRUARY
00726   *         @arg @ref LL_RTC_MONTH_MARCH
00727   *         @arg @ref LL_RTC_MONTH_APRIL
00728   *         @arg @ref LL_RTC_MONTH_MAY
00729   *         @arg @ref LL_RTC_MONTH_JUNE
00730   *         @arg @ref LL_RTC_MONTH_JULY
00731   *         @arg @ref LL_RTC_MONTH_AUGUST
00732   *         @arg @ref LL_RTC_MONTH_SEPTEMBER
00733   *         @arg @ref LL_RTC_MONTH_OCTOBER
00734   *         @arg @ref LL_RTC_MONTH_NOVEMBER
00735   *         @arg @ref LL_RTC_MONTH_DECEMBER
00736   */
00737 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU)
00738 
00739 /**
00740   * @brief  Helper macro to retrieve Day in BCD format
00741   * @param  __RTC_DATE__ Value returned by @ref  LL_RTC_DATE_Get
00742   * @retval Day in BCD format (0x01 . . . 0x31)
00743   */
00744 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU)
00745 
00746 /**
00747   * @}
00748   */
00749 
00750 /** @defgroup RTC_LL_EM_Time Time helper Macros
00751   * @{
00752   */
00753 
00754 /**
00755   * @brief  Helper macro to retrieve hour in BCD format
00756   * @param  __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
00757   * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23)
00758   */
00759 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU)
00760 
00761 /**
00762   * @brief  Helper macro to retrieve minute in BCD format
00763   * @param  __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
00764   * @retval Minutes in BCD format (0x00. . .0x59)
00765   */
00766 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU)
00767 
00768 /**
00769   * @brief  Helper macro to retrieve second in BCD format
00770   * @param  __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
00771   * @retval Seconds in  format (0x00. . .0x59)
00772   */
00773 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU)
00774 
00775 /**
00776   * @}
00777   */
00778 
00779 /**
00780   * @}
00781   */
00782 
00783 /* Exported functions --------------------------------------------------------*/
00784 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
00785   * @{
00786   */
00787 
00788 /** @defgroup RTC_LL_EF_Configuration Configuration
00789   * @{
00790   */
00791 
00792 /**
00793   * @brief  Set Hours format (24 hour/day or AM/PM hour format)
00794   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
00795   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
00796   * @rmtoll CR           FMT           LL_RTC_SetHourFormat
00797   * @param  RTCx RTC Instance
00798   * @param  HourFormat This parameter can be one of the following values:
00799   *         @arg @ref LL_RTC_HOURFORMAT_24HOUR
00800   *         @arg @ref LL_RTC_HOURFORMAT_AMPM
00801   * @retval None
00802   */
00803 __STATIC_INLINE void LL_RTC_SetHourFormat(RTC_TypeDef *RTCx, uint32_t HourFormat)
00804 {
00805   MODIFY_REG(RTCx->CR, RTC_CR_FMT, HourFormat);
00806 }
00807 
00808 /**
00809   * @brief  Get Hours format (24 hour/day or AM/PM hour format)
00810   * @rmtoll CR           FMT           LL_RTC_GetHourFormat
00811   * @param  RTCx RTC Instance
00812   * @retval Returned value can be one of the following values:
00813   *         @arg @ref LL_RTC_HOURFORMAT_24HOUR
00814   *         @arg @ref LL_RTC_HOURFORMAT_AMPM
00815   */
00816 __STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx)
00817 {
00818   return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_FMT));
00819 }
00820 
00821 /**
00822   * @brief  Select the flag to be routed to RTC_ALARM output
00823   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
00824   * @rmtoll CR           OSEL          LL_RTC_SetAlarmOutEvent
00825   * @param  RTCx RTC Instance
00826   * @param  AlarmOutput This parameter can be one of the following values:
00827   *         @arg @ref LL_RTC_ALARMOUT_DISABLE
00828   *         @arg @ref LL_RTC_ALARMOUT_ALMA
00829   *         @arg @ref LL_RTC_ALARMOUT_ALMB
00830   *         @arg @ref LL_RTC_ALARMOUT_WAKEUP
00831   * @retval None
00832   */
00833 __STATIC_INLINE void LL_RTC_SetAlarmOutEvent(RTC_TypeDef *RTCx, uint32_t AlarmOutput)
00834 {
00835   MODIFY_REG(RTCx->CR, RTC_CR_OSEL, AlarmOutput);
00836 }
00837 
00838 /**
00839   * @brief  Get the flag to be routed to RTC_ALARM output
00840   * @rmtoll CR           OSEL          LL_RTC_GetAlarmOutEvent
00841   * @param  RTCx RTC Instance
00842   * @retval Returned value can be one of the following values:
00843   *         @arg @ref LL_RTC_ALARMOUT_DISABLE
00844   *         @arg @ref LL_RTC_ALARMOUT_ALMA
00845   *         @arg @ref LL_RTC_ALARMOUT_ALMB
00846   *         @arg @ref LL_RTC_ALARMOUT_WAKEUP
00847   */
00848 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef *RTCx)
00849 {
00850   return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_OSEL));
00851 }
00852 
00853 /**
00854   * @brief  Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
00855   * @note   Used only when RTC_ALARM is mapped on PC13
00856   * @rmtoll OR        ALARMOUTTYPE  LL_RTC_SetAlarmOutputType
00857   * @param  RTCx RTC Instance
00858   * @param  Output This parameter can be one of the following values:
00859   *         @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
00860   *         @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
00861   * @retval None
00862   */
00863 __STATIC_INLINE void LL_RTC_SetAlarmOutputType(RTC_TypeDef *RTCx, uint32_t Output)
00864 {
00865   MODIFY_REG(RTCx->OR, RTC_OR_ALARMOUTTYPE, Output);
00866 }
00867 
00868 /**
00869   * @brief  Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
00870   * @note   used only when RTC_ALARM is mapped on PC13
00871   * @rmtoll OR        ALARMOUTTYPE  LL_RTC_GetAlarmOutputType
00872   * @param  RTCx RTC Instance
00873   * @retval Returned value can be one of the following values:
00874   *         @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
00875   *         @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
00876   */
00877 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef *RTCx)
00878 {
00879   return (uint32_t)(READ_BIT(RTCx->OR, RTC_OR_ALARMOUTTYPE));
00880 }
00881 
00882 /**
00883   * @brief  Enable initialization mode
00884   * @note   Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
00885   *         and prescaler register (RTC_PRER).
00886   *         Counters are stopped and start counting from the new value when INIT is reset.
00887   * @rmtoll ISR          INIT          LL_RTC_EnableInitMode
00888   * @param  RTCx RTC Instance
00889   * @retval None
00890   */
00891 __STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx)
00892 {
00893   /* Set the Initialization mode */
00894   WRITE_REG(RTCx->ISR, RTC_INIT_MASK);
00895 }
00896 
00897 /**
00898   * @brief  Disable initialization mode (Free running mode)
00899   * @rmtoll ISR          INIT          LL_RTC_DisableInitMode
00900   * @param  RTCx RTC Instance
00901   * @retval None
00902   */
00903 __STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
00904 {
00905   /* Exit Initialization mode */
00906   WRITE_REG(RTCx->ISR, (uint32_t)~RTC_ISR_INIT);
00907 }
00908 
00909 /**
00910   * @brief  Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted)
00911   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
00912   * @rmtoll CR           POL           LL_RTC_SetOutputPolarity
00913   * @param  RTCx RTC Instance
00914   * @param  Polarity This parameter can be one of the following values:
00915   *         @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
00916   *         @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
00917   * @retval None
00918   */
00919 __STATIC_INLINE void LL_RTC_SetOutputPolarity(RTC_TypeDef *RTCx, uint32_t Polarity)
00920 {
00921   MODIFY_REG(RTCx->CR, RTC_CR_POL, Polarity);
00922 }
00923 
00924 /**
00925   * @brief  Get Output polarity
00926   * @rmtoll CR           POL           LL_RTC_GetOutputPolarity
00927   * @param  RTCx RTC Instance
00928   * @retval Returned value can be one of the following values:
00929   *         @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
00930   *         @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
00931   */
00932 __STATIC_INLINE uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef *RTCx)
00933 {
00934   return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_POL));
00935 }
00936 
00937 /**
00938   * @brief  Enable Bypass the shadow registers
00939   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
00940   * @rmtoll CR           BYPSHAD       LL_RTC_EnableShadowRegBypass
00941   * @param  RTCx RTC Instance
00942   * @retval None
00943   */
00944 __STATIC_INLINE void LL_RTC_EnableShadowRegBypass(RTC_TypeDef *RTCx)
00945 {
00946   SET_BIT(RTCx->CR, RTC_CR_BYPSHAD);
00947 }
00948 
00949 /**
00950   * @brief  Disable Bypass the shadow registers
00951   * @rmtoll CR           BYPSHAD       LL_RTC_DisableShadowRegBypass
00952   * @param  RTCx RTC Instance
00953   * @retval None
00954   */
00955 __STATIC_INLINE void LL_RTC_DisableShadowRegBypass(RTC_TypeDef *RTCx)
00956 {
00957   CLEAR_BIT(RTCx->CR, RTC_CR_BYPSHAD);
00958 }
00959 
00960 /**
00961   * @brief  Check if Shadow registers bypass is enabled or not.
00962   * @rmtoll CR           BYPSHAD       LL_RTC_IsShadowRegBypassEnabled
00963   * @param  RTCx RTC Instance
00964   * @retval State of bit (1 or 0).
00965   */
00966 __STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx)
00967 {
00968   return (READ_BIT(RTCx->CR, RTC_CR_BYPSHAD) == (RTC_CR_BYPSHAD));
00969 }
00970 
00971 /**
00972   * @brief  Enable RTC_REFIN reference clock detection (50 or 60 Hz)
00973   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
00974   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
00975   * @rmtoll CR           REFCKON       LL_RTC_EnableRefClock
00976   * @param  RTCx RTC Instance
00977   * @retval None
00978   */
00979 __STATIC_INLINE void LL_RTC_EnableRefClock(RTC_TypeDef *RTCx)
00980 {
00981   SET_BIT(RTCx->CR, RTC_CR_REFCKON);
00982 }
00983 
00984 /**
00985   * @brief  Disable RTC_REFIN reference clock detection (50 or 60 Hz)
00986   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
00987   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
00988   * @rmtoll CR           REFCKON       LL_RTC_DisableRefClock
00989   * @param  RTCx RTC Instance
00990   * @retval None
00991   */
00992 __STATIC_INLINE void LL_RTC_DisableRefClock(RTC_TypeDef *RTCx)
00993 {
00994   CLEAR_BIT(RTCx->CR, RTC_CR_REFCKON);
00995 }
00996 
00997 /**
00998   * @brief  Set Asynchronous prescaler factor
00999   * @rmtoll PRER         PREDIV_A      LL_RTC_SetAsynchPrescaler
01000   * @param  RTCx RTC Instance
01001   * @param  AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F
01002   * @retval None
01003   */
01004 __STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler)
01005 {
01006   MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_A, AsynchPrescaler << RTC_PRER_PREDIV_A_Pos);
01007 }
01008 
01009 /**
01010   * @brief  Set Synchronous prescaler factor
01011   * @rmtoll PRER         PREDIV_S      LL_RTC_SetSynchPrescaler
01012   * @param  RTCx RTC Instance
01013   * @param  SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF
01014   * @retval None
01015   */
01016 __STATIC_INLINE void LL_RTC_SetSynchPrescaler(RTC_TypeDef *RTCx, uint32_t SynchPrescaler)
01017 {
01018   MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_S, SynchPrescaler);
01019 }
01020 
01021 /**
01022   * @brief  Get Asynchronous prescaler factor
01023   * @rmtoll PRER         PREDIV_A      LL_RTC_GetAsynchPrescaler
01024   * @param  RTCx RTC Instance
01025   * @retval Value between Min_Data = 0 and Max_Data = 0x7F
01026   */
01027 __STATIC_INLINE uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef *RTCx)
01028 {
01029   return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_A) >> RTC_PRER_PREDIV_A_Pos);
01030 }
01031 
01032 /**
01033   * @brief  Get Synchronous prescaler factor
01034   * @rmtoll PRER         PREDIV_S      LL_RTC_GetSynchPrescaler
01035   * @param  RTCx RTC Instance
01036   * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF
01037   */
01038 __STATIC_INLINE uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef *RTCx)
01039 {
01040   return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_S));
01041 }
01042 
01043 /**
01044   * @brief  Enable the write protection for RTC registers.
01045   * @rmtoll WPR          KEY           LL_RTC_EnableWriteProtection
01046   * @param  RTCx RTC Instance
01047   * @retval None
01048   */
01049 __STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
01050 {
01051   WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_DISABLE);
01052 }
01053 
01054 /**
01055   * @brief  Disable the write protection for RTC registers.
01056   * @rmtoll WPR          KEY           LL_RTC_DisableWriteProtection
01057   * @param  RTCx RTC Instance
01058   * @retval None
01059   */
01060 __STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
01061 {
01062   WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_1);
01063   WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_2);
01064 }
01065 
01066 /**
01067   * @brief  Enable RTC_OUT remap
01068   * @rmtoll OR           OUT_RMP       LL_RTC_EnableOutRemap
01069   * @param  RTCx RTC Instance
01070   * @retval None
01071   */
01072 __STATIC_INLINE void LL_RTC_EnableOutRemap(RTC_TypeDef *RTCx)
01073 {
01074   SET_BIT(RTCx->OR, RTC_OR_OUT_RMP);
01075 }
01076 
01077 /**
01078   * @brief  Disable RTC_OUT remap
01079   * @rmtoll OR           OUT_RMP       LL_RTC_DisableOutRemap
01080   * @param  RTCx RTC Instance
01081   * @retval None
01082   */
01083 __STATIC_INLINE void LL_RTC_DisableOutRemap(RTC_TypeDef *RTCx)
01084 {
01085   CLEAR_BIT(RTCx->OR, RTC_OR_OUT_RMP);
01086 }
01087 
01088 /**
01089   * @}
01090   */
01091 
01092 /** @defgroup RTC_LL_EF_Time Time
01093   * @{
01094   */
01095 
01096 /**
01097   * @brief  Set time format (AM/24-hour or PM notation)
01098   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01099   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
01100   * @rmtoll TR           PM            LL_RTC_TIME_SetFormat
01101   * @param  RTCx RTC Instance
01102   * @param  TimeFormat This parameter can be one of the following values:
01103   *         @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
01104   *         @arg @ref LL_RTC_TIME_FORMAT_PM
01105   * @retval None
01106   */
01107 __STATIC_INLINE void LL_RTC_TIME_SetFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
01108 {
01109   MODIFY_REG(RTCx->TR, RTC_TR_PM, TimeFormat);
01110 }
01111 
01112 /**
01113   * @brief  Get time format (AM or PM notation)
01114   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01115   *       before reading this bit
01116   * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
01117   *       shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
01118   * @rmtoll TR           PM            LL_RTC_TIME_GetFormat
01119   * @param  RTCx RTC Instance
01120   * @retval Returned value can be one of the following values:
01121   *         @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
01122   *         @arg @ref LL_RTC_TIME_FORMAT_PM
01123   */
01124 __STATIC_INLINE uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef *RTCx)
01125 {
01126   return (uint32_t)(READ_BIT(RTCx->TR, RTC_TR_PM));
01127 }
01128 
01129 /**
01130   * @brief  Set Hours in BCD format
01131   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01132   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
01133   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format
01134   * @rmtoll TR           HT            LL_RTC_TIME_SetHour\n
01135   *         TR           HU            LL_RTC_TIME_SetHour
01136   * @param  RTCx RTC Instance
01137   * @param  Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
01138   * @retval None
01139   */
01140 __STATIC_INLINE void LL_RTC_TIME_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
01141 {
01142   MODIFY_REG(RTCx->TR, (RTC_TR_HT | RTC_TR_HU),
01143              (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos)));
01144 }
01145 
01146 /**
01147   * @brief  Get Hours in BCD format
01148   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01149   *       before reading this bit
01150   * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
01151   *       shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
01152   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to
01153   *       Binary format
01154   * @rmtoll TR           HT            LL_RTC_TIME_GetHour\n
01155   *         TR           HU            LL_RTC_TIME_GetHour
01156   * @param  RTCx RTC Instance
01157   * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
01158   */
01159 __STATIC_INLINE uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef *RTCx)
01160 {
01161   return ((READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU))) >> RTC_TR_HU_Pos);
01162 }
01163 
01164 /**
01165   * @brief  Set Minutes in BCD format
01166   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01167   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
01168   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
01169   * @rmtoll TR           MNT           LL_RTC_TIME_SetMinute\n
01170   *         TR           MNU           LL_RTC_TIME_SetMinute
01171   * @param  RTCx RTC Instance
01172   * @param  Minutes Value between Min_Data=0x00 and Max_Data=0x59
01173   * @retval None
01174   */
01175 __STATIC_INLINE void LL_RTC_TIME_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
01176 {
01177   MODIFY_REG(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU),
01178              (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)));
01179 }
01180 
01181 /**
01182   * @brief  Get Minutes in BCD format
01183   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01184   *       before reading this bit
01185   * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
01186   *       shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
01187   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD
01188   *       to Binary format
01189   * @rmtoll TR           MNT           LL_RTC_TIME_GetMinute\n
01190   *         TR           MNU           LL_RTC_TIME_GetMinute
01191   * @param  RTCx RTC Instance
01192   * @retval Value between Min_Data=0x00 and Max_Data=0x59
01193   */
01194 __STATIC_INLINE uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef *RTCx)
01195 {
01196   return ((READ_BIT(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU)))>> RTC_TR_MNU_Pos);
01197 }
01198 
01199 /**
01200   * @brief  Set Seconds in BCD format
01201   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01202   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
01203   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
01204   * @rmtoll TR           ST            LL_RTC_TIME_SetSecond\n
01205   *         TR           SU            LL_RTC_TIME_SetSecond
01206   * @param  RTCx RTC Instance
01207   * @param  Seconds Value between Min_Data=0x00 and Max_Data=0x59
01208   * @retval None
01209   */
01210 __STATIC_INLINE void LL_RTC_TIME_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
01211 {
01212   MODIFY_REG(RTCx->TR, (RTC_TR_ST | RTC_TR_SU),
01213              (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos)));
01214 }
01215 
01216 /**
01217   * @brief  Get Seconds in BCD format
01218   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01219   *       before reading this bit
01220   * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
01221   *       shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
01222   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD
01223   *       to Binary format
01224   * @rmtoll TR           ST            LL_RTC_TIME_GetSecond\n
01225   *         TR           SU            LL_RTC_TIME_GetSecond
01226   * @param  RTCx RTC Instance
01227   * @retval Value between Min_Data=0x00 and Max_Data=0x59
01228   */
01229 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef *RTCx)
01230 {
01231   return ((READ_BIT(RTCx->TR, (RTC_TR_ST | RTC_TR_SU))) >> RTC_TR_SU_Pos);
01232 }
01233 
01234 /**
01235   * @brief  Set time (hour, minute and second) in BCD format
01236   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01237   * @note   It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
01238   * @note TimeFormat and Hours should follow the same format
01239   * @rmtoll TR           PM            LL_RTC_TIME_Config\n
01240   *         TR           HT            LL_RTC_TIME_Config\n
01241   *         TR           HU            LL_RTC_TIME_Config\n
01242   *         TR           MNT           LL_RTC_TIME_Config\n
01243   *         TR           MNU           LL_RTC_TIME_Config\n
01244   *         TR           ST            LL_RTC_TIME_Config\n
01245   *         TR           SU            LL_RTC_TIME_Config
01246   * @param  RTCx RTC Instance
01247   * @param  Format12_24 This parameter can be one of the following values:
01248   *         @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
01249   *         @arg @ref LL_RTC_TIME_FORMAT_PM
01250   * @param  Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
01251   * @param  Minutes Value between Min_Data=0x00 and Max_Data=0x59
01252   * @param  Seconds Value between Min_Data=0x00 and Max_Data=0x59
01253   * @retval None
01254   */
01255 __STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
01256 {
01257   register uint32_t temp = 0U;
01258 
01259   temp = Format12_24                                                                                    | \
01260          (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos))     | \
01261          (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)) | \
01262          (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos));
01263   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);
01264 }
01265 
01266 /**
01267   * @brief  Get time (hour, minute and second) in BCD format
01268   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01269   *       before reading this bit
01270   * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
01271   *       shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
01272   * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
01273   *       are available to get independently each parameter.
01274   * @rmtoll TR           HT            LL_RTC_TIME_Get\n
01275   *         TR           HU            LL_RTC_TIME_Get\n
01276   *         TR           MNT           LL_RTC_TIME_Get\n
01277   *         TR           MNU           LL_RTC_TIME_Get\n
01278   *         TR           ST            LL_RTC_TIME_Get\n
01279   *         TR           SU            LL_RTC_TIME_Get
01280   * @param  RTCx RTC Instance
01281   * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
01282   */
01283 __STATIC_INLINE uint32_t LL_RTC_TIME_Get(RTC_TypeDef *RTCx)
01284 {
01285   register uint32_t temp = 0U;
01286   
01287   temp = READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU | RTC_TR_ST | RTC_TR_SU));
01288   return (uint32_t)((((((temp & RTC_TR_HT) >> RTC_TR_HT_Pos) << 4U) | ((temp & RTC_TR_HU) >> RTC_TR_HU_Pos)) << RTC_OFFSET_HOUR) |  \
01289                     (((((temp & RTC_TR_MNT) >> RTC_TR_MNT_Pos) << 4U) | ((temp & RTC_TR_MNU) >> RTC_TR_MNU_Pos)) << RTC_OFFSET_MINUTE) | \
01290                     ((((temp & RTC_TR_ST) >> RTC_TR_ST_Pos) << 4U) | ((temp & RTC_TR_SU) >> RTC_TR_SU_Pos)));
01291 }
01292 
01293 /**
01294   * @brief  Memorize whether the daylight saving time change has been performed
01295   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01296   * @rmtoll CR           BKP           LL_RTC_TIME_EnableDayLightStore
01297   * @param  RTCx RTC Instance
01298   * @retval None
01299   */
01300 __STATIC_INLINE void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef *RTCx)
01301 {
01302   SET_BIT(RTCx->CR, RTC_CR_BKP);
01303 }
01304 
01305 /**
01306   * @brief  Disable memorization whether the daylight saving time change has been performed.
01307   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01308   * @rmtoll CR           BKP           LL_RTC_TIME_DisableDayLightStore
01309   * @param  RTCx RTC Instance
01310   * @retval None
01311   */
01312 __STATIC_INLINE void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef *RTCx)
01313 {
01314   CLEAR_BIT(RTCx->CR, RTC_CR_BKP);
01315 }
01316 
01317 /**
01318   * @brief  Check if RTC Day Light Saving stored operation has been enabled or not
01319   * @rmtoll CR           BKP           LL_RTC_TIME_IsDayLightStoreEnabled
01320   * @param  RTCx RTC Instance
01321   * @retval State of bit (1 or 0).
01322   */
01323 __STATIC_INLINE uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef *RTCx)
01324 {
01325   return (READ_BIT(RTCx->CR, RTC_CR_BKP) == (RTC_CR_BKP));
01326 }
01327 
01328 /**
01329   * @brief  Subtract 1 hour (winter time change)
01330   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01331   * @rmtoll CR           SUB1H         LL_RTC_TIME_DecHour
01332   * @param  RTCx RTC Instance
01333   * @retval None
01334   */
01335 __STATIC_INLINE void LL_RTC_TIME_DecHour(RTC_TypeDef *RTCx)
01336 {
01337   SET_BIT(RTCx->CR, RTC_CR_SUB1H);
01338 }
01339 
01340 /**
01341   * @brief  Add 1 hour (summer time change)
01342   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01343   * @rmtoll CR           ADD1H         LL_RTC_TIME_IncHour
01344   * @param  RTCx RTC Instance
01345   * @retval None
01346   */
01347 __STATIC_INLINE void LL_RTC_TIME_IncHour(RTC_TypeDef *RTCx)
01348 {
01349   SET_BIT(RTCx->CR, RTC_CR_ADD1H);
01350 }
01351 
01352 /**
01353   * @brief  Get Sub second value in the synchronous prescaler counter.
01354   * @note  You can use both SubSeconds value and SecondFraction (PREDIV_S through
01355   *        LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar
01356   *        SubSeconds value in second fraction ratio with time unit following
01357   *        generic formula:
01358   *          ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit
01359   *        This conversion can be performed only if no shift operation is pending
01360   *        (ie. SHFP=0) when PREDIV_S >= SS.
01361   * @rmtoll SSR          SS            LL_RTC_TIME_GetSubSecond
01362   * @param  RTCx RTC Instance
01363   * @retval Sub second value (number between 0 and 65535)
01364   */
01365 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef *RTCx)
01366 {
01367   return (uint32_t)(READ_BIT(RTCx->SSR, RTC_SSR_SS));
01368 }
01369 
01370 /**
01371   * @brief  Synchronize to a remote clock with a high degree of precision.
01372   * @note   This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
01373   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01374   * @note   When REFCKON is set, firmware must not write to Shift control register.
01375   * @rmtoll SHIFTR       ADD1S         LL_RTC_TIME_Synchronize\n
01376   *         SHIFTR       SUBFS         LL_RTC_TIME_Synchronize
01377   * @param  RTCx RTC Instance
01378   * @param  ShiftSecond This parameter can be one of the following values:
01379   *         @arg @ref LL_RTC_SHIFT_SECOND_DELAY
01380   *         @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE
01381   * @param  Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF)
01382   * @retval None
01383   */
01384 __STATIC_INLINE void LL_RTC_TIME_Synchronize(RTC_TypeDef *RTCx, uint32_t ShiftSecond, uint32_t Fraction)
01385 {
01386   WRITE_REG(RTCx->SHIFTR, ShiftSecond | Fraction);
01387 }
01388 
01389 /**
01390   * @}
01391   */
01392 
01393 /** @defgroup RTC_LL_EF_Date Date
01394   * @{
01395   */
01396 
01397 /**
01398   * @brief  Set Year in BCD format
01399   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format
01400   * @rmtoll DR           YT            LL_RTC_DATE_SetYear\n
01401   *         DR           YU            LL_RTC_DATE_SetYear
01402   * @param  RTCx RTC Instance
01403   * @param  Year Value between Min_Data=0x00 and Max_Data=0x99
01404   * @retval None
01405   */
01406 __STATIC_INLINE void LL_RTC_DATE_SetYear(RTC_TypeDef *RTCx, uint32_t Year)
01407 {
01408   MODIFY_REG(RTCx->DR, (RTC_DR_YT | RTC_DR_YU),
01409              (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos)));
01410 }
01411 
01412 /**
01413   * @brief  Get Year in BCD format
01414   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01415   *       before reading this bit
01416   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
01417   * @rmtoll DR           YT            LL_RTC_DATE_GetYear\n
01418   *         DR           YU            LL_RTC_DATE_GetYear
01419   * @param  RTCx RTC Instance
01420   * @retval Value between Min_Data=0x00 and Max_Data=0x99
01421   */
01422 __STATIC_INLINE uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef *RTCx)
01423 {
01424   return ((READ_BIT(RTCx->DR, (RTC_DR_YT | RTC_DR_YU))) >> RTC_DR_YU_Pos);
01425 }
01426 
01427 /**
01428   * @brief  Set Week day
01429   * @rmtoll DR           WDU           LL_RTC_DATE_SetWeekDay
01430   * @param  RTCx RTC Instance
01431   * @param  WeekDay This parameter can be one of the following values:
01432   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
01433   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
01434   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
01435   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
01436   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
01437   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
01438   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
01439   * @retval None
01440   */
01441 __STATIC_INLINE void LL_RTC_DATE_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
01442 {
01443   MODIFY_REG(RTCx->DR, RTC_DR_WDU, WeekDay << RTC_DR_WDU_Pos);
01444 }
01445 
01446 /**
01447   * @brief  Get Week day
01448   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01449   *       before reading this bit
01450   * @rmtoll DR           WDU           LL_RTC_DATE_GetWeekDay
01451   * @param  RTCx RTC Instance
01452   * @retval Returned value can be one of the following values:
01453   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
01454   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
01455   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
01456   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
01457   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
01458   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
01459   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
01460   */
01461 __STATIC_INLINE uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef *RTCx)
01462 {
01463   return (uint32_t)(READ_BIT(RTCx->DR, RTC_DR_WDU) >> RTC_DR_WDU_Pos);
01464 }
01465 
01466 /**
01467   * @brief  Set Month in BCD format
01468   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format
01469   * @rmtoll DR           MT            LL_RTC_DATE_SetMonth\n
01470   *         DR           MU            LL_RTC_DATE_SetMonth
01471   * @param  RTCx RTC Instance
01472   * @param  Month This parameter can be one of the following values:
01473   *         @arg @ref LL_RTC_MONTH_JANUARY
01474   *         @arg @ref LL_RTC_MONTH_FEBRUARY
01475   *         @arg @ref LL_RTC_MONTH_MARCH
01476   *         @arg @ref LL_RTC_MONTH_APRIL
01477   *         @arg @ref LL_RTC_MONTH_MAY
01478   *         @arg @ref LL_RTC_MONTH_JUNE
01479   *         @arg @ref LL_RTC_MONTH_JULY
01480   *         @arg @ref LL_RTC_MONTH_AUGUST
01481   *         @arg @ref LL_RTC_MONTH_SEPTEMBER
01482   *         @arg @ref LL_RTC_MONTH_OCTOBER
01483   *         @arg @ref LL_RTC_MONTH_NOVEMBER
01484   *         @arg @ref LL_RTC_MONTH_DECEMBER
01485   * @retval None
01486   */
01487 __STATIC_INLINE void LL_RTC_DATE_SetMonth(RTC_TypeDef *RTCx, uint32_t Month)
01488 {
01489   MODIFY_REG(RTCx->DR, (RTC_DR_MT | RTC_DR_MU),
01490              (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)));
01491 }
01492 
01493 /**
01494   * @brief  Get Month in BCD format
01495   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01496   *       before reading this bit
01497   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
01498   * @rmtoll DR           MT            LL_RTC_DATE_GetMonth\n
01499   *         DR           MU            LL_RTC_DATE_GetMonth
01500   * @param  RTCx RTC Instance
01501   * @retval Returned value can be one of the following values:
01502   *         @arg @ref LL_RTC_MONTH_JANUARY
01503   *         @arg @ref LL_RTC_MONTH_FEBRUARY
01504   *         @arg @ref LL_RTC_MONTH_MARCH
01505   *         @arg @ref LL_RTC_MONTH_APRIL
01506   *         @arg @ref LL_RTC_MONTH_MAY
01507   *         @arg @ref LL_RTC_MONTH_JUNE
01508   *         @arg @ref LL_RTC_MONTH_JULY
01509   *         @arg @ref LL_RTC_MONTH_AUGUST
01510   *         @arg @ref LL_RTC_MONTH_SEPTEMBER
01511   *         @arg @ref LL_RTC_MONTH_OCTOBER
01512   *         @arg @ref LL_RTC_MONTH_NOVEMBER
01513   *         @arg @ref LL_RTC_MONTH_DECEMBER
01514   */
01515 __STATIC_INLINE uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef *RTCx)
01516 {
01517   return ((READ_BIT(RTCx->DR, (RTC_DR_MT | RTC_DR_MU)))>> RTC_DR_MU_Pos);
01518 }
01519 
01520 /**
01521   * @brief  Set Day in BCD format
01522   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
01523   * @rmtoll DR           DT            LL_RTC_DATE_SetDay\n
01524   *         DR           DU            LL_RTC_DATE_SetDay
01525   * @param  RTCx RTC Instance
01526   * @param  Day Value between Min_Data=0x01 and Max_Data=0x31
01527   * @retval None
01528   */
01529 __STATIC_INLINE void LL_RTC_DATE_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
01530 {
01531   MODIFY_REG(RTCx->DR, (RTC_DR_DT | RTC_DR_DU),
01532              (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos)));
01533 }
01534 
01535 /**
01536   * @brief  Get Day in BCD format
01537   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01538   *       before reading this bit
01539   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
01540   * @rmtoll DR           DT            LL_RTC_DATE_GetDay\n
01541   *         DR           DU            LL_RTC_DATE_GetDay
01542   * @param  RTCx RTC Instance
01543   * @retval Value between Min_Data=0x01 and Max_Data=0x31
01544   */
01545 __STATIC_INLINE uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef *RTCx)
01546 {
01547   return ((READ_BIT(RTCx->DR, (RTC_DR_DT | RTC_DR_DU))) >> RTC_DR_DU_Pos);
01548 }
01549 
01550 /**
01551   * @brief  Set date (WeekDay, Day, Month and Year) in BCD format
01552   * @rmtoll DR           WDU           LL_RTC_DATE_Config\n
01553   *         DR           MT            LL_RTC_DATE_Config\n
01554   *         DR           MU            LL_RTC_DATE_Config\n
01555   *         DR           DT            LL_RTC_DATE_Config\n
01556   *         DR           DU            LL_RTC_DATE_Config\n
01557   *         DR           YT            LL_RTC_DATE_Config\n
01558   *         DR           YU            LL_RTC_DATE_Config
01559   * @param  RTCx RTC Instance
01560   * @param  WeekDay This parameter can be one of the following values:
01561   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
01562   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
01563   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
01564   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
01565   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
01566   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
01567   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
01568   * @param  Day Value between Min_Data=0x01 and Max_Data=0x31
01569   * @param  Month This parameter can be one of the following values:
01570   *         @arg @ref LL_RTC_MONTH_JANUARY
01571   *         @arg @ref LL_RTC_MONTH_FEBRUARY
01572   *         @arg @ref LL_RTC_MONTH_MARCH
01573   *         @arg @ref LL_RTC_MONTH_APRIL
01574   *         @arg @ref LL_RTC_MONTH_MAY
01575   *         @arg @ref LL_RTC_MONTH_JUNE
01576   *         @arg @ref LL_RTC_MONTH_JULY
01577   *         @arg @ref LL_RTC_MONTH_AUGUST
01578   *         @arg @ref LL_RTC_MONTH_SEPTEMBER
01579   *         @arg @ref LL_RTC_MONTH_OCTOBER
01580   *         @arg @ref LL_RTC_MONTH_NOVEMBER
01581   *         @arg @ref LL_RTC_MONTH_DECEMBER
01582   * @param  Year Value between Min_Data=0x00 and Max_Data=0x99
01583   * @retval None
01584   */
01585 __STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uint32_t Day, uint32_t Month, uint32_t Year)
01586 {
01587   register uint32_t temp = 0U;
01588 
01589   temp = (WeekDay << RTC_DR_WDU_Pos)                                                        | \
01590          (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos))   | \
01591          (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)) | \
01592          (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos));
01593 
01594   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);
01595 }
01596 
01597 /**
01598   * @brief  Get date (WeekDay, Day, Month and Year) in BCD format
01599   * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
01600   *       before reading this bit
01601   * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
01602   * and __LL_RTC_GET_DAY are available to get independently each parameter.
01603   * @rmtoll DR           WDU           LL_RTC_DATE_Get\n
01604   *         DR           MT            LL_RTC_DATE_Get\n
01605   *         DR           MU            LL_RTC_DATE_Get\n
01606   *         DR           DT            LL_RTC_DATE_Get\n
01607   *         DR           DU            LL_RTC_DATE_Get\n
01608   *         DR           YT            LL_RTC_DATE_Get\n
01609   *         DR           YU            LL_RTC_DATE_Get
01610   * @param  RTCx RTC Instance
01611   * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY).
01612   */
01613 __STATIC_INLINE uint32_t LL_RTC_DATE_Get(RTC_TypeDef *RTCx)
01614 {
01615   register uint32_t temp = 0U;
01616   
01617   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));
01618   return (uint32_t)((((temp & RTC_DR_WDU) >> RTC_DR_WDU_Pos) << RTC_OFFSET_WEEKDAY) | \
01619                     (((((temp & RTC_DR_DT) >> RTC_DR_DT_Pos) << 4U) | ((temp & RTC_DR_DU) >> RTC_DR_DU_Pos)) << RTC_OFFSET_DAY) | \
01620                     (((((temp & RTC_DR_MT) >> RTC_DR_MT_Pos) << 4U) | ((temp & RTC_DR_MU) >> RTC_DR_MU_Pos)) << RTC_OFFSET_MONTH) | \
01621                     ((((temp & RTC_DR_YT) >> RTC_DR_YT_Pos) << 4U) | ((temp & RTC_DR_YU) >> RTC_DR_YU_Pos)));
01622 }
01623 
01624 /**
01625   * @}
01626   */
01627 
01628 /** @defgroup RTC_LL_EF_ALARMA ALARMA
01629   * @{
01630   */
01631 
01632 /**
01633   * @brief  Enable Alarm A
01634   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01635   * @rmtoll CR           ALRAE         LL_RTC_ALMA_Enable
01636   * @param  RTCx RTC Instance
01637   * @retval None
01638   */
01639 __STATIC_INLINE void LL_RTC_ALMA_Enable(RTC_TypeDef *RTCx)
01640 {
01641   SET_BIT(RTCx->CR, RTC_CR_ALRAE);
01642 }
01643 
01644 /**
01645   * @brief  Disable Alarm A
01646   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
01647   * @rmtoll CR           ALRAE         LL_RTC_ALMA_Disable
01648   * @param  RTCx RTC Instance
01649   * @retval None
01650   */
01651 __STATIC_INLINE void LL_RTC_ALMA_Disable(RTC_TypeDef *RTCx)
01652 {
01653   CLEAR_BIT(RTCx->CR, RTC_CR_ALRAE);
01654 }
01655 
01656 /**
01657   * @brief  Specify the Alarm A masks.
01658   * @rmtoll ALRMAR       MSK4          LL_RTC_ALMA_SetMask\n
01659   *         ALRMAR       MSK3          LL_RTC_ALMA_SetMask\n
01660   *         ALRMAR       MSK2          LL_RTC_ALMA_SetMask\n
01661   *         ALRMAR       MSK1          LL_RTC_ALMA_SetMask
01662   * @param  RTCx RTC Instance
01663   * @param  Mask This parameter can be a combination of the following values:
01664   *         @arg @ref LL_RTC_ALMA_MASK_NONE
01665   *         @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
01666   *         @arg @ref LL_RTC_ALMA_MASK_HOURS
01667   *         @arg @ref LL_RTC_ALMA_MASK_MINUTES
01668   *         @arg @ref LL_RTC_ALMA_MASK_SECONDS
01669   *         @arg @ref LL_RTC_ALMA_MASK_ALL
01670   * @retval None
01671   */
01672 __STATIC_INLINE void LL_RTC_ALMA_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
01673 {
01674   MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1, Mask);
01675 }
01676 
01677 /**
01678   * @brief  Get the Alarm A masks.
01679   * @rmtoll ALRMAR       MSK4          LL_RTC_ALMA_GetMask\n
01680   *         ALRMAR       MSK3          LL_RTC_ALMA_GetMask\n
01681   *         ALRMAR       MSK2          LL_RTC_ALMA_GetMask\n
01682   *         ALRMAR       MSK1          LL_RTC_ALMA_GetMask
01683   * @param  RTCx RTC Instance
01684   * @retval Returned value can be can be a combination of the following values:
01685   *         @arg @ref LL_RTC_ALMA_MASK_NONE
01686   *         @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
01687   *         @arg @ref LL_RTC_ALMA_MASK_HOURS
01688   *         @arg @ref LL_RTC_ALMA_MASK_MINUTES
01689   *         @arg @ref LL_RTC_ALMA_MASK_SECONDS
01690   *         @arg @ref LL_RTC_ALMA_MASK_ALL
01691   */
01692 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef *RTCx)
01693 {
01694   return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1));
01695 }
01696 
01697 /**
01698   * @brief  Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
01699   * @rmtoll ALRMAR       WDSEL         LL_RTC_ALMA_EnableWeekday
01700   * @param  RTCx RTC Instance
01701   * @retval None
01702   */
01703 __STATIC_INLINE void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef *RTCx)
01704 {
01705   SET_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL);
01706 }
01707 
01708 /**
01709   * @brief  Disable AlarmA Week day selection (DU[3:0] represents the date )
01710   * @rmtoll ALRMAR       WDSEL         LL_RTC_ALMA_DisableWeekday
01711   * @param  RTCx RTC Instance
01712   * @retval None
01713   */
01714 __STATIC_INLINE void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef *RTCx)
01715 {
01716   CLEAR_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL);
01717 }
01718 
01719 /**
01720   * @brief  Set ALARM A Day in BCD format
01721   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
01722   * @rmtoll ALRMAR       DT            LL_RTC_ALMA_SetDay\n
01723   *         ALRMAR       DU            LL_RTC_ALMA_SetDay
01724   * @param  RTCx RTC Instance
01725   * @param  Day Value between Min_Data=0x01 and Max_Data=0x31
01726   * @retval None
01727   */
01728 __STATIC_INLINE void LL_RTC_ALMA_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
01729 {
01730   MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU),
01731              (((Day & 0xF0U) << (RTC_ALRMAR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMAR_DU_Pos)));
01732 }
01733 
01734 /**
01735   * @brief  Get ALARM A Day in BCD format
01736   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
01737   * @rmtoll ALRMAR       DT            LL_RTC_ALMA_GetDay\n
01738   *         ALRMAR       DU            LL_RTC_ALMA_GetDay
01739   * @param  RTCx RTC Instance
01740   * @retval Value between Min_Data=0x01 and Max_Data=0x31
01741   */
01742 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef *RTCx)
01743 {
01744   return ((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU))) >> RTC_ALRMAR_DU_Pos);
01745 }
01746 
01747 /**
01748   * @brief  Set ALARM A Weekday
01749   * @rmtoll ALRMAR       DU            LL_RTC_ALMA_SetWeekDay
01750   * @param  RTCx RTC Instance
01751   * @param  WeekDay This parameter can be one of the following values:
01752   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
01753   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
01754   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
01755   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
01756   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
01757   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
01758   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
01759   * @retval None
01760   */
01761 __STATIC_INLINE void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
01762 {
01763   MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_DU, WeekDay << RTC_ALRMAR_DU_Pos);
01764 }
01765 
01766 /**
01767   * @brief  Get ALARM A Weekday
01768   * @rmtoll ALRMAR       DU            LL_RTC_ALMA_GetWeekDay
01769   * @param  RTCx RTC Instance
01770   * @retval Returned value can be one of the following values:
01771   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
01772   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
01773   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
01774   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
01775   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
01776   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
01777   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
01778   */
01779 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef *RTCx)
01780 {
01781   return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_DU) >> RTC_ALRMAR_DU_Pos);
01782 }
01783 
01784 /**
01785   * @brief  Set Alarm A time format (AM/24-hour or PM notation)
01786   * @rmtoll ALRMAR       PM            LL_RTC_ALMA_SetTimeFormat
01787   * @param  RTCx RTC Instance
01788   * @param  TimeFormat This parameter can be one of the following values:
01789   *         @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
01790   *         @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
01791   * @retval None
01792   */
01793 __STATIC_INLINE void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
01794 {
01795   MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM, TimeFormat);
01796 }
01797 
01798 /**
01799   * @brief  Get Alarm A time format (AM or PM notation)
01800   * @rmtoll ALRMAR       PM            LL_RTC_ALMA_GetTimeFormat
01801   * @param  RTCx RTC Instance
01802   * @retval Returned value can be one of the following values:
01803   *         @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
01804   *         @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
01805   */
01806 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef *RTCx)
01807 {
01808   return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_PM));
01809 }
01810 
01811 /**
01812   * @brief  Set ALARM A Hours in BCD format
01813   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
01814   * @rmtoll ALRMAR       HT            LL_RTC_ALMA_SetHour\n
01815   *         ALRMAR       HU            LL_RTC_ALMA_SetHour
01816   * @param  RTCx RTC Instance
01817   * @param  Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
01818   * @retval None
01819   */
01820 __STATIC_INLINE void LL_RTC_ALMA_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
01821 {
01822   MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU),
01823              (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos)));
01824 }
01825 
01826 /**
01827   * @brief  Get ALARM A Hours in BCD format
01828   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
01829   * @rmtoll ALRMAR       HT            LL_RTC_ALMA_GetHour\n
01830   *         ALRMAR       HU            LL_RTC_ALMA_GetHour
01831   * @param  RTCx RTC Instance
01832   * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
01833   */
01834 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef *RTCx)
01835 {
01836   return ((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU))) >> RTC_ALRMAR_HU_Pos);
01837 }
01838 
01839 /**
01840   * @brief  Set ALARM A Minutes in BCD format
01841   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
01842   * @rmtoll ALRMAR       MNT           LL_RTC_ALMA_SetMinute\n
01843   *         ALRMAR       MNU           LL_RTC_ALMA_SetMinute
01844   * @param  RTCx RTC Instance
01845   * @param  Minutes Value between Min_Data=0x00 and Max_Data=0x59
01846   * @retval None
01847   */
01848 __STATIC_INLINE void LL_RTC_ALMA_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
01849 {
01850   MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU),
01851              (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)));
01852 }
01853 
01854 /**
01855   * @brief  Get ALARM A Minutes in BCD format
01856   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
01857   * @rmtoll ALRMAR       MNT           LL_RTC_ALMA_GetMinute\n
01858   *         ALRMAR       MNU           LL_RTC_ALMA_GetMinute
01859   * @param  RTCx RTC Instance
01860   * @retval Value between Min_Data=0x00 and Max_Data=0x59
01861   */
01862 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef *RTCx)
01863 {
01864   return ((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU))) >> RTC_ALRMAR_MNU_Pos);
01865 }
01866 
01867 /**
01868   * @brief  Set ALARM A Seconds in BCD format
01869   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
01870   * @rmtoll ALRMAR       ST            LL_RTC_ALMA_SetSecond\n
01871   *         ALRMAR       SU            LL_RTC_ALMA_SetSecond
01872   * @param  RTCx RTC Instance
01873   * @param  Seconds Value between Min_Data=0x00 and Max_Data=0x59
01874   * @retval None
01875   */
01876 __STATIC_INLINE void LL_RTC_ALMA_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
01877 {
01878   MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU),
01879              (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos)));
01880 }
01881 
01882 /**
01883   * @brief  Get ALARM A Seconds in BCD format
01884   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
01885   * @rmtoll ALRMAR       ST            LL_RTC_ALMA_GetSecond\n
01886   *         ALRMAR       SU            LL_RTC_ALMA_GetSecond
01887   * @param  RTCx RTC Instance
01888   * @retval Value between Min_Data=0x00 and Max_Data=0x59
01889   */
01890 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef *RTCx)
01891 {
01892   return ((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU))) >> RTC_ALRMAR_SU_Pos);
01893 }
01894 
01895 /**
01896   * @brief  Set Alarm A Time (hour, minute and second) in BCD format
01897   * @rmtoll ALRMAR       PM            LL_RTC_ALMA_ConfigTime\n
01898   *         ALRMAR       HT            LL_RTC_ALMA_ConfigTime\n
01899   *         ALRMAR       HU            LL_RTC_ALMA_ConfigTime\n
01900   *         ALRMAR       MNT           LL_RTC_ALMA_ConfigTime\n
01901   *         ALRMAR       MNU           LL_RTC_ALMA_ConfigTime\n
01902   *         ALRMAR       ST            LL_RTC_ALMA_ConfigTime\n
01903   *         ALRMAR       SU            LL_RTC_ALMA_ConfigTime
01904   * @param  RTCx RTC Instance
01905   * @param  Format12_24 This parameter can be one of the following values:
01906   *         @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
01907   *         @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
01908   * @param  Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
01909   * @param  Minutes Value between Min_Data=0x00 and Max_Data=0x59
01910   * @param  Seconds Value between Min_Data=0x00 and Max_Data=0x59
01911   * @retval None
01912   */
01913 __STATIC_INLINE void LL_RTC_ALMA_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
01914 {
01915   register uint32_t temp = 0U;
01916 
01917   temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos))    | \
01918          (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)) | \
01919          (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos));
01920 
01921   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);
01922 }
01923 
01924 /**
01925   * @brief  Get Alarm B Time (hour, minute and second) in BCD format
01926   * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
01927   * are available to get independently each parameter.
01928   * @rmtoll ALRMAR       HT            LL_RTC_ALMA_GetTime\n
01929   *         ALRMAR       HU            LL_RTC_ALMA_GetTime\n
01930   *         ALRMAR       MNT           LL_RTC_ALMA_GetTime\n
01931   *         ALRMAR       MNU           LL_RTC_ALMA_GetTime\n
01932   *         ALRMAR       ST            LL_RTC_ALMA_GetTime\n
01933   *         ALRMAR       SU            LL_RTC_ALMA_GetTime
01934   * @param  RTCx RTC Instance
01935   * @retval Combination of hours, minutes and seconds.
01936   */
01937 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef *RTCx)
01938 {
01939   return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMA_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMA_GetSecond(RTCx));
01940 }
01941 
01942 /**
01943   * @brief  Set Alarm A Mask the most-significant bits starting at this bit
01944   * @note This register can be written only when ALRAE is reset in RTC_CR register,
01945   *       or in initialization mode.
01946   * @rmtoll ALRMASSR     MASKSS        LL_RTC_ALMA_SetSubSecondMask
01947   * @param  RTCx RTC Instance
01948   * @param  Mask Value between Min_Data=0x00 and Max_Data=0xF
01949   * @retval None
01950   */
01951 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask)
01952 {
01953   MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS, Mask << RTC_ALRMASSR_MASKSS_Pos);
01954 }
01955 
01956 /**
01957   * @brief  Get Alarm A Mask the most-significant bits starting at this bit
01958   * @rmtoll ALRMASSR     MASKSS        LL_RTC_ALMA_GetSubSecondMask
01959   * @param  RTCx RTC Instance
01960   * @retval Value between Min_Data=0x00 and Max_Data=0xF
01961   */
01962 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef *RTCx)
01963 {
01964   return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS) >> RTC_ALRMASSR_MASKSS_Pos);
01965 }
01966 
01967 /**
01968   * @brief  Set Alarm A Sub seconds value
01969   * @rmtoll ALRMASSR     SS            LL_RTC_ALMA_SetSubSecond
01970   * @param  RTCx RTC Instance
01971   * @param  Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
01972   * @retval None
01973   */
01974 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond)
01975 {
01976   MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_SS, Subsecond);
01977 }
01978 
01979 /**
01980   * @brief  Get Alarm A Sub seconds value
01981   * @rmtoll ALRMASSR     SS            LL_RTC_ALMA_GetSubSecond
01982   * @param  RTCx RTC Instance
01983   * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
01984   */
01985 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef *RTCx)
01986 {
01987   return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_SS));
01988 }
01989 
01990 /**
01991   * @}
01992   */
01993 
01994 /** @defgroup RTC_LL_EF_ALARMB ALARMB
01995   * @{
01996   */
01997 
01998 /**
01999   * @brief  Enable Alarm B
02000   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02001   * @rmtoll CR           ALRBE         LL_RTC_ALMB_Enable
02002   * @param  RTCx RTC Instance
02003   * @retval None
02004   */
02005 __STATIC_INLINE void LL_RTC_ALMB_Enable(RTC_TypeDef *RTCx)
02006 {
02007   SET_BIT(RTCx->CR, RTC_CR_ALRBE);
02008 }
02009 
02010 /**
02011   * @brief  Disable Alarm B
02012   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02013   * @rmtoll CR           ALRBE         LL_RTC_ALMB_Disable
02014   * @param  RTCx RTC Instance
02015   * @retval None
02016   */
02017 __STATIC_INLINE void LL_RTC_ALMB_Disable(RTC_TypeDef *RTCx)
02018 {
02019   CLEAR_BIT(RTCx->CR, RTC_CR_ALRBE);
02020 }
02021 
02022 /**
02023   * @brief  Specify the Alarm B masks.
02024   * @rmtoll ALRMBR       MSK4          LL_RTC_ALMB_SetMask\n
02025   *         ALRMBR       MSK3          LL_RTC_ALMB_SetMask\n
02026   *         ALRMBR       MSK2          LL_RTC_ALMB_SetMask\n
02027   *         ALRMBR       MSK1          LL_RTC_ALMB_SetMask
02028   * @param  RTCx RTC Instance
02029   * @param  Mask This parameter can be a combination of the following values:
02030   *         @arg @ref LL_RTC_ALMB_MASK_NONE
02031   *         @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
02032   *         @arg @ref LL_RTC_ALMB_MASK_HOURS
02033   *         @arg @ref LL_RTC_ALMB_MASK_MINUTES
02034   *         @arg @ref LL_RTC_ALMB_MASK_SECONDS
02035   *         @arg @ref LL_RTC_ALMB_MASK_ALL
02036   * @retval None
02037   */
02038 __STATIC_INLINE void LL_RTC_ALMB_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
02039 {
02040   MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1, Mask);
02041 }
02042 
02043 /**
02044   * @brief  Get the Alarm B masks.
02045   * @rmtoll ALRMBR       MSK4          LL_RTC_ALMB_GetMask\n
02046   *         ALRMBR       MSK3          LL_RTC_ALMB_GetMask\n
02047   *         ALRMBR       MSK2          LL_RTC_ALMB_GetMask\n
02048   *         ALRMBR       MSK1          LL_RTC_ALMB_GetMask
02049   * @param  RTCx RTC Instance
02050   * @retval Returned value can be can be a combination of the following values:
02051   *         @arg @ref LL_RTC_ALMB_MASK_NONE
02052   *         @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
02053   *         @arg @ref LL_RTC_ALMB_MASK_HOURS
02054   *         @arg @ref LL_RTC_ALMB_MASK_MINUTES
02055   *         @arg @ref LL_RTC_ALMB_MASK_SECONDS
02056   *         @arg @ref LL_RTC_ALMB_MASK_ALL
02057   */
02058 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef *RTCx)
02059 {
02060   return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1));
02061 }
02062 
02063 /**
02064   * @brief  Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
02065   * @rmtoll ALRMBR       WDSEL         LL_RTC_ALMB_EnableWeekday
02066   * @param  RTCx RTC Instance
02067   * @retval None
02068   */
02069 __STATIC_INLINE void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef *RTCx)
02070 {
02071   SET_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL);
02072 }
02073 
02074 /**
02075   * @brief  Disable AlarmB Week day selection (DU[3:0] represents the date )
02076   * @rmtoll ALRMBR       WDSEL         LL_RTC_ALMB_DisableWeekday
02077   * @param  RTCx RTC Instance
02078   * @retval None
02079   */
02080 __STATIC_INLINE void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef *RTCx)
02081 {
02082   CLEAR_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL);
02083 }
02084 
02085 /**
02086   * @brief  Set ALARM B Day in BCD format
02087   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
02088   * @rmtoll ALRMBR       DT            LL_RTC_ALMB_SetDay\n
02089   *         ALRMBR       DU            LL_RTC_ALMB_SetDay
02090   * @param  RTCx RTC Instance
02091   * @param  Day Value between Min_Data=0x01 and Max_Data=0x31
02092   * @retval None
02093   */
02094 __STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
02095 {
02096   MODIFY_REG(RTC->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU),
02097              (((Day & 0xF0U) << (RTC_ALRMBR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMBR_DU_Pos)));
02098 }
02099 
02100 /**
02101   * @brief  Get ALARM B Day in BCD format
02102   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
02103   * @rmtoll ALRMBR       DT            LL_RTC_ALMB_GetDay\n
02104   *         ALRMBR       DU            LL_RTC_ALMB_GetDay
02105   * @param  RTCx RTC Instance
02106   * @retval Value between Min_Data=0x01 and Max_Data=0x31
02107   */
02108 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef *RTCx)
02109 {
02110   return ((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU))) >> RTC_ALRMBR_DU_Pos);
02111 }
02112 
02113 /**
02114   * @brief  Set ALARM B Weekday
02115   * @rmtoll ALRMBR       DU            LL_RTC_ALMB_SetWeekDay
02116   * @param  RTCx RTC Instance
02117   * @param  WeekDay This parameter can be one of the following values:
02118   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
02119   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
02120   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
02121   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
02122   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
02123   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
02124   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
02125   * @retval None
02126   */
02127 __STATIC_INLINE void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
02128 {
02129   MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_DU, WeekDay << RTC_ALRMBR_DU_Pos);
02130 }
02131 
02132 /**
02133   * @brief  Get ALARM B Weekday
02134   * @rmtoll ALRMBR       DU            LL_RTC_ALMB_GetWeekDay
02135   * @param  RTCx RTC Instance
02136   * @retval Returned value can be one of the following values:
02137   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
02138   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
02139   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
02140   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
02141   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
02142   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
02143   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
02144   */
02145 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef *RTCx)
02146 {
02147   return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_DU) >> RTC_ALRMBR_DU_Pos);
02148 }
02149 
02150 /**
02151   * @brief  Set ALARM B time format (AM/24-hour or PM notation)
02152   * @rmtoll ALRMBR       PM            LL_RTC_ALMB_SetTimeFormat
02153   * @param  RTCx RTC Instance
02154   * @param  TimeFormat This parameter can be one of the following values:
02155   *         @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
02156   *         @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
02157   * @retval None
02158   */
02159 __STATIC_INLINE void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
02160 {
02161   MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM, TimeFormat);
02162 }
02163 
02164 /**
02165   * @brief  Get ALARM B time format (AM or PM notation)
02166   * @rmtoll ALRMBR       PM            LL_RTC_ALMB_GetTimeFormat
02167   * @param  RTCx RTC Instance
02168   * @retval Returned value can be one of the following values:
02169   *         @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
02170   *         @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
02171   */
02172 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef *RTCx)
02173 {
02174   return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_PM));
02175 }
02176 
02177 /**
02178   * @brief  Set ALARM B Hours in BCD format
02179   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
02180   * @rmtoll ALRMBR       HT            LL_RTC_ALMB_SetHour\n
02181   *         ALRMBR       HU            LL_RTC_ALMB_SetHour
02182   * @param  RTCx RTC Instance
02183   * @param  Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
02184   * @retval None
02185   */
02186 __STATIC_INLINE void LL_RTC_ALMB_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
02187 {
02188   MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU),
02189              (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos)));
02190 }
02191 
02192 /**
02193   * @brief  Get ALARM B Hours in BCD format
02194   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
02195   * @rmtoll ALRMBR       HT            LL_RTC_ALMB_GetHour\n
02196   *         ALRMBR       HU            LL_RTC_ALMB_GetHour
02197   * @param  RTCx RTC Instance
02198   * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
02199   */
02200 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef *RTCx)
02201 {
02202   return ((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU))) >> RTC_ALRMBR_HU_Pos);
02203 }
02204 
02205 /**
02206   * @brief  Set ALARM B Minutes in BCD format
02207   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
02208   * @rmtoll ALRMBR       MNT           LL_RTC_ALMB_SetMinute\n
02209   *         ALRMBR       MNU           LL_RTC_ALMB_SetMinute
02210   * @param  RTCx RTC Instance
02211   * @param  Minutes between Min_Data=0x00 and Max_Data=0x59
02212   * @retval None
02213   */
02214 __STATIC_INLINE void LL_RTC_ALMB_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
02215 {
02216   MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU),
02217              (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)));
02218 }
02219 
02220 /**
02221   * @brief  Get ALARM B Minutes in BCD format
02222   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
02223   * @rmtoll ALRMBR       MNT           LL_RTC_ALMB_GetMinute\n
02224   *         ALRMBR       MNU           LL_RTC_ALMB_GetMinute
02225   * @param  RTCx RTC Instance
02226   * @retval Value between Min_Data=0x00 and Max_Data=0x59
02227   */
02228 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef *RTCx)
02229 {
02230   return ((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU))) >> RTC_ALRMBR_MNU_Pos);
02231 }
02232 
02233 /**
02234   * @brief  Set ALARM B Seconds in BCD format
02235   * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
02236   * @rmtoll ALRMBR       ST            LL_RTC_ALMB_SetSecond\n
02237   *         ALRMBR       SU            LL_RTC_ALMB_SetSecond
02238   * @param  RTCx RTC Instance
02239   * @param  Seconds Value between Min_Data=0x00 and Max_Data=0x59
02240   * @retval None
02241   */
02242 __STATIC_INLINE void LL_RTC_ALMB_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
02243 {
02244   MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU),
02245              (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos)));
02246 }
02247 
02248 /**
02249   * @brief  Get ALARM B Seconds in BCD format
02250   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
02251   * @rmtoll ALRMBR       ST            LL_RTC_ALMB_GetSecond\n
02252   *         ALRMBR       SU            LL_RTC_ALMB_GetSecond
02253   * @param  RTCx RTC Instance
02254   * @retval Value between Min_Data=0x00 and Max_Data=0x59
02255   */
02256 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef *RTCx)
02257 {
02258   return ((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU))) >> RTC_ALRMBR_SU_Pos);
02259 }
02260 
02261 /**
02262   * @brief  Set Alarm B Time (hour, minute and second) in BCD format
02263   * @rmtoll ALRMBR       PM            LL_RTC_ALMB_ConfigTime\n
02264   *         ALRMBR       HT            LL_RTC_ALMB_ConfigTime\n
02265   *         ALRMBR       HU            LL_RTC_ALMB_ConfigTime\n
02266   *         ALRMBR       MNT           LL_RTC_ALMB_ConfigTime\n
02267   *         ALRMBR       MNU           LL_RTC_ALMB_ConfigTime\n
02268   *         ALRMBR       ST            LL_RTC_ALMB_ConfigTime\n
02269   *         ALRMBR       SU            LL_RTC_ALMB_ConfigTime
02270   * @param  RTCx RTC Instance
02271   * @param  Format12_24 This parameter can be one of the following values:
02272   *         @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
02273   *         @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
02274   * @param  Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
02275   * @param  Minutes Value between Min_Data=0x00 and Max_Data=0x59
02276   * @param  Seconds Value between Min_Data=0x00 and Max_Data=0x59
02277   * @retval None
02278   */
02279 __STATIC_INLINE void LL_RTC_ALMB_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
02280 {
02281   register uint32_t temp = 0U;
02282 
02283   temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos))    | \
02284          (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)) | \
02285          (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos));
02286 
02287   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);
02288 }
02289 
02290 /**
02291   * @brief  Get Alarm B Time (hour, minute and second) in BCD format
02292   * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
02293   * are available to get independently each parameter.
02294   * @rmtoll ALRMBR       HT            LL_RTC_ALMB_GetTime\n
02295   *         ALRMBR       HU            LL_RTC_ALMB_GetTime\n
02296   *         ALRMBR       MNT           LL_RTC_ALMB_GetTime\n
02297   *         ALRMBR       MNU           LL_RTC_ALMB_GetTime\n
02298   *         ALRMBR       ST            LL_RTC_ALMB_GetTime\n
02299   *         ALRMBR       SU            LL_RTC_ALMB_GetTime
02300   * @param  RTCx RTC Instance
02301   * @retval Combination of hours, minutes and seconds.
02302   */
02303 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef *RTCx)
02304 {
02305   return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMB_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMB_GetSecond(RTCx));
02306 }
02307 
02308 /**
02309   * @brief  Set Alarm B Mask the most-significant bits starting at this bit
02310   * @note This register can be written only when ALRBE is reset in RTC_CR register,
02311   *       or in initialization mode.
02312   * @rmtoll ALRMBSSR     MASKSS        LL_RTC_ALMB_SetSubSecondMask
02313   * @param  RTCx RTC Instance
02314   * @param  Mask Value between Min_Data=0x00 and Max_Data=0xF
02315   * @retval None
02316   */
02317 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask)
02318 {
02319   MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS, Mask << RTC_ALRMBSSR_MASKSS_Pos);
02320 }
02321 
02322 /**
02323   * @brief  Get Alarm B Mask the most-significant bits starting at this bit
02324   * @rmtoll ALRMBSSR     MASKSS        LL_RTC_ALMB_GetSubSecondMask
02325   * @param  RTCx RTC Instance
02326   * @retval Value between Min_Data=0x00 and Max_Data=0xF
02327   */
02328 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef *RTCx)
02329 {
02330   return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS)  >> RTC_ALRMBSSR_MASKSS_Pos);
02331 }
02332 
02333 /**
02334   * @brief  Set Alarm B Sub seconds value
02335   * @rmtoll ALRMBSSR     SS            LL_RTC_ALMB_SetSubSecond
02336   * @param  RTCx RTC Instance
02337   * @param  Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
02338   * @retval None
02339   */
02340 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond)
02341 {
02342   MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS, Subsecond);
02343 }
02344 
02345 /**
02346   * @brief  Get Alarm B Sub seconds value
02347   * @rmtoll ALRMBSSR     SS            LL_RTC_ALMB_GetSubSecond
02348   * @param  RTCx RTC Instance
02349   * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
02350   */
02351 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef *RTCx)
02352 {
02353   return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS));
02354 }
02355 
02356 /**
02357   * @}
02358   */
02359 
02360 /** @defgroup RTC_LL_EF_Timestamp Timestamp
02361   * @{
02362   */
02363 
02364 /**
02365   * @brief  Enable internal event timestamp
02366   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02367   * @rmtoll CR           ITSE          LL_RTC_TS_EnableInternalEvent
02368   * @param  RTCx RTC Instance
02369   * @retval None
02370   */
02371 __STATIC_INLINE void LL_RTC_TS_EnableInternalEvent(RTC_TypeDef *RTCx)
02372 {
02373   SET_BIT(RTCx->CR, RTC_CR_ITSE);
02374 }
02375 
02376 /**
02377   * @brief  Disable internal event timestamp
02378   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02379   * @rmtoll CR           ITSE          LL_RTC_TS_DisableInternalEvent
02380   * @param  RTCx RTC Instance
02381   * @retval None
02382   */
02383 __STATIC_INLINE void LL_RTC_TS_DisableInternalEvent(RTC_TypeDef *RTCx)
02384 {
02385   CLEAR_BIT(RTCx->CR, RTC_CR_ITSE);
02386 }
02387 
02388 /**
02389   * @brief  Enable Timestamp
02390   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02391   * @rmtoll CR           TSE           LL_RTC_TS_Enable
02392   * @param  RTCx RTC Instance
02393   * @retval None
02394   */
02395 __STATIC_INLINE void LL_RTC_TS_Enable(RTC_TypeDef *RTCx)
02396 {
02397   SET_BIT(RTCx->CR, RTC_CR_TSE);
02398 }
02399 
02400 /**
02401   * @brief  Disable Timestamp
02402   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02403   * @rmtoll CR           TSE           LL_RTC_TS_Disable
02404   * @param  RTCx RTC Instance
02405   * @retval None
02406   */
02407 __STATIC_INLINE void LL_RTC_TS_Disable(RTC_TypeDef *RTCx)
02408 {
02409   CLEAR_BIT(RTCx->CR, RTC_CR_TSE);
02410 }
02411 
02412 /**
02413   * @brief  Set Time-stamp event active edge
02414   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02415   * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting
02416   * @rmtoll CR           TSEDGE        LL_RTC_TS_SetActiveEdge
02417   * @param  RTCx RTC Instance
02418   * @param  Edge This parameter can be one of the following values:
02419   *         @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
02420   *         @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
02421   * @retval None
02422   */
02423 __STATIC_INLINE void LL_RTC_TS_SetActiveEdge(RTC_TypeDef *RTCx, uint32_t Edge)
02424 {
02425   MODIFY_REG(RTCx->CR, RTC_CR_TSEDGE, Edge);
02426 }
02427 
02428 /**
02429   * @brief  Get Time-stamp event active edge
02430   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02431   * @rmtoll CR           TSEDGE        LL_RTC_TS_GetActiveEdge
02432   * @param  RTCx RTC Instance
02433   * @retval Returned value can be one of the following values:
02434   *         @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
02435   *         @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
02436   */
02437 __STATIC_INLINE uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef *RTCx)
02438 {
02439   return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_TSEDGE));
02440 }
02441 
02442 /**
02443   * @brief  Get Timestamp AM/PM notation (AM or 24-hour format)
02444   * @rmtoll TSTR         PM            LL_RTC_TS_GetTimeFormat
02445   * @param  RTCx RTC Instance
02446   * @retval Returned value can be one of the following values:
02447   *         @arg @ref LL_RTC_TS_TIME_FORMAT_AM
02448   *         @arg @ref LL_RTC_TS_TIME_FORMAT_PM
02449   */
02450 __STATIC_INLINE uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef *RTCx)
02451 {
02452   return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_PM));
02453 }
02454 
02455 /**
02456   * @brief  Get Timestamp Hours in BCD format
02457   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
02458   * @rmtoll TSTR         HT            LL_RTC_TS_GetHour\n
02459   *         TSTR         HU            LL_RTC_TS_GetHour
02460   * @param  RTCx RTC Instance
02461   * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
02462   */
02463 __STATIC_INLINE uint32_t LL_RTC_TS_GetHour(RTC_TypeDef *RTCx)
02464 {
02465   return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_HT | RTC_TSTR_HU) >> RTC_TSTR_HU_Pos);
02466 }
02467 
02468 /**
02469   * @brief  Get Timestamp Minutes in BCD format
02470   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
02471   * @rmtoll TSTR         MNT           LL_RTC_TS_GetMinute\n
02472   *         TSTR         MNU           LL_RTC_TS_GetMinute
02473   * @param  RTCx RTC Instance
02474   * @retval Value between Min_Data=0x00 and Max_Data=0x59
02475   */
02476 __STATIC_INLINE uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef *RTCx)
02477 {
02478   return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_MNT | RTC_TSTR_MNU) >> RTC_TSTR_MNU_Pos);
02479 }
02480 
02481 /**
02482   * @brief  Get Timestamp Seconds in BCD format
02483   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
02484   * @rmtoll TSTR         ST            LL_RTC_TS_GetSecond\n
02485   *         TSTR         SU            LL_RTC_TS_GetSecond
02486   * @param  RTCx RTC Instance
02487   * @retval Value between Min_Data=0x00 and Max_Data=0x59
02488   */
02489 __STATIC_INLINE uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef *RTCx)
02490 {
02491   return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_ST | RTC_TSTR_SU));
02492 }
02493 
02494 /**
02495   * @brief  Get Timestamp time (hour, minute and second) in BCD format
02496   * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
02497   * are available to get independently each parameter.
02498   * @rmtoll TSTR         HT            LL_RTC_TS_GetTime\n
02499   *         TSTR         HU            LL_RTC_TS_GetTime\n
02500   *         TSTR         MNT           LL_RTC_TS_GetTime\n
02501   *         TSTR         MNU           LL_RTC_TS_GetTime\n
02502   *         TSTR         ST            LL_RTC_TS_GetTime\n
02503   *         TSTR         SU            LL_RTC_TS_GetTime
02504   * @param  RTCx RTC Instance
02505   * @retval Combination of hours, minutes and seconds.
02506   */
02507 __STATIC_INLINE uint32_t LL_RTC_TS_GetTime(RTC_TypeDef *RTCx)
02508 {
02509   return (uint32_t)(READ_BIT(RTCx->TSTR,
02510                              RTC_TSTR_HT | RTC_TSTR_HU | RTC_TSTR_MNT | RTC_TSTR_MNU | RTC_TSTR_ST | RTC_TSTR_SU));
02511 }
02512 
02513 /**
02514   * @brief  Get Timestamp Week day
02515   * @rmtoll TSDR         WDU           LL_RTC_TS_GetWeekDay
02516   * @param  RTCx RTC Instance
02517   * @retval Returned value can be one of the following values:
02518   *         @arg @ref LL_RTC_WEEKDAY_MONDAY
02519   *         @arg @ref LL_RTC_WEEKDAY_TUESDAY
02520   *         @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
02521   *         @arg @ref LL_RTC_WEEKDAY_THURSDAY
02522   *         @arg @ref LL_RTC_WEEKDAY_FRIDAY
02523   *         @arg @ref LL_RTC_WEEKDAY_SATURDAY
02524   *         @arg @ref LL_RTC_WEEKDAY_SUNDAY
02525   */
02526 __STATIC_INLINE uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef *RTCx)
02527 {
02528   return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU) >> RTC_TSDR_WDU_Pos);
02529 }
02530 
02531 /**
02532   * @brief  Get Timestamp Month in BCD format
02533   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
02534   * @rmtoll TSDR         MT            LL_RTC_TS_GetMonth\n
02535   *         TSDR         MU            LL_RTC_TS_GetMonth
02536   * @param  RTCx RTC Instance
02537   * @retval Returned value can be one of the following values:
02538   *         @arg @ref LL_RTC_MONTH_JANUARY
02539   *         @arg @ref LL_RTC_MONTH_FEBRUARY
02540   *         @arg @ref LL_RTC_MONTH_MARCH
02541   *         @arg @ref LL_RTC_MONTH_APRIL
02542   *         @arg @ref LL_RTC_MONTH_MAY
02543   *         @arg @ref LL_RTC_MONTH_JUNE
02544   *         @arg @ref LL_RTC_MONTH_JULY
02545   *         @arg @ref LL_RTC_MONTH_AUGUST
02546   *         @arg @ref LL_RTC_MONTH_SEPTEMBER
02547   *         @arg @ref LL_RTC_MONTH_OCTOBER
02548   *         @arg @ref LL_RTC_MONTH_NOVEMBER
02549   *         @arg @ref LL_RTC_MONTH_DECEMBER
02550   */
02551 __STATIC_INLINE uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef *RTCx)
02552 {
02553   return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_MT | RTC_TSDR_MU) >> RTC_TSDR_MU_Pos);
02554 }
02555 
02556 /**
02557   * @brief  Get Timestamp Day in BCD format
02558   * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
02559   * @rmtoll TSDR         DT            LL_RTC_TS_GetDay\n
02560   *         TSDR         DU            LL_RTC_TS_GetDay
02561   * @param  RTCx RTC Instance
02562   * @retval Value between Min_Data=0x01 and Max_Data=0x31
02563   */
02564 __STATIC_INLINE uint32_t LL_RTC_TS_GetDay(RTC_TypeDef *RTCx)
02565 {
02566   return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_DT | RTC_TSDR_DU));
02567 }
02568 
02569 /**
02570   * @brief  Get Timestamp date (WeekDay, Day and Month) in BCD format
02571   * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH,
02572   * and __LL_RTC_GET_DAY are available to get independently each parameter.
02573   * @rmtoll TSDR         WDU           LL_RTC_TS_GetDate\n
02574   *         TSDR         MT            LL_RTC_TS_GetDate\n
02575   *         TSDR         MU            LL_RTC_TS_GetDate\n
02576   *         TSDR         DT            LL_RTC_TS_GetDate\n
02577   *         TSDR         DU            LL_RTC_TS_GetDate
02578   * @param  RTCx RTC Instance
02579   * @retval Combination of Weekday, Day and Month
02580   */
02581 __STATIC_INLINE uint32_t LL_RTC_TS_GetDate(RTC_TypeDef *RTCx)
02582 {
02583   return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU | RTC_TSDR_MT | RTC_TSDR_MU | RTC_TSDR_DT | RTC_TSDR_DU));
02584 }
02585 
02586 /**
02587   * @brief  Get time-stamp sub second value
02588   * @rmtoll TSSSR        SS            LL_RTC_TS_GetSubSecond
02589   * @param  RTCx RTC Instance
02590   * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
02591   */
02592 __STATIC_INLINE uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef *RTCx)
02593 {
02594   return (uint32_t)(READ_BIT(RTCx->TSSSR, RTC_TSSSR_SS));
02595 }
02596 
02597 #if defined(RTC_TAMPCR_TAMPTS)
02598 /**
02599   * @brief  Activate timestamp on tamper detection event
02600   * @rmtoll TAMPCR       TAMPTS        LL_RTC_TS_EnableOnTamper
02601   * @param  RTCx RTC Instance
02602   * @retval None
02603   */
02604 __STATIC_INLINE void LL_RTC_TS_EnableOnTamper(RTC_TypeDef *RTCx)
02605 {
02606   SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPTS);
02607 }
02608 
02609 /**
02610   * @brief  Disable timestamp on tamper detection event
02611   * @rmtoll TAMPCR       TAMPTS        LL_RTC_TS_DisableOnTamper
02612   * @param  RTCx RTC Instance
02613   * @retval None
02614   */
02615 __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx)
02616 {
02617   CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPTS);
02618 }
02619 #endif /* RTC_TAMPCR_TAMPTS */
02620 
02621 /**
02622   * @}
02623   */
02624 
02625 /** @defgroup RTC_LL_EF_Tamper Tamper
02626   * @{
02627   */
02628 
02629 /**
02630   * @brief  Enable RTC_TAMPx input detection
02631   * @rmtoll TAMPCR       TAMP1E        LL_RTC_TAMPER_Enable\n
02632   *         TAMPCR       TAMP2E        LL_RTC_TAMPER_Enable\n
02633   *         TAMPCR       TAMP3E        LL_RTC_TAMPER_Enable
02634   * @param  RTCx RTC Instance
02635   * @param  Tamper This parameter can be a combination of the following values:
02636   *         @arg @ref LL_RTC_TAMPER_1 
02637   *         @arg @ref LL_RTC_TAMPER_2 
02638   *         @arg @ref LL_RTC_TAMPER_3 
02639   *         
02640   * @retval None
02641   */
02642 __STATIC_INLINE void LL_RTC_TAMPER_Enable(RTC_TypeDef *RTCx, uint32_t Tamper)
02643 {
02644   SET_BIT(RTCx->TAMPCR, Tamper);
02645 }
02646 
02647 /**
02648   * @brief  Clear RTC_TAMPx input detection
02649   * @rmtoll TAMPCR       TAMP1E        LL_RTC_TAMPER_Disable\n
02650   *         TAMPCR       TAMP2E        LL_RTC_TAMPER_Disable\n
02651   *         TAMPCR       TAMP3E        LL_RTC_TAMPER_Disable
02652   * @param  RTCx RTC Instance
02653   * @param  Tamper This parameter can be a combination of the following values:
02654   *         @arg @ref LL_RTC_TAMPER_1 
02655   *         @arg @ref LL_RTC_TAMPER_2 
02656   *         @arg @ref LL_RTC_TAMPER_3 
02657   *         
02658   * @retval None
02659   */
02660 __STATIC_INLINE void LL_RTC_TAMPER_Disable(RTC_TypeDef *RTCx, uint32_t Tamper)
02661 {
02662   CLEAR_BIT(RTCx->TAMPCR, Tamper);
02663 }
02664 
02665 /**
02666   * @brief  Enable Tamper mask flag
02667   * @note Associated Tamper IT must not enabled when tamper mask is set.
02668   * @rmtoll TAMPCR       TAMP1MF       LL_RTC_TAMPER_EnableMask\n
02669   *         TAMPCR       TAMP2MF       LL_RTC_TAMPER_EnableMask\n
02670   *         TAMPCR       TAMP3MF       LL_RTC_TAMPER_EnableMask
02671   * @param  RTCx RTC Instance
02672   * @param  Mask This parameter can be a combination of the following values:
02673   *         @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 
02674   *         @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 
02675   *         @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 
02676   *         
02677   * @retval None
02678   */
02679 __STATIC_INLINE void LL_RTC_TAMPER_EnableMask(RTC_TypeDef *RTCx, uint32_t Mask)
02680 {
02681   SET_BIT(RTCx->TAMPCR, Mask);
02682 }
02683 
02684 /**
02685   * @brief  Disable Tamper mask flag
02686   * @rmtoll TAMPCR       TAMP1MF       LL_RTC_TAMPER_DisableMask\n
02687   *         TAMPCR       TAMP2MF       LL_RTC_TAMPER_DisableMask\n
02688   *         TAMPCR       TAMP3MF       LL_RTC_TAMPER_DisableMask
02689   * @param  RTCx RTC Instance
02690   * @param  Mask This parameter can be a combination of the following values:
02691   *         @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 
02692   *         @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 
02693   *         @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 
02694   *         
02695   * @retval None
02696   */
02697 __STATIC_INLINE void LL_RTC_TAMPER_DisableMask(RTC_TypeDef *RTCx, uint32_t Mask)
02698 {
02699   CLEAR_BIT(RTCx->TAMPCR, Mask);
02700 }
02701 
02702 /**
02703   * @brief  Enable backup register erase after Tamper event detection
02704   * @rmtoll TAMPCR       TAMP1NOERASE  LL_RTC_TAMPER_EnableEraseBKP\n
02705   *         TAMPCR       TAMP2NOERASE  LL_RTC_TAMPER_EnableEraseBKP\n
02706   *         TAMPCR       TAMP3NOERASE  LL_RTC_TAMPER_EnableEraseBKP
02707   * @param  RTCx RTC Instance
02708   * @param  Tamper This parameter can be a combination of the following values:
02709   *         @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 
02710   *         @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 
02711   *         @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 
02712   *         
02713   * @retval None
02714   */
02715 __STATIC_INLINE void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef *RTCx, uint32_t Tamper)
02716 {
02717   CLEAR_BIT(RTCx->TAMPCR, Tamper);
02718 }
02719 
02720 /**
02721   * @brief  Disable backup register erase after Tamper event detection
02722   * @rmtoll TAMPCR       TAMP1NOERASE  LL_RTC_TAMPER_DisableEraseBKP\n
02723   *         TAMPCR       TAMP2NOERASE  LL_RTC_TAMPER_DisableEraseBKP\n
02724   *         TAMPCR       TAMP3NOERASE  LL_RTC_TAMPER_DisableEraseBKP
02725   * @param  RTCx RTC Instance
02726   * @param  Tamper This parameter can be a combination of the following values:
02727   *         @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 
02728   *         @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 
02729   *         @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 
02730   *         
02731   * @retval None
02732   */
02733 __STATIC_INLINE void LL_RTC_TAMPER_DisableEraseBKP(RTC_TypeDef *RTCx, uint32_t Tamper)
02734 {
02735   SET_BIT(RTCx->TAMPCR, Tamper);
02736 }
02737 
02738 #if defined(RTC_TAMPCR_TAMPPUDIS)
02739 /**
02740   * @brief  Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
02741   * @rmtoll TAMPCR       TAMPPUDIS     LL_RTC_TAMPER_DisablePullUp
02742   * @param  RTCx RTC Instance
02743   * @retval None
02744   */
02745 __STATIC_INLINE void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef *RTCx)
02746 {
02747   SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPUDIS);
02748 }
02749 
02750 /**
02751   * @brief  Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling)
02752   * @rmtoll TAMPCR       TAMPPUDIS     LL_RTC_TAMPER_EnablePullUp
02753   * @param  RTCx RTC Instance
02754   * @retval None
02755   */
02756 __STATIC_INLINE void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef *RTCx)
02757 {
02758   CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPUDIS);
02759 }
02760 #endif /* RTC_TAMPCR_TAMPPUDIS */
02761 
02762 #if defined(RTC_TAMPCR_TAMPPRCH)
02763 /**
02764   * @brief  Set RTC_TAMPx precharge duration
02765   * @rmtoll TAMPCR       TAMPPRCH      LL_RTC_TAMPER_SetPrecharge
02766   * @param  RTCx RTC Instance
02767   * @param  Duration This parameter can be one of the following values:
02768   *         @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
02769   *         @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
02770   *         @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
02771   *         @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
02772   * @retval None
02773   */
02774 __STATIC_INLINE void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef *RTCx, uint32_t Duration)
02775 {
02776   MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPPRCH, Duration);
02777 }
02778 
02779 /**
02780   * @brief  Get RTC_TAMPx precharge duration
02781   * @rmtoll TAMPCR       TAMPPRCH      LL_RTC_TAMPER_GetPrecharge
02782   * @param  RTCx RTC Instance
02783   * @retval Returned value can be one of the following values:
02784   *         @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
02785   *         @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
02786   *         @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
02787   *         @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
02788   */
02789 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef *RTCx)
02790 {
02791   return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPRCH));
02792 }
02793 #endif /* RTC_TAMPCR_TAMPPRCH */
02794 
02795 #if defined(RTC_TAMPCR_TAMPFLT)
02796 /**
02797   * @brief  Set RTC_TAMPx filter count
02798   * @rmtoll TAMPCR       TAMPFLT       LL_RTC_TAMPER_SetFilterCount
02799   * @param  RTCx RTC Instance
02800   * @param  FilterCount This parameter can be one of the following values:
02801   *         @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
02802   *         @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
02803   *         @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
02804   *         @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
02805   * @retval None
02806   */
02807 __STATIC_INLINE void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef *RTCx, uint32_t FilterCount)
02808 {
02809   MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPFLT, FilterCount);
02810 }
02811 
02812 /**
02813   * @brief  Get RTC_TAMPx filter count
02814   * @rmtoll TAMPCR       TAMPFLT       LL_RTC_TAMPER_GetFilterCount
02815   * @param  RTCx RTC Instance
02816   * @retval Returned value can be one of the following values:
02817   *         @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
02818   *         @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
02819   *         @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
02820   *         @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
02821   */
02822 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef *RTCx)
02823 {
02824   return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPFLT));
02825 }
02826 #endif /* RTC_TAMPCR_TAMPFLT */
02827 
02828 #if defined(RTC_TAMPCR_TAMPFREQ)
02829 /**
02830   * @brief  Set Tamper sampling frequency
02831   * @rmtoll TAMPCR       TAMPFREQ      LL_RTC_TAMPER_SetSamplingFreq
02832   * @param  RTCx RTC Instance
02833   * @param  SamplingFreq This parameter can be one of the following values:
02834   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
02835   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
02836   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
02837   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
02838   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
02839   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
02840   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
02841   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
02842   * @retval None
02843   */
02844 __STATIC_INLINE void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef *RTCx, uint32_t SamplingFreq)
02845 {
02846   MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPFREQ, SamplingFreq);
02847 }
02848 
02849 /**
02850   * @brief  Get Tamper sampling frequency
02851   * @rmtoll TAMPCR       TAMPFREQ      LL_RTC_TAMPER_GetSamplingFreq
02852   * @param  RTCx RTC Instance
02853   * @retval Returned value can be one of the following values:
02854   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
02855   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
02856   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
02857   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
02858   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
02859   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
02860   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
02861   *         @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
02862   */
02863 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef *RTCx)
02864 {
02865   return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPFREQ));
02866 }
02867 #endif /* RTC_TAMPCR_TAMPFREQ */
02868 
02869 /**
02870   * @brief  Enable Active level for Tamper input
02871   * @rmtoll TAMPCR       TAMP1TRG      LL_RTC_TAMPER_EnableActiveLevel\n
02872   *         TAMPCR       TAMP2TRG      LL_RTC_TAMPER_EnableActiveLevel\n
02873   *         TAMPCR       TAMP3TRG      LL_RTC_TAMPER_EnableActiveLevel
02874   * @param  RTCx RTC Instance
02875   * @param  Tamper This parameter can be a combination of the following values:
02876   *         @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 
02877   *         @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 
02878   *         @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 
02879   *         
02880   * @retval None
02881   */
02882 __STATIC_INLINE void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper)
02883 {
02884   SET_BIT(RTCx->TAMPCR, Tamper);
02885 }
02886 
02887 /**
02888   * @brief  Disable Active level for Tamper input
02889   * @rmtoll TAMPCR       TAMP1TRG      LL_RTC_TAMPER_DisableActiveLevel\n
02890   *         TAMPCR       TAMP2TRG      LL_RTC_TAMPER_DisableActiveLevel\n
02891   *         TAMPCR       TAMP3TRG      LL_RTC_TAMPER_DisableActiveLevel
02892   * @param  RTCx RTC Instance
02893   * @param  Tamper This parameter can be a combination of the following values:
02894   *         @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 
02895   *         @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 
02896   *         @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 
02897   *         
02898   * @retval None
02899   */
02900 __STATIC_INLINE void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper)
02901 {
02902   CLEAR_BIT(RTCx->TAMPCR, Tamper);
02903 }
02904 
02905 /**
02906   * @}
02907   */
02908 
02909 #if defined(RTC_WAKEUP_SUPPORT)
02910 /** @defgroup RTC_LL_EF_Wakeup Wakeup
02911   * @{
02912   */
02913 
02914 /**
02915   * @brief  Enable Wakeup timer
02916   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02917   * @rmtoll CR           WUTE          LL_RTC_WAKEUP_Enable
02918   * @param  RTCx RTC Instance
02919   * @retval None
02920   */
02921 __STATIC_INLINE void LL_RTC_WAKEUP_Enable(RTC_TypeDef *RTCx)
02922 {
02923   SET_BIT(RTCx->CR, RTC_CR_WUTE);
02924 }
02925 
02926 /**
02927   * @brief  Disable Wakeup timer
02928   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02929   * @rmtoll CR           WUTE          LL_RTC_WAKEUP_Disable
02930   * @param  RTCx RTC Instance
02931   * @retval None
02932   */
02933 __STATIC_INLINE void LL_RTC_WAKEUP_Disable(RTC_TypeDef *RTCx)
02934 {
02935   CLEAR_BIT(RTCx->CR, RTC_CR_WUTE);
02936 }
02937 
02938 /**
02939   * @brief  Check if Wakeup timer is enabled or not
02940   * @rmtoll CR           WUTE          LL_RTC_WAKEUP_IsEnabled
02941   * @param  RTCx RTC Instance
02942   * @retval State of bit (1 or 0).
02943   */
02944 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef *RTCx)
02945 {
02946   return (READ_BIT(RTCx->CR, RTC_CR_WUTE) == (RTC_CR_WUTE));
02947 }
02948 
02949 /**
02950   * @brief  Select Wakeup clock
02951   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
02952   * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1
02953   * @rmtoll CR           WUCKSEL       LL_RTC_WAKEUP_SetClock
02954   * @param  RTCx RTC Instance
02955   * @param  WakeupClock This parameter can be one of the following values:
02956   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
02957   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
02958   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
02959   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
02960   *         @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
02961   *         @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
02962   * @retval None
02963   */
02964 __STATIC_INLINE void LL_RTC_WAKEUP_SetClock(RTC_TypeDef *RTCx, uint32_t WakeupClock)
02965 {
02966   MODIFY_REG(RTCx->CR, RTC_CR_WUCKSEL, WakeupClock);
02967 }
02968 
02969 /**
02970   * @brief  Get Wakeup clock
02971   * @rmtoll CR           WUCKSEL       LL_RTC_WAKEUP_GetClock
02972   * @param  RTCx RTC Instance
02973   * @retval Returned value can be one of the following values:
02974   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
02975   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
02976   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
02977   *         @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
02978   *         @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
02979   *         @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
02980   */
02981 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef *RTCx)
02982 {
02983   return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_WUCKSEL));
02984 }
02985 
02986 /**
02987   * @brief  Set Wakeup auto-reload value
02988   * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR
02989   * @rmtoll WUTR         WUT           LL_RTC_WAKEUP_SetAutoReload
02990   * @param  RTCx RTC Instance
02991   * @param  Value Value between Min_Data=0x00 and Max_Data=0xFFFF
02992   * @retval None
02993   */
02994 __STATIC_INLINE void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef *RTCx, uint32_t Value)
02995 {
02996   MODIFY_REG(RTCx->WUTR, RTC_WUTR_WUT, Value);
02997 }
02998 
02999 /**
03000   * @brief  Get Wakeup auto-reload value
03001   * @rmtoll WUTR         WUT           LL_RTC_WAKEUP_GetAutoReload
03002   * @param  RTCx RTC Instance
03003   * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
03004   */
03005 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef *RTCx)
03006 {
03007   return (uint32_t)(READ_BIT(RTCx->WUTR, RTC_WUTR_WUT));
03008 }
03009 
03010 /**
03011   * @}
03012   */
03013 #endif /* RTC_WAKEUP_SUPPORT */
03014 
03015 #if defined(RTC_BACKUP_SUPPORT)
03016 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
03017   * @{
03018   */
03019 
03020 /**
03021   * @brief  Writes a data in a specified RTC Backup data register.
03022   * @rmtoll BKPxR        BKP           LL_RTC_BAK_SetRegister
03023   * @param  RTCx RTC Instance
03024   * @param  BackupRegister This parameter can be one of the following values:
03025   *         @arg @ref LL_RTC_BKP_DR0
03026   *         @arg @ref LL_RTC_BKP_DR1
03027   *         @arg @ref LL_RTC_BKP_DR2
03028   *         @arg @ref LL_RTC_BKP_DR3
03029   *         @arg @ref LL_RTC_BKP_DR4
03030   *         @arg @ref LL_RTC_BKP_DR5
03031   *         @arg @ref LL_RTC_BKP_DR6
03032   *         @arg @ref LL_RTC_BKP_DR7
03033   *         @arg @ref LL_RTC_BKP_DR8
03034   *         @arg @ref LL_RTC_BKP_DR9
03035   *         @arg @ref LL_RTC_BKP_DR10
03036   *         @arg @ref LL_RTC_BKP_DR11
03037   *         @arg @ref LL_RTC_BKP_DR12
03038   *         @arg @ref LL_RTC_BKP_DR13
03039   *         @arg @ref LL_RTC_BKP_DR14
03040   *         @arg @ref LL_RTC_BKP_DR15
03041   *         @arg @ref LL_RTC_BKP_DR16
03042   *         @arg @ref LL_RTC_BKP_DR17
03043   *         @arg @ref LL_RTC_BKP_DR18
03044   *         @arg @ref LL_RTC_BKP_DR19
03045   *         @arg @ref LL_RTC_BKP_DR20
03046   *         @arg @ref LL_RTC_BKP_DR21
03047   *         @arg @ref LL_RTC_BKP_DR22
03048   *         @arg @ref LL_RTC_BKP_DR23
03049   *         @arg @ref LL_RTC_BKP_DR24
03050   *         @arg @ref LL_RTC_BKP_DR25
03051   *         @arg @ref LL_RTC_BKP_DR26
03052   *         @arg @ref LL_RTC_BKP_DR27
03053   *         @arg @ref LL_RTC_BKP_DR28
03054   *         @arg @ref LL_RTC_BKP_DR29
03055   *         @arg @ref LL_RTC_BKP_DR30
03056   *         @arg @ref LL_RTC_BKP_DR31
03057   * @param  Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
03058   * @retval None
03059   */
03060 __STATIC_INLINE void LL_RTC_BAK_SetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister, uint32_t Data)
03061 {
03062   register uint32_t tmp = 0U;
03063 
03064   tmp = (uint32_t)(&(RTCx->BKP0R));
03065   tmp += (BackupRegister * 4U);
03066 
03067   /* Write the specified register */
03068   *(__IO uint32_t *)tmp = (uint32_t)Data;
03069 }
03070 
03071 /**
03072   * @brief  Reads data from the specified RTC Backup data Register.
03073   * @rmtoll BKPxR        BKP           LL_RTC_BAK_GetRegister
03074   * @param  RTCx RTC Instance
03075   * @param  BackupRegister This parameter can be one of the following values:
03076   *         @arg @ref LL_RTC_BKP_DR0
03077   *         @arg @ref LL_RTC_BKP_DR1
03078   *         @arg @ref LL_RTC_BKP_DR2
03079   *         @arg @ref LL_RTC_BKP_DR3
03080   *         @arg @ref LL_RTC_BKP_DR4
03081   *         @arg @ref LL_RTC_BKP_DR5
03082   *         @arg @ref LL_RTC_BKP_DR6
03083   *         @arg @ref LL_RTC_BKP_DR7
03084   *         @arg @ref LL_RTC_BKP_DR8
03085   *         @arg @ref LL_RTC_BKP_DR9
03086   *         @arg @ref LL_RTC_BKP_DR10
03087   *         @arg @ref LL_RTC_BKP_DR11
03088   *         @arg @ref LL_RTC_BKP_DR12
03089   *         @arg @ref LL_RTC_BKP_DR13
03090   *         @arg @ref LL_RTC_BKP_DR14
03091   *         @arg @ref LL_RTC_BKP_DR15
03092   *         @arg @ref LL_RTC_BKP_DR16
03093   *         @arg @ref LL_RTC_BKP_DR17
03094   *         @arg @ref LL_RTC_BKP_DR18
03095   *         @arg @ref LL_RTC_BKP_DR19
03096   *         @arg @ref LL_RTC_BKP_DR20
03097   *         @arg @ref LL_RTC_BKP_DR21
03098   *         @arg @ref LL_RTC_BKP_DR22
03099   *         @arg @ref LL_RTC_BKP_DR23
03100   *         @arg @ref LL_RTC_BKP_DR24
03101   *         @arg @ref LL_RTC_BKP_DR25
03102   *         @arg @ref LL_RTC_BKP_DR26
03103   *         @arg @ref LL_RTC_BKP_DR27
03104   *         @arg @ref LL_RTC_BKP_DR28
03105   *         @arg @ref LL_RTC_BKP_DR29
03106   *         @arg @ref LL_RTC_BKP_DR30
03107   *         @arg @ref LL_RTC_BKP_DR31
03108   * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
03109   */
03110 __STATIC_INLINE uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister)
03111 {
03112   register uint32_t tmp = 0U;
03113 
03114   tmp = (uint32_t)(&(RTCx->BKP0R));
03115   tmp += (BackupRegister * 4U);
03116 
03117   /* Read the specified register */
03118   return (*(__IO uint32_t *)tmp);
03119 }
03120 
03121 /**
03122   * @}
03123   */
03124 #endif /* RTC_BACKUP_SUPPORT */
03125 
03126 /** @defgroup RTC_LL_EF_Calibration Calibration
03127   * @{
03128   */
03129 
03130 /**
03131   * @brief  Set Calibration output frequency (1 Hz or 512 Hz)
03132   * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03133   * @rmtoll CR           COE           LL_RTC_CAL_SetOutputFreq\n
03134   *         CR           COSEL         LL_RTC_CAL_SetOutputFreq
03135   * @param  RTCx RTC Instance
03136   * @param  Frequency This parameter can be one of the following values:
03137   *         @arg @ref LL_RTC_CALIB_OUTPUT_NONE
03138   *         @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
03139   *         @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
03140   * @retval None
03141   */
03142 __STATIC_INLINE void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef *RTCx, uint32_t Frequency)
03143 {
03144   MODIFY_REG(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL, Frequency);
03145 }
03146 
03147 /**
03148   * @brief  Get Calibration output frequency (1 Hz or 512 Hz)
03149   * @rmtoll CR           COE           LL_RTC_CAL_GetOutputFreq\n
03150   *         CR           COSEL         LL_RTC_CAL_GetOutputFreq
03151   * @param  RTCx RTC Instance
03152   * @retval Returned value can be one of the following values:
03153   *         @arg @ref LL_RTC_CALIB_OUTPUT_NONE
03154   *         @arg @ref LL_RTC_CALIB_OUTPUT_1HZ
03155   *         @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
03156   */
03157 __STATIC_INLINE uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef *RTCx)
03158 {
03159   return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL));
03160 }
03161 
03162 /**
03163   * @brief  Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm)
03164   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03165   * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
03166   * @rmtoll CALR         CALP          LL_RTC_CAL_SetPulse
03167   * @param  RTCx RTC Instance
03168   * @param  Pulse This parameter can be one of the following values:
03169   *         @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE
03170   *         @arg @ref LL_RTC_CALIB_INSERTPULSE_SET
03171   * @retval None
03172   */
03173 __STATIC_INLINE void LL_RTC_CAL_SetPulse(RTC_TypeDef *RTCx, uint32_t Pulse)
03174 {
03175   MODIFY_REG(RTCx->CALR, RTC_CALR_CALP, Pulse);
03176 }
03177 
03178 /**
03179   * @brief  Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm)
03180   * @rmtoll CALR         CALP          LL_RTC_CAL_IsPulseInserted
03181   * @param  RTCx RTC Instance
03182   * @retval State of bit (1 or 0).
03183   */
03184 __STATIC_INLINE uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef *RTCx)
03185 {
03186   return (READ_BIT(RTCx->CALR, RTC_CALR_CALP) == (RTC_CALR_CALP));
03187 }
03188 
03189 /**
03190   * @brief  Set the calibration cycle period
03191   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03192   * @note   Bit can be written only when RECALPF is set to 0 in RTC_ISR
03193   * @rmtoll CALR         CALW8         LL_RTC_CAL_SetPeriod\n
03194   *         CALR         CALW16        LL_RTC_CAL_SetPeriod
03195   * @param  RTCx RTC Instance
03196   * @param  Period This parameter can be one of the following values:
03197   *         @arg @ref LL_RTC_CALIB_PERIOD_32SEC
03198   *         @arg @ref LL_RTC_CALIB_PERIOD_16SEC
03199   *         @arg @ref LL_RTC_CALIB_PERIOD_8SEC
03200   * @retval None
03201   */
03202 __STATIC_INLINE void LL_RTC_CAL_SetPeriod(RTC_TypeDef *RTCx, uint32_t Period)
03203 {
03204   MODIFY_REG(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16, Period);
03205 }
03206 
03207 /**
03208   * @brief  Get the calibration cycle period
03209   * @rmtoll CALR         CALW8         LL_RTC_CAL_GetPeriod\n
03210   *         CALR         CALW16        LL_RTC_CAL_GetPeriod
03211   * @param  RTCx RTC Instance
03212   * @retval Returned value can be one of the following values:
03213   *         @arg @ref LL_RTC_CALIB_PERIOD_32SEC
03214   *         @arg @ref LL_RTC_CALIB_PERIOD_16SEC
03215   *         @arg @ref LL_RTC_CALIB_PERIOD_8SEC
03216   */
03217 __STATIC_INLINE uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef *RTCx)
03218 {
03219   return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16));
03220 }
03221 
03222 /**
03223   * @brief  Set Calibration minus
03224   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03225   * @note   Bit can be written only when RECALPF is set to 0 in RTC_ISR
03226   * @rmtoll CALR         CALM          LL_RTC_CAL_SetMinus
03227   * @param  RTCx RTC Instance
03228   * @param  CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF
03229   * @retval None
03230   */
03231 __STATIC_INLINE void LL_RTC_CAL_SetMinus(RTC_TypeDef *RTCx, uint32_t CalibMinus)
03232 {
03233   MODIFY_REG(RTCx->CALR, RTC_CALR_CALM, CalibMinus);
03234 }
03235 
03236 /**
03237   * @brief  Get Calibration minus
03238   * @rmtoll CALR         CALM          LL_RTC_CAL_GetMinus
03239   * @param  RTCx RTC Instance
03240   * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF
03241   */
03242 __STATIC_INLINE uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef *RTCx)
03243 {
03244   return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALM));
03245 }
03246 
03247 /**
03248   * @}
03249   */
03250 
03251 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
03252   * @{
03253   */
03254 
03255 /**
03256   * @brief  Get Internal Time-stamp flag
03257   * @rmtoll ISR          ITSF          LL_RTC_IsActiveFlag_ITS
03258   * @param  RTCx RTC Instance
03259   * @retval State of bit (1 or 0).
03260   */
03261 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef *RTCx)
03262 {
03263   return (READ_BIT(RTCx->ISR, RTC_ISR_ITSF) == (RTC_ISR_ITSF));
03264 }
03265 
03266 /**
03267   * @brief  Get Recalibration pending Flag
03268   * @rmtoll ISR          RECALPF       LL_RTC_IsActiveFlag_RECALP
03269   * @param  RTCx RTC Instance
03270   * @retval State of bit (1 or 0).
03271   */
03272 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef *RTCx)
03273 {
03274   return (READ_BIT(RTCx->ISR, RTC_ISR_RECALPF) == (RTC_ISR_RECALPF));
03275 }
03276 
03277 #if defined(RTC_TAMPER3_SUPPORT)
03278 /**
03279   * @brief  Get RTC_TAMP3 detection flag
03280   * @rmtoll ISR          TAMP3F        LL_RTC_IsActiveFlag_TAMP3
03281   * @param  RTCx RTC Instance
03282   * @retval State of bit (1 or 0).
03283   */
03284 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef *RTCx)
03285 {
03286   return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP3F) == (RTC_ISR_TAMP3F));
03287 }
03288 #endif /* RTC_TAMPER3_SUPPORT */
03289 
03290 #if defined(RTC_TAMPER2_SUPPORT)
03291 /**
03292   * @brief  Get RTC_TAMP2 detection flag
03293   * @rmtoll ISR          TAMP2F        LL_RTC_IsActiveFlag_TAMP2
03294   * @param  RTCx RTC Instance
03295   * @retval State of bit (1 or 0).
03296   */
03297 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef *RTCx)
03298 {
03299   return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP2F) == (RTC_ISR_TAMP2F));
03300 }
03301 #endif /* RTC_TAMPER2_SUPPORT */
03302 
03303 #if defined(RTC_TAMPER1_SUPPORT)
03304 /**
03305   * @brief  Get RTC_TAMP1 detection flag
03306   * @rmtoll ISR          TAMP1F        LL_RTC_IsActiveFlag_TAMP1
03307   * @param  RTCx RTC Instance
03308   * @retval State of bit (1 or 0).
03309   */
03310 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef *RTCx)
03311 {
03312   return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP1F) == (RTC_ISR_TAMP1F));
03313 }
03314 #endif /* RTC_TAMPER1_SUPPORT */
03315 
03316 /**
03317   * @brief  Get Time-stamp overflow flag
03318   * @rmtoll ISR          TSOVF         LL_RTC_IsActiveFlag_TSOV
03319   * @param  RTCx RTC Instance
03320   * @retval State of bit (1 or 0).
03321   */
03322 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef *RTCx)
03323 {
03324   return (READ_BIT(RTCx->ISR, RTC_ISR_TSOVF) == (RTC_ISR_TSOVF));
03325 }
03326 
03327 /**
03328   * @brief  Get Time-stamp flag
03329   * @rmtoll ISR          TSF           LL_RTC_IsActiveFlag_TS
03330   * @param  RTCx RTC Instance
03331   * @retval State of bit (1 or 0).
03332   */
03333 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef *RTCx)
03334 {
03335   return (READ_BIT(RTCx->ISR, RTC_ISR_TSF) == (RTC_ISR_TSF));
03336 }
03337 
03338 #if defined(RTC_WAKEUP_SUPPORT)
03339 /**
03340   * @brief  Get Wakeup timer flag
03341   * @rmtoll ISR          WUTF          LL_RTC_IsActiveFlag_WUT
03342   * @param  RTCx RTC Instance
03343   * @retval State of bit (1 or 0).
03344   */
03345 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef *RTCx)
03346 {
03347   return (READ_BIT(RTCx->ISR, RTC_ISR_WUTF) == (RTC_ISR_WUTF));
03348 }
03349 #endif /* RTC_WAKEUP_SUPPORT */
03350 
03351 /**
03352   * @brief  Get Alarm B flag
03353   * @rmtoll ISR          ALRBF         LL_RTC_IsActiveFlag_ALRB
03354   * @param  RTCx RTC Instance
03355   * @retval State of bit (1 or 0).
03356   */
03357 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef *RTCx)
03358 {
03359   return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBF) == (RTC_ISR_ALRBF));
03360 }
03361 
03362 /**
03363   * @brief  Get Alarm A flag
03364   * @rmtoll ISR          ALRAF         LL_RTC_IsActiveFlag_ALRA
03365   * @param  RTCx RTC Instance
03366   * @retval State of bit (1 or 0).
03367   */
03368 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef *RTCx)
03369 {
03370   return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAF) == (RTC_ISR_ALRAF));
03371 }
03372 
03373 /**
03374   * @brief  Clear Internal Time-stamp flag
03375   * @rmtoll ISR          ITSF          LL_RTC_ClearFlag_ITS
03376   * @param  RTCx RTC Instance
03377   * @retval None
03378   */
03379 __STATIC_INLINE void LL_RTC_ClearFlag_ITS(RTC_TypeDef *RTCx)
03380 {
03381   WRITE_REG(RTCx->ISR, (~((RTC_ISR_ITSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03382 }
03383 
03384 #if defined(RTC_TAMPER3_SUPPORT)
03385 /**
03386   * @brief  Clear RTC_TAMP3 detection flag
03387   * @rmtoll ISR          TAMP3F        LL_RTC_ClearFlag_TAMP3
03388   * @param  RTCx RTC Instance
03389   * @retval None
03390   */
03391 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef *RTCx)
03392 {
03393   WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP3F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03394 }
03395 #endif /* RTC_TAMPER3_SUPPORT */
03396 
03397 #if defined(RTC_TAMPER2_SUPPORT)
03398 /**
03399   * @brief  Clear RTC_TAMP2 detection flag
03400   * @rmtoll ISR          TAMP2F        LL_RTC_ClearFlag_TAMP2
03401   * @param  RTCx RTC Instance
03402   * @retval None
03403   */
03404 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef *RTCx)
03405 {
03406   WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP2F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03407 }
03408 #endif /* RTC_TAMPER2_SUPPORT */
03409 
03410 #if defined(RTC_TAMPER1_SUPPORT)
03411 /**
03412   * @brief  Clear RTC_TAMP1 detection flag
03413   * @rmtoll ISR          TAMP1F        LL_RTC_ClearFlag_TAMP1
03414   * @param  RTCx RTC Instance
03415   * @retval None
03416   */
03417 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef *RTCx)
03418 {
03419   WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP1F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03420 }
03421 #endif /* RTC_TAMPER1_SUPPORT */
03422 
03423 /**
03424   * @brief  Clear Time-stamp overflow flag
03425   * @rmtoll ISR          TSOVF         LL_RTC_ClearFlag_TSOV
03426   * @param  RTCx RTC Instance
03427   * @retval None
03428   */
03429 __STATIC_INLINE void LL_RTC_ClearFlag_TSOV(RTC_TypeDef *RTCx)
03430 {
03431   WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSOVF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03432 }
03433 
03434 /**
03435   * @brief  Clear Time-stamp flag
03436   * @rmtoll ISR          TSF           LL_RTC_ClearFlag_TS
03437   * @param  RTCx RTC Instance
03438   * @retval None
03439   */
03440 __STATIC_INLINE void LL_RTC_ClearFlag_TS(RTC_TypeDef *RTCx)
03441 {
03442   WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03443 }
03444 
03445 #if defined(RTC_WAKEUP_SUPPORT)
03446 /**
03447   * @brief  Clear Wakeup timer flag
03448   * @rmtoll ISR          WUTF          LL_RTC_ClearFlag_WUT
03449   * @param  RTCx RTC Instance
03450   * @retval None
03451   */
03452 __STATIC_INLINE void LL_RTC_ClearFlag_WUT(RTC_TypeDef *RTCx)
03453 {
03454   WRITE_REG(RTCx->ISR, (~((RTC_ISR_WUTF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03455 }
03456 #endif /* RTC_WAKEUP_SUPPORT */
03457 
03458 /**
03459   * @brief  Clear Alarm B flag
03460   * @rmtoll ISR          ALRBF         LL_RTC_ClearFlag_ALRB
03461   * @param  RTCx RTC Instance
03462   * @retval None
03463   */
03464 __STATIC_INLINE void LL_RTC_ClearFlag_ALRB(RTC_TypeDef *RTCx)
03465 {
03466   WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRBF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03467 }
03468 
03469 /**
03470   * @brief  Clear Alarm A flag
03471   * @rmtoll ISR          ALRAF         LL_RTC_ClearFlag_ALRA
03472   * @param  RTCx RTC Instance
03473   * @retval None
03474   */
03475 __STATIC_INLINE void LL_RTC_ClearFlag_ALRA(RTC_TypeDef *RTCx)
03476 {
03477   WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRAF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03478 }
03479 
03480 /**
03481   * @brief  Get Initialization flag
03482   * @rmtoll ISR          INITF         LL_RTC_IsActiveFlag_INIT
03483   * @param  RTCx RTC Instance
03484   * @retval State of bit (1 or 0).
03485   */
03486 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx)
03487 {
03488   return (READ_BIT(RTCx->ISR, RTC_ISR_INITF) == (RTC_ISR_INITF));
03489 }
03490 
03491 /**
03492   * @brief  Get Registers synchronization flag
03493   * @rmtoll ISR          RSF           LL_RTC_IsActiveFlag_RS
03494   * @param  RTCx RTC Instance
03495   * @retval State of bit (1 or 0).
03496   */
03497 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx)
03498 {
03499   return (READ_BIT(RTCx->ISR, RTC_ISR_RSF) == (RTC_ISR_RSF));
03500 }
03501 
03502 /**
03503   * @brief  Clear Registers synchronization flag
03504   * @rmtoll ISR          RSF           LL_RTC_ClearFlag_RS
03505   * @param  RTCx RTC Instance
03506   * @retval None
03507   */
03508 __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx)
03509 {
03510   WRITE_REG(RTCx->ISR, (~((RTC_ISR_RSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
03511 }
03512 
03513 /**
03514   * @brief  Get Initialization status flag
03515   * @rmtoll ISR          INITS         LL_RTC_IsActiveFlag_INITS
03516   * @param  RTCx RTC Instance
03517   * @retval State of bit (1 or 0).
03518   */
03519 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef *RTCx)
03520 {
03521   return (READ_BIT(RTCx->ISR, RTC_ISR_INITS) == (RTC_ISR_INITS));
03522 }
03523 
03524 /**
03525   * @brief  Get Shift operation pending flag
03526   * @rmtoll ISR          SHPF          LL_RTC_IsActiveFlag_SHP
03527   * @param  RTCx RTC Instance
03528   * @retval State of bit (1 or 0).
03529   */
03530 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef *RTCx)
03531 {
03532   return (READ_BIT(RTCx->ISR, RTC_ISR_SHPF) == (RTC_ISR_SHPF));
03533 }
03534 
03535 #if defined(RTC_WAKEUP_SUPPORT)
03536 /**
03537   * @brief  Get Wakeup timer write flag
03538   * @rmtoll ISR          WUTWF         LL_RTC_IsActiveFlag_WUTW
03539   * @param  RTCx RTC Instance
03540   * @retval State of bit (1 or 0).
03541   */
03542 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef *RTCx)
03543 {
03544   return (READ_BIT(RTCx->ISR, RTC_ISR_WUTWF) == (RTC_ISR_WUTWF));
03545 }
03546 #endif /* RTC_WAKEUP_SUPPORT */
03547 
03548 /**
03549   * @brief  Get Alarm B write flag
03550   * @rmtoll ISR          ALRBWF        LL_RTC_IsActiveFlag_ALRBW
03551   * @param  RTCx RTC Instance
03552   * @retval State of bit (1 or 0).
03553   */
03554 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef *RTCx)
03555 {
03556   return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBWF) == (RTC_ISR_ALRBWF));
03557 }
03558 
03559 /**
03560   * @brief  Get Alarm A write flag
03561   * @rmtoll ISR          ALRAWF        LL_RTC_IsActiveFlag_ALRAW
03562   * @param  RTCx RTC Instance
03563   * @retval State of bit (1 or 0).
03564   */
03565 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef *RTCx)
03566 {
03567   return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAWF) == (RTC_ISR_ALRAWF));
03568 }
03569 
03570 /**
03571   * @}
03572   */
03573 
03574 /** @defgroup RTC_LL_EF_IT_Management IT_Management
03575   * @{
03576   */
03577 
03578 /**
03579   * @brief  Enable Time-stamp interrupt
03580   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03581   * @rmtoll CR           TSIE          LL_RTC_EnableIT_TS
03582   * @param  RTCx RTC Instance
03583   * @retval None
03584   */
03585 __STATIC_INLINE void LL_RTC_EnableIT_TS(RTC_TypeDef *RTCx)
03586 {
03587   SET_BIT(RTCx->CR, RTC_CR_TSIE);
03588 }
03589 
03590 /**
03591   * @brief  Disable Time-stamp interrupt
03592   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03593   * @rmtoll CR           TSIE          LL_RTC_DisableIT_TS
03594   * @param  RTCx RTC Instance
03595   * @retval None
03596   */
03597 __STATIC_INLINE void LL_RTC_DisableIT_TS(RTC_TypeDef *RTCx)
03598 {
03599   CLEAR_BIT(RTCx->CR, RTC_CR_TSIE);
03600 }
03601 
03602 #if defined(RTC_WAKEUP_SUPPORT)
03603 /**
03604   * @brief  Enable Wakeup timer interrupt
03605   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03606   * @rmtoll CR           WUTIE         LL_RTC_EnableIT_WUT
03607   * @param  RTCx RTC Instance
03608   * @retval None
03609   */
03610 __STATIC_INLINE void LL_RTC_EnableIT_WUT(RTC_TypeDef *RTCx)
03611 {
03612   SET_BIT(RTCx->CR, RTC_CR_WUTIE);
03613 }
03614 
03615 /**
03616   * @brief  Disable Wakeup timer interrupt
03617   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03618   * @rmtoll CR           WUTIE         LL_RTC_DisableIT_WUT
03619   * @param  RTCx RTC Instance
03620   * @retval None
03621   */
03622 __STATIC_INLINE void LL_RTC_DisableIT_WUT(RTC_TypeDef *RTCx)
03623 {
03624   CLEAR_BIT(RTCx->CR, RTC_CR_WUTIE);
03625 }
03626 #endif /* RTC_WAKEUP_SUPPORT */
03627 
03628 /**
03629   * @brief  Enable Alarm B interrupt
03630   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03631   * @rmtoll CR           ALRBIE        LL_RTC_EnableIT_ALRB
03632   * @param  RTCx RTC Instance
03633   * @retval None
03634   */
03635 __STATIC_INLINE void LL_RTC_EnableIT_ALRB(RTC_TypeDef *RTCx)
03636 {
03637   SET_BIT(RTCx->CR, RTC_CR_ALRBIE);
03638 }
03639 
03640 /**
03641   * @brief  Disable Alarm B interrupt
03642   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03643   * @rmtoll CR           ALRBIE        LL_RTC_DisableIT_ALRB
03644   * @param  RTCx RTC Instance
03645   * @retval None
03646   */
03647 __STATIC_INLINE void LL_RTC_DisableIT_ALRB(RTC_TypeDef *RTCx)
03648 {
03649   CLEAR_BIT(RTCx->CR, RTC_CR_ALRBIE);
03650 }
03651 
03652 /**
03653   * @brief  Enable Alarm A interrupt
03654   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03655   * @rmtoll CR           ALRAIE        LL_RTC_EnableIT_ALRA
03656   * @param  RTCx RTC Instance
03657   * @retval None
03658   */
03659 __STATIC_INLINE void LL_RTC_EnableIT_ALRA(RTC_TypeDef *RTCx)
03660 {
03661   SET_BIT(RTCx->CR, RTC_CR_ALRAIE);
03662 }
03663 
03664 /**
03665   * @brief  Disable Alarm A interrupt
03666   * @note   Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
03667   * @rmtoll CR           ALRAIE        LL_RTC_DisableIT_ALRA
03668   * @param  RTCx RTC Instance
03669   * @retval None
03670   */
03671 __STATIC_INLINE void LL_RTC_DisableIT_ALRA(RTC_TypeDef *RTCx)
03672 {
03673   CLEAR_BIT(RTCx->CR, RTC_CR_ALRAIE);
03674 }
03675 
03676 #if defined(RTC_TAMPER3_SUPPORT)
03677 /**
03678   * @brief  Enable Tamper 3 interrupt
03679   * @rmtoll TAMPCR       TAMP3IE       LL_RTC_EnableIT_TAMP3
03680   * @param  RTCx RTC Instance
03681   * @retval None
03682   */
03683 __STATIC_INLINE void LL_RTC_EnableIT_TAMP3(RTC_TypeDef *RTCx)
03684 {
03685   SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE);
03686 }
03687 
03688 /**
03689   * @brief  Disable Tamper 3 interrupt
03690   * @rmtoll TAMPCR       TAMP3IE       LL_RTC_DisableIT_TAMP3
03691   * @param  RTCx RTC Instance
03692   * @retval None
03693   */
03694 __STATIC_INLINE void LL_RTC_DisableIT_TAMP3(RTC_TypeDef *RTCx)
03695 {
03696   CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE);
03697 }
03698 #endif /* RTC_TAMPER3_SUPPORT */
03699 
03700 #if defined(RTC_TAMPER2_SUPPORT)
03701 /**
03702   * @brief  Enable Tamper 2 interrupt
03703   * @rmtoll TAMPCR       TAMP2IE       LL_RTC_EnableIT_TAMP2
03704   * @param  RTCx RTC Instance
03705   * @retval None
03706   */
03707 __STATIC_INLINE void LL_RTC_EnableIT_TAMP2(RTC_TypeDef *RTCx)
03708 {
03709   SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE);
03710 }
03711 
03712 /**
03713   * @brief  Disable Tamper 2 interrupt
03714   * @rmtoll TAMPCR       TAMP2IE       LL_RTC_DisableIT_TAMP2
03715   * @param  RTCx RTC Instance
03716   * @retval None
03717   */
03718 __STATIC_INLINE void LL_RTC_DisableIT_TAMP2(RTC_TypeDef *RTCx)
03719 {
03720   CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE);
03721 }
03722 #endif /* RTC_TAMPER2_SUPPORT */
03723 
03724 #if defined(RTC_TAMPER1_SUPPORT)
03725 /**
03726   * @brief  Enable Tamper 1 interrupt
03727   * @rmtoll TAMPCR       TAMP1IE       LL_RTC_EnableIT_TAMP1
03728   * @param  RTCx RTC Instance
03729   * @retval None
03730   */
03731 __STATIC_INLINE void LL_RTC_EnableIT_TAMP1(RTC_TypeDef *RTCx)
03732 {
03733   SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE);
03734 }
03735 
03736 /**
03737   * @brief  Disable Tamper 1 interrupt
03738   * @rmtoll TAMPCR       TAMP1IE       LL_RTC_DisableIT_TAMP1
03739   * @param  RTCx RTC Instance
03740   * @retval None
03741   */
03742 __STATIC_INLINE void LL_RTC_DisableIT_TAMP1(RTC_TypeDef *RTCx)
03743 {
03744   CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE);
03745 }
03746 #endif /* RTC_TAMPER1_SUPPORT */
03747 
03748 /**
03749   * @brief  Enable all Tamper Interrupt
03750   * @rmtoll TAMPCR       TAMPIE        LL_RTC_EnableIT_TAMP
03751   * @param  RTCx RTC Instance
03752   * @retval None
03753   */
03754 __STATIC_INLINE void LL_RTC_EnableIT_TAMP(RTC_TypeDef *RTCx)
03755 {
03756   SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE);
03757 }
03758 
03759 /**
03760   * @brief  Disable all Tamper Interrupt
03761   * @rmtoll TAMPCR       TAMPIE        LL_RTC_DisableIT_TAMP
03762   * @param  RTCx RTC Instance
03763   * @retval None
03764   */
03765 __STATIC_INLINE void LL_RTC_DisableIT_TAMP(RTC_TypeDef *RTCx)
03766 {
03767   CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE);
03768 }
03769 
03770 /**
03771   * @brief  Check if  Time-stamp interrupt is enabled or not
03772   * @rmtoll CR           TSIE          LL_RTC_IsEnabledIT_TS
03773   * @param  RTCx RTC Instance
03774   * @retval State of bit (1 or 0).
03775   */
03776 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef *RTCx)
03777 {
03778   return (READ_BIT(RTCx->CR, RTC_CR_TSIE) == (RTC_CR_TSIE));
03779 }
03780 
03781 #if defined(RTC_WAKEUP_SUPPORT)
03782 /**
03783   * @brief  Check if  Wakeup timer interrupt is enabled or not
03784   * @rmtoll CR           WUTIE         LL_RTC_IsEnabledIT_WUT
03785   * @param  RTCx RTC Instance
03786   * @retval State of bit (1 or 0).
03787   */
03788 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef *RTCx)
03789 {
03790   return (READ_BIT(RTCx->CR, RTC_CR_WUTIE) == (RTC_CR_WUTIE));
03791 }
03792 #endif /* RTC_WAKEUP_SUPPORT */
03793 
03794 /**
03795   * @brief  Check if  Alarm B interrupt is enabled or not
03796   * @rmtoll CR           ALRBIE        LL_RTC_IsEnabledIT_ALRB
03797   * @param  RTCx RTC Instance
03798   * @retval State of bit (1 or 0).
03799   */
03800 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef *RTCx)
03801 {
03802   return (READ_BIT(RTCx->CR, RTC_CR_ALRBIE) == (RTC_CR_ALRBIE));
03803 }
03804 
03805 /**
03806   * @brief  Check if  Alarm A interrupt is enabled or not
03807   * @rmtoll CR           ALRAIE        LL_RTC_IsEnabledIT_ALRA
03808   * @param  RTCx RTC Instance
03809   * @retval State of bit (1 or 0).
03810   */
03811 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef *RTCx)
03812 {
03813   return (READ_BIT(RTCx->CR, RTC_CR_ALRAIE) == (RTC_CR_ALRAIE));
03814 }
03815 
03816 #if defined(RTC_TAMPER3_SUPPORT)
03817 /**
03818   * @brief  Check if  Tamper 3 interrupt is enabled or not
03819   * @rmtoll TAMPCR       TAMP3IE       LL_RTC_IsEnabledIT_TAMP3
03820   * @param  RTCx RTC Instance
03821   * @retval State of bit (1 or 0).
03822   */
03823 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef *RTCx)
03824 {
03825   return (READ_BIT(RTCx->TAMPCR,
03826                    RTC_TAMPCR_TAMP3IE) == (RTC_TAMPCR_TAMP3IE));
03827 }
03828 #endif /* RTC_TAMPER3_SUPPORT */
03829 
03830 #if defined(RTC_TAMPER2_SUPPORT)
03831 /**
03832   * @brief  Check if  Tamper 2 interrupt is enabled or not
03833   * @rmtoll TAMPCR       TAMP2IE       LL_RTC_IsEnabledIT_TAMP2
03834   * @param  RTCx RTC Instance
03835   * @retval State of bit (1 or 0).
03836   */
03837 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP2(RTC_TypeDef *RTCx)
03838 {
03839   return (READ_BIT(RTCx->TAMPCR,
03840                    RTC_TAMPCR_TAMP2IE) == (RTC_TAMPCR_TAMP2IE));
03841 
03842 }
03843 #endif /* RTC_TAMPER2_SUPPORT */
03844 
03845 #if defined(RTC_TAMPER1_SUPPORT)
03846 /**
03847   * @brief  Check if  Tamper 1 interrupt is enabled or not
03848   * @rmtoll TAMPCR       TAMP1IE       LL_RTC_IsEnabledIT_TAMP1
03849   * @param  RTCx RTC Instance
03850   * @retval State of bit (1 or 0).
03851   */
03852 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP1(RTC_TypeDef *RTCx)
03853 {
03854   return (READ_BIT(RTCx->TAMPCR,
03855                    RTC_TAMPCR_TAMP1IE) == (RTC_TAMPCR_TAMP1IE));
03856 }
03857 #endif /* RTC_TAMPER1_SUPPORT */
03858 
03859 /**
03860   * @brief  Check if all the TAMPER interrupts are enabled or not
03861   * @rmtoll TAMPCR       TAMPIE        LL_RTC_IsEnabledIT_TAMP
03862   * @param  RTCx RTC Instance
03863   * @retval State of bit (1 or 0).
03864   */
03865 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef *RTCx)
03866 {
03867   return (READ_BIT(RTCx->TAMPCR,
03868                    RTC_TAMPCR_TAMPIE) == (RTC_TAMPCR_TAMPIE));
03869 }
03870 
03871 /**
03872   * @}
03873   */
03874 
03875 #if defined(USE_FULL_LL_DRIVER)
03876 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
03877   * @{
03878   */
03879 
03880 ErrorStatus LL_RTC_DeInit(RTC_TypeDef *RTCx);
03881 ErrorStatus LL_RTC_Init(RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct);
03882 void        LL_RTC_StructInit(LL_RTC_InitTypeDef *RTC_InitStruct);
03883 ErrorStatus LL_RTC_TIME_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct);
03884 void        LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef *RTC_TimeStruct);
03885 ErrorStatus LL_RTC_DATE_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_DateTypeDef *RTC_DateStruct);
03886 void        LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef *RTC_DateStruct);
03887 ErrorStatus LL_RTC_ALMA_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
03888 ErrorStatus LL_RTC_ALMB_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
03889 void        LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
03890 void        LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
03891 ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx);
03892 ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx);
03893 ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx);
03894 
03895 /**
03896   * @}
03897   */
03898 #endif /* USE_FULL_LL_DRIVER */
03899 
03900 /**
03901   * @}
03902   */
03903 
03904 /**
03905   * @}
03906   */
03907 
03908 #endif /* defined(RTC) */
03909 
03910 /**
03911   * @}
03912   */
03913 
03914 #ifdef __cplusplus
03915 }
03916 #endif
03917 
03918 #endif /* __STM32L4xx_LL_RTC_H */
03919 
03920 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/