STM32H735xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32h7xx_ll_rtc.h 00004 * @author MCD Application Team 00005 * @brief Header file of RTC LL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2017 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00015 * 00016 ****************************************************************************** 00017 */ 00018 00019 /* Define to prevent recursive inclusion -------------------------------------*/ 00020 #ifndef STM32H7xx_LL_RTC_H 00021 #define STM32H7xx_LL_RTC_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32h7xx.h" 00029 00030 /** @addtogroup STM32H7xx_LL_Driver 00031 * @{ 00032 */ 00033 00034 #if defined(RTC) 00035 00036 /** @defgroup RTC_LL RTC 00037 * @{ 00038 */ 00039 00040 /* Private types -------------------------------------------------------------*/ 00041 /* Private variables ---------------------------------------------------------*/ 00042 /* Private constants ---------------------------------------------------------*/ 00043 /** @defgroup RTC_LL_Private_Constants RTC Private Constants 00044 * @{ 00045 */ 00046 /* Masks Definition */ 00047 #define RTC_LL_INIT_MASK 0xFFFFFFFFU 00048 #define RTC_LL_RSF_MASK 0xFFFFFF5FU 00049 00050 /* Write protection defines */ 00051 #define RTC_WRITE_PROTECTION_DISABLE 0xFFU 00052 #define RTC_WRITE_PROTECTION_ENABLE_1 0xCAU 00053 #define RTC_WRITE_PROTECTION_ENABLE_2 0x53U 00054 00055 /* Defines used to combine date & time */ 00056 #define RTC_OFFSET_WEEKDAY 24U 00057 #define RTC_OFFSET_DAY 16U 00058 #define RTC_OFFSET_MONTH 8U 00059 #define RTC_OFFSET_HOUR 16U 00060 #define RTC_OFFSET_MINUTE 8U 00061 00062 /** 00063 * @} 00064 */ 00065 00066 /* Private macros ------------------------------------------------------------*/ 00067 #if defined(USE_FULL_LL_DRIVER) 00068 /** @defgroup RTC_LL_Private_Macros RTC Private Macros 00069 * @{ 00070 */ 00071 /** 00072 * @} 00073 */ 00074 #endif /*USE_FULL_LL_DRIVER*/ 00075 00076 /* Exported types ------------------------------------------------------------*/ 00077 #if defined(USE_FULL_LL_DRIVER) 00078 /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure 00079 * @{ 00080 */ 00081 00082 /** 00083 * @brief RTC Init structures definition 00084 */ 00085 typedef struct 00086 { 00087 uint32_t HourFormat; /*!< Specifies the RTC Hours Format. 00088 This parameter can be a value of @ref RTC_LL_EC_HOURFORMAT 00089 00090 This feature can be modified afterwards using unitary function 00091 @ref LL_RTC_SetHourFormat(). */ 00092 00093 uint32_t AsynchPrescaler; /*!< Specifies the RTC Asynchronous Predivider value. 00094 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F 00095 00096 This feature can be modified afterwards using unitary function 00097 @ref LL_RTC_SetAsynchPrescaler(). */ 00098 00099 uint32_t SynchPrescaler; /*!< Specifies the RTC Synchronous Predivider value. 00100 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF 00101 00102 This feature can be modified afterwards using unitary function 00103 @ref LL_RTC_SetSynchPrescaler(). */ 00104 } LL_RTC_InitTypeDef; 00105 00106 /** 00107 * @brief RTC Time structure definition 00108 */ 00109 typedef struct 00110 { 00111 uint32_t TimeFormat; /*!< Specifies the RTC AM/PM Time. 00112 This parameter can be a value of @ref RTC_LL_EC_TIME_FORMAT 00113 00114 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetFormat(). */ 00115 00116 uint8_t Hours; /*!< Specifies the RTC Time Hours. 00117 This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the @ref LL_RTC_TIME_FORMAT_PM is selected. 00118 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. 00119 00120 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetHour(). */ 00121 00122 uint8_t Minutes; /*!< Specifies the RTC Time Minutes. 00123 This parameter must be a number between Min_Data = 0 and Max_Data = 59 00124 00125 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetMinute(). */ 00126 00127 uint8_t Seconds; /*!< Specifies the RTC Time Seconds. 00128 This parameter must be a number between Min_Data = 0 and Max_Data = 59 00129 00130 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetSecond(). */ 00131 } LL_RTC_TimeTypeDef; 00132 00133 /** 00134 * @brief RTC Date structure definition 00135 */ 00136 typedef struct 00137 { 00138 uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay. 00139 This parameter can be a value of @ref RTC_LL_EC_WEEKDAY 00140 00141 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetWeekDay(). */ 00142 00143 uint8_t Month; /*!< Specifies the RTC Date Month. 00144 This parameter can be a value of @ref RTC_LL_EC_MONTH 00145 00146 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetMonth(). */ 00147 00148 uint8_t Day; /*!< Specifies the RTC Date Day. 00149 This parameter must be a number between Min_Data = 1 and Max_Data = 31 00150 00151 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetDay(). */ 00152 00153 uint8_t Year; /*!< Specifies the RTC Date Year. 00154 This parameter must be a number between Min_Data = 0 and Max_Data = 99 00155 00156 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetYear(). */ 00157 } LL_RTC_DateTypeDef; 00158 00159 /** 00160 * @brief RTC Alarm structure definition 00161 */ 00162 typedef struct 00163 { 00164 LL_RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members. */ 00165 00166 uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks. 00167 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. 00168 00169 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetMask() for ALARM A 00170 or @ref LL_RTC_ALMB_SetMask() for ALARM B 00171 */ 00172 00173 uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on day or WeekDay. 00174 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 00175 00176 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_EnableWeekday() or @ref LL_RTC_ALMA_DisableWeekday() 00177 for ALARM A or @ref LL_RTC_ALMB_EnableWeekday() or @ref LL_RTC_ALMB_DisableWeekday() for ALARM B 00178 */ 00179 00180 uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Day/WeekDay. 00181 If AlarmDateWeekDaySel set to day, this parameter must be a number between Min_Data = 1 and Max_Data = 31. 00182 00183 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetDay() 00184 for ALARM A or @ref LL_RTC_ALMB_SetDay() for ALARM B. 00185 00186 If AlarmDateWeekDaySel set to Weekday, this parameter can be a value of @ref RTC_LL_EC_WEEKDAY. 00187 00188 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetWeekDay() 00189 for ALARM A or @ref LL_RTC_ALMB_SetWeekDay() for ALARM B. 00190 */ 00191 } LL_RTC_AlarmTypeDef; 00192 00193 /** 00194 * @} 00195 */ 00196 #endif /* USE_FULL_LL_DRIVER */ 00197 00198 /* Exported constants --------------------------------------------------------*/ 00199 /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants 00200 * @{ 00201 */ 00202 00203 #if defined(USE_FULL_LL_DRIVER) 00204 /** @defgroup RTC_LL_EC_FORMAT FORMAT 00205 * @{ 00206 */ 00207 #define LL_RTC_FORMAT_BIN 0x00000000U /*!< Binary data format */ 00208 #define LL_RTC_FORMAT_BCD 0x00000001U /*!< BCD data format */ 00209 /** 00210 * @} 00211 */ 00212 00213 /** @defgroup RTC_LL_EC_ALMA_WEEKDAY_SELECTION RTC Alarm A Date WeekDay 00214 * @{ 00215 */ 00216 #define LL_RTC_ALMA_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm A Date is selected */ 00217 #define LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL /*!< Alarm A WeekDay is selected */ 00218 /** 00219 * @} 00220 */ 00221 00222 /** @defgroup RTC_LL_EC_ALMB_WEEKDAY_SELECTION RTC Alarm B Date WeekDay 00223 * @{ 00224 */ 00225 #define LL_RTC_ALMB_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm B Date is selected */ 00226 #define LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMBR_WDSEL /*!< Alarm B WeekDay is selected */ 00227 /** 00228 * @} 00229 */ 00230 00231 #endif /* USE_FULL_LL_DRIVER */ 00232 00233 /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines 00234 * @brief Flags defines which can be used with LL_RTC_ReadReg function 00235 * @{ 00236 */ 00237 #if defined(RTC_SCR_CALRAF) 00238 #define LL_RTC_SCR_ITSF RTC_SCR_CITSF 00239 #define LL_RTC_SCR_TSOVF RTC_SCR_CTSOVF 00240 #define LL_RTC_SCR_TSF RTC_SCR_CTSF 00241 #define LL_RTC_SCR_WUTF RTC_SCR_CWUTF 00242 #define LL_RTC_SCR_ALRBF RTC_SCR_CALRBF 00243 #define LL_RTC_SCR_ALRAF RTC_SCR_CALRAF 00244 #endif /* RTC_SCR_CALRAF */ 00245 00246 #if defined(RTC_ICSR_ALRAWF) 00247 #define LL_RTC_ICSR_RECALPF RTC_ICSR_RECALPF 00248 #define LL_RTC_ICSR_INITF RTC_ICSR_INITF 00249 #define LL_RTC_ICSR_RSF RTC_ICSR_RSF 00250 #define LL_RTC_ICSR_INITS RTC_ICSR_INITS 00251 #define LL_RTC_ICSR_SHPF RTC_ICSR_SHPF 00252 #define LL_RTC_ICSR_WUTWF RTC_ICSR_WUTWF 00253 #endif /* RTC_ICSR_ALRAWF */ 00254 #if defined(RTC_ISR_ALRAWF) 00255 #define LL_RTC_ISR_ITSF RTC_ISR_ITSF 00256 #define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF 00257 #define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F 00258 #define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F 00259 #define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F 00260 #define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF 00261 #define LL_RTC_ISR_TSF RTC_ISR_TSF 00262 #define LL_RTC_ISR_WUTF RTC_ISR_WUTF 00263 #define LL_RTC_ISR_ALRBF RTC_ISR_ALRBF 00264 #define LL_RTC_ISR_ALRAF RTC_ISR_ALRAF 00265 #define LL_RTC_ISR_INITF RTC_ISR_INITF 00266 #define LL_RTC_ISR_RSF RTC_ISR_RSF 00267 #define LL_RTC_ISR_INITS RTC_ISR_INITS 00268 #define LL_RTC_ISR_SHPF RTC_ISR_SHPF 00269 #define LL_RTC_ISR_WUTWF RTC_ISR_WUTWF 00270 #define LL_RTC_ISR_ALRBWF RTC_ISR_ALRBWF 00271 #define LL_RTC_ISR_ALRAWF RTC_ISR_ALRAWF 00272 #endif /* RTC_ISR_ALRAWF */ 00273 /** 00274 * @} 00275 */ 00276 00277 /** @defgroup RTC_LL_EC_IT IT Defines 00278 * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions 00279 * @{ 00280 */ 00281 #define LL_RTC_CR_TSIE RTC_CR_TSIE 00282 #define LL_RTC_CR_WUTIE RTC_CR_WUTIE 00283 #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE 00284 #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE 00285 #if defined(RTC_TAMPCR_TAMP3E) 00286 #define LL_RTC_TAMPCR_TAMP3IE RTC_TAMPCR_TAMP3IE 00287 #endif /* RTC_TAMPCR_TAMP3E */ 00288 #if defined(RTC_TAMPCR_TAMP2E) 00289 #define LL_RTC_TAMPCR_TAMP2IE RTC_TAMPCR_TAMP2IE 00290 #endif /* RTC_TAMPCR_TAMP2E */ 00291 #if defined(RTC_TAMPCR_TAMP1E) 00292 #define LL_RTC_TAMPCR_TAMP1IE RTC_TAMPCR_TAMP1IE 00293 #endif /* RTC_TAMPCR_TAMP1E */ 00294 #if defined(RTC_TAMPCR_TAMPIE) 00295 #define LL_RTC_TAMPCR_TAMPIE RTC_TAMPCR_TAMPIE 00296 #endif /* RTC_TAMPCR_TAMPIE */ 00297 /** 00298 * @} 00299 */ 00300 00301 /** @defgroup RTC_LL_EC_WEEKDAY WEEK DAY 00302 * @{ 00303 */ 00304 #define LL_RTC_WEEKDAY_MONDAY (uint8_t)0x01 /*!< Monday */ 00305 #define LL_RTC_WEEKDAY_TUESDAY (uint8_t)0x02 /*!< Tuesday */ 00306 #define LL_RTC_WEEKDAY_WEDNESDAY (uint8_t)0x03 /*!< Wednesday */ 00307 #define LL_RTC_WEEKDAY_THURSDAY (uint8_t)0x04 /*!< Thrusday */ 00308 #define LL_RTC_WEEKDAY_FRIDAY (uint8_t)0x05 /*!< Friday */ 00309 #define LL_RTC_WEEKDAY_SATURDAY (uint8_t)0x06 /*!< Saturday */ 00310 #define LL_RTC_WEEKDAY_SUNDAY (uint8_t)0x07 /*!< Sunday */ 00311 /** 00312 * @} 00313 */ 00314 00315 /** @defgroup RTC_LL_EC_MONTH MONTH 00316 * @{ 00317 */ 00318 #define LL_RTC_MONTH_JANUARY (uint8_t)0x01 /*!< January */ 00319 #define LL_RTC_MONTH_FEBRUARY (uint8_t)0x02 /*!< February */ 00320 #define LL_RTC_MONTH_MARCH (uint8_t)0x03 /*!< March */ 00321 #define LL_RTC_MONTH_APRIL (uint8_t)0x04 /*!< April */ 00322 #define LL_RTC_MONTH_MAY (uint8_t)0x05 /*!< May */ 00323 #define LL_RTC_MONTH_JUNE (uint8_t)0x06 /*!< June */ 00324 #define LL_RTC_MONTH_JULY (uint8_t)0x07 /*!< July */ 00325 #define LL_RTC_MONTH_AUGUST (uint8_t)0x08 /*!< August */ 00326 #define LL_RTC_MONTH_SEPTEMBER (uint8_t)0x09 /*!< September */ 00327 #define LL_RTC_MONTH_OCTOBER (uint8_t)0x10 /*!< October */ 00328 #define LL_RTC_MONTH_NOVEMBER (uint8_t)0x11 /*!< November */ 00329 #define LL_RTC_MONTH_DECEMBER (uint8_t)0x12 /*!< December */ 00330 /** 00331 * @} 00332 */ 00333 00334 /** @defgroup RTC_LL_EC_HOURFORMAT HOUR FORMAT 00335 * @{ 00336 */ 00337 #define LL_RTC_HOURFORMAT_24HOUR 0x00000000U /*!< 24 hour/day format */ 00338 #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */ 00339 /** 00340 * @} 00341 */ 00342 00343 /** @defgroup RTC_LL_EC_ALARMOUT ALARM OUTPUT 00344 * @{ 00345 */ 00346 #define LL_RTC_ALARMOUT_DISABLE 0x00000000U /*!< Output disabled */ 00347 #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */ 00348 #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */ 00349 #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */ 00350 /** 00351 * @} 00352 */ 00353 00354 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUT TYPE 00355 * @{ 00356 */ 00357 #if defined(RTC_CR_TAMPALRM_TYPE) 00358 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN RTC_CR_TAMPALRM_TYPE /*!< RTC_ALARM is open-drain output */ 00359 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL 0x00000000U /*!< RTC_ALARM is push-pull output */ 00360 #endif /* RTC_CR_TAMPALRM_TYPE */ 00361 #if defined(RTC_OR_ALARMOUTTYPE) 00362 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 0x00000000U /*!< RTC_ALARM, when mapped on PC13, is open-drain output */ 00363 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_OR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */ 00364 #endif /* RTC_OR_ALARMOUTTYPE */ 00365 /** 00366 * @} 00367 */ 00368 00369 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUT POLARITY PIN 00370 * @{ 00371 */ 00372 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH 0x00000000U /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/ 00373 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */ 00374 /** 00375 * @} 00376 */ 00377 00378 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT 00379 * @{ 00380 */ 00381 #define LL_RTC_TIME_FORMAT_AM_OR_24 0x00000000U /*!< AM or 24-hour format */ 00382 #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */ 00383 /** 00384 * @} 00385 */ 00386 00387 /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND 00388 * @{ 00389 */ 00390 #define LL_RTC_SHIFT_SECOND_DELAY 0x00000000U /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */ 00391 #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */ 00392 /** 00393 * @} 00394 */ 00395 00396 /** @defgroup RTC_LL_EC_ALMA_MASK ALARMA MASK 00397 * @{ 00398 */ 00399 #define LL_RTC_ALMA_MASK_NONE 0x00000000U /*!< No masks applied on Alarm A*/ 00400 #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */ 00401 #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */ 00402 #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */ 00403 #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */ 00404 #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */ 00405 /** 00406 * @} 00407 */ 00408 00409 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALARMA TIME FORMAT 00410 * @{ 00411 */ 00412 #define LL_RTC_ALMA_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */ 00413 #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */ 00414 /** 00415 * @} 00416 */ 00417 00418 /** @defgroup RTC_LL_EC_ALMB_MASK ALARMB MASK 00419 * @{ 00420 */ 00421 #define LL_RTC_ALMB_MASK_NONE 0x00000000U /*!< No masks applied on Alarm B*/ 00422 #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */ 00423 #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */ 00424 #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */ 00425 #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */ 00426 #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */ 00427 /** 00428 * @} 00429 */ 00430 00431 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALARMB TIME FORMAT 00432 * @{ 00433 */ 00434 #define LL_RTC_ALMB_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */ 00435 #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */ 00436 /** 00437 * @} 00438 */ 00439 00440 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE 00441 * @{ 00442 */ 00443 #define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */ 00444 #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */ 00445 /** 00446 * @} 00447 */ 00448 00449 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TIMESTAMP TIME FORMAT 00450 * @{ 00451 */ 00452 #define LL_RTC_TS_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */ 00453 #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */ 00454 /** 00455 * @} 00456 */ 00457 00458 /** @defgroup RTC_LL_EC_TAMPER TAMPER 00459 * @{ 00460 */ 00461 #if defined(TAMP_CR1_TAMP1E) 00462 #define LL_RTC_TAMPER_1 TAMP_CR1_TAMP1E /*!< Tamper 1 input detection */ 00463 #endif /* TAMP_CR1_TAMP1E */ 00464 #if defined(TAMP_CR1_TAMP2E) 00465 #define LL_RTC_TAMPER_2 TAMP_CR1_TAMP2E /*!< Tamper 2 input detection */ 00466 #endif /* TAMP_CR1_TAMP2E */ 00467 #if defined(TAMP_CR1_TAMP3E) 00468 #define LL_RTC_TAMPER_3 TAMP_CR1_TAMP3E /*!< Tamper 3 input detection */ 00469 #endif /* TAMP_CR1_TAMP3E */ 00470 /** 00471 * @} 00472 */ 00473 00474 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK 00475 * @{ 00476 */ 00477 #if defined(TAMP_CR1_TAMP1E) 00478 #define LL_RTC_TAMPER_MASK_TAMPER1 TAMP_CR2_TAMP1MSK /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware. The backup registers are not erased */ 00479 #endif /* TAMP_CR1_TAMP1E */ 00480 #if defined(TAMP_CR1_TAMP2E) 00481 #define LL_RTC_TAMPER_MASK_TAMPER2 TAMP_CR2_TAMP2MSK /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */ 00482 #endif /* TAMP_CR1_TAMP2E */ 00483 #if defined(TAMP_CR1_TAMP3E) 00484 #define LL_RTC_TAMPER_MASK_TAMPER3 TAMP_CR2_TAMP3MSK /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased. */ 00485 #endif /* TAMP_CR1_TAMP3E */ 00486 /** 00487 * @} 00488 */ 00489 00490 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE 00491 * @{ 00492 */ 00493 #if defined(TAMP_CR1_TAMP1E) 00494 #define LL_RTC_TAMPER_NOERASE_TAMPER1 TAMP_CR2_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */ 00495 #endif /* TAMP_CR1_TAMP1E */ 00496 #if defined(TAMP_CR1_TAMP2E) 00497 #define LL_RTC_TAMPER_NOERASE_TAMPER2 TAMP_CR2_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */ 00498 #endif /* TAMP_CR1_TAMP2E */ 00499 #if defined(TAMP_CR1_TAMP3E) 00500 #define LL_RTC_TAMPER_NOERASE_TAMPER3 TAMP_CR2_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */ 00501 #endif /* TAMP_CR1_TAMP3E */ 00502 /** 00503 * @} 00504 */ 00505 00506 #if defined(TAMP_FLTCR_TAMPPRCH) 00507 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION 00508 * @{ 00509 */ 00510 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */ 00511 #define LL_RTC_TAMPER_DURATION_2RTCCLK TAMP_FLTCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */ 00512 #define LL_RTC_TAMPER_DURATION_4RTCCLK TAMP_FLTCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */ 00513 #define LL_RTC_TAMPER_DURATION_8RTCCLK TAMP_FLTCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */ 00514 /** 00515 * @} 00516 */ 00517 #endif /* TAMP_FLTCR_TAMPPRCH */ 00518 00519 #if defined(TAMP_FLTCR_TAMPFLT) 00520 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER 00521 * @{ 00522 */ 00523 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */ 00524 #define LL_RTC_TAMPER_FILTER_2SAMPLE TAMP_FLTCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */ 00525 #define LL_RTC_TAMPER_FILTER_4SAMPLE TAMP_FLTCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */ 00526 #define LL_RTC_TAMPER_FILTER_8SAMPLE TAMP_FLTCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */ 00527 /** 00528 * @} 00529 */ 00530 #endif /* TAMP_FLTCR_TAMPFLT */ 00531 00532 #if defined(TAMP_FLTCR_TAMPFREQ) 00533 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER 00534 * @{ 00535 */ 00536 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */ 00537 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 TAMP_FLTCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */ 00538 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 TAMP_FLTCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */ 00539 #define LL_RTC_TAMPER_SAMPLFREQDIV_4096 (TAMP_FLTCR_TAMPFREQ_1 | TAMP_FLTCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */ 00540 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 TAMP_FLTCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */ 00541 #define LL_RTC_TAMPER_SAMPLFREQDIV_1024 (TAMP_FLTCR_TAMPFREQ_2 | TAMP_FLTCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */ 00542 #define LL_RTC_TAMPER_SAMPLFREQDIV_512 (TAMP_FLTCR_TAMPFREQ_2 | TAMP_FLTCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */ 00543 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 TAMP_FLTCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */ 00544 /** 00545 * @} 00546 */ 00547 #endif /* TAMP_FLTCR_TAMPFREQ */ 00548 00549 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL 00550 * @{ 00551 */ 00552 #if defined(TAMP_CR1_TAMP1E) 00553 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 TAMP_CR2_TAMP1TRG /*!< Tamper 1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */ 00554 #endif /* TAMP_CR1_TAMP1E */ 00555 #if defined(TAMP_CR1_TAMP2E) 00556 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 TAMP_CR2_TAMP2TRG /*!< Tamper 2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */ 00557 #endif /* TAMP_CR1_TAMP2E */ 00558 #if defined(TAMP_CR1_TAMP3E) 00559 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 TAMP_CR2_TAMP3TRG /*!< Tamper 3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event */ 00560 #endif /* TAMP_CR1_TAMP3E */ 00561 /** 00562 * @} 00563 */ 00564 00565 /** @defgroup RTC_LL_EC_TAMPER TAMPER 00566 * @{ 00567 */ 00568 #if defined (RTC_TAMPCR_TAMP1E) 00569 #define LL_RTC_TAMPER_1 RTC_TAMPCR_TAMP1E /*!< RTC_TAMP1 input detection */ 00570 #endif /* RTC_TAMPCR_TAMP1E */ 00571 #if defined (RTC_TAMPCR_TAMP2E) 00572 #define LL_RTC_TAMPER_2 RTC_TAMPCR_TAMP2E /*!< RTC_TAMP2 input detection */ 00573 #endif /* RTC_TAMPCR_TAMP2E */ 00574 #if defined (RTC_TAMPCR_TAMP3E) 00575 #define LL_RTC_TAMPER_3 RTC_TAMPCR_TAMP3E /*!< RTC_TAMP3 input detection */ 00576 #endif /* RTC_TAMPCR_TAMP3E */ 00577 /** 00578 * @} 00579 */ 00580 00581 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK 00582 * @{ 00583 */ 00584 #if defined (RTC_TAMPCR_TAMP1E) 00585 #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 */ 00586 #endif /* RTC_TAMPCR_TAMP1E */ 00587 #if defined (RTC_TAMPCR_TAMP2E) 00588 #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. */ 00589 #endif /* RTC_TAMPCR_TAMP2E */ 00590 #if defined (RTC_TAMPCR_TAMP3E) 00591 #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 */ 00592 #endif /* RTC_TAMPCR_TAMP3E */ 00593 /** 00594 * @} 00595 */ 00596 00597 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE 00598 * @{ 00599 */ 00600 #if defined (RTC_TAMPCR_TAMP1E) 00601 #define LL_RTC_TAMPER_NOERASE_TAMPER1 RTC_TAMPCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */ 00602 #endif /* RTC_TAMPCR_TAMP1E */ 00603 #if defined (RTC_TAMPCR_TAMP2E) 00604 #define LL_RTC_TAMPER_NOERASE_TAMPER2 RTC_TAMPCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */ 00605 #endif /* RTC_TAMPCR_TAMP2E */ 00606 #if defined (RTC_TAMPCR_TAMP3E) 00607 #define LL_RTC_TAMPER_NOERASE_TAMPER3 RTC_TAMPCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */ 00608 #endif /* RTC_TAMPCR_TAMP3E */ 00609 /** 00610 * @} 00611 */ 00612 00613 #if defined(RTC_TAMPCR_TAMPPRCH) 00614 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION 00615 * @{ 00616 */ 00617 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */ 00618 #define LL_RTC_TAMPER_DURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */ 00619 #define LL_RTC_TAMPER_DURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */ 00620 #define LL_RTC_TAMPER_DURATION_8RTCCLK RTC_TAMPCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */ 00621 /** 00622 * @} 00623 */ 00624 #endif /* RTC_TAMPCR_TAMPPRCH */ 00625 00626 #if defined(RTC_TAMPCR_TAMPFLT) 00627 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER 00628 * @{ 00629 */ 00630 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */ 00631 #define LL_RTC_TAMPER_FILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */ 00632 #define LL_RTC_TAMPER_FILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */ 00633 #define LL_RTC_TAMPER_FILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */ 00634 /** 00635 * @} 00636 */ 00637 #endif /* RTC_TAMPCR_TAMPFLT */ 00638 00639 #if defined(RTC_TAMPCR_TAMPFREQ) 00640 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER 00641 * @{ 00642 */ 00643 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */ 00644 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */ 00645 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */ 00646 #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 */ 00647 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */ 00648 #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 */ 00649 #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 */ 00650 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 RTC_TAMPCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */ 00651 /** 00652 * @} 00653 */ 00654 #endif /* RTC_TAMPCR_TAMPFREQ */ 00655 00656 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL 00657 * @{ 00658 */ 00659 #if defined (RTC_TAMPCR_TAMP1E) 00660 #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*/ 00661 #endif /* RTC_TAMPCR_TAMP1E */ 00662 #if defined (RTC_TAMPCR_TAMP2E) 00663 #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*/ 00664 #endif /* RTC_TAMPCR_TAMP2E */ 00665 #if defined (RTC_TAMPCR_TAMP3E) 00666 #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*/ 00667 #endif /* RTC_TAMPCR_TAMP3E */ 00668 /** 00669 * @} 00670 */ 00671 00672 /** @defgroup RTC_LL_EC_ACTIVE_MODE ACTIVE TAMPER MODE 00673 * @{ 00674 */ 00675 #if defined(TAMP_ATCR1_TAMP1AM) 00676 #define LL_RTC_TAMPER_ATAMP_TAMP1AM TAMP_ATCR1_TAMP1AM /*!< tamper 1 is active */ 00677 #endif /* TAMP_ATCR1_TAMP1AM */ 00678 #if defined(TAMP_ATCR1_TAMP2AM) 00679 #define LL_RTC_TAMPER_ATAMP_TAMP2AM TAMP_ATCR1_TAMP2AM /*!< tamper 2 is active */ 00680 #endif /* TAMP_ATCR1_TAMP2AM */ 00681 #if defined(TAMP_ATCR1_TAMP3AM) 00682 #define LL_RTC_TAMPER_ATAMP_TAMP3AM TAMP_ATCR1_TAMP3AM /*!< tamper 3 is active */ 00683 #endif /* TAMP_ATCR1_TAMP3AM */ 00684 /** 00685 * @} 00686 */ 00687 00688 #if defined(TAMP_ATCR1_ATCKSEL) 00689 /** @defgroup RTC_LL_EC_ACTIVE_ASYNC_PRESCALER ACTIVE TAMPER ASYNCHRONOUS PRESCALER CLOCK 00690 * @{ 00691 */ 00692 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK 0U /*!< RTCCLK */ 00693 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_2 TAMP_ATCR1_ATCKSEL_0 /*!< RTCCLK/2 */ 00694 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_4 TAMP_ATCR1_ATCKSEL_1 /*!< RTCCLK/4 */ 00695 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_8 (TAMP_ATCR1_ATCKSEL_1 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/8 */ 00696 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_16 TAMP_ATCR1_ATCKSEL_2 /*!< RTCCLK/16 */ 00697 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_32 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/32 */ 00698 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_64 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_1) /*!< RTCCLK/64 */ 00699 #define LL_RTC_TAMPER_ATAMP_ASYNCPRES_RTCCLK_128 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_1 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/128 */ 00700 /** 00701 * @} 00702 */ 00703 #endif /* TAMP_ATCR1_ATCKSEL */ 00704 00705 /** @defgroup RTC_LL_EC_ACTIVE_OUTPUT_SELECTION ACTIVE TAMPER OUTPUT SELECTION 00706 * @{ 00707 */ 00708 #if defined(TAMP_ATCR1_TAMP1AM) 00709 #define LL_RTC_TAMPER_ATAMP1IN_ATAMP1OUT (0UL << TAMP_ATCR2_ATOSEL1_Pos) 00710 #define LL_RTC_TAMPER_ATAMP1IN_ATAMP2OUT (1UL << TAMP_ATCR2_ATOSEL1_Pos) 00711 #define LL_RTC_TAMPER_ATAMP1IN_ATAMP3OUT (2UL << TAMP_ATCR2_ATOSEL1_Pos) 00712 #endif /* TAMP_ATCR1_TAMP1AM */ 00713 00714 #if defined(TAMP_ATCR1_TAMP2AM) 00715 #define LL_RTC_TAMPER_ATAMP2IN_ATAMP1OUT (0UL << TAMP_ATCR2_ATOSEL2_Pos) 00716 #define LL_RTC_TAMPER_ATAMP2IN_ATAMP2OUT (1UL << TAMP_ATCR2_ATOSEL2_Pos) 00717 #define LL_RTC_TAMPER_ATAMP2IN_ATAMP3OUT (2UL << TAMP_ATCR2_ATOSEL2_Pos) 00718 #endif /* TAMP_ATCR1_TAMP2AM */ 00719 00720 #if defined(TAMP_ATCR1_TAMP3AM) 00721 #define LL_RTC_TAMPER_ATAMP3IN_ATAMP1OUT (0UL << TAMP_ATCR2_ATOSEL3_Pos) 00722 #define LL_RTC_TAMPER_ATAMP3IN_ATAMP2OUT (1UL << TAMP_ATCR2_ATOSEL3_Pos) 00723 #define LL_RTC_TAMPER_ATAMP3IN_ATAMP3OUT (2UL << TAMP_ATCR2_ATOSEL3_Pos) 00724 #endif /* TAMP_ATCR1_TAMP3AM */ 00725 /** 00726 * @} 00727 */ 00728 00729 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUP CLOCK DIV 00730 * @{ 00731 */ 00732 #define LL_RTC_WAKEUPCLOCK_DIV_16 0x00000000U /*!< RTC/16 clock is selected */ 00733 #define LL_RTC_WAKEUPCLOCK_DIV_8 RTC_CR_WUCKSEL_0 /*!< RTC/8 clock is selected */ 00734 #define LL_RTC_WAKEUPCLOCK_DIV_4 RTC_CR_WUCKSEL_1 /*!< RTC/4 clock is selected */ 00735 #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */ 00736 #define LL_RTC_WAKEUPCLOCK_CKSPRE RTC_CR_WUCKSEL_2 /*!< ck_spre (usually 1 Hz) clock is selected */ 00737 #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*/ 00738 /** 00739 * @} 00740 */ 00741 00742 /** @defgroup RTC_LL_EC_BKP BACKUP 00743 * @{ 00744 */ 00745 #define LL_RTC_BKP_DR0 0x00000000U 00746 #define LL_RTC_BKP_DR1 0x00000001U 00747 #define LL_RTC_BKP_DR2 0x00000002U 00748 #define LL_RTC_BKP_DR3 0x00000003U 00749 #define LL_RTC_BKP_DR4 0x00000004U 00750 #define LL_RTC_BKP_DR5 0x00000005U 00751 #define LL_RTC_BKP_DR6 0x00000006U 00752 #define LL_RTC_BKP_DR7 0x00000007U 00753 #define LL_RTC_BKP_DR8 0x00000008U 00754 #define LL_RTC_BKP_DR9 0x00000009U 00755 #define LL_RTC_BKP_DR10 0x0000000AU 00756 #define LL_RTC_BKP_DR11 0x0000000BU 00757 #define LL_RTC_BKP_DR12 0x0000000CU 00758 #define LL_RTC_BKP_DR13 0x0000000DU 00759 #define LL_RTC_BKP_DR14 0x0000000EU 00760 #define LL_RTC_BKP_DR15 0x0000000FU 00761 #define LL_RTC_BKP_DR16 0x00000010U 00762 #define LL_RTC_BKP_DR17 0x00000011U 00763 #define LL_RTC_BKP_DR18 0x00000012U 00764 #define LL_RTC_BKP_DR19 0x00000013U 00765 #define LL_RTC_BKP_DR20 0x00000014U 00766 #define LL_RTC_BKP_DR21 0x00000015U 00767 #define LL_RTC_BKP_DR22 0x00000016U 00768 #define LL_RTC_BKP_DR23 0x00000017U 00769 #define LL_RTC_BKP_DR24 0x00000018U 00770 #define LL_RTC_BKP_DR25 0x00000019U 00771 #define LL_RTC_BKP_DR26 0x0000001AU 00772 #define LL_RTC_BKP_DR27 0x0000001BU 00773 #define LL_RTC_BKP_DR28 0x0000001CU 00774 #define LL_RTC_BKP_DR29 0x0000001DU 00775 #define LL_RTC_BKP_DR30 0x0000001EU 00776 #define LL_RTC_BKP_DR31 0x0000001FU 00777 /** 00778 * @} 00779 */ 00780 00781 /** @defgroup RTC_LL_EC_CALIB_OUTPUT Calibration output 00782 * @{ 00783 */ 00784 #define LL_RTC_CALIB_OUTPUT_NONE 0x00000000U /*!< Calibration output disabled */ 00785 #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */ 00786 #define LL_RTC_CALIB_OUTPUT_512HZ RTC_CR_COE /*!< Calibration output is 512 Hz */ 00787 /** 00788 * @} 00789 */ 00790 00791 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE Calibration pulse insertion 00792 * @{ 00793 */ 00794 #define LL_RTC_CALIB_INSERTPULSE_NONE 0x00000000U /*!< No RTCCLK pulses are added */ 00795 #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */ 00796 /** 00797 * @} 00798 */ 00799 00800 /** @defgroup RTC_LL_EC_CALIB_PERIOD Calibration period 00801 * @{ 00802 */ 00803 #define LL_RTC_CALIB_PERIOD_32SEC 0x00000000U /*!< Use a 32-second calibration cycle period */ 00804 #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */ 00805 #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */ 00806 /** 00807 * @} 00808 */ 00809 00810 /** 00811 * @} 00812 */ 00813 00814 /* Exported macro ------------------------------------------------------------*/ 00815 /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros 00816 * @{ 00817 */ 00818 00819 /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros 00820 * @{ 00821 */ 00822 00823 /** 00824 * @brief Write a value in RTC register 00825 * @param __INSTANCE__ RTC Instance 00826 * @param __REG__ Register to be written 00827 * @param __VALUE__ Value to be written in the register 00828 * @retval None 00829 */ 00830 #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, __VALUE__) 00831 00832 /** 00833 * @brief Read a value in RTC register 00834 * @param __INSTANCE__ RTC Instance 00835 * @param __REG__ Register to be read 00836 * @retval Register value 00837 */ 00838 #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__) 00839 /** 00840 * @} 00841 */ 00842 00843 /** @defgroup RTC_LL_EM_Convert Convert helper Macros 00844 * @{ 00845 */ 00846 00847 /** 00848 * @brief Helper macro to convert a value from 2 digit decimal format to BCD format 00849 * @param __VALUE__ Byte to be converted 00850 * @retval Converted byte 00851 */ 00852 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U)) 00853 00854 /** 00855 * @brief Helper macro to convert a value from BCD format to 2 digit decimal format 00856 * @param __VALUE__ BCD value to be converted 00857 * @retval Converted byte 00858 */ 00859 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) ((uint8_t)((((uint8_t)((__VALUE__) & (uint8_t)0xF0) >> (uint8_t)0x4) * 10U) + ((__VALUE__) & (uint8_t)0x0F))) 00860 00861 /** 00862 * @} 00863 */ 00864 00865 /** @defgroup RTC_LL_EM_Date Date helper Macros 00866 * @{ 00867 */ 00868 00869 /** 00870 * @brief Helper macro to retrieve weekday. 00871 * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function. 00872 * @retval Returned value can be one of the following values: 00873 * @arg @ref LL_RTC_WEEKDAY_MONDAY 00874 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 00875 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 00876 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 00877 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 00878 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 00879 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 00880 */ 00881 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU) 00882 00883 /** 00884 * @brief Helper macro to retrieve Year in BCD format 00885 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get 00886 * @retval Year in BCD format (0x00 . . . 0x99) 00887 */ 00888 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU) 00889 00890 /** 00891 * @brief Helper macro to retrieve Month in BCD format 00892 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get 00893 * @retval Returned value can be one of the following values: 00894 * @arg @ref LL_RTC_MONTH_JANUARY 00895 * @arg @ref LL_RTC_MONTH_FEBRUARY 00896 * @arg @ref LL_RTC_MONTH_MARCH 00897 * @arg @ref LL_RTC_MONTH_APRIL 00898 * @arg @ref LL_RTC_MONTH_MAY 00899 * @arg @ref LL_RTC_MONTH_JUNE 00900 * @arg @ref LL_RTC_MONTH_JULY 00901 * @arg @ref LL_RTC_MONTH_AUGUST 00902 * @arg @ref LL_RTC_MONTH_SEPTEMBER 00903 * @arg @ref LL_RTC_MONTH_OCTOBER 00904 * @arg @ref LL_RTC_MONTH_NOVEMBER 00905 * @arg @ref LL_RTC_MONTH_DECEMBER 00906 */ 00907 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU) 00908 00909 /** 00910 * @brief Helper macro to retrieve Day in BCD format 00911 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get 00912 * @retval Day in BCD format (0x01 . . . 0x31) 00913 */ 00914 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU) 00915 00916 /** 00917 * @} 00918 */ 00919 00920 /** @defgroup RTC_LL_EM_Time Time helper Macros 00921 * @{ 00922 */ 00923 00924 /** 00925 * @brief Helper macro to retrieve hour in BCD format 00926 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function 00927 * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23) 00928 */ 00929 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU) 00930 00931 /** 00932 * @brief Helper macro to retrieve minute in BCD format 00933 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function 00934 * @retval Minutes in BCD format (0x00. . .0x59) 00935 */ 00936 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU) 00937 00938 /** 00939 * @brief Helper macro to retrieve second in BCD format 00940 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function 00941 * @retval Seconds in format (0x00. . .0x59) 00942 */ 00943 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU) 00944 00945 /** 00946 * @} 00947 */ 00948 00949 /** 00950 * @} 00951 */ 00952 00953 /* Exported functions --------------------------------------------------------*/ 00954 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions 00955 * @{ 00956 */ 00957 00958 /** @defgroup RTC_LL_EF_Configuration Configuration 00959 * @{ 00960 */ 00961 00962 /** 00963 * @brief Set Hours format (24 hour/day or AM/PM hour format) 00964 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 00965 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 00966 * @rmtoll RTC_CR FMT LL_RTC_SetHourFormat 00967 * @param RTCx RTC Instance 00968 * @param HourFormat This parameter can be one of the following values: 00969 * @arg @ref LL_RTC_HOURFORMAT_24HOUR 00970 * @arg @ref LL_RTC_HOURFORMAT_AMPM 00971 * @retval None 00972 */ 00973 __STATIC_INLINE void LL_RTC_SetHourFormat(RTC_TypeDef *RTCx, uint32_t HourFormat) 00974 { 00975 MODIFY_REG(RTCx->CR, RTC_CR_FMT, HourFormat); 00976 } 00977 00978 /** 00979 * @brief Get Hours format (24 hour/day or AM/PM hour format) 00980 * @rmtoll RTC_CR FMT LL_RTC_GetHourFormat 00981 * @param RTCx RTC Instance 00982 * @retval Returned value can be one of the following values: 00983 * @arg @ref LL_RTC_HOURFORMAT_24HOUR 00984 * @arg @ref LL_RTC_HOURFORMAT_AMPM 00985 */ 00986 __STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx) 00987 { 00988 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_FMT)); 00989 } 00990 00991 /** 00992 * @brief Select the flag to be routed to RTC_ALARM output 00993 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 00994 * @rmtoll RTC_CR OSEL LL_RTC_SetAlarmOutEvent 00995 * @param RTCx RTC Instance 00996 * @param AlarmOutput This parameter can be one of the following values: 00997 * @arg @ref LL_RTC_ALARMOUT_DISABLE 00998 * @arg @ref LL_RTC_ALARMOUT_ALMA 00999 * @arg @ref LL_RTC_ALARMOUT_ALMB 01000 * @arg @ref LL_RTC_ALARMOUT_WAKEUP 01001 * @retval None 01002 */ 01003 __STATIC_INLINE void LL_RTC_SetAlarmOutEvent(RTC_TypeDef *RTCx, uint32_t AlarmOutput) 01004 { 01005 MODIFY_REG(RTCx->CR, RTC_CR_OSEL, AlarmOutput); 01006 } 01007 01008 /** 01009 * @brief Get the flag to be routed to RTC_ALARM output 01010 * @rmtoll RTC_CR OSEL LL_RTC_GetAlarmOutEvent 01011 * @param RTCx RTC Instance 01012 * @retval Returned value can be one of the following values: 01013 * @arg @ref LL_RTC_ALARMOUT_DISABLE 01014 * @arg @ref LL_RTC_ALARMOUT_ALMA 01015 * @arg @ref LL_RTC_ALARMOUT_ALMB 01016 * @arg @ref LL_RTC_ALARMOUT_WAKEUP 01017 */ 01018 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef *RTCx) 01019 { 01020 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_OSEL)); 01021 } 01022 01023 #if defined(RTC_CR_TAMPALRM_TYPE) 01024 /** 01025 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output) 01026 * @rmtoll RTC_CR TAMPALRM_TYPE LL_RTC_SetAlarmOutputType 01027 * @param RTCx RTC Instance 01028 * @param Output This parameter can be one of the following values: 01029 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 01030 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL 01031 * @retval None 01032 */ 01033 __STATIC_INLINE void LL_RTC_SetAlarmOutputType(RTC_TypeDef *RTCx, uint32_t Output) 01034 { 01035 MODIFY_REG(RTCx->CR, RTC_CR_TAMPALRM_TYPE, Output); 01036 } 01037 01038 /** 01039 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output) 01040 * @rmtoll RTC_CR TAMPALRM_TYPE LL_RTC_SetAlarmOutputType 01041 * @param RTCx RTC Instance 01042 * @retval Returned value can be one of the following values: 01043 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 01044 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL 01045 */ 01046 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef *RTCx) 01047 { 01048 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_TAMPALRM_TYPE)); 01049 } 01050 #endif /* RTC_CR_TAMPALRM_TYPE */ 01051 01052 #if defined(RTC_ICSR_INIT) 01053 /** 01054 * @brief Enable initialization mode 01055 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR) 01056 * and prescaler register (RTC_PRER). 01057 * Counters are stopped and start counting from the new value when INIT is reset. 01058 * @rmtoll RTC_ICSR INIT LL_RTC_EnableInitMode 01059 * @param RTCx RTC Instance 01060 * @retval None 01061 */ 01062 __STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx) 01063 { 01064 /* Set the Initialization mode */ 01065 WRITE_REG(RTCx->ICSR, RTC_LL_INIT_MASK); 01066 } 01067 01068 /** 01069 * @brief Disable initialization mode (Free running mode) 01070 * @rmtoll RTC_ICSR INIT LL_RTC_DisableInitMode 01071 * @param RTCx RTC Instance 01072 * @retval None 01073 */ 01074 __STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx) 01075 { 01076 /* Exit Initialization mode */ 01077 WRITE_REG(RTCx->ICSR, (uint32_t)~RTC_ICSR_INIT); 01078 } 01079 01080 #endif /* RTC_ICSR_INIT */ 01081 01082 #if defined(RTC_OR_ALARMOUTTYPE) 01083 /** 01084 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output) 01085 * @note Used only when RTC_ALARM is mapped on PC13 01086 * @rmtoll OR ALARMOUTTYPE LL_RTC_SetAlarmOutputType 01087 * @param RTCx RTC Instance 01088 * @param Output This parameter can be one of the following values: 01089 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 01090 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL 01091 * @retval None 01092 */ 01093 __STATIC_INLINE void LL_RTC_SetAlarmOutputType(RTC_TypeDef *RTCx, uint32_t Output) 01094 { 01095 MODIFY_REG(RTCx->OR, RTC_OR_ALARMOUTTYPE, Output); 01096 } 01097 01098 /** 01099 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output) 01100 * @note used only when RTC_ALARM is mapped on PC13 01101 * @rmtoll OR ALARMOUTTYPE LL_RTC_GetAlarmOutputType 01102 * @param RTCx RTC Instance 01103 * @retval Returned value can be one of the following values: 01104 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 01105 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL 01106 */ 01107 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef *RTCx) 01108 { 01109 return (uint32_t)(READ_BIT(RTCx->OR, RTC_OR_ALARMOUTTYPE)); 01110 } 01111 #endif /* RTC_OR_ALARMOUTTYPE */ 01112 01113 #if defined(RTC_ISR_INIT) 01114 /** 01115 * @brief Enable initialization mode 01116 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR) 01117 * and prescaler register (RTC_PRER). 01118 * Counters are stopped and start counting from the new value when INIT is reset. 01119 * @rmtoll ISR INIT LL_RTC_EnableInitMode 01120 * @param RTCx RTC Instance 01121 * @retval None 01122 */ 01123 __STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx) 01124 { 01125 /* Set the Initialization mode */ 01126 WRITE_REG(RTCx->ISR, RTC_LL_INIT_MASK); 01127 } 01128 01129 /** 01130 * @brief Disable initialization mode (Free running mode) 01131 * @rmtoll ISR INIT LL_RTC_DisableInitMode 01132 * @param RTCx RTC Instance 01133 * @retval None 01134 */ 01135 __STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx) 01136 { 01137 /* Exit Initialization mode */ 01138 WRITE_REG(RTCx->ISR, (uint32_t)~RTC_ISR_INIT); 01139 } 01140 #endif /* RTC_ISR_INIT */ 01141 01142 /** 01143 * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted) 01144 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01145 * @rmtoll RTC_CR POL LL_RTC_SetOutputPolarity 01146 * @param RTCx RTC Instance 01147 * @param Polarity This parameter can be one of the following values: 01148 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH 01149 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW 01150 * @retval None 01151 */ 01152 __STATIC_INLINE void LL_RTC_SetOutputPolarity(RTC_TypeDef *RTCx, uint32_t Polarity) 01153 { 01154 MODIFY_REG(RTCx->CR, RTC_CR_POL, Polarity); 01155 } 01156 01157 /** 01158 * @brief Get Output polarity 01159 * @rmtoll RTC_CR POL LL_RTC_GetOutputPolarity 01160 * @param RTCx RTC Instance 01161 * @retval Returned value can be one of the following values: 01162 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH 01163 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW 01164 */ 01165 __STATIC_INLINE uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef *RTCx) 01166 { 01167 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_POL)); 01168 } 01169 01170 /** 01171 * @brief Enable Bypass the shadow registers 01172 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01173 * @rmtoll RTC_CR BYPSHAD LL_RTC_EnableShadowRegBypass 01174 * @param RTCx RTC Instance 01175 * @retval None 01176 */ 01177 __STATIC_INLINE void LL_RTC_EnableShadowRegBypass(RTC_TypeDef *RTCx) 01178 { 01179 SET_BIT(RTCx->CR, RTC_CR_BYPSHAD); 01180 } 01181 01182 /** 01183 * @brief Disable Bypass the shadow registers 01184 * @rmtoll RTC_CR BYPSHAD LL_RTC_DisableShadowRegBypass 01185 * @param RTCx RTC Instance 01186 * @retval None 01187 */ 01188 __STATIC_INLINE void LL_RTC_DisableShadowRegBypass(RTC_TypeDef *RTCx) 01189 { 01190 CLEAR_BIT(RTCx->CR, RTC_CR_BYPSHAD); 01191 } 01192 01193 /** 01194 * @brief Check if Shadow registers bypass is enabled or not. 01195 * @rmtoll RTC_CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled 01196 * @param RTCx RTC Instance 01197 * @retval State of bit (1 or 0). 01198 */ 01199 __STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx) 01200 { 01201 return ((READ_BIT(RTCx->CR, RTC_CR_BYPSHAD) == (RTC_CR_BYPSHAD)) ? 1UL : 0UL); 01202 } 01203 01204 /** 01205 * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz) 01206 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01207 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01208 * @rmtoll RTC_CR REFCKON LL_RTC_EnableRefClock 01209 * @param RTCx RTC Instance 01210 * @retval None 01211 */ 01212 __STATIC_INLINE void LL_RTC_EnableRefClock(RTC_TypeDef *RTCx) 01213 { 01214 SET_BIT(RTCx->CR, RTC_CR_REFCKON); 01215 } 01216 01217 /** 01218 * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz) 01219 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01220 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01221 * @rmtoll RTC_CR REFCKON LL_RTC_DisableRefClock 01222 * @param RTCx RTC Instance 01223 * @retval None 01224 */ 01225 __STATIC_INLINE void LL_RTC_DisableRefClock(RTC_TypeDef *RTCx) 01226 { 01227 CLEAR_BIT(RTCx->CR, RTC_CR_REFCKON); 01228 } 01229 01230 /** 01231 * @brief Set Asynchronous prescaler factor 01232 * @rmtoll RTC_PRER PREDIV_A LL_RTC_SetAsynchPrescaler 01233 * @param RTCx RTC Instance 01234 * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F 01235 * @retval None 01236 */ 01237 __STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler) 01238 { 01239 MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_A, AsynchPrescaler << RTC_PRER_PREDIV_A_Pos); 01240 } 01241 01242 /** 01243 * @brief Set Synchronous prescaler factor 01244 * @rmtoll RTC_PRER PREDIV_S LL_RTC_SetSynchPrescaler 01245 * @param RTCx RTC Instance 01246 * @param SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF 01247 * @retval None 01248 */ 01249 __STATIC_INLINE void LL_RTC_SetSynchPrescaler(RTC_TypeDef *RTCx, uint32_t SynchPrescaler) 01250 { 01251 MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_S, SynchPrescaler); 01252 } 01253 01254 /** 01255 * @brief Get Asynchronous prescaler factor 01256 * @rmtoll RTC_PRER PREDIV_A LL_RTC_GetAsynchPrescaler 01257 * @param RTCx RTC Instance 01258 * @retval Value between Min_Data = 0 and Max_Data = 0x7F 01259 */ 01260 __STATIC_INLINE uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef *RTCx) 01261 { 01262 return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_A) >> RTC_PRER_PREDIV_A_Pos); 01263 } 01264 01265 /** 01266 * @brief Get Synchronous prescaler factor 01267 * @rmtoll RTC_PRER PREDIV_S LL_RTC_GetSynchPrescaler 01268 * @param RTCx RTC Instance 01269 * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF 01270 */ 01271 __STATIC_INLINE uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef *RTCx) 01272 { 01273 return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_S)); 01274 } 01275 01276 /** 01277 * @brief Enable the write protection for RTC registers. 01278 * @rmtoll RTC_WPR KEY LL_RTC_EnableWriteProtection 01279 * @param RTCx RTC Instance 01280 * @retval None 01281 */ 01282 __STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx) 01283 { 01284 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_DISABLE); 01285 } 01286 01287 /** 01288 * @brief Disable the write protection for RTC registers. 01289 * @rmtoll RTC_WPR KEY LL_RTC_DisableWriteProtection 01290 * @param RTCx RTC Instance 01291 * @retval None 01292 */ 01293 __STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx) 01294 { 01295 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_1); 01296 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_2); 01297 } 01298 01299 #if defined(RTC_CR_TAMPOE) 01300 /** 01301 * @brief Enable tamper output. 01302 * @note When the tamper output is enabled, all external and internal tamper flags 01303 * are ORed and routed to the TAMPALRM output. 01304 * @rmtoll RTC_CR TAMPOE LL_RTC_EnableTamperOutput 01305 * @param RTCx RTC Instance 01306 * @retval None 01307 */ 01308 __STATIC_INLINE void LL_RTC_EnableTamperOutput(RTC_TypeDef *RTCx) 01309 { 01310 SET_BIT(RTCx->CR, RTC_CR_TAMPOE); 01311 } 01312 01313 /** 01314 * @brief Disable tamper output. 01315 * @rmtoll RTC_CR TAMPOE LL_RTC_DisableTamperOutput 01316 * @param RTCx RTC Instance 01317 * @retval None 01318 */ 01319 __STATIC_INLINE void LL_RTC_DisableTamperOutput(RTC_TypeDef *RTCx) 01320 { 01321 CLEAR_BIT(RTCx->CR, RTC_CR_TAMPOE); 01322 } 01323 01324 /** 01325 * @brief Check if tamper output is enabled or not. 01326 * @rmtoll RTC_CR TAMPOE LL_RTC_IsTamperOutputEnabled 01327 * @param RTCx RTC Instance 01328 * @retval State of bit (1 or 0). 01329 */ 01330 __STATIC_INLINE uint32_t LL_RTC_IsTamperOutputEnabled(RTC_TypeDef *RTCx) 01331 { 01332 return ((READ_BIT(RTCx->CR, RTC_CR_TAMPOE) == (RTC_CR_TAMPOE)) ? 1UL : 0UL); 01333 } 01334 #endif /* RTC_CR_TAMPOE */ 01335 01336 #if defined(RTC_CR_TAMPALRM_PU) 01337 /** 01338 * @brief Enable internal pull-up in output mode. 01339 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_EnableAlarmPullUp 01340 * @param RTCx RTC Instance 01341 * @retval None 01342 */ 01343 __STATIC_INLINE void LL_RTC_EnableAlarmPullUp(RTC_TypeDef *RTCx) 01344 { 01345 SET_BIT(RTCx->CR, RTC_CR_TAMPALRM_PU); 01346 } 01347 01348 /** 01349 * @brief Disable internal pull-up in output mode. 01350 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_EnableAlarmPullUp 01351 * @param RTCx RTC Instance 01352 * @retval None 01353 */ 01354 __STATIC_INLINE void LL_RTC_DisableAlarmPullUp(RTC_TypeDef *RTCx) 01355 { 01356 CLEAR_BIT(RTCx->CR, RTC_CR_TAMPALRM_PU); 01357 } 01358 01359 /** 01360 * @brief Check if internal pull-up in output mode is enabled or not. 01361 * @rmtoll RTC_CR TAMPALRM_PU LL_RTC_IsAlarmPullUpEnabled 01362 * @param RTCx RTC Instance 01363 * @retval State of bit (1 or 0). 01364 */ 01365 __STATIC_INLINE uint32_t LL_RTC_IsAlarmPullUpEnabled(RTC_TypeDef *RTCx) 01366 { 01367 return ((READ_BIT(RTCx->CR, RTC_CR_TAMPALRM_PU) == (RTC_CR_TAMPALRM_PU)) ? 1UL : 0UL); 01368 } 01369 #endif /* RTC_CR_TAMPALRM_PU */ 01370 01371 #if defined(RTC_CR_OUT2EN) 01372 /** 01373 * @brief Enable RTC_OUT2 output 01374 * @note RTC_OUT2 mapping depends on both OSEL (@ref LL_RTC_SetAlarmOutEvent) 01375 * and COE (@ref LL_RTC_CAL_SetOutputFreq) settings. 01376 * @note RTC_OUT2 isn't available ins VBAT mode. 01377 * @rmtoll RTC_CR OUT2EN LL_RTC_EnableOutput2 01378 * @param RTCx RTC Instance 01379 * @retval None 01380 */ 01381 __STATIC_INLINE void LL_RTC_EnableOutput2(RTC_TypeDef *RTCx) 01382 { 01383 SET_BIT(RTCx->CR, RTC_CR_OUT2EN); 01384 } 01385 01386 /** 01387 * @brief Disable RTC_OUT2 output 01388 * @rmtoll RTC_CR OUT2EN LL_RTC_DisableOutput2 01389 * @param RTCx RTC Instance 01390 * @retval None 01391 */ 01392 __STATIC_INLINE void LL_RTC_DisableOutput2(RTC_TypeDef *RTCx) 01393 { 01394 CLEAR_BIT(RTCx->CR, RTC_CR_OUT2EN); 01395 } 01396 01397 /** 01398 * @brief Check if RTC_OUT2 output is enabled or not. 01399 * @rmtoll RTC_CR OUT2EN LL_RTC_IsOutput2Enabled 01400 * @param RTCx RTC Instance 01401 * @retval State of bit (1 or 0). 01402 */ 01403 __STATIC_INLINE uint32_t LL_RTC_IsOutput2Enabled(RTC_TypeDef *RTCx) 01404 { 01405 return ((READ_BIT(RTCx->CR, RTC_CR_OUT2EN) == (RTC_CR_OUT2EN)) ? 1UL : 0UL); 01406 } 01407 01408 #endif /* RTC_CR_OUT2EN */ 01409 01410 #if defined(RTC_OR_OUT_RMP) 01411 /** 01412 * @brief Enable RTC_OUT remap 01413 * @rmtoll OR OUT_RMP LL_RTC_EnableOutRemap 01414 * @param RTCx RTC Instance 01415 * @retval None 01416 */ 01417 __STATIC_INLINE void LL_RTC_EnableOutRemap(RTC_TypeDef *RTCx) 01418 { 01419 SET_BIT(RTCx->OR, RTC_OR_OUT_RMP); 01420 } 01421 01422 /** 01423 * @brief Disable RTC_OUT remap 01424 * @rmtoll OR OUT_RMP LL_RTC_DisableOutRemap 01425 * @param RTCx RTC Instance 01426 * @retval None 01427 */ 01428 __STATIC_INLINE void LL_RTC_DisableOutRemap(RTC_TypeDef *RTCx) 01429 { 01430 CLEAR_BIT(RTCx->OR, RTC_OR_OUT_RMP); 01431 } 01432 #endif /* RTC_OR_OUT_RMP */ 01433 01434 /** 01435 * @} 01436 */ 01437 01438 /** @defgroup RTC_LL_EF_Time Time 01439 * @{ 01440 */ 01441 01442 /** 01443 * @brief Set time format (AM/24-hour or PM notation) 01444 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01445 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01446 * @rmtoll RTC_TR PM LL_RTC_TIME_SetFormat 01447 * @param RTCx RTC Instance 01448 * @param TimeFormat This parameter can be one of the following values: 01449 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24 01450 * @arg @ref LL_RTC_TIME_FORMAT_PM 01451 * @retval None 01452 */ 01453 __STATIC_INLINE void LL_RTC_TIME_SetFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat) 01454 { 01455 MODIFY_REG(RTCx->TR, RTC_TR_PM, TimeFormat); 01456 } 01457 01458 /** 01459 * @brief Get time format (AM or PM notation) 01460 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01461 * before reading this bit 01462 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar 01463 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). 01464 * @rmtoll RTC_TR PM LL_RTC_TIME_GetFormat 01465 * @param RTCx RTC Instance 01466 * @retval Returned value can be one of the following values: 01467 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24 01468 * @arg @ref LL_RTC_TIME_FORMAT_PM 01469 */ 01470 __STATIC_INLINE uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef *RTCx) 01471 { 01472 return (uint32_t)(READ_BIT(RTCx->TR, RTC_TR_PM)); 01473 } 01474 01475 /** 01476 * @brief Set Hours in BCD format 01477 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01478 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01479 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format 01480 * @rmtoll RTC_TR HT LL_RTC_TIME_SetHour 01481 * RTC_TR HU LL_RTC_TIME_SetHour 01482 * @param RTCx RTC Instance 01483 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 01484 * @retval None 01485 */ 01486 __STATIC_INLINE void LL_RTC_TIME_SetHour(RTC_TypeDef *RTCx, uint32_t Hours) 01487 { 01488 MODIFY_REG(RTCx->TR, (RTC_TR_HT | RTC_TR_HU), 01489 (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos))); 01490 } 01491 01492 /** 01493 * @brief Get Hours in BCD format 01494 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01495 * before reading this bit 01496 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar 01497 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). 01498 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to 01499 * Binary format 01500 * @rmtoll RTC_TR HT LL_RTC_TIME_GetHour 01501 * RTC_TR HU LL_RTC_TIME_GetHour 01502 * @param RTCx RTC Instance 01503 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 01504 */ 01505 __STATIC_INLINE uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef *RTCx) 01506 { 01507 return (uint32_t)((READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU))) >> RTC_TR_HU_Pos); 01508 } 01509 01510 /** 01511 * @brief Set Minutes in BCD format 01512 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01513 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01514 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format 01515 * @rmtoll RTC_TR MNT LL_RTC_TIME_SetMinute 01516 * RTC_TR MNU LL_RTC_TIME_SetMinute 01517 * @param RTCx RTC Instance 01518 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59 01519 * @retval None 01520 */ 01521 __STATIC_INLINE void LL_RTC_TIME_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes) 01522 { 01523 MODIFY_REG(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU), 01524 (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos))); 01525 } 01526 01527 /** 01528 * @brief Get Minutes in BCD format 01529 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01530 * before reading this bit 01531 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar 01532 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). 01533 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD 01534 * to Binary format 01535 * @rmtoll RTC_TR MNT LL_RTC_TIME_GetMinute 01536 * RTC_TR MNU LL_RTC_TIME_GetMinute 01537 * @param RTCx RTC Instance 01538 * @retval Value between Min_Data=0x00 and Max_Data=0x59 01539 */ 01540 __STATIC_INLINE uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef *RTCx) 01541 { 01542 return (uint32_t)(READ_BIT(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU)) >> RTC_TR_MNU_Pos); 01543 } 01544 01545 /** 01546 * @brief Set Seconds in BCD format 01547 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01548 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01549 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format 01550 * @rmtoll RTC_TR ST LL_RTC_TIME_SetSecond 01551 * RTC_TR SU LL_RTC_TIME_SetSecond 01552 * @param RTCx RTC Instance 01553 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59 01554 * @retval None 01555 */ 01556 __STATIC_INLINE void LL_RTC_TIME_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds) 01557 { 01558 MODIFY_REG(RTCx->TR, (RTC_TR_ST | RTC_TR_SU), 01559 (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos))); 01560 } 01561 01562 /** 01563 * @brief Get Seconds in BCD format 01564 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01565 * before reading this bit 01566 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar 01567 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). 01568 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD 01569 * to Binary format 01570 * @rmtoll RTC_TR ST LL_RTC_TIME_GetSecond 01571 * RTC_TR SU LL_RTC_TIME_GetSecond 01572 * @param RTCx RTC Instance 01573 * @retval Value between Min_Data=0x00 and Max_Data=0x59 01574 */ 01575 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef *RTCx) 01576 { 01577 return (uint32_t)(READ_BIT(RTCx->TR, (RTC_TR_ST | RTC_TR_SU)) >> RTC_TR_SU_Pos); 01578 } 01579 01580 /** 01581 * @brief Set time (hour, minute and second) in BCD format 01582 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01583 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) 01584 * @note TimeFormat and Hours should follow the same format 01585 * @rmtoll RTC_TR PM LL_RTC_TIME_Config 01586 * RTC_TR HT LL_RTC_TIME_Config 01587 * RTC_TR HU LL_RTC_TIME_Config 01588 * RTC_TR MNT LL_RTC_TIME_Config 01589 * RTC_TR MNU LL_RTC_TIME_Config 01590 * RTC_TR ST LL_RTC_TIME_Config 01591 * RTC_TR SU LL_RTC_TIME_Config 01592 * @param RTCx RTC Instance 01593 * @param Format12_24 This parameter can be one of the following values: 01594 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24 01595 * @arg @ref LL_RTC_TIME_FORMAT_PM 01596 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 01597 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59 01598 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59 01599 * @retval None 01600 */ 01601 __STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds) 01602 { 01603 uint32_t temp; 01604 01605 temp = Format12_24 | \ 01606 (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos)) | \ 01607 (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)) | \ 01608 (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos)); 01609 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); 01610 } 01611 01612 /** 01613 * @brief Get time (hour, minute and second) in BCD format 01614 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01615 * before reading this bit 01616 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar 01617 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). 01618 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND 01619 * are available to get independently each parameter. 01620 * @rmtoll RTC_TR HT LL_RTC_TIME_Get 01621 * RTC_TR HU LL_RTC_TIME_Get 01622 * RTC_TR MNT LL_RTC_TIME_Get 01623 * RTC_TR MNU LL_RTC_TIME_Get 01624 * RTC_TR ST LL_RTC_TIME_Get 01625 * RTC_TR SU LL_RTC_TIME_Get 01626 * @param RTCx RTC Instance 01627 * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS). 01628 */ 01629 __STATIC_INLINE uint32_t LL_RTC_TIME_Get(RTC_TypeDef *RTCx) 01630 { 01631 uint32_t temp; 01632 01633 temp = READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU | RTC_TR_ST | RTC_TR_SU)); 01634 return (uint32_t)((((((temp & RTC_TR_HT) >> RTC_TR_HT_Pos) << 4U) | ((temp & RTC_TR_HU) >> RTC_TR_HU_Pos)) << RTC_OFFSET_HOUR) | \ 01635 (((((temp & RTC_TR_MNT) >> RTC_TR_MNT_Pos) << 4U) | ((temp & RTC_TR_MNU) >> RTC_TR_MNU_Pos)) << RTC_OFFSET_MINUTE) | \ 01636 ((((temp & RTC_TR_ST) >> RTC_TR_ST_Pos) << 4U) | ((temp & RTC_TR_SU) >> RTC_TR_SU_Pos))); 01637 } 01638 01639 /** 01640 * @brief Memorize whether the daylight saving time change has been performed 01641 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01642 * @rmtoll RTC_CR BKP LL_RTC_TIME_EnableDayLightStore 01643 * @param RTCx RTC Instance 01644 * @retval None 01645 */ 01646 __STATIC_INLINE void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef *RTCx) 01647 { 01648 SET_BIT(RTCx->CR, RTC_CR_BKP); 01649 } 01650 01651 /** 01652 * @brief Disable memorization whether the daylight saving time change has been performed. 01653 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01654 * @rmtoll RTC_CR BKP LL_RTC_TIME_DisableDayLightStore 01655 * @param RTCx RTC Instance 01656 * @retval None 01657 */ 01658 __STATIC_INLINE void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef *RTCx) 01659 { 01660 CLEAR_BIT(RTCx->CR, RTC_CR_BKP); 01661 } 01662 01663 /** 01664 * @brief Check if RTC Day Light Saving stored operation has been enabled or not 01665 * @rmtoll RTC_CR BKP LL_RTC_TIME_IsDayLightStoreEnabled 01666 * @param RTCx RTC Instance 01667 * @retval State of bit (1 or 0). 01668 */ 01669 __STATIC_INLINE uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef *RTCx) 01670 { 01671 return ((READ_BIT(RTCx->CR, RTC_CR_BKP) == (RTC_CR_BKP)) ? 1UL : 0UL); 01672 } 01673 01674 /** 01675 * @brief Subtract 1 hour (winter time change) 01676 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01677 * @rmtoll RTC_CR SUB1H LL_RTC_TIME_DecHour 01678 * @param RTCx RTC Instance 01679 * @retval None 01680 */ 01681 __STATIC_INLINE void LL_RTC_TIME_DecHour(RTC_TypeDef *RTCx) 01682 { 01683 SET_BIT(RTCx->CR, RTC_CR_SUB1H); 01684 } 01685 01686 /** 01687 * @brief Add 1 hour (summer time change) 01688 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01689 * @rmtoll RTC_CR ADD1H LL_RTC_TIME_IncHour 01690 * @param RTCx RTC Instance 01691 * @retval None 01692 */ 01693 __STATIC_INLINE void LL_RTC_TIME_IncHour(RTC_TypeDef *RTCx) 01694 { 01695 SET_BIT(RTCx->CR, RTC_CR_ADD1H); 01696 } 01697 01698 /** 01699 * @brief Get Sub second value in the synchronous prescaler counter. 01700 * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through 01701 * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar 01702 * SubSeconds value in second fraction ratio with time unit following 01703 * generic formula: 01704 * ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit 01705 * This conversion can be performed only if no shift operation is pending 01706 * (ie. SHFP=0) when PREDIV_S >= SS. 01707 * @rmtoll RTC_SSR SS LL_RTC_TIME_GetSubSecond 01708 * @param RTCx RTC Instance 01709 * @retval Sub second value (number between 0 and 65535) 01710 */ 01711 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef *RTCx) 01712 { 01713 return (uint32_t)(READ_BIT(RTCx->SSR, RTC_SSR_SS)); 01714 } 01715 01716 /** 01717 * @brief Synchronize to a remote clock with a high degree of precision. 01718 * @note This operation effectively subtracts from (delays) or advance the clock of a fraction of a second. 01719 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01720 * @note When REFCKON is set, firmware must not write to Shift control register. 01721 * @rmtoll RTC_SHIFTR ADD1S LL_RTC_TIME_Synchronize 01722 * RTC_SHIFTR SUBFS LL_RTC_TIME_Synchronize 01723 * @param RTCx RTC Instance 01724 * @param ShiftSecond This parameter can be one of the following values: 01725 * @arg @ref LL_RTC_SHIFT_SECOND_DELAY 01726 * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE 01727 * @param Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF) 01728 * @retval None 01729 */ 01730 __STATIC_INLINE void LL_RTC_TIME_Synchronize(RTC_TypeDef *RTCx, uint32_t ShiftSecond, uint32_t Fraction) 01731 { 01732 WRITE_REG(RTCx->SHIFTR, ShiftSecond | Fraction); 01733 } 01734 01735 /** 01736 * @} 01737 */ 01738 01739 /** @defgroup RTC_LL_EF_Date Date 01740 * @{ 01741 */ 01742 01743 /** 01744 * @brief Set Year in BCD format 01745 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format 01746 * @rmtoll RTC_DR YT LL_RTC_DATE_SetYear 01747 * RTC_DR YU LL_RTC_DATE_SetYear 01748 * @param RTCx RTC Instance 01749 * @param Year Value between Min_Data=0x00 and Max_Data=0x99 01750 * @retval None 01751 */ 01752 __STATIC_INLINE void LL_RTC_DATE_SetYear(RTC_TypeDef *RTCx, uint32_t Year) 01753 { 01754 MODIFY_REG(RTCx->DR, (RTC_DR_YT | RTC_DR_YU), 01755 (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos))); 01756 } 01757 01758 /** 01759 * @brief Get Year in BCD format 01760 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01761 * before reading this bit 01762 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format 01763 * @rmtoll RTC_DR YT LL_RTC_DATE_GetYear 01764 * RTC_DR YU LL_RTC_DATE_GetYear 01765 * @param RTCx RTC Instance 01766 * @retval Value between Min_Data=0x00 and Max_Data=0x99 01767 */ 01768 __STATIC_INLINE uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef *RTCx) 01769 { 01770 return (uint32_t)((READ_BIT(RTCx->DR, (RTC_DR_YT | RTC_DR_YU))) >> RTC_DR_YU_Pos); 01771 } 01772 01773 /** 01774 * @brief Set Week day 01775 * @rmtoll RTC_DR WDU LL_RTC_DATE_SetWeekDay 01776 * @param RTCx RTC Instance 01777 * @param WeekDay This parameter can be one of the following values: 01778 * @arg @ref LL_RTC_WEEKDAY_MONDAY 01779 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 01780 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 01781 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 01782 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 01783 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 01784 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 01785 * @retval None 01786 */ 01787 __STATIC_INLINE void LL_RTC_DATE_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay) 01788 { 01789 MODIFY_REG(RTCx->DR, RTC_DR_WDU, WeekDay << RTC_DR_WDU_Pos); 01790 } 01791 01792 /** 01793 * @brief Get Week day 01794 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01795 * before reading this bit 01796 * @rmtoll RTC_DR WDU LL_RTC_DATE_GetWeekDay 01797 * @param RTCx RTC Instance 01798 * @retval Returned value can be one of the following values: 01799 * @arg @ref LL_RTC_WEEKDAY_MONDAY 01800 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 01801 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 01802 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 01803 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 01804 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 01805 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 01806 */ 01807 __STATIC_INLINE uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef *RTCx) 01808 { 01809 return (uint32_t)(READ_BIT(RTCx->DR, RTC_DR_WDU) >> RTC_DR_WDU_Pos); 01810 } 01811 01812 /** 01813 * @brief Set Month in BCD format 01814 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format 01815 * @rmtoll RTC_DR MT LL_RTC_DATE_SetMonth 01816 * RTC_DR MU LL_RTC_DATE_SetMonth 01817 * @param RTCx RTC Instance 01818 * @param Month This parameter can be one of the following values: 01819 * @arg @ref LL_RTC_MONTH_JANUARY 01820 * @arg @ref LL_RTC_MONTH_FEBRUARY 01821 * @arg @ref LL_RTC_MONTH_MARCH 01822 * @arg @ref LL_RTC_MONTH_APRIL 01823 * @arg @ref LL_RTC_MONTH_MAY 01824 * @arg @ref LL_RTC_MONTH_JUNE 01825 * @arg @ref LL_RTC_MONTH_JULY 01826 * @arg @ref LL_RTC_MONTH_AUGUST 01827 * @arg @ref LL_RTC_MONTH_SEPTEMBER 01828 * @arg @ref LL_RTC_MONTH_OCTOBER 01829 * @arg @ref LL_RTC_MONTH_NOVEMBER 01830 * @arg @ref LL_RTC_MONTH_DECEMBER 01831 * @retval None 01832 */ 01833 __STATIC_INLINE void LL_RTC_DATE_SetMonth(RTC_TypeDef *RTCx, uint32_t Month) 01834 { 01835 MODIFY_REG(RTCx->DR, (RTC_DR_MT | RTC_DR_MU), 01836 (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos))); 01837 } 01838 01839 /** 01840 * @brief Get Month in BCD format 01841 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01842 * before reading this bit 01843 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format 01844 * @rmtoll RTC_DR MT LL_RTC_DATE_GetMonth 01845 * RTC_DR MU LL_RTC_DATE_GetMonth 01846 * @param RTCx RTC Instance 01847 * @retval Returned value can be one of the following values: 01848 * @arg @ref LL_RTC_MONTH_JANUARY 01849 * @arg @ref LL_RTC_MONTH_FEBRUARY 01850 * @arg @ref LL_RTC_MONTH_MARCH 01851 * @arg @ref LL_RTC_MONTH_APRIL 01852 * @arg @ref LL_RTC_MONTH_MAY 01853 * @arg @ref LL_RTC_MONTH_JUNE 01854 * @arg @ref LL_RTC_MONTH_JULY 01855 * @arg @ref LL_RTC_MONTH_AUGUST 01856 * @arg @ref LL_RTC_MONTH_SEPTEMBER 01857 * @arg @ref LL_RTC_MONTH_OCTOBER 01858 * @arg @ref LL_RTC_MONTH_NOVEMBER 01859 * @arg @ref LL_RTC_MONTH_DECEMBER 01860 */ 01861 __STATIC_INLINE uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef *RTCx) 01862 { 01863 return (uint32_t)((READ_BIT(RTCx->DR, (RTC_DR_MT | RTC_DR_MU))) >> RTC_DR_MU_Pos); 01864 } 01865 01866 /** 01867 * @brief Set Day in BCD format 01868 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format 01869 * @rmtoll RTC_DR DT LL_RTC_DATE_SetDay 01870 * RTC_DR DU LL_RTC_DATE_SetDay 01871 * @param RTCx RTC Instance 01872 * @param Day Value between Min_Data=0x01 and Max_Data=0x31 01873 * @retval None 01874 */ 01875 __STATIC_INLINE void LL_RTC_DATE_SetDay(RTC_TypeDef *RTCx, uint32_t Day) 01876 { 01877 MODIFY_REG(RTCx->DR, (RTC_DR_DT | RTC_DR_DU), 01878 (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos))); 01879 } 01880 01881 /** 01882 * @brief Get Day in BCD format 01883 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01884 * before reading this bit 01885 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format 01886 * @rmtoll RTC_DR DT LL_RTC_DATE_GetDay 01887 * RTC_DR DU LL_RTC_DATE_GetDay 01888 * @param RTCx RTC Instance 01889 * @retval Value between Min_Data=0x01 and Max_Data=0x31 01890 */ 01891 __STATIC_INLINE uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef *RTCx) 01892 { 01893 return (uint32_t)((READ_BIT(RTCx->DR, (RTC_DR_DT | RTC_DR_DU))) >> RTC_DR_DU_Pos); 01894 } 01895 01896 /** 01897 * @brief Set date (WeekDay, Day, Month and Year) in BCD format 01898 * @rmtoll RTC_DR WDU LL_RTC_DATE_Config 01899 * RTC_DR MT LL_RTC_DATE_Config 01900 * RTC_DR MU LL_RTC_DATE_Config 01901 * RTC_DR DT LL_RTC_DATE_Config 01902 * RTC_DR DU LL_RTC_DATE_Config 01903 * RTC_DR YT LL_RTC_DATE_Config 01904 * RTC_DR YU LL_RTC_DATE_Config 01905 * @param RTCx RTC Instance 01906 * @param WeekDay This parameter can be one of the following values: 01907 * @arg @ref LL_RTC_WEEKDAY_MONDAY 01908 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 01909 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 01910 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 01911 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 01912 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 01913 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 01914 * @param Day Value between Min_Data=0x01 and Max_Data=0x31 01915 * @param Month This parameter can be one of the following values: 01916 * @arg @ref LL_RTC_MONTH_JANUARY 01917 * @arg @ref LL_RTC_MONTH_FEBRUARY 01918 * @arg @ref LL_RTC_MONTH_MARCH 01919 * @arg @ref LL_RTC_MONTH_APRIL 01920 * @arg @ref LL_RTC_MONTH_MAY 01921 * @arg @ref LL_RTC_MONTH_JUNE 01922 * @arg @ref LL_RTC_MONTH_JULY 01923 * @arg @ref LL_RTC_MONTH_AUGUST 01924 * @arg @ref LL_RTC_MONTH_SEPTEMBER 01925 * @arg @ref LL_RTC_MONTH_OCTOBER 01926 * @arg @ref LL_RTC_MONTH_NOVEMBER 01927 * @arg @ref LL_RTC_MONTH_DECEMBER 01928 * @param Year Value between Min_Data=0x00 and Max_Data=0x99 01929 * @retval None 01930 */ 01931 __STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uint32_t Day, uint32_t Month, uint32_t Year) 01932 { 01933 uint32_t temp; 01934 01935 temp = (WeekDay << RTC_DR_WDU_Pos) | \ 01936 (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos)) | \ 01937 (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)) | \ 01938 (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos)); 01939 01940 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); 01941 } 01942 01943 /** 01944 * @brief Get date (WeekDay, Day, Month and Year) in BCD format 01945 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set 01946 * before reading this bit 01947 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH, 01948 * and __LL_RTC_GET_DAY are available to get independently each parameter. 01949 * @rmtoll RTC_DR WDU LL_RTC_DATE_Get 01950 * RTC_DR MT LL_RTC_DATE_Get 01951 * RTC_DR MU LL_RTC_DATE_Get 01952 * RTC_DR DT LL_RTC_DATE_Get 01953 * RTC_DR DU LL_RTC_DATE_Get 01954 * RTC_DR YT LL_RTC_DATE_Get 01955 * RTC_DR YU LL_RTC_DATE_Get 01956 * @param RTCx RTC Instance 01957 * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY). 01958 */ 01959 __STATIC_INLINE uint32_t LL_RTC_DATE_Get(RTC_TypeDef *RTCx) 01960 { 01961 uint32_t temp; 01962 01963 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)); 01964 return (uint32_t)((((temp & RTC_DR_WDU) >> RTC_DR_WDU_Pos) << RTC_OFFSET_WEEKDAY) | \ 01965 (((((temp & RTC_DR_DT) >> RTC_DR_DT_Pos) << 4U) | ((temp & RTC_DR_DU) >> RTC_DR_DU_Pos)) << RTC_OFFSET_DAY) | \ 01966 (((((temp & RTC_DR_MT) >> RTC_DR_MT_Pos) << 4U) | ((temp & RTC_DR_MU) >> RTC_DR_MU_Pos)) << RTC_OFFSET_MONTH) | \ 01967 ((((temp & RTC_DR_YT) >> RTC_DR_YT_Pos) << 4U) | ((temp & RTC_DR_YU) >> RTC_DR_YU_Pos))); 01968 } 01969 01970 /** 01971 * @} 01972 */ 01973 01974 /** @defgroup RTC_LL_EF_ALARMA ALARMA 01975 * @{ 01976 */ 01977 01978 /** 01979 * @brief Enable Alarm A 01980 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01981 * @rmtoll RTC_CR ALRAE LL_RTC_ALMA_Enable 01982 * @param RTCx RTC Instance 01983 * @retval None 01984 */ 01985 __STATIC_INLINE void LL_RTC_ALMA_Enable(RTC_TypeDef *RTCx) 01986 { 01987 SET_BIT(RTCx->CR, RTC_CR_ALRAE); 01988 } 01989 01990 /** 01991 * @brief Disable Alarm A 01992 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 01993 * @rmtoll RTC_CR ALRAE LL_RTC_ALMA_Disable 01994 * @param RTCx RTC Instance 01995 * @retval None 01996 */ 01997 __STATIC_INLINE void LL_RTC_ALMA_Disable(RTC_TypeDef *RTCx) 01998 { 01999 CLEAR_BIT(RTCx->CR, RTC_CR_ALRAE); 02000 } 02001 02002 /** 02003 * @brief Specify the Alarm A masks. 02004 * @rmtoll RTC_ALRMAR MSK4 LL_RTC_ALMA_SetMask 02005 * RTC_ALRMAR MSK3 LL_RTC_ALMA_SetMask 02006 * RTC_ALRMAR MSK2 LL_RTC_ALMA_SetMask 02007 * RTC_ALRMAR MSK1 LL_RTC_ALMA_SetMask 02008 * @param RTCx RTC Instance 02009 * @param Mask This parameter can be a combination of the following values: 02010 * @arg @ref LL_RTC_ALMA_MASK_NONE 02011 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY 02012 * @arg @ref LL_RTC_ALMA_MASK_HOURS 02013 * @arg @ref LL_RTC_ALMA_MASK_MINUTES 02014 * @arg @ref LL_RTC_ALMA_MASK_SECONDS 02015 * @arg @ref LL_RTC_ALMA_MASK_ALL 02016 * @retval None 02017 */ 02018 __STATIC_INLINE void LL_RTC_ALMA_SetMask(RTC_TypeDef *RTCx, uint32_t Mask) 02019 { 02020 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1, Mask); 02021 } 02022 02023 /** 02024 * @brief Get the Alarm A masks. 02025 * @rmtoll RTC_ALRMAR MSK4 LL_RTC_ALMA_GetMask 02026 * RTC_ALRMAR MSK3 LL_RTC_ALMA_GetMask 02027 * RTC_ALRMAR MSK2 LL_RTC_ALMA_GetMask 02028 * RTC_ALRMAR MSK1 LL_RTC_ALMA_GetMask 02029 * @param RTCx RTC Instance 02030 * @retval Returned value can be can be a combination of the following values: 02031 * @arg @ref LL_RTC_ALMA_MASK_NONE 02032 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY 02033 * @arg @ref LL_RTC_ALMA_MASK_HOURS 02034 * @arg @ref LL_RTC_ALMA_MASK_MINUTES 02035 * @arg @ref LL_RTC_ALMA_MASK_SECONDS 02036 * @arg @ref LL_RTC_ALMA_MASK_ALL 02037 */ 02038 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef *RTCx) 02039 { 02040 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1)); 02041 } 02042 02043 /** 02044 * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care) 02045 * @rmtoll RTC_ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday 02046 * @param RTCx RTC Instance 02047 * @retval None 02048 */ 02049 __STATIC_INLINE void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef *RTCx) 02050 { 02051 SET_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL); 02052 } 02053 02054 /** 02055 * @brief Disable AlarmA Week day selection (DU[3:0] represents the date ) 02056 * @rmtoll RTC_ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday 02057 * @param RTCx RTC Instance 02058 * @retval None 02059 */ 02060 __STATIC_INLINE void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef *RTCx) 02061 { 02062 CLEAR_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL); 02063 } 02064 02065 /** 02066 * @brief Set ALARM A Day in BCD format 02067 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format 02068 * @rmtoll RTC_ALRMAR DT LL_RTC_ALMA_SetDay 02069 * RTC_ALRMAR DU LL_RTC_ALMA_SetDay 02070 * @param RTCx RTC Instance 02071 * @param Day Value between Min_Data=0x01 and Max_Data=0x31 02072 * @retval None 02073 */ 02074 __STATIC_INLINE void LL_RTC_ALMA_SetDay(RTC_TypeDef *RTCx, uint32_t Day) 02075 { 02076 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU), 02077 (((Day & 0xF0U) << (RTC_ALRMAR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMAR_DU_Pos))); 02078 } 02079 02080 /** 02081 * @brief Get ALARM A Day in BCD format 02082 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format 02083 * @rmtoll RTC_ALRMAR DT LL_RTC_ALMA_GetDay 02084 * RTC_ALRMAR DU LL_RTC_ALMA_GetDay 02085 * @param RTCx RTC Instance 02086 * @retval Value between Min_Data=0x01 and Max_Data=0x31 02087 */ 02088 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef *RTCx) 02089 { 02090 return (uint32_t)((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU))) >> RTC_ALRMAR_DU_Pos); 02091 } 02092 02093 /** 02094 * @brief Set ALARM A Weekday 02095 * @rmtoll RTC_ALRMAR DU LL_RTC_ALMA_SetWeekDay 02096 * @param RTCx RTC Instance 02097 * @param WeekDay This parameter can be one of the following values: 02098 * @arg @ref LL_RTC_WEEKDAY_MONDAY 02099 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 02100 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 02101 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 02102 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 02103 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 02104 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 02105 * @retval None 02106 */ 02107 __STATIC_INLINE void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay) 02108 { 02109 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_DU, WeekDay << RTC_ALRMAR_DU_Pos); 02110 } 02111 02112 /** 02113 * @brief Get ALARM A Weekday 02114 * @rmtoll RTC_ALRMAR DU LL_RTC_ALMA_GetWeekDay 02115 * @param RTCx RTC Instance 02116 * @retval Returned value can be one of the following values: 02117 * @arg @ref LL_RTC_WEEKDAY_MONDAY 02118 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 02119 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 02120 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 02121 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 02122 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 02123 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 02124 */ 02125 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef *RTCx) 02126 { 02127 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_DU) >> RTC_ALRMAR_DU_Pos); 02128 } 02129 02130 /** 02131 * @brief Set Alarm A time format (AM/24-hour or PM notation) 02132 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_SetTimeFormat 02133 * @param RTCx RTC Instance 02134 * @param TimeFormat This parameter can be one of the following values: 02135 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM 02136 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM 02137 * @retval None 02138 */ 02139 __STATIC_INLINE void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat) 02140 { 02141 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM, TimeFormat); 02142 } 02143 02144 /** 02145 * @brief Get Alarm A time format (AM or PM notation) 02146 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_GetTimeFormat 02147 * @param RTCx RTC Instance 02148 * @retval Returned value can be one of the following values: 02149 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM 02150 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM 02151 */ 02152 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef *RTCx) 02153 { 02154 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_PM)); 02155 } 02156 02157 /** 02158 * @brief Set ALARM A Hours in BCD format 02159 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format 02160 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_SetHour 02161 * RTC_ALRMAR HU LL_RTC_ALMA_SetHour 02162 * @param RTCx RTC Instance 02163 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02164 * @retval None 02165 */ 02166 __STATIC_INLINE void LL_RTC_ALMA_SetHour(RTC_TypeDef *RTCx, uint32_t Hours) 02167 { 02168 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU), 02169 (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos))); 02170 } 02171 02172 /** 02173 * @brief Get ALARM A Hours in BCD format 02174 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format 02175 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_GetHour 02176 * RTC_ALRMAR HU LL_RTC_ALMA_GetHour 02177 * @param RTCx RTC Instance 02178 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02179 */ 02180 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef *RTCx) 02181 { 02182 return (uint32_t)((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU))) >> RTC_ALRMAR_HU_Pos); 02183 } 02184 02185 /** 02186 * @brief Set ALARM A Minutes in BCD format 02187 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format 02188 * @rmtoll RTC_ALRMAR MNT LL_RTC_ALMA_SetMinute 02189 * RTC_ALRMAR MNU LL_RTC_ALMA_SetMinute 02190 * @param RTCx RTC Instance 02191 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59 02192 * @retval None 02193 */ 02194 __STATIC_INLINE void LL_RTC_ALMA_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes) 02195 { 02196 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU), 02197 (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos))); 02198 } 02199 02200 /** 02201 * @brief Get ALARM A Minutes in BCD format 02202 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format 02203 * @rmtoll RTC_ALRMAR MNT LL_RTC_ALMA_GetMinute 02204 * RTC_ALRMAR MNU LL_RTC_ALMA_GetMinute 02205 * @param RTCx RTC Instance 02206 * @retval Value between Min_Data=0x00 and Max_Data=0x59 02207 */ 02208 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef *RTCx) 02209 { 02210 return (uint32_t)((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU))) >> RTC_ALRMAR_MNU_Pos); 02211 } 02212 02213 /** 02214 * @brief Set ALARM A Seconds in BCD format 02215 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format 02216 * @rmtoll RTC_ALRMAR ST LL_RTC_ALMA_SetSecond 02217 * RTC_ALRMAR SU LL_RTC_ALMA_SetSecond 02218 * @param RTCx RTC Instance 02219 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59 02220 * @retval None 02221 */ 02222 __STATIC_INLINE void LL_RTC_ALMA_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds) 02223 { 02224 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU), 02225 (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos))); 02226 } 02227 02228 /** 02229 * @brief Get ALARM A Seconds in BCD format 02230 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format 02231 * @rmtoll RTC_ALRMAR ST LL_RTC_ALMA_GetSecond 02232 * RTC_ALRMAR SU LL_RTC_ALMA_GetSecond 02233 * @param RTCx RTC Instance 02234 * @retval Value between Min_Data=0x00 and Max_Data=0x59 02235 */ 02236 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef *RTCx) 02237 { 02238 return (uint32_t)((READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU))) >> RTC_ALRMAR_SU_Pos); 02239 } 02240 02241 /** 02242 * @brief Set Alarm A Time (hour, minute and second) in BCD format 02243 * @rmtoll RTC_ALRMAR PM LL_RTC_ALMA_ConfigTime 02244 * RTC_ALRMAR HT LL_RTC_ALMA_ConfigTime 02245 * RTC_ALRMAR HU LL_RTC_ALMA_ConfigTime 02246 * RTC_ALRMAR MNT LL_RTC_ALMA_ConfigTime 02247 * RTC_ALRMAR MNU LL_RTC_ALMA_ConfigTime 02248 * RTC_ALRMAR ST LL_RTC_ALMA_ConfigTime 02249 * RTC_ALRMAR SU LL_RTC_ALMA_ConfigTime 02250 * @param RTCx RTC Instance 02251 * @param Format12_24 This parameter can be one of the following values: 02252 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM 02253 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM 02254 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02255 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59 02256 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59 02257 * @retval None 02258 */ 02259 __STATIC_INLINE void LL_RTC_ALMA_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds) 02260 { 02261 uint32_t temp; 02262 02263 temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos)) | \ 02264 (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)) | \ 02265 (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos)); 02266 02267 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); 02268 } 02269 02270 /** 02271 * @brief Get Alarm B Time (hour, minute and second) in BCD format 02272 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND 02273 * are available to get independently each parameter. 02274 * @rmtoll RTC_ALRMAR HT LL_RTC_ALMA_GetTime 02275 * RTC_ALRMAR HU LL_RTC_ALMA_GetTime 02276 * RTC_ALRMAR MNT LL_RTC_ALMA_GetTime 02277 * RTC_ALRMAR MNU LL_RTC_ALMA_GetTime 02278 * RTC_ALRMAR ST LL_RTC_ALMA_GetTime 02279 * RTC_ALRMAR SU LL_RTC_ALMA_GetTime 02280 * @param RTCx RTC Instance 02281 * @retval Combination of hours, minutes and seconds. 02282 */ 02283 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef *RTCx) 02284 { 02285 return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMA_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMA_GetSecond(RTCx)); 02286 } 02287 02288 /** 02289 * @brief Set Alarm A Mask the most-significant bits starting at this bit 02290 * @note This register can be written only when ALRAE is reset in RTC_CR register, 02291 * or in initialization mode. 02292 * @rmtoll RTC_ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask 02293 * @param RTCx RTC Instance 02294 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF 02295 * @retval None 02296 */ 02297 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask) 02298 { 02299 MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS, Mask << RTC_ALRMASSR_MASKSS_Pos); 02300 } 02301 02302 /** 02303 * @brief Get Alarm A Mask the most-significant bits starting at this bit 02304 * @rmtoll RTC_ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask 02305 * @param RTCx RTC Instance 02306 * @retval Value between Min_Data=0x00 and Max_Data=0xF 02307 */ 02308 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef *RTCx) 02309 { 02310 return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS) >> RTC_ALRMASSR_MASKSS_Pos); 02311 } 02312 02313 /** 02314 * @brief Set Alarm A Sub seconds value 02315 * @rmtoll RCT_ALRMASSR SS LL_RTC_ALMA_SetSubSecond 02316 * @param RTCx RTC Instance 02317 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF 02318 * @retval None 02319 */ 02320 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond) 02321 { 02322 MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_SS, Subsecond); 02323 } 02324 02325 /** 02326 * @brief Get Alarm A Sub seconds value 02327 * @rmtoll RCT_ALRMASSR SS LL_RTC_ALMA_GetSubSecond 02328 * @param RTCx RTC Instance 02329 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF 02330 */ 02331 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef *RTCx) 02332 { 02333 return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_SS)); 02334 } 02335 02336 /** 02337 * @} 02338 */ 02339 02340 /** @defgroup RTC_LL_EF_ALARMB ALARMB 02341 * @{ 02342 */ 02343 02344 /** 02345 * @brief Enable Alarm B 02346 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02347 * @rmtoll RTC_CR ALRBE LL_RTC_ALMB_Enable 02348 * @param RTCx RTC Instance 02349 * @retval None 02350 */ 02351 __STATIC_INLINE void LL_RTC_ALMB_Enable(RTC_TypeDef *RTCx) 02352 { 02353 SET_BIT(RTCx->CR, RTC_CR_ALRBE); 02354 } 02355 02356 /** 02357 * @brief Disable Alarm B 02358 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02359 * @rmtoll RTC_CR ALRBE LL_RTC_ALMB_Disable 02360 * @param RTCx RTC Instance 02361 * @retval None 02362 */ 02363 __STATIC_INLINE void LL_RTC_ALMB_Disable(RTC_TypeDef *RTCx) 02364 { 02365 CLEAR_BIT(RTCx->CR, RTC_CR_ALRBE); 02366 } 02367 02368 /** 02369 * @brief Specify the Alarm B masks. 02370 * @rmtoll RTC_ALRMBR MSK4 LL_RTC_ALMB_SetMask 02371 * RTC_ALRMBR MSK3 LL_RTC_ALMB_SetMask 02372 * RTC_ALRMBR MSK2 LL_RTC_ALMB_SetMask 02373 * RTC_ALRMBR MSK1 LL_RTC_ALMB_SetMask 02374 * @param RTCx RTC Instance 02375 * @param Mask This parameter can be a combination of the following values: 02376 * @arg @ref LL_RTC_ALMB_MASK_NONE 02377 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY 02378 * @arg @ref LL_RTC_ALMB_MASK_HOURS 02379 * @arg @ref LL_RTC_ALMB_MASK_MINUTES 02380 * @arg @ref LL_RTC_ALMB_MASK_SECONDS 02381 * @arg @ref LL_RTC_ALMB_MASK_ALL 02382 * @retval None 02383 */ 02384 __STATIC_INLINE void LL_RTC_ALMB_SetMask(RTC_TypeDef *RTCx, uint32_t Mask) 02385 { 02386 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1, Mask); 02387 } 02388 02389 /** 02390 * @brief Get the Alarm B masks. 02391 * @rmtoll RTC_ALRMBR MSK4 LL_RTC_ALMB_GetMask 02392 * RTC_ALRMBR MSK3 LL_RTC_ALMB_GetMask 02393 * RTC_ALRMBR MSK2 LL_RTC_ALMB_GetMask 02394 * RTC_ALRMBR MSK1 LL_RTC_ALMB_GetMask 02395 * @param RTCx RTC Instance 02396 * @retval Returned value can be can be a combination of the following values: 02397 * @arg @ref LL_RTC_ALMB_MASK_NONE 02398 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY 02399 * @arg @ref LL_RTC_ALMB_MASK_HOURS 02400 * @arg @ref LL_RTC_ALMB_MASK_MINUTES 02401 * @arg @ref LL_RTC_ALMB_MASK_SECONDS 02402 * @arg @ref LL_RTC_ALMB_MASK_ALL 02403 */ 02404 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef *RTCx) 02405 { 02406 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1)); 02407 } 02408 02409 /** 02410 * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care) 02411 * @rmtoll RTC_ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday 02412 * @param RTCx RTC Instance 02413 * @retval None 02414 */ 02415 __STATIC_INLINE void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef *RTCx) 02416 { 02417 SET_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL); 02418 } 02419 02420 /** 02421 * @brief Disable AlarmB Week day selection (DU[3:0] represents the date ) 02422 * @rmtoll RTC_ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday 02423 * @param RTCx RTC Instance 02424 * @retval None 02425 */ 02426 __STATIC_INLINE void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef *RTCx) 02427 { 02428 CLEAR_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL); 02429 } 02430 02431 /** 02432 * @brief Set ALARM B Day in BCD format 02433 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format 02434 * @rmtoll RTC_ALRMBR DT LL_RTC_ALMB_SetDay 02435 * RTC_ALRMBR DU LL_RTC_ALMB_SetDay 02436 * @param RTCx RTC Instance 02437 * @param Day Value between Min_Data=0x01 and Max_Data=0x31 02438 * @retval None 02439 */ 02440 __STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day) 02441 { 02442 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU), 02443 (((Day & 0xF0U) << (RTC_ALRMBR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMBR_DU_Pos))); 02444 } 02445 02446 /** 02447 * @brief Get ALARM B Day in BCD format 02448 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format 02449 * @rmtoll RTC_ALRMBR DT LL_RTC_ALMB_GetDay 02450 * RTC_ALRMBR DU LL_RTC_ALMB_GetDay 02451 * @param RTCx RTC Instance 02452 * @retval Value between Min_Data=0x01 and Max_Data=0x31 02453 */ 02454 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef *RTCx) 02455 { 02456 return (uint32_t)((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU))) >> RTC_ALRMBR_DU_Pos); 02457 } 02458 02459 /** 02460 * @brief Set ALARM B Weekday 02461 * @rmtoll RTC_ALRMBR DU LL_RTC_ALMB_SetWeekDay 02462 * @param RTCx RTC Instance 02463 * @param WeekDay This parameter can be one of the following values: 02464 * @arg @ref LL_RTC_WEEKDAY_MONDAY 02465 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 02466 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 02467 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 02468 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 02469 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 02470 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 02471 * @retval None 02472 */ 02473 __STATIC_INLINE void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay) 02474 { 02475 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_DU, WeekDay << RTC_ALRMBR_DU_Pos); 02476 } 02477 02478 /** 02479 * @brief Get ALARM B Weekday 02480 * @rmtoll RTC_ALRMBR DU LL_RTC_ALMB_GetWeekDay 02481 * @param RTCx RTC Instance 02482 * @retval Returned value can be one of the following values: 02483 * @arg @ref LL_RTC_WEEKDAY_MONDAY 02484 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 02485 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 02486 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 02487 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 02488 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 02489 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 02490 */ 02491 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef *RTCx) 02492 { 02493 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_DU) >> RTC_ALRMBR_DU_Pos); 02494 } 02495 02496 /** 02497 * @brief Set ALARM B time format (AM/24-hour or PM notation) 02498 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_SetTimeFormat 02499 * @param RTCx RTC Instance 02500 * @param TimeFormat This parameter can be one of the following values: 02501 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM 02502 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM 02503 * @retval None 02504 */ 02505 __STATIC_INLINE void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat) 02506 { 02507 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM, TimeFormat); 02508 } 02509 02510 /** 02511 * @brief Get ALARM B time format (AM or PM notation) 02512 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_GetTimeFormat 02513 * @param RTCx RTC Instance 02514 * @retval Returned value can be one of the following values: 02515 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM 02516 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM 02517 */ 02518 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef *RTCx) 02519 { 02520 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_PM)); 02521 } 02522 02523 /** 02524 * @brief Set ALARM B Hours in BCD format 02525 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format 02526 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_SetHour 02527 * RTC_ALRMBR HU LL_RTC_ALMB_SetHour 02528 * @param RTCx RTC Instance 02529 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02530 * @retval None 02531 */ 02532 __STATIC_INLINE void LL_RTC_ALMB_SetHour(RTC_TypeDef *RTCx, uint32_t Hours) 02533 { 02534 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU), 02535 (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos))); 02536 } 02537 02538 /** 02539 * @brief Get ALARM B Hours in BCD format 02540 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format 02541 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_GetHour 02542 * RTC_ALRMBR HU LL_RTC_ALMB_GetHour 02543 * @param RTCx RTC Instance 02544 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02545 */ 02546 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef *RTCx) 02547 { 02548 return (uint32_t)((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU))) >> RTC_ALRMBR_HU_Pos); 02549 } 02550 02551 /** 02552 * @brief Set ALARM B Minutes in BCD format 02553 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format 02554 * @rmtoll RTC_ALRMBR MNT LL_RTC_ALMB_SetMinute 02555 * RTC_ALRMBR MNU LL_RTC_ALMB_SetMinute 02556 * @param RTCx RTC Instance 02557 * @param Minutes between Min_Data=0x00 and Max_Data=0x59 02558 * @retval None 02559 */ 02560 __STATIC_INLINE void LL_RTC_ALMB_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes) 02561 { 02562 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU), 02563 (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos))); 02564 } 02565 02566 /** 02567 * @brief Get ALARM B Minutes in BCD format 02568 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format 02569 * @rmtoll RTC_ALRMBR MNT LL_RTC_ALMB_GetMinute 02570 * RTC_ALRMBR MNU LL_RTC_ALMB_GetMinute 02571 * @param RTCx RTC Instance 02572 * @retval Value between Min_Data=0x00 and Max_Data=0x59 02573 */ 02574 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef *RTCx) 02575 { 02576 return (uint32_t)((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU))) >> RTC_ALRMBR_MNU_Pos); 02577 } 02578 02579 /** 02580 * @brief Set ALARM B Seconds in BCD format 02581 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format 02582 * @rmtoll RTC_ALRMBR ST LL_RTC_ALMB_SetSecond 02583 * RTC_ALRMBR SU LL_RTC_ALMB_SetSecond 02584 * @param RTCx RTC Instance 02585 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59 02586 * @retval None 02587 */ 02588 __STATIC_INLINE void LL_RTC_ALMB_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds) 02589 { 02590 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU), 02591 (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos))); 02592 } 02593 02594 /** 02595 * @brief Get ALARM B Seconds in BCD format 02596 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format 02597 * @rmtoll RTC_ALRMBR ST LL_RTC_ALMB_GetSecond 02598 * RTC_ALRMBR SU LL_RTC_ALMB_GetSecond 02599 * @param RTCx RTC Instance 02600 * @retval Value between Min_Data=0x00 and Max_Data=0x59 02601 */ 02602 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef *RTCx) 02603 { 02604 return (uint32_t)((READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU))) >> RTC_ALRMBR_SU_Pos); 02605 } 02606 02607 /** 02608 * @brief Set Alarm B Time (hour, minute and second) in BCD format 02609 * @rmtoll RTC_ALRMBR PM LL_RTC_ALMB_ConfigTime 02610 * RTC_ALRMBR HT LL_RTC_ALMB_ConfigTime 02611 * RTC_ALRMBR HU LL_RTC_ALMB_ConfigTime 02612 * RTC_ALRMBR MNT LL_RTC_ALMB_ConfigTime 02613 * RTC_ALRMBR MNU LL_RTC_ALMB_ConfigTime 02614 * RTC_ALRMBR ST LL_RTC_ALMB_ConfigTime 02615 * RTC_ALRMBR SU LL_RTC_ALMB_ConfigTime 02616 * @param RTCx RTC Instance 02617 * @param Format12_24 This parameter can be one of the following values: 02618 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM 02619 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM 02620 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02621 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59 02622 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59 02623 * @retval None 02624 */ 02625 __STATIC_INLINE void LL_RTC_ALMB_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds) 02626 { 02627 uint32_t temp; 02628 02629 temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos)) | \ 02630 (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)) | \ 02631 (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos)); 02632 02633 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); 02634 } 02635 02636 /** 02637 * @brief Get Alarm B Time (hour, minute and second) in BCD format 02638 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND 02639 * are available to get independently each parameter. 02640 * @rmtoll RTC_ALRMBR HT LL_RTC_ALMB_GetTime 02641 * RTC_ALRMBR HU LL_RTC_ALMB_GetTime 02642 * RTC_ALRMBR MNT LL_RTC_ALMB_GetTime 02643 * RTC_ALRMBR MNU LL_RTC_ALMB_GetTime 02644 * RTC_ALRMBR ST LL_RTC_ALMB_GetTime 02645 * RTC_ALRMBR SU LL_RTC_ALMB_GetTime 02646 * @param RTCx RTC Instance 02647 * @retval Combination of hours, minutes and seconds. 02648 */ 02649 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef *RTCx) 02650 { 02651 return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMB_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMB_GetSecond(RTCx)); 02652 } 02653 02654 /** 02655 * @brief Set Alarm B Mask the most-significant bits starting at this bit 02656 * @note This register can be written only when ALRBE is reset in RTC_CR register, 02657 * or in initialization mode. 02658 * @rmtoll RTC_ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask 02659 * @param RTCx RTC Instance 02660 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF 02661 * @retval None 02662 */ 02663 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask) 02664 { 02665 MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS, Mask << RTC_ALRMBSSR_MASKSS_Pos); 02666 } 02667 02668 /** 02669 * @brief Get Alarm B Mask the most-significant bits starting at this bit 02670 * @rmtoll RTC_ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask 02671 * @param RTCx RTC Instance 02672 * @retval Value between Min_Data=0x00 and Max_Data=0xF 02673 */ 02674 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef *RTCx) 02675 { 02676 return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS) >> RTC_ALRMBSSR_MASKSS_Pos); 02677 } 02678 02679 /** 02680 * @brief Set Alarm B Sub seconds value 02681 * @rmtoll RTC_ALRMBSSR SS LL_RTC_ALMB_SetSubSecond 02682 * @param RTCx RTC Instance 02683 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF 02684 * @retval None 02685 */ 02686 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond) 02687 { 02688 MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS, Subsecond); 02689 } 02690 02691 /** 02692 * @brief Get Alarm B Sub seconds value 02693 * @rmtoll RTC_ALRMBSSR SS LL_RTC_ALMB_GetSubSecond 02694 * @param RTCx RTC Instance 02695 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF 02696 */ 02697 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef *RTCx) 02698 { 02699 return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS)); 02700 } 02701 02702 /** 02703 * @} 02704 */ 02705 02706 /** @defgroup RTC_LL_EF_Timestamp Timestamp 02707 * @{ 02708 */ 02709 02710 /** 02711 * @brief Enable internal event timestamp 02712 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02713 * @rmtoll RTC_CR ITSE LL_RTC_TS_EnableInternalEvent 02714 * @param RTCx RTC Instance 02715 * @retval None 02716 */ 02717 __STATIC_INLINE void LL_RTC_TS_EnableInternalEvent(RTC_TypeDef *RTCx) 02718 { 02719 SET_BIT(RTCx->CR, RTC_CR_ITSE); 02720 } 02721 02722 /** 02723 * @brief Disable internal event timestamp 02724 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02725 * @rmtoll RTC_CR ITSE LL_RTC_TS_DisableInternalEvent 02726 * @param RTCx RTC Instance 02727 * @retval None 02728 */ 02729 __STATIC_INLINE void LL_RTC_TS_DisableInternalEvent(RTC_TypeDef *RTCx) 02730 { 02731 CLEAR_BIT(RTCx->CR, RTC_CR_ITSE); 02732 } 02733 02734 /** 02735 * @brief Enable Timestamp 02736 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02737 * @rmtoll RTC_CR TSE LL_RTC_TS_Enable 02738 * @param RTCx RTC Instance 02739 * @retval None 02740 */ 02741 __STATIC_INLINE void LL_RTC_TS_Enable(RTC_TypeDef *RTCx) 02742 { 02743 SET_BIT(RTCx->CR, RTC_CR_TSE); 02744 } 02745 02746 /** 02747 * @brief Disable Timestamp 02748 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02749 * @rmtoll RTC_CR TSE LL_RTC_TS_Disable 02750 * @param RTCx RTC Instance 02751 * @retval None 02752 */ 02753 __STATIC_INLINE void LL_RTC_TS_Disable(RTC_TypeDef *RTCx) 02754 { 02755 CLEAR_BIT(RTCx->CR, RTC_CR_TSE); 02756 } 02757 02758 /** 02759 * @brief Set Time-stamp event active edge 02760 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02761 * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting 02762 * @rmtoll RTC_CR TSEDGE LL_RTC_TS_SetActiveEdge 02763 * @param RTCx RTC Instance 02764 * @param Edge This parameter can be one of the following values: 02765 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING 02766 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING 02767 * @retval None 02768 */ 02769 __STATIC_INLINE void LL_RTC_TS_SetActiveEdge(RTC_TypeDef *RTCx, uint32_t Edge) 02770 { 02771 MODIFY_REG(RTCx->CR, RTC_CR_TSEDGE, Edge); 02772 } 02773 02774 /** 02775 * @brief Get Time-stamp event active edge 02776 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 02777 * @rmtoll RTC_CR TSEDGE LL_RTC_TS_GetActiveEdge 02778 * @param RTCx RTC Instance 02779 * @retval Returned value can be one of the following values: 02780 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING 02781 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING 02782 */ 02783 __STATIC_INLINE uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef *RTCx) 02784 { 02785 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_TSEDGE)); 02786 } 02787 02788 /** 02789 * @brief Get Timestamp AM/PM notation (AM or 24-hour format) 02790 * @rmtoll RTC_TSTR PM LL_RTC_TS_GetTimeFormat 02791 * @param RTCx RTC Instance 02792 * @retval Returned value can be one of the following values: 02793 * @arg @ref LL_RTC_TS_TIME_FORMAT_AM 02794 * @arg @ref LL_RTC_TS_TIME_FORMAT_PM 02795 */ 02796 __STATIC_INLINE uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef *RTCx) 02797 { 02798 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_PM)); 02799 } 02800 02801 /** 02802 * @brief Get Timestamp Hours in BCD format 02803 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format 02804 * @rmtoll RTC_TSTR HT LL_RTC_TS_GetHour 02805 * RTC_TSTR HU LL_RTC_TS_GetHour 02806 * @param RTCx RTC Instance 02807 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23 02808 */ 02809 __STATIC_INLINE uint32_t LL_RTC_TS_GetHour(RTC_TypeDef *RTCx) 02810 { 02811 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_HT | RTC_TSTR_HU) >> RTC_TSTR_HU_Pos); 02812 } 02813 02814 /** 02815 * @brief Get Timestamp Minutes in BCD format 02816 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format 02817 * @rmtoll RTC_TSTR MNT LL_RTC_TS_GetMinute 02818 * RTC_TSTR MNU LL_RTC_TS_GetMinute 02819 * @param RTCx RTC Instance 02820 * @retval Value between Min_Data=0x00 and Max_Data=0x59 02821 */ 02822 __STATIC_INLINE uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef *RTCx) 02823 { 02824 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_MNT | RTC_TSTR_MNU) >> RTC_TSTR_MNU_Pos); 02825 } 02826 02827 /** 02828 * @brief Get Timestamp Seconds in BCD format 02829 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format 02830 * @rmtoll RTC_TSTR ST LL_RTC_TS_GetSecond 02831 * RTC_TSTR SU LL_RTC_TS_GetSecond 02832 * @param RTCx RTC Instance 02833 * @retval Value between Min_Data=0x00 and Max_Data=0x59 02834 */ 02835 __STATIC_INLINE uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef *RTCx) 02836 { 02837 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_ST | RTC_TSTR_SU)); 02838 } 02839 02840 /** 02841 * @brief Get Timestamp time (hour, minute and second) in BCD format 02842 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND 02843 * are available to get independently each parameter. 02844 * @rmtoll RTC_TSTR HT LL_RTC_TS_GetTime 02845 * RTC_TSTR HU LL_RTC_TS_GetTime 02846 * RTC_TSTR MNT LL_RTC_TS_GetTime 02847 * RTC_TSTR MNU LL_RTC_TS_GetTime 02848 * RTC_TSTR ST LL_RTC_TS_GetTime 02849 * RTC_TSTR SU LL_RTC_TS_GetTime 02850 * @param RTCx RTC Instance 02851 * @retval Combination of hours, minutes and seconds. 02852 */ 02853 __STATIC_INLINE uint32_t LL_RTC_TS_GetTime(RTC_TypeDef *RTCx) 02854 { 02855 return (uint32_t)(READ_BIT(RTCx->TSTR, 02856 RTC_TSTR_HT | RTC_TSTR_HU | RTC_TSTR_MNT | RTC_TSTR_MNU | RTC_TSTR_ST | RTC_TSTR_SU)); 02857 } 02858 02859 /** 02860 * @brief Get Timestamp Week day 02861 * @rmtoll RTC_TSDR WDU LL_RTC_TS_GetWeekDay 02862 * @param RTCx RTC Instance 02863 * @retval Returned value can be one of the following values: 02864 * @arg @ref LL_RTC_WEEKDAY_MONDAY 02865 * @arg @ref LL_RTC_WEEKDAY_TUESDAY 02866 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY 02867 * @arg @ref LL_RTC_WEEKDAY_THURSDAY 02868 * @arg @ref LL_RTC_WEEKDAY_FRIDAY 02869 * @arg @ref LL_RTC_WEEKDAY_SATURDAY 02870 * @arg @ref LL_RTC_WEEKDAY_SUNDAY 02871 */ 02872 __STATIC_INLINE uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef *RTCx) 02873 { 02874 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU) >> RTC_TSDR_WDU_Pos); 02875 } 02876 02877 /** 02878 * @brief Get Timestamp Month in BCD format 02879 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format 02880 * @rmtoll RTC_TSDR MT LL_RTC_TS_GetMonth 02881 * RTC_TSDR MU LL_RTC_TS_GetMonth 02882 * @param RTCx RTC Instance 02883 * @retval Returned value can be one of the following values: 02884 * @arg @ref LL_RTC_MONTH_JANUARY 02885 * @arg @ref LL_RTC_MONTH_FEBRUARY 02886 * @arg @ref LL_RTC_MONTH_MARCH 02887 * @arg @ref LL_RTC_MONTH_APRIL 02888 * @arg @ref LL_RTC_MONTH_MAY 02889 * @arg @ref LL_RTC_MONTH_JUNE 02890 * @arg @ref LL_RTC_MONTH_JULY 02891 * @arg @ref LL_RTC_MONTH_AUGUST 02892 * @arg @ref LL_RTC_MONTH_SEPTEMBER 02893 * @arg @ref LL_RTC_MONTH_OCTOBER 02894 * @arg @ref LL_RTC_MONTH_NOVEMBER 02895 * @arg @ref LL_RTC_MONTH_DECEMBER 02896 */ 02897 __STATIC_INLINE uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef *RTCx) 02898 { 02899 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_MT | RTC_TSDR_MU) >> RTC_TSDR_MU_Pos); 02900 } 02901 02902 /** 02903 * @brief Get Timestamp Day in BCD format 02904 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format 02905 * @rmtoll RTC_TSDR DT LL_RTC_TS_GetDay 02906 * RTC_TSDR DU LL_RTC_TS_GetDay 02907 * @param RTCx RTC Instance 02908 * @retval Value between Min_Data=0x01 and Max_Data=0x31 02909 */ 02910 __STATIC_INLINE uint32_t LL_RTC_TS_GetDay(RTC_TypeDef *RTCx) 02911 { 02912 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_DT | RTC_TSDR_DU)); 02913 } 02914 02915 /** 02916 * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format 02917 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH, 02918 * and __LL_RTC_GET_DAY are available to get independently each parameter. 02919 * @rmtoll RTC_TSDR WDU LL_RTC_TS_GetDate 02920 * RTC_TSDR MT LL_RTC_TS_GetDate 02921 * RTC_TSDR MU LL_RTC_TS_GetDate 02922 * RTC_TSDR DT LL_RTC_TS_GetDate 02923 * RTC_TSDR DU LL_RTC_TS_GetDate 02924 * @param RTCx RTC Instance 02925 * @retval Combination of Weekday, Day and Month 02926 */ 02927 __STATIC_INLINE uint32_t LL_RTC_TS_GetDate(RTC_TypeDef *RTCx) 02928 { 02929 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU | RTC_TSDR_MT | RTC_TSDR_MU | RTC_TSDR_DT | RTC_TSDR_DU)); 02930 } 02931 02932 /** 02933 * @brief Get time-stamp sub second value 02934 * @rmtoll RTC_TSSSR SS LL_RTC_TS_GetSubSecond 02935 * @param RTCx RTC Instance 02936 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF 02937 */ 02938 __STATIC_INLINE uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef *RTCx) 02939 { 02940 return (uint32_t)(READ_BIT(RTCx->TSSSR, RTC_TSSSR_SS)); 02941 } 02942 02943 /** 02944 * @} 02945 */ 02946 02947 /** @defgroup RTC_LL_EF_Tamper_Timestamp Time-stamp on Tamper 02948 * @{ 02949 */ 02950 02951 #if defined(RTC_TAMPCR_TAMPTS) 02952 /** 02953 * @brief Activate timestamp on tamper detection event 02954 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_EnableOnTamper 02955 * @param RTCx RTC Instance 02956 * @retval None 02957 */ 02958 __STATIC_INLINE void LL_RTC_TS_EnableOnTamper(RTC_TypeDef *RTCx) 02959 { 02960 SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPTS); 02961 } 02962 02963 /** 02964 * @brief Disable timestamp on tamper detection event 02965 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_DisableOnTamper 02966 * @param RTCx RTC Instance 02967 * @retval None 02968 */ 02969 __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx) 02970 { 02971 CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPTS); 02972 } 02973 #endif /* RTC_TAMPCR_TAMPTS */ 02974 02975 #if defined(RTC_CR_TAMPTS) 02976 /** 02977 * @brief Activate timestamp on tamper detection event 02978 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_EnableOnTamper 02979 * @param RTCx RTC Instance 02980 * @retval None 02981 */ 02982 02983 __STATIC_INLINE void LL_RTC_TS_EnableOnTamper(RTC_TypeDef *RTCx) 02984 { 02985 SET_BIT(RTCx->CR, RTC_CR_TAMPTS); 02986 } 02987 02988 /** 02989 * @brief Disable timestamp on tamper detection event 02990 * @rmtoll RTC_CR TAMPTS LL_RTC_TS_DisableOnTamper 02991 * @param RTCx RTC Instance 02992 * @retval None 02993 */ 02994 __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx) 02995 { 02996 CLEAR_BIT(RTCx->CR, RTC_CR_TAMPTS); 02997 } 02998 #endif /* RTC_CR_TAMPTS */ 02999 03000 /** 03001 * @} 03002 */ 03003 03004 /** @defgroup RTC_LL_EF_Tamper Tamper 03005 * @{ 03006 */ 03007 03008 #if defined(RTC_TAMPCR_TAMP1E) 03009 /** 03010 * @brief Enable RTC_TAMPx input detection 03011 * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Enable 03012 * TAMPCR TAMP2E LL_RTC_TAMPER_Enable 03013 * TAMPCR TAMP3E LL_RTC_TAMPER_Enable 03014 * @param RTCx RTC Instance 03015 * @param Tamper This parameter can be a combination of the following values: 03016 * @arg @ref LL_RTC_TAMPER_1 03017 * @arg @ref LL_RTC_TAMPER_2 03018 * @arg @ref LL_RTC_TAMPER_3 03019 * 03020 * @retval None 03021 */ 03022 __STATIC_INLINE void LL_RTC_TAMPER_Enable(RTC_TypeDef *RTCx, uint32_t Tamper) 03023 { 03024 SET_BIT(RTCx->TAMPCR, Tamper); 03025 } 03026 03027 /** 03028 * @brief Clear RTC_TAMPx input detection 03029 * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Disable 03030 * TAMPCR TAMP2E LL_RTC_TAMPER_Disable 03031 * TAMPCR TAMP3E LL_RTC_TAMPER_Disable 03032 * @param RTCx RTC Instance 03033 * @param Tamper This parameter can be a combination of the following values: 03034 * @arg @ref LL_RTC_TAMPER_1 03035 * @arg @ref LL_RTC_TAMPER_2 03036 * @arg @ref LL_RTC_TAMPER_3 03037 * 03038 * @retval None 03039 */ 03040 __STATIC_INLINE void LL_RTC_TAMPER_Disable(RTC_TypeDef *RTCx, uint32_t Tamper) 03041 { 03042 CLEAR_BIT(RTCx->TAMPCR, Tamper); 03043 } 03044 03045 /** 03046 * @brief Enable Tamper mask flag 03047 * @note Associated Tamper IT must not enabled when tamper mask is set. 03048 * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_EnableMask 03049 * TAMPCR TAMP2MF LL_RTC_TAMPER_EnableMask 03050 * TAMPCR TAMP3MF LL_RTC_TAMPER_EnableMask 03051 * @param RTCx RTC Instance 03052 * @param Mask This parameter can be a combination of the following values: 03053 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 03054 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 03055 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 03056 * 03057 * @retval None 03058 */ 03059 __STATIC_INLINE void LL_RTC_TAMPER_EnableMask(RTC_TypeDef *RTCx, uint32_t Mask) 03060 { 03061 SET_BIT(RTCx->TAMPCR, Mask); 03062 } 03063 03064 /** 03065 * @brief Disable Tamper mask flag 03066 * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_DisableMask 03067 * TAMPCR TAMP2MF LL_RTC_TAMPER_DisableMask 03068 * TAMPCR TAMP3MF LL_RTC_TAMPER_DisableMask 03069 * @param RTCx RTC Instance 03070 * @param Mask This parameter can be a combination of the following values: 03071 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 03072 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 03073 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 03074 * 03075 * @retval None 03076 */ 03077 __STATIC_INLINE void LL_RTC_TAMPER_DisableMask(RTC_TypeDef *RTCx, uint32_t Mask) 03078 { 03079 CLEAR_BIT(RTCx->TAMPCR, Mask); 03080 } 03081 03082 /** 03083 * @brief Enable backup register erase after Tamper event detection 03084 * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP 03085 * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_EnableEraseBKP 03086 * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP 03087 * @param RTCx RTC Instance 03088 * @param Tamper This parameter can be a combination of the following values: 03089 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 03090 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 03091 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 03092 * 03093 * @retval None 03094 */ 03095 __STATIC_INLINE void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef *RTCx, uint32_t Tamper) 03096 { 03097 CLEAR_BIT(RTCx->TAMPCR, Tamper); 03098 } 03099 03100 /** 03101 * @brief Disable backup register erase after Tamper event detection 03102 * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP 03103 * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_DisableEraseBKP 03104 * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP 03105 * @param RTCx RTC Instance 03106 * @param Tamper This parameter can be a combination of the following values: 03107 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 03108 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 03109 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 03110 * 03111 * @retval None 03112 */ 03113 __STATIC_INLINE void LL_RTC_TAMPER_DisableEraseBKP(RTC_TypeDef *RTCx, uint32_t Tamper) 03114 { 03115 SET_BIT(RTCx->TAMPCR, Tamper); 03116 } 03117 #endif /* RTC_TAMPCR_TAMP1E */ 03118 03119 #if defined(RTC_TAMPCR_TAMPPUDIS) 03120 /** 03121 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins) 03122 * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp 03123 * @param RTCx RTC Instance 03124 * @retval None 03125 */ 03126 __STATIC_INLINE void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef *RTCx) 03127 { 03128 SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPUDIS); 03129 } 03130 03131 /** 03132 * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling) 03133 * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp 03134 * @param RTCx RTC Instance 03135 * @retval None 03136 */ 03137 __STATIC_INLINE void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef *RTCx) 03138 { 03139 CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPUDIS); 03140 } 03141 #endif /* RTC_TAMPCR_TAMPPUDIS */ 03142 03143 #if defined(RTC_TAMPCR_TAMPPRCH) 03144 /** 03145 * @brief Set RTC_TAMPx precharge duration 03146 * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge 03147 * @param RTCx RTC Instance 03148 * @param Duration This parameter can be one of the following values: 03149 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK 03150 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK 03151 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK 03152 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK 03153 * @retval None 03154 */ 03155 __STATIC_INLINE void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef *RTCx, uint32_t Duration) 03156 { 03157 MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPPRCH, Duration); 03158 } 03159 03160 /** 03161 * @brief Get RTC_TAMPx precharge duration 03162 * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge 03163 * @param RTCx RTC Instance 03164 * @retval Returned value can be one of the following values: 03165 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK 03166 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK 03167 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK 03168 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK 03169 */ 03170 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef *RTCx) 03171 { 03172 return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPRCH)); 03173 } 03174 #endif /* RTC_TAMPCR_TAMPPRCH */ 03175 03176 #if defined(RTC_TAMPCR_TAMPFLT) 03177 /** 03178 * @brief Set RTC_TAMPx filter count 03179 * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_SetFilterCount 03180 * @param RTCx RTC Instance 03181 * @param FilterCount This parameter can be one of the following values: 03182 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE 03183 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE 03184 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE 03185 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE 03186 * @retval None 03187 */ 03188 __STATIC_INLINE void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef *RTCx, uint32_t FilterCount) 03189 { 03190 MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPFLT, FilterCount); 03191 } 03192 03193 /** 03194 * @brief Get RTC_TAMPx filter count 03195 * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_GetFilterCount 03196 * @param RTCx RTC Instance 03197 * @retval Returned value can be one of the following values: 03198 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE 03199 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE 03200 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE 03201 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE 03202 */ 03203 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef *RTCx) 03204 { 03205 return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPFLT)); 03206 } 03207 #endif /* RTC_TAMPCR_TAMPFLT */ 03208 03209 #if defined(RTC_TAMPCR_TAMPFREQ) 03210 /** 03211 * @brief Set Tamper sampling frequency 03212 * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq 03213 * @param RTCx RTC Instance 03214 * @param SamplingFreq This parameter can be one of the following values: 03215 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768 03216 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384 03217 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192 03218 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096 03219 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048 03220 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024 03221 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512 03222 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256 03223 * @retval None 03224 */ 03225 __STATIC_INLINE void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef *RTCx, uint32_t SamplingFreq) 03226 { 03227 MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPFREQ, SamplingFreq); 03228 } 03229 03230 /** 03231 * @brief Get Tamper sampling frequency 03232 * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq 03233 * @param RTCx RTC Instance 03234 * @retval Returned value can be one of the following values: 03235 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768 03236 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384 03237 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192 03238 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096 03239 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048 03240 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024 03241 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512 03242 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256 03243 */ 03244 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef *RTCx) 03245 { 03246 return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPFREQ)); 03247 } 03248 #endif /* RTC_TAMPCR_TAMPFREQ */ 03249 03250 #if defined(RTC_TAMPCR_TAMP1E) 03251 /** 03252 * @brief Enable Active level for Tamper input 03253 * @rmtoll TAMPCR TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel 03254 * TAMPCR TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel 03255 * TAMPCR TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel 03256 * @param RTCx RTC Instance 03257 * @param Tamper This parameter can be a combination of the following values: 03258 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 03259 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 03260 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 03261 * 03262 * @retval None 03263 */ 03264 __STATIC_INLINE void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper) 03265 { 03266 SET_BIT(RTCx->TAMPCR, Tamper); 03267 } 03268 03269 /** 03270 * @brief Disable Active level for Tamper input 03271 * @rmtoll TAMPCR TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel 03272 * TAMPCR TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel 03273 * TAMPCR TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel 03274 * @param RTCx RTC Instance 03275 * @param Tamper This parameter can be a combination of the following values: 03276 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 03277 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 03278 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 03279 * 03280 * @retval None 03281 */ 03282 __STATIC_INLINE void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper) 03283 { 03284 CLEAR_BIT(RTCx->TAMPCR, Tamper); 03285 } 03286 #endif /* RTC_TAMPCR_TAMP1E */ 03287 03288 #if defined(TAMP_CR1_TAMP1E) 03289 /** 03290 * @brief Enable TAMPx input detection 03291 * @rmtoll TAMP_CR1 TAMP1E LL_RTC_TAMPER_Enable 03292 * TAMP_CR1 TAMP2E LL_RTC_TAMPER_Enable 03293 * TAMP_CR1 TAMP3E LL_RTC_TAMPER_Enable 03294 * @param TAMPx TAMP Instance 03295 * @param Tamper This parameter can be a combination of the following values: 03296 * @arg @ref LL_RTC_TAMPER_1 03297 * @arg @ref LL_RTC_TAMPER_2 03298 * @arg @ref LL_RTC_TAMPER_3 03299 * 03300 * @retval None 03301 */ 03302 __STATIC_INLINE void LL_RTC_TAMPER_Enable(TAMP_TypeDef *TAMPx, uint32_t Tamper) 03303 { 03304 SET_BIT(TAMPx->CR1, Tamper); 03305 } 03306 03307 /** 03308 * @brief Clear TAMPx input detection 03309 * @rmtoll TAMP_CR1 TAMP1E LL_RTC_TAMPER_Disable 03310 * TAMP_CR1 TAMP2E LL_RTC_TAMPER_Disable 03311 * TAMP_CR1 TAMP3E LL_RTC_TAMPER_Disable 03312 * @param TAMPx TAMP Instance 03313 * @param Tamper This parameter can be a combination of the following values: 03314 * @arg @ref LL_RTC_TAMPER_1 03315 * @arg @ref LL_RTC_TAMPER_2 03316 * @arg @ref LL_RTC_TAMPER_3 03317 * 03318 * @retval None 03319 */ 03320 __STATIC_INLINE void LL_RTC_TAMPER_Disable(TAMP_TypeDef *TAMPx, uint32_t Tamper) 03321 { 03322 CLEAR_BIT(TAMPx->CR1, Tamper); 03323 } 03324 #endif /* TAMP_CR1_TAMP1E */ 03325 03326 #if defined(TAMP_CR2_TAMP1MSK) 03327 /** 03328 * @brief Enable Tamper mask flag 03329 * @note Associated Tamper IT must not enabled when tamper mask is set. 03330 * @rmtoll TAMP_CR2 TAMP1MF LL_RTC_TAMPER_EnableMask 03331 * TAMP_CR2 TAMP2MF LL_RTC_TAMPER_EnableMask 03332 * TAMP_CR2 TAMP3MF LL_RTC_TAMPER_EnableMask 03333 * @param TAMPx TAMP Instance 03334 * @param Mask This parameter can be a combination of the following values: 03335 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 03336 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 03337 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 03338 * 03339 * @retval None 03340 */ 03341 __STATIC_INLINE void LL_RTC_TAMPER_EnableMask(TAMP_TypeDef *TAMPx, uint32_t Mask) 03342 { 03343 SET_BIT(TAMPx->CR2, Mask); 03344 } 03345 03346 /** 03347 * @brief Disable Tamper mask flag 03348 * @rmtoll TAMP_CR2 TAMP1MF LL_RTC_TAMPER_DisableMask 03349 * TAMP_CR2 TAMP2MF LL_RTC_TAMPER_DisableMask 03350 * TAMP_CR2 TAMP3MF LL_RTC_TAMPER_DisableMask 03351 * @param TAMPx TAMP Instance 03352 * @param Mask This parameter can be a combination of the following values: 03353 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 03354 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 03355 * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 03356 * 03357 * @retval None 03358 */ 03359 __STATIC_INLINE void LL_RTC_TAMPER_DisableMask(TAMP_TypeDef *TAMPx, uint32_t Mask) 03360 { 03361 CLEAR_BIT(TAMPx->CR2, Mask); 03362 } 03363 03364 /** 03365 * @brief Enable backup register erase after Tamper event detection 03366 * @rmtoll TAMP_CR2 TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP 03367 * TAMP_CR2 TAMP2NOERASE LL_RTC_TAMPER_EnableEraseBKP 03368 * TAMP_CR2 TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP 03369 * @param TAMPx TAMP Instance 03370 * @param Tamper This parameter can be a combination of the following values: 03371 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 03372 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 03373 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 03374 * 03375 * @retval None 03376 */ 03377 __STATIC_INLINE void LL_RTC_TAMPER_EnableEraseBKP(TAMP_TypeDef *TAMPx, uint32_t Tamper) 03378 { 03379 CLEAR_BIT(TAMPx->CR2, Tamper); 03380 } 03381 03382 /** 03383 * @brief Disable backup register erase after Tamper event detection 03384 * @rmtoll TAMP_CR2 TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP 03385 * TAMP_CR2 TAMP2NOERASE LL_RTC_TAMPER_DisableEraseBKP 03386 * TAMP_CR2 TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP 03387 * @param TAMPx TAMP Instance 03388 * @param Tamper This parameter can be a combination of the following values: 03389 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 03390 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 03391 * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 03392 * 03393 * @retval None 03394 */ 03395 __STATIC_INLINE void LL_RTC_TAMPER_DisableEraseBKP(TAMP_TypeDef *TAMPx, uint32_t Tamper) 03396 { 03397 SET_BIT(TAMPx->CR2, Tamper); 03398 } 03399 03400 /** 03401 * @brief Enable Active level for Tamper input 03402 * @rmtoll TAMP_CR2 TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel 03403 * TAMP_CR2 TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel 03404 * TAMP_CR2 TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel 03405 * @param TAMPx TAMP Instance 03406 * @param Tamper This parameter can be a combination of the following values: 03407 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 03408 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 03409 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 03410 * 03411 * @retval None 03412 */ 03413 __STATIC_INLINE void LL_RTC_TAMPER_EnableActiveLevel(TAMP_TypeDef *TAMPx, uint32_t Tamper) 03414 { 03415 SET_BIT(TAMPx->CR2, Tamper); 03416 } 03417 03418 /** 03419 * @brief Disable Active level for Tamper input 03420 * @rmtoll TAMP_CR2 TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel 03421 * TAMP_CR2 TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel 03422 * TAMP_CR2 TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel 03423 * @param TAMPx TAMP Instance 03424 * @param Tamper This parameter can be a combination of the following values: 03425 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 03426 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 03427 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 03428 * 03429 * @retval None 03430 */ 03431 __STATIC_INLINE void LL_RTC_TAMPER_DisableActiveLevel(TAMP_TypeDef *TAMPx, uint32_t Tamper) 03432 { 03433 CLEAR_BIT(TAMPx->CR2, Tamper); 03434 } 03435 #endif /* TAMP_CR2_TAMP1MSK */ 03436 03437 #if defined(TAMP_FLTCR_TAMPPUDIS) 03438 /** 03439 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins) 03440 * @rmtoll TAMP_FLTCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp 03441 * @param TAMPx TAMP Instance 03442 * @retval None 03443 */ 03444 __STATIC_INLINE void LL_RTC_TAMPER_DisablePullUp(TAMP_TypeDef *TAMPx) 03445 { 03446 SET_BIT(TAMPx->FLTCR, TAMP_FLTCR_TAMPPUDIS); 03447 } 03448 03449 /** 03450 * @brief Enable RTC_TAMPx pull-up disable (Precharge RTC_TAMPx pins before sampling) 03451 * @rmtoll TAMP_FLTCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp 03452 * @param TAMPx TAMP Instance 03453 * @retval None 03454 */ 03455 __STATIC_INLINE void LL_RTC_TAMPER_EnablePullUp(TAMP_TypeDef *TAMPx) 03456 { 03457 CLEAR_BIT(TAMPx->FLTCR, TAMP_FLTCR_TAMPPUDIS); 03458 } 03459 03460 /** 03461 * @brief Set RTC_TAMPx precharge duration 03462 * @rmtoll TAMP_FLTCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge 03463 * @param TAMPx TAMP Instance 03464 * @param Duration This parameter can be one of the following values: 03465 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK 03466 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK 03467 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK 03468 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK 03469 * @retval None 03470 */ 03471 __STATIC_INLINE void LL_RTC_TAMPER_SetPrecharge(TAMP_TypeDef *TAMPx, uint32_t Duration) 03472 { 03473 MODIFY_REG(TAMPx->FLTCR, TAMP_FLTCR_TAMPPRCH, Duration); 03474 } 03475 03476 /** 03477 * @brief Get RTC_TAMPx precharge duration 03478 * @rmtoll TAMP_FLTCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge 03479 * @param TAMPx TAMP Instance 03480 * @retval Returned value can be one of the following values: 03481 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK 03482 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK 03483 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK 03484 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK 03485 */ 03486 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetPrecharge(TAMP_TypeDef *TAMPx) 03487 { 03488 return (uint32_t)(READ_BIT(TAMPx->FLTCR, TAMP_FLTCR_TAMPPRCH)); 03489 } 03490 03491 /** 03492 * @brief Set RTC_TAMPx filter count 03493 * @rmtoll TAMP_FLTCR TAMPFLT LL_RTC_TAMPER_SetFilterCount 03494 * @param TAMPx TAMP Instance 03495 * @param FilterCount This parameter can be one of the following values: 03496 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE 03497 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE 03498 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE 03499 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE 03500 * @retval None 03501 */ 03502 __STATIC_INLINE void LL_RTC_TAMPER_SetFilterCount(TAMP_TypeDef *TAMPx, uint32_t FilterCount) 03503 { 03504 MODIFY_REG(TAMPx->FLTCR, TAMP_FLTCR_TAMPFLT, FilterCount); 03505 } 03506 03507 /** 03508 * @brief Get RTC_TAMPx filter count 03509 * @rmtoll TAMP_FLTCR TAMPFLT LL_RTC_TAMPER_GetFilterCount 03510 * @param TAMPx TAMP Instance 03511 * @retval Returned value can be one of the following values: 03512 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE 03513 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE 03514 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE 03515 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE 03516 */ 03517 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetFilterCount(TAMP_TypeDef *TAMPx) 03518 { 03519 return (uint32_t)(READ_BIT(TAMPx->FLTCR, TAMP_FLTCR_TAMPFLT)); 03520 } 03521 03522 /** 03523 * @brief Set Tamper sampling frequency 03524 * @rmtoll TAMP_FLTCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq 03525 * @param TAMPx TAMP Instance 03526 * @param SamplingFreq This parameter can be one of the following values: 03527 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768 03528 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384 03529 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192 03530 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096 03531 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048 03532 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024 03533 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512 03534 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256 03535 * @retval None 03536 */ 03537 __STATIC_INLINE void LL_RTC_TAMPER_SetSamplingFreq(TAMP_TypeDef *TAMPx, uint32_t SamplingFreq) 03538 { 03539 MODIFY_REG(TAMPx->FLTCR, TAMP_FLTCR_TAMPFREQ, SamplingFreq); 03540 } 03541 03542 /** 03543 * @brief Get Tamper sampling frequency 03544 * @rmtoll TAMP_FLTCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq 03545 * @param TAMPx TAMP Instance 03546 * @retval Returned value can be one of the following values: 03547 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768 03548 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384 03549 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192 03550 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096 03551 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048 03552 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024 03553 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512 03554 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256 03555 */ 03556 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetSamplingFreq(TAMP_TypeDef *TAMPx) 03557 { 03558 return (uint32_t)(READ_BIT(TAMPx->FLTCR, TAMP_FLTCR_TAMPFREQ)); 03559 } 03560 #endif /* TAMP_FLTCR_TAMPPUDIS */ 03561 03562 /** 03563 * @} 03564 */ 03565 03566 /** @defgroup RTC_LL_EF_Wakeup Wakeup 03567 * @{ 03568 */ 03569 03570 /** 03571 * @brief Enable Wakeup timer 03572 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03573 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_Enable 03574 * @param RTCx RTC Instance 03575 * @retval None 03576 */ 03577 __STATIC_INLINE void LL_RTC_WAKEUP_Enable(RTC_TypeDef *RTCx) 03578 { 03579 SET_BIT(RTCx->CR, RTC_CR_WUTE); 03580 } 03581 03582 /** 03583 * @brief Disable Wakeup timer 03584 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03585 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_Disable 03586 * @param RTCx RTC Instance 03587 * @retval None 03588 */ 03589 __STATIC_INLINE void LL_RTC_WAKEUP_Disable(RTC_TypeDef *RTCx) 03590 { 03591 CLEAR_BIT(RTCx->CR, RTC_CR_WUTE); 03592 } 03593 03594 /** 03595 * @brief Check if Wakeup timer is enabled or not 03596 * @rmtoll RTC_CR WUTE LL_RTC_WAKEUP_IsEnabled 03597 * @param RTCx RTC Instance 03598 * @retval State of bit (1 or 0). 03599 */ 03600 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef *RTCx) 03601 { 03602 return ((READ_BIT(RTCx->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) ? 1UL : 0UL); 03603 } 03604 03605 /** 03606 * @brief Select Wakeup clock 03607 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03608 * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1 03609 * @rmtoll RTC_CR WUCKSEL LL_RTC_WAKEUP_SetClock 03610 * @param RTCx RTC Instance 03611 * @param WakeupClock This parameter can be one of the following values: 03612 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16 03613 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8 03614 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4 03615 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2 03616 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE 03617 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT 03618 * @retval None 03619 */ 03620 __STATIC_INLINE void LL_RTC_WAKEUP_SetClock(RTC_TypeDef *RTCx, uint32_t WakeupClock) 03621 { 03622 MODIFY_REG(RTCx->CR, RTC_CR_WUCKSEL, WakeupClock); 03623 } 03624 03625 /** 03626 * @brief Get Wakeup clock 03627 * @rmtoll RTC_CR WUCKSEL LL_RTC_WAKEUP_GetClock 03628 * @param RTCx RTC Instance 03629 * @retval Returned value can be one of the following values: 03630 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16 03631 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8 03632 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4 03633 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2 03634 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE 03635 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT 03636 */ 03637 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef *RTCx) 03638 { 03639 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_WUCKSEL)); 03640 } 03641 03642 /** 03643 * @brief Set Wakeup auto-reload value 03644 * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR 03645 * @rmtoll RTC_WUTR WUT LL_RTC_WAKEUP_SetAutoReload 03646 * @param RTCx RTC Instance 03647 * @param Value Value between Min_Data=0x00 and Max_Data=0xFFFF 03648 * @retval None 03649 */ 03650 __STATIC_INLINE void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef *RTCx, uint32_t Value) 03651 { 03652 MODIFY_REG(RTCx->WUTR, RTC_WUTR_WUT, Value); 03653 } 03654 03655 /** 03656 * @brief Get Wakeup auto-reload value 03657 * @rmtoll RTC_WUTR WUT LL_RTC_WAKEUP_GetAutoReload 03658 * @param RTCx RTC Instance 03659 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF 03660 */ 03661 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef *RTCx) 03662 { 03663 return (uint32_t)(READ_BIT(RTCx->WUTR, RTC_WUTR_WUT)); 03664 } 03665 03666 /** 03667 * @} 03668 */ 03669 03670 03671 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers 03672 * @{ 03673 */ 03674 03675 #if defined(RTC_BKP0R) 03676 /** 03677 * @brief Writes a data in a specified RTC Backup data register. 03678 * @rmtoll BKPxR BKP LL_RTC_BAK_SetRegister 03679 * @param RTCx RTC Instance 03680 * @param BackupRegister This parameter can be one of the following values: 03681 * @arg @ref LL_RTC_BKP_DR0 03682 * @arg @ref LL_RTC_BKP_DR1 03683 * @arg @ref LL_RTC_BKP_DR2 03684 * @arg @ref LL_RTC_BKP_DR3 03685 * @arg @ref LL_RTC_BKP_DR4 03686 * @arg @ref LL_RTC_BKP_DR5 03687 * @arg @ref LL_RTC_BKP_DR6 03688 * @arg @ref LL_RTC_BKP_DR7 03689 * @arg @ref LL_RTC_BKP_DR8 03690 * @arg @ref LL_RTC_BKP_DR9 03691 * @arg @ref LL_RTC_BKP_DR10 03692 * @arg @ref LL_RTC_BKP_DR11 03693 * @arg @ref LL_RTC_BKP_DR12 03694 * @arg @ref LL_RTC_BKP_DR13 03695 * @arg @ref LL_RTC_BKP_DR14 03696 * @arg @ref LL_RTC_BKP_DR15 03697 * @arg @ref LL_RTC_BKP_DR16 03698 * @arg @ref LL_RTC_BKP_DR17 03699 * @arg @ref LL_RTC_BKP_DR18 03700 * @arg @ref LL_RTC_BKP_DR19 03701 * @arg @ref LL_RTC_BKP_DR20 03702 * @arg @ref LL_RTC_BKP_DR21 03703 * @arg @ref LL_RTC_BKP_DR22 03704 * @arg @ref LL_RTC_BKP_DR23 03705 * @arg @ref LL_RTC_BKP_DR24 03706 * @arg @ref LL_RTC_BKP_DR25 03707 * @arg @ref LL_RTC_BKP_DR26 03708 * @arg @ref LL_RTC_BKP_DR27 03709 * @arg @ref LL_RTC_BKP_DR28 03710 * @arg @ref LL_RTC_BKP_DR29 03711 * @arg @ref LL_RTC_BKP_DR30 03712 * @arg @ref LL_RTC_BKP_DR31 03713 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF 03714 * @retval None 03715 */ 03716 __STATIC_INLINE void LL_RTC_BAK_SetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister, uint32_t Data) 03717 { 03718 uint32_t tmp; 03719 03720 tmp = (uint32_t)(&(RTCx->BKP0R)); 03721 tmp += (BackupRegister * 4U); 03722 03723 /* Write the specified register */ 03724 *(__IO uint32_t *)tmp = (uint32_t)Data; 03725 } 03726 03727 /** 03728 * @brief Reads data from the specified RTC Backup data Register. 03729 * @rmtoll BKPxR BKP LL_RTC_BAK_GetRegister 03730 * @param RTCx RTC Instance 03731 * @param BackupRegister This parameter can be one of the following values: 03732 * @arg @ref LL_RTC_BKP_DR0 03733 * @arg @ref LL_RTC_BKP_DR1 03734 * @arg @ref LL_RTC_BKP_DR2 03735 * @arg @ref LL_RTC_BKP_DR3 03736 * @arg @ref LL_RTC_BKP_DR4 03737 * @arg @ref LL_RTC_BKP_DR5 03738 * @arg @ref LL_RTC_BKP_DR6 03739 * @arg @ref LL_RTC_BKP_DR7 03740 * @arg @ref LL_RTC_BKP_DR8 03741 * @arg @ref LL_RTC_BKP_DR9 03742 * @arg @ref LL_RTC_BKP_DR10 03743 * @arg @ref LL_RTC_BKP_DR11 03744 * @arg @ref LL_RTC_BKP_DR12 03745 * @arg @ref LL_RTC_BKP_DR13 03746 * @arg @ref LL_RTC_BKP_DR14 03747 * @arg @ref LL_RTC_BKP_DR15 03748 * @arg @ref LL_RTC_BKP_DR16 03749 * @arg @ref LL_RTC_BKP_DR17 03750 * @arg @ref LL_RTC_BKP_DR18 03751 * @arg @ref LL_RTC_BKP_DR19 03752 * @arg @ref LL_RTC_BKP_DR20 03753 * @arg @ref LL_RTC_BKP_DR21 03754 * @arg @ref LL_RTC_BKP_DR22 03755 * @arg @ref LL_RTC_BKP_DR23 03756 * @arg @ref LL_RTC_BKP_DR24 03757 * @arg @ref LL_RTC_BKP_DR25 03758 * @arg @ref LL_RTC_BKP_DR26 03759 * @arg @ref LL_RTC_BKP_DR27 03760 * @arg @ref LL_RTC_BKP_DR28 03761 * @arg @ref LL_RTC_BKP_DR29 03762 * @arg @ref LL_RTC_BKP_DR30 03763 * @arg @ref LL_RTC_BKP_DR31 03764 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF 03765 */ 03766 __STATIC_INLINE uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister) 03767 { 03768 uint32_t tmp; 03769 03770 tmp = (uint32_t)(&(RTCx->BKP0R)); 03771 tmp += (BackupRegister * 4U); 03772 03773 /* Read the specified register */ 03774 return (*(__IO uint32_t *)tmp); 03775 } 03776 #endif /* RTC_BKP0R */ 03777 03778 #if defined(TAMP_BKP0R) 03779 /** 03780 * @brief Writes a data in a specified Backup data register. 03781 * @rmtoll TAMP_BKPxR BKP LL_RTC_BKP_SetRegister 03782 * @param TAMPx RTC Instance 03783 * @param BackupRegister This parameter can be one of the following values: 03784 * @arg @ref LL_RTC_BKP_DR0 03785 * @arg @ref LL_RTC_BKP_DR1 03786 * @arg @ref LL_RTC_BKP_DR2 03787 * @arg @ref LL_RTC_BKP_DR3 03788 * @arg @ref LL_RTC_BKP_DR4 03789 * @arg @ref LL_RTC_BKP_DR5 03790 * @arg @ref LL_RTC_BKP_DR6 03791 * @arg @ref LL_RTC_BKP_DR7 03792 * @arg @ref LL_RTC_BKP_DR8 03793 * @arg @ref LL_RTC_BKP_DR9 03794 * @arg @ref LL_RTC_BKP_DR10 03795 * @arg @ref LL_RTC_BKP_DR11 03796 * @arg @ref LL_RTC_BKP_DR12 03797 * @arg @ref LL_RTC_BKP_DR13 03798 * @arg @ref LL_RTC_BKP_DR14 03799 * @arg @ref LL_RTC_BKP_DR15 03800 * @arg @ref LL_RTC_BKP_DR16 03801 * @arg @ref LL_RTC_BKP_DR17 03802 * @arg @ref LL_RTC_BKP_DR18 03803 * @arg @ref LL_RTC_BKP_DR19 03804 * @arg @ref LL_RTC_BKP_DR20 03805 * @arg @ref LL_RTC_BKP_DR21 03806 * @arg @ref LL_RTC_BKP_DR22 03807 * @arg @ref LL_RTC_BKP_DR23 03808 * @arg @ref LL_RTC_BKP_DR24 03809 * @arg @ref LL_RTC_BKP_DR25 03810 * @arg @ref LL_RTC_BKP_DR26 03811 * @arg @ref LL_RTC_BKP_DR27 03812 * @arg @ref LL_RTC_BKP_DR28 03813 * @arg @ref LL_RTC_BKP_DR29 03814 * @arg @ref LL_RTC_BKP_DR30 03815 * @arg @ref LL_RTC_BKP_DR31 03816 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF 03817 * @retval None 03818 */ 03819 __STATIC_INLINE void LL_RTC_BKP_SetRegister(TAMP_TypeDef *TAMPx, uint32_t BackupRegister, uint32_t Data) 03820 { 03821 uint32_t tmp = 0U; 03822 03823 tmp = (uint32_t)(&(TAMPx->BKP0R)); 03824 tmp += (BackupRegister * 4U); 03825 03826 /* Write the specified register */ 03827 *(__IO uint32_t *)tmp = (uint32_t)Data; 03828 } 03829 03830 /** 03831 * @brief Reads data from the specified RTC Backup data Register. 03832 * @rmtoll TAMP_BKPxR BKP LL_RTC_BKP_GetRegister 03833 * @param TAMPx RTC Instance 03834 * @param BackupRegister This parameter can be one of the following values: 03835 * @arg @ref LL_RTC_BKP_DR0 03836 * @arg @ref LL_RTC_BKP_DR1 03837 * @arg @ref LL_RTC_BKP_DR2 03838 * @arg @ref LL_RTC_BKP_DR3 03839 * @arg @ref LL_RTC_BKP_DR4 03840 * @arg @ref LL_RTC_BKP_DR5 03841 * @arg @ref LL_RTC_BKP_DR6 03842 * @arg @ref LL_RTC_BKP_DR7 03843 * @arg @ref LL_RTC_BKP_DR8 03844 * @arg @ref LL_RTC_BKP_DR9 03845 * @arg @ref LL_RTC_BKP_DR10 03846 * @arg @ref LL_RTC_BKP_DR11 03847 * @arg @ref LL_RTC_BKP_DR12 03848 * @arg @ref LL_RTC_BKP_DR13 03849 * @arg @ref LL_RTC_BKP_DR14 03850 * @arg @ref LL_RTC_BKP_DR15 03851 * @arg @ref LL_RTC_BKP_DR16 03852 * @arg @ref LL_RTC_BKP_DR17 03853 * @arg @ref LL_RTC_BKP_DR18 03854 * @arg @ref LL_RTC_BKP_DR19 03855 * @arg @ref LL_RTC_BKP_DR20 03856 * @arg @ref LL_RTC_BKP_DR21 03857 * @arg @ref LL_RTC_BKP_DR22 03858 * @arg @ref LL_RTC_BKP_DR23 03859 * @arg @ref LL_RTC_BKP_DR24 03860 * @arg @ref LL_RTC_BKP_DR25 03861 * @arg @ref LL_RTC_BKP_DR26 03862 * @arg @ref LL_RTC_BKP_DR27 03863 * @arg @ref LL_RTC_BKP_DR28 03864 * @arg @ref LL_RTC_BKP_DR29 03865 * @arg @ref LL_RTC_BKP_DR30 03866 * @arg @ref LL_RTC_BKP_DR31 03867 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF 03868 */ 03869 __STATIC_INLINE uint32_t LL_RTC_BKP_GetRegister(TAMP_TypeDef *TAMPx, uint32_t BackupRegister) 03870 { 03871 uint32_t tmp = 0U; 03872 03873 tmp = (uint32_t)(&(TAMPx->BKP0R)); 03874 tmp += (BackupRegister * 4U); 03875 03876 /* Read the specified register */ 03877 return (*(__IO uint32_t *)tmp); 03878 } 03879 #endif /* TAMP_BKP0R */ 03880 03881 /** 03882 * @} 03883 */ 03884 03885 03886 /** @defgroup RTC_LL_EF_Calibration Calibration 03887 * @{ 03888 */ 03889 03890 /** 03891 * @brief Set Calibration output frequency (1 Hz or 512 Hz) 03892 * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03893 * @rmtoll RTC_CR COE LL_RTC_CAL_SetOutputFreq 03894 * RTC_CR COSEL LL_RTC_CAL_SetOutputFreq 03895 * @param RTCx RTC Instance 03896 * @param Frequency This parameter can be one of the following values: 03897 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE 03898 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ 03899 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ 03900 * @retval None 03901 */ 03902 __STATIC_INLINE void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef *RTCx, uint32_t Frequency) 03903 { 03904 MODIFY_REG(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL, Frequency); 03905 } 03906 03907 /** 03908 * @brief Get Calibration output frequency (1 Hz or 512 Hz) 03909 * @rmtoll RTC_CR COE LL_RTC_CAL_GetOutputFreq 03910 * RTC_CR COSEL LL_RTC_CAL_GetOutputFreq 03911 * @param RTCx RTC Instance 03912 * @retval Returned value can be one of the following values: 03913 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE 03914 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ 03915 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ 03916 */ 03917 __STATIC_INLINE uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef *RTCx) 03918 { 03919 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL)); 03920 } 03921 03922 /** 03923 * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm) 03924 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03925 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR 03926 * @rmtoll RTC_CALR CALP LL_RTC_CAL_SetPulse 03927 * @param RTCx RTC Instance 03928 * @param Pulse This parameter can be one of the following values: 03929 * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE 03930 * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET 03931 * @retval None 03932 */ 03933 __STATIC_INLINE void LL_RTC_CAL_SetPulse(RTC_TypeDef *RTCx, uint32_t Pulse) 03934 { 03935 MODIFY_REG(RTCx->CALR, RTC_CALR_CALP, Pulse); 03936 } 03937 03938 /** 03939 * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm) 03940 * @rmtoll RTC_CALR CALP LL_RTC_CAL_IsPulseInserted 03941 * @param RTCx RTC Instance 03942 * @retval State of bit (1 or 0). 03943 */ 03944 __STATIC_INLINE uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef *RTCx) 03945 { 03946 return ((READ_BIT(RTCx->CALR, RTC_CALR_CALP) == (RTC_CALR_CALP)) ? 1UL : 0UL); 03947 } 03948 03949 /** 03950 * @brief Set the calibration cycle period 03951 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03952 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR 03953 * @rmtoll RTC_CALR CALW8 LL_RTC_CAL_SetPeriod 03954 * RTC_CALR CALW16 LL_RTC_CAL_SetPeriod 03955 * @param RTCx RTC Instance 03956 * @param Period This parameter can be one of the following values: 03957 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC 03958 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC 03959 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC 03960 * @retval None 03961 */ 03962 __STATIC_INLINE void LL_RTC_CAL_SetPeriod(RTC_TypeDef *RTCx, uint32_t Period) 03963 { 03964 MODIFY_REG(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16, Period); 03965 } 03966 03967 /** 03968 * @brief Get the calibration cycle period 03969 * @rmtoll RTC_CALR CALW8 LL_RTC_CAL_GetPeriod 03970 * RTC_CALR CALW16 LL_RTC_CAL_GetPeriod 03971 * @param RTCx RTC Instance 03972 * @retval Returned value can be one of the following values: 03973 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC 03974 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC 03975 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC 03976 */ 03977 __STATIC_INLINE uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef *RTCx) 03978 { 03979 return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16)); 03980 } 03981 03982 /** 03983 * @brief Set Calibration minus 03984 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 03985 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR 03986 * @rmtoll RTC_CALR CALM LL_RTC_CAL_SetMinus 03987 * @param RTCx RTC Instance 03988 * @param CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF 03989 * @retval None 03990 */ 03991 __STATIC_INLINE void LL_RTC_CAL_SetMinus(RTC_TypeDef *RTCx, uint32_t CalibMinus) 03992 { 03993 MODIFY_REG(RTCx->CALR, RTC_CALR_CALM, CalibMinus); 03994 } 03995 03996 /** 03997 * @brief Get Calibration minus 03998 * @rmtoll RTC_CALR CALM LL_RTC_CAL_GetMinus 03999 * @param RTCx RTC Instance 04000 * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF 04001 */ 04002 __STATIC_INLINE uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef *RTCx) 04003 { 04004 return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALM)); 04005 } 04006 04007 /** 04008 * @} 04009 */ 04010 04011 04012 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management 04013 * @{ 04014 */ 04015 04016 #if defined(RTC_ISR_ITSF) 04017 /** 04018 * @brief Get Internal Time-stamp flag 04019 * @rmtoll RTC_ISR ITSF LL_RTC_IsActiveFlag_ITS 04020 * @param RTCx RTC Instance 04021 * @retval State of bit (1 or 0). 04022 */ 04023 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef *RTCx) 04024 { 04025 return ((READ_BIT(RTCx->ISR, RTC_ISR_ITSF) == (RTC_ISR_ITSF)) ? 1UL : 0UL); 04026 } 04027 04028 /** 04029 * @brief Get Recalibration pending Flag 04030 * @rmtoll ISR RECALPF LL_RTC_IsActiveFlag_RECALP 04031 * @param RTCx RTC Instance 04032 * @retval State of bit (1 or 0). 04033 */ 04034 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef *RTCx) 04035 { 04036 return ((READ_BIT(RTCx->ISR, RTC_ISR_RECALPF) == (RTC_ISR_RECALPF)) ? 1UL : 0UL); 04037 } 04038 04039 /** 04040 * @brief Get RTC_TAMP3 detection flag 04041 * @rmtoll ISR TAMP3F LL_RTC_IsActiveFlag_TAMP3 04042 * @param RTCx RTC Instance 04043 * @retval State of bit (1 or 0). 04044 */ 04045 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef *RTCx) 04046 { 04047 return ((READ_BIT(RTCx->ISR, RTC_ISR_TAMP3F) == (RTC_ISR_TAMP3F)) ? 1UL : 0UL); 04048 } 04049 04050 /** 04051 * @brief Get RTC_TAMP2 detection flag 04052 * @rmtoll ISR TAMP2F LL_RTC_IsActiveFlag_TAMP2 04053 * @param RTCx RTC Instance 04054 * @retval State of bit (1 or 0). 04055 */ 04056 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef *RTCx) 04057 { 04058 return ((READ_BIT(RTCx->ISR, RTC_ISR_TAMP2F) == (RTC_ISR_TAMP2F)) ? 1UL : 0UL); 04059 } 04060 04061 /** 04062 * @brief Get RTC_TAMP1 detection flag 04063 * @rmtoll ISR TAMP1F LL_RTC_IsActiveFlag_TAMP1 04064 * @param RTCx RTC Instance 04065 * @retval State of bit (1 or 0). 04066 */ 04067 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef *RTCx) 04068 { 04069 return ((READ_BIT(RTCx->ISR, RTC_ISR_TAMP1F) == (RTC_ISR_TAMP1F)) ? 1UL : 0UL); 04070 } 04071 04072 /** 04073 * @brief Get Time-stamp overflow flag 04074 * @rmtoll ISR TSOVF LL_RTC_IsActiveFlag_TSOV 04075 * @param RTCx RTC Instance 04076 * @retval State of bit (1 or 0). 04077 */ 04078 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef *RTCx) 04079 { 04080 return ((READ_BIT(RTCx->ISR, RTC_ISR_TSOVF) == (RTC_ISR_TSOVF)) ? 1UL : 0UL); 04081 } 04082 04083 /** 04084 * @brief Get Time-stamp flag 04085 * @rmtoll ISR TSF LL_RTC_IsActiveFlag_TS 04086 * @param RTCx RTC Instance 04087 * @retval State of bit (1 or 0). 04088 */ 04089 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef *RTCx) 04090 { 04091 return ((READ_BIT(RTCx->ISR, RTC_ISR_TSF) == (RTC_ISR_TSF)) ? 1UL : 0UL); 04092 } 04093 04094 /** 04095 * @brief Get Wakeup timer flag 04096 * @rmtoll ISR WUTF LL_RTC_IsActiveFlag_WUT 04097 * @param RTCx RTC Instance 04098 * @retval State of bit (1 or 0). 04099 */ 04100 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef *RTCx) 04101 { 04102 return ((READ_BIT(RTCx->ISR, RTC_ISR_WUTF) == (RTC_ISR_WUTF)) ? 1UL : 0UL); 04103 } 04104 04105 /** 04106 * @brief Get Alarm B flag 04107 * @rmtoll ISR ALRBF LL_RTC_IsActiveFlag_ALRB 04108 * @param RTCx RTC Instance 04109 * @retval State of bit (1 or 0). 04110 */ 04111 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef *RTCx) 04112 { 04113 return ((READ_BIT(RTCx->ISR, RTC_ISR_ALRBF) == (RTC_ISR_ALRBF)) ? 1UL : 0UL); 04114 } 04115 04116 /** 04117 * @brief Get Alarm A flag 04118 * @rmtoll ISR ALRAF LL_RTC_IsActiveFlag_ALRA 04119 * @param RTCx RTC Instance 04120 * @retval State of bit (1 or 0). 04121 */ 04122 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef *RTCx) 04123 { 04124 return ((READ_BIT(RTCx->ISR, RTC_ISR_ALRAF) == (RTC_ISR_ALRAF)) ? 1UL : 0UL); 04125 } 04126 04127 /** 04128 * @brief Clear Internal Time-stamp flag 04129 * @rmtoll ISR ITSF LL_RTC_ClearFlag_ITS 04130 * @param RTCx RTC Instance 04131 * @retval None 04132 */ 04133 __STATIC_INLINE void LL_RTC_ClearFlag_ITS(RTC_TypeDef *RTCx) 04134 { 04135 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ITSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04136 } 04137 04138 /** 04139 * @brief Clear RTC_TAMP3 detection flag 04140 * @rmtoll ISR TAMP3F LL_RTC_ClearFlag_TAMP3 04141 * @param RTCx RTC Instance 04142 * @retval None 04143 */ 04144 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef *RTCx) 04145 { 04146 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP3F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04147 } 04148 04149 /** 04150 * @brief Clear RTC_TAMP2 detection flag 04151 * @rmtoll ISR TAMP2F LL_RTC_ClearFlag_TAMP2 04152 * @param RTCx RTC Instance 04153 * @retval None 04154 */ 04155 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef *RTCx) 04156 { 04157 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP2F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04158 } 04159 04160 /** 04161 * @brief Clear RTC_TAMP1 detection flag 04162 * @rmtoll ISR TAMP1F LL_RTC_ClearFlag_TAMP1 04163 * @param RTCx RTC Instance 04164 * @retval None 04165 */ 04166 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef *RTCx) 04167 { 04168 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP1F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04169 } 04170 04171 /** 04172 * @brief Clear Time-stamp overflow flag 04173 * @rmtoll ISR TSOVF LL_RTC_ClearFlag_TSOV 04174 * @param RTCx RTC Instance 04175 * @retval None 04176 */ 04177 __STATIC_INLINE void LL_RTC_ClearFlag_TSOV(RTC_TypeDef *RTCx) 04178 { 04179 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSOVF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04180 } 04181 04182 /** 04183 * @brief Clear Time-stamp flag 04184 * @rmtoll ISR TSF LL_RTC_ClearFlag_TS 04185 * @param RTCx RTC Instance 04186 * @retval None 04187 */ 04188 __STATIC_INLINE void LL_RTC_ClearFlag_TS(RTC_TypeDef *RTCx) 04189 { 04190 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04191 } 04192 04193 /** 04194 * @brief Clear Wakeup timer flag 04195 * @rmtoll ISR WUTF LL_RTC_ClearFlag_WUT 04196 * @param RTCx RTC Instance 04197 * @retval None 04198 */ 04199 __STATIC_INLINE void LL_RTC_ClearFlag_WUT(RTC_TypeDef *RTCx) 04200 { 04201 WRITE_REG(RTCx->ISR, (~((RTC_ISR_WUTF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04202 } 04203 04204 /** 04205 * @brief Clear Alarm B flag 04206 * @rmtoll ISR ALRBF LL_RTC_ClearFlag_ALRB 04207 * @param RTCx RTC Instance 04208 * @retval None 04209 */ 04210 __STATIC_INLINE void LL_RTC_ClearFlag_ALRB(RTC_TypeDef *RTCx) 04211 { 04212 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRBF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04213 } 04214 04215 /** 04216 * @brief Clear Alarm A flag 04217 * @rmtoll ISR ALRAF LL_RTC_ClearFlag_ALRA 04218 * @param RTCx RTC Instance 04219 * @retval None 04220 */ 04221 __STATIC_INLINE void LL_RTC_ClearFlag_ALRA(RTC_TypeDef *RTCx) 04222 { 04223 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRAF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04224 } 04225 04226 /** 04227 * @brief Get Initialization flag 04228 * @rmtoll ISR INITF LL_RTC_IsActiveFlag_INIT 04229 * @param RTCx RTC Instance 04230 * @retval State of bit (1 or 0). 04231 */ 04232 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx) 04233 { 04234 return ((READ_BIT(RTCx->ISR, RTC_ISR_INITF) == (RTC_ISR_INITF)) ? 1UL : 0UL); 04235 } 04236 04237 /** 04238 * @brief Get Registers synchronization flag 04239 * @rmtoll ISR RSF LL_RTC_IsActiveFlag_RS 04240 * @param RTCx RTC Instance 04241 * @retval State of bit (1 or 0). 04242 */ 04243 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx) 04244 { 04245 return ((READ_BIT(RTCx->ISR, RTC_ISR_RSF) == (RTC_ISR_RSF)) ? 1UL : 0UL); 04246 } 04247 04248 /** 04249 * @brief Clear Registers synchronization flag 04250 * @rmtoll ISR RSF LL_RTC_ClearFlag_RS 04251 * @param RTCx RTC Instance 04252 * @retval None 04253 */ 04254 __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx) 04255 { 04256 WRITE_REG(RTCx->ISR, (~((RTC_ISR_RSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT))); 04257 } 04258 04259 /** 04260 * @brief Get Initialization status flag 04261 * @rmtoll ISR INITS LL_RTC_IsActiveFlag_INITS 04262 * @param RTCx RTC Instance 04263 * @retval State of bit (1 or 0). 04264 */ 04265 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef *RTCx) 04266 { 04267 return ((READ_BIT(RTCx->ISR, RTC_ISR_INITS) == (RTC_ISR_INITS)) ? 1UL : 0UL); 04268 } 04269 04270 /** 04271 * @brief Get Shift operation pending flag 04272 * @rmtoll ISR SHPF LL_RTC_IsActiveFlag_SHP 04273 * @param RTCx RTC Instance 04274 * @retval State of bit (1 or 0). 04275 */ 04276 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef *RTCx) 04277 { 04278 return ((READ_BIT(RTCx->ISR, RTC_ISR_SHPF) == (RTC_ISR_SHPF)) ? 1UL : 0UL); 04279 } 04280 04281 /** 04282 * @brief Get Wakeup timer write flag 04283 * @rmtoll ISR WUTWF LL_RTC_IsActiveFlag_WUTW 04284 * @param RTCx RTC Instance 04285 * @retval State of bit (1 or 0). 04286 */ 04287 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef *RTCx) 04288 { 04289 return ((READ_BIT(RTCx->ISR, RTC_ISR_WUTWF) == (RTC_ISR_WUTWF)) ? 1UL : 0UL); 04290 } 04291 04292 /** 04293 * @brief Get Alarm B write flag 04294 * @rmtoll ISR ALRBWF LL_RTC_IsActiveFlag_ALRBW 04295 * @param RTCx RTC Instance 04296 * @retval State of bit (1 or 0). 04297 */ 04298 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef *RTCx) 04299 { 04300 return ((READ_BIT(RTCx->ISR, RTC_ISR_ALRBWF) == (RTC_ISR_ALRBWF)) ? 1UL : 0UL); 04301 } 04302 04303 /** 04304 * @brief Get Alarm A write flag 04305 * @rmtoll ISR ALRAWF LL_RTC_IsActiveFlag_ALRAW 04306 * @param RTCx RTC Instance 04307 * @retval State of bit (1 or 0). 04308 */ 04309 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef *RTCx) 04310 { 04311 return ((READ_BIT(RTCx->ISR, RTC_ISR_ALRAWF) == (RTC_ISR_ALRAWF)) ? 1UL : 0UL); 04312 } 04313 #endif /* RTC_ISR_ITSF */ 04314 04315 #if defined(RTC_SR_ITSF) 04316 /** 04317 * @brief Get Internal Time-stamp flag 04318 * @rmtoll RTC_SR ITSF LL_RTC_IsActiveFlag_ITS 04319 * @param RTCx RTC Instance 04320 * @retval State of bit (1 or 0). 04321 */ 04322 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef *RTCx) 04323 { 04324 return ((READ_BIT(RTCx->SR, RTC_SR_ITSF) == (RTC_SR_ITSF)) ? 1UL : 0UL); 04325 } 04326 04327 /** 04328 * @brief Get Time-stamp overflow flag 04329 * @rmtoll RTC_SR TSOVF LL_RTC_IsActiveFlag_TSOV 04330 * @param RTCx RTC Instance 04331 * @retval State of bit (1 or 0). 04332 */ 04333 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef *RTCx) 04334 { 04335 return ((READ_BIT(RTCx->SR, RTC_SR_TSOVF) == (RTC_SR_TSOVF)) ? 1UL : 0UL); 04336 } 04337 04338 /** 04339 * @brief Get Time-stamp flag 04340 * @rmtoll RTC_SR TSF LL_RTC_IsActiveFlag_TS 04341 * @param RTCx RTC Instance 04342 * @retval State of bit (1 or 0). 04343 */ 04344 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef *RTCx) 04345 { 04346 return ((READ_BIT(RTCx->SR, RTC_SR_TSF) == (RTC_SR_TSF)) ? 1UL : 0UL); 04347 } 04348 04349 /** 04350 * @brief Get Wakeup timer flag 04351 * @rmtoll RTC_SR WUTF LL_RTC_IsActiveFlag_WUT 04352 * @param RTCx RTC Instance 04353 * @retval State of bit (1 or 0). 04354 */ 04355 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef *RTCx) 04356 { 04357 return ((READ_BIT(RTCx->SR, RTC_SR_WUTF) == (RTC_SR_WUTF)) ? 1UL : 0UL); 04358 } 04359 04360 /** 04361 * @brief Get Alarm B flag 04362 * @rmtoll RTC_SR ALRBF LL_RTC_IsActiveFlag_ALRB 04363 * @param RTCx RTC Instance 04364 * @retval State of bit (1 or 0). 04365 */ 04366 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef *RTCx) 04367 { 04368 return ((READ_BIT(RTCx->SR, RTC_SR_ALRBF) == (RTC_SR_ALRBF)) ? 1UL : 0UL); 04369 } 04370 04371 /** 04372 * @brief Get Alarm A flag 04373 * @rmtoll RTC_SR ALRAF LL_RTC_IsActiveFlag_ALRA 04374 * @param RTCx RTC Instance 04375 * @retval State of bit (1 or 0). 04376 */ 04377 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef *RTCx) 04378 { 04379 return ((READ_BIT(RTCx->SR, RTC_SR_ALRAF) == (RTC_SR_ALRAF)) ? 1UL : 0UL); 04380 } 04381 #endif /* RTC_SR_ITSF */ 04382 04383 #if defined(RTC_SCR_CITSF) 04384 /** 04385 * @brief Clear Internal Time-stamp flag 04386 * @rmtoll RTC_SCR CITSF LL_RTC_ClearFlag_ITS 04387 * @param RTCx RTC Instance 04388 * @retval None 04389 */ 04390 __STATIC_INLINE void LL_RTC_ClearFlag_ITS(RTC_TypeDef *RTCx) 04391 { 04392 SET_BIT(RTCx->SCR, RTC_SCR_CITSF); 04393 } 04394 04395 /** 04396 * @brief Clear Time-stamp overflow flag 04397 * @rmtoll RTC_SCR CTSOVF LL_RTC_ClearFlag_TSOV 04398 * @param RTCx RTC Instance 04399 * @retval None 04400 */ 04401 __STATIC_INLINE void LL_RTC_ClearFlag_TSOV(RTC_TypeDef *RTCx) 04402 { 04403 SET_BIT(RTCx->SCR, RTC_SCR_CTSOVF); 04404 } 04405 04406 /** 04407 * @brief Clear Time-stamp flag 04408 * @rmtoll RTC_SCR CTSF LL_RTC_ClearFlag_TS 04409 * @param RTCx RTC Instance 04410 * @retval None 04411 */ 04412 __STATIC_INLINE void LL_RTC_ClearFlag_TS(RTC_TypeDef *RTCx) 04413 { 04414 SET_BIT(RTCx->SCR, RTC_SCR_CTSF); 04415 } 04416 04417 /** 04418 * @brief Clear Wakeup timer flag 04419 * @rmtoll RTC_SCR CWUTF LL_RTC_ClearFlag_WUT 04420 * @param RTCx RTC Instance 04421 * @retval None 04422 */ 04423 __STATIC_INLINE void LL_RTC_ClearFlag_WUT(RTC_TypeDef *RTCx) 04424 { 04425 SET_BIT(RTCx->SCR, RTC_SCR_CWUTF); 04426 } 04427 04428 /** 04429 * @brief Clear Alarm B flag 04430 * @rmtoll RTC_SCR CALRBF LL_RTC_ClearFlag_ALRB 04431 * @param RTCx RTC Instance 04432 * @retval None 04433 */ 04434 __STATIC_INLINE void LL_RTC_ClearFlag_ALRB(RTC_TypeDef *RTCx) 04435 { 04436 SET_BIT(RTCx->SCR, RTC_SCR_CALRBF); 04437 } 04438 04439 /** 04440 * @brief Clear Alarm A flag 04441 * @rmtoll RTC_SCR CALRAF LL_RTC_ClearFlag_ALRA 04442 * @param RTCx RTC Instance 04443 * @retval None 04444 */ 04445 __STATIC_INLINE void LL_RTC_ClearFlag_ALRA(RTC_TypeDef *RTCx) 04446 { 04447 SET_BIT(RTCx->SCR, RTC_SCR_CALRAF); 04448 } 04449 #endif /* RTC_SCR_CITSF */ 04450 04451 #if defined(RTC_ICSR_RECALPF) 04452 /** 04453 * @brief Get Recalibration pending Flag 04454 * @rmtoll RTC_ICSR RECALPF LL_RTC_IsActiveFlag_RECALP 04455 * @param RTCx RTC Instance 04456 * @retval State of bit (1 or 0). 04457 */ 04458 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef *RTCx) 04459 { 04460 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_RECALPF) == (RTC_ICSR_RECALPF)) ? 1UL : 0UL); 04461 } 04462 04463 /** 04464 * @brief Get Initialization flag 04465 * @rmtoll RTC_ICSR INITF LL_RTC_IsActiveFlag_INIT 04466 * @param RTCx RTC Instance 04467 * @retval State of bit (1 or 0). 04468 */ 04469 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx) 04470 { 04471 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_INITF) == (RTC_ICSR_INITF)) ? 1UL : 0UL); 04472 } 04473 04474 /** 04475 * @brief Get Registers synchronization flag 04476 * @rmtoll RTC_ICSR RSF LL_RTC_IsActiveFlag_RS 04477 * @param RTCx RTC Instance 04478 * @retval State of bit (1 or 0). 04479 */ 04480 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx) 04481 { 04482 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_RSF) == (RTC_ICSR_RSF)) ? 1UL : 0UL); 04483 } 04484 04485 /** 04486 * @brief Clear Registers synchronization flag 04487 * @rmtoll RTC_ICSR RSF LL_RTC_ClearFlag_RS 04488 * @param RTCx RTC Instance 04489 * @retval None 04490 */ 04491 __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx) 04492 { 04493 WRITE_REG(RTCx->ICSR, (~((RTC_ICSR_RSF | RTC_ICSR_INIT) & 0x000000FFU) | (RTCx->ICSR & RTC_ICSR_INIT))); 04494 } 04495 04496 /** 04497 * @brief Get Initialization status flag 04498 * @rmtoll RTC_ICSR INITS LL_RTC_IsActiveFlag_INITS 04499 * @param RTCx RTC Instance 04500 * @retval State of bit (1 or 0). 04501 */ 04502 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef *RTCx) 04503 { 04504 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_INITS) == (RTC_ICSR_INITS)) ? 1UL : 0UL); 04505 } 04506 04507 /** 04508 * @brief Get Shift operation pending flag 04509 * @rmtoll RTC_ICSR SHPF LL_RTC_IsActiveFlag_SHP 04510 * @param RTCx RTC Instance 04511 * @retval State of bit (1 or 0). 04512 */ 04513 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef *RTCx) 04514 { 04515 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_SHPF) == (RTC_ICSR_SHPF)) ? 1UL : 0UL); 04516 } 04517 04518 /** 04519 * @brief Get Wakeup timer write flag 04520 * @rmtoll RTC_ICSR WUTWF LL_RTC_IsActiveFlag_WUTW 04521 * @param RTCx RTC Instance 04522 * @retval State of bit (1 or 0). 04523 */ 04524 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef *RTCx) 04525 { 04526 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_WUTWF) == (RTC_ICSR_WUTWF)) ? 1UL : 0UL); 04527 } 04528 04529 /** 04530 * @brief Get Alarm B write flag 04531 * @rmtoll RTC_ICSR ALRBWF LL_RTC_IsActiveFlag_ALRBW 04532 * @param RTCx RTC Instance 04533 * @retval State of bit (1 or 0). 04534 */ 04535 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef *RTCx) 04536 { 04537 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_ALRBWF) == (RTC_ICSR_ALRBWF)) ? 1UL : 0UL); 04538 } 04539 04540 /** 04541 * @brief Get Alarm A write flag 04542 * @rmtoll RTC_ICSR ALRAWF LL_RTC_IsActiveFlag_ALRAW 04543 * @param RTCx RTC Instance 04544 * @retval State of bit (1 or 0). 04545 */ 04546 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef *RTCx) 04547 { 04548 return ((READ_BIT(RTCx->ICSR, RTC_ICSR_ALRAWF) == (RTC_ICSR_ALRAWF)) ? 1UL : 0UL); 04549 } 04550 #endif /* RTC_ICSR_RECALPF */ 04551 04552 #if defined(RTC_MISR_ALRAMF) 04553 /** 04554 * @brief Get Alarm A masked flag. 04555 * @rmtoll RTC_MISR ALRAMF LL_RTC_IsActiveFlag_ALRAM 04556 * @param RTCx RTC Instance 04557 * @retval State of bit (1 or 0). 04558 */ 04559 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAM(RTC_TypeDef *RTCx) 04560 { 04561 return ((READ_BIT(RTCx->MISR, RTC_MISR_ALRAMF) == (RTC_MISR_ALRAMF)) ? 1UL : 0UL); 04562 } 04563 04564 /** 04565 * @brief Get Alarm B masked flag. 04566 * @rmtoll RTC_MISR ALRBMF LL_RTC_IsActiveFlag_ALRBM 04567 * @param RTCx RTC Instance 04568 * @retval State of bit (1 or 0). 04569 */ 04570 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBM(RTC_TypeDef *RTCx) 04571 { 04572 return ((READ_BIT(RTCx->MISR, RTC_MISR_ALRBMF) == (RTC_MISR_ALRBMF)) ? 1UL : 0UL); 04573 } 04574 04575 /** 04576 * @brief Get Wakeup timer masked flag. 04577 * @rmtoll RTC_MISR WUTMF LL_RTC_IsActiveFlag_WUTM 04578 * @param RTCx RTC Instance 04579 * @retval State of bit (1 or 0). 04580 */ 04581 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTM(RTC_TypeDef *RTCx) 04582 { 04583 return ((READ_BIT(RTCx->MISR, RTC_MISR_WUTMF) == (RTC_MISR_WUTMF)) ? 1UL : 0UL); 04584 } 04585 04586 /** 04587 * @brief Get Time-stamp masked flag. 04588 * @rmtoll RTC_MISR TSMF LL_RTC_IsActiveFlag_TSM 04589 * @param RTCx RTC Instance 04590 * @retval State of bit (1 or 0). 04591 */ 04592 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSM(RTC_TypeDef *RTCx) 04593 { 04594 return ((READ_BIT(RTCx->MISR, RTC_MISR_TSMF) == (RTC_MISR_TSMF)) ? 1UL : 0UL); 04595 } 04596 04597 /** 04598 * @brief Get Time-stamp overflow masked flag. 04599 * @rmtoll RTC_MISR TSOVMF LL_RTC_IsActiveFlag_TSOVM 04600 * @param RTCx RTC Instance 04601 * @retval State of bit (1 or 0). 04602 */ 04603 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOVM(RTC_TypeDef *RTCx) 04604 { 04605 return ((READ_BIT(RTCx->MISR, RTC_MISR_TSOVMF) == (RTC_MISR_TSOVMF)) ? 1UL : 0UL); 04606 } 04607 04608 /** 04609 * @brief Get Internal Time-stamp masked flag. 04610 * @rmtoll RTC_MISR ITSMF LL_RTC_IsActiveFlag_ITSM 04611 * @param RTCx RTC Instance 04612 * @retval State of bit (1 or 0). 04613 */ 04614 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ITSM(RTC_TypeDef *RTCx) 04615 { 04616 return ((READ_BIT(RTCx->MISR, RTC_MISR_ITSMF) == (RTC_MISR_ITSMF)) ? 1UL : 0UL); 04617 } 04618 #endif /* RTC_MISR_ALRAMF */ 04619 04620 #if defined(TAMP_CR1_TAMP1E) 04621 /** 04622 * @brief Get tamper 1 detection flag. 04623 * @rmtoll TAMP_SR TAMP1F LL_RTC_IsActiveFlag_TAMP1 04624 * @param TAMPx TAMP Instance 04625 * @retval State of bit (1 or 0). 04626 */ 04627 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1(TAMP_TypeDef *TAMPx) 04628 { 04629 return ((READ_BIT(TAMPx->SR, TAMP_SR_TAMP1F) == (TAMP_SR_TAMP1F)) ? 1UL : 0UL); 04630 } 04631 #endif /* TAMP_CR1_TAMP1E */ 04632 04633 #if defined(TAMP_CR1_TAMP2E) 04634 /** 04635 * @brief Get tamper 2 detection flag. 04636 * @rmtoll TAMP_SR TAMP2F LL_RTC_IsActiveFlag_TAMP2 04637 * @param TAMPx TAMP Instance 04638 * @retval State of bit (1 or 0). 04639 */ 04640 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2(TAMP_TypeDef *TAMPx) 04641 { 04642 return ((READ_BIT(TAMPx->SR, TAMP_SR_TAMP2F) == (TAMP_SR_TAMP2F)) ? 1UL : 0UL); 04643 } 04644 #endif /* TAMP_CR1_TAMP2E */ 04645 04646 #if defined(TAMP_CR1_TAMP3E) 04647 /** 04648 * @brief Get tamper 3 detection flag. 04649 * @rmtoll TAMP_SR TAMP3F LL_RTC_IsActiveFlag_TAMP3 04650 * @param TAMPx TAMP Instance 04651 * @retval State of bit (1 or 0). 04652 */ 04653 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3(TAMP_TypeDef *TAMPx) 04654 { 04655 return ((READ_BIT(TAMPx->SR, TAMP_SR_TAMP3F) == (TAMP_SR_TAMP3F)) ? 1UL : 0UL); 04656 } 04657 #endif /* TAMP_CR1_TAMP3E */ 04658 04659 #if defined(TAMP_CR1_TAMP1E) 04660 /** 04661 * @brief Get tamper 1 interrupt masked flag. 04662 * @rmtoll TAMP_MISR TAMP1MF LL_RTC_IsActiveFlag_TAMP1M 04663 * @param TAMPx TAMP Instance 04664 * @retval State of bit (1 or 0). 04665 */ 04666 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1M(TAMP_TypeDef *TAMPx) 04667 { 04668 return ((READ_BIT(TAMPx->MISR, TAMP_MISR_TAMP1MF) == (TAMP_MISR_TAMP1MF)) ? 1UL : 0UL); 04669 } 04670 #endif /* TAMP_CR1_TAMP1E */ 04671 04672 #if defined(TAMP_CR1_TAMP2E) 04673 /** 04674 * @brief Get tamper 2 interrupt masked flag. 04675 * @rmtoll TAMP_MISR TAMP2MF LL_RTC_IsActiveFlag_TAMP2M 04676 * @param TAMPx TAMP Instance 04677 * @retval State of bit (1 or 0). 04678 */ 04679 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2M(TAMP_TypeDef *TAMPx) 04680 { 04681 return ((READ_BIT(TAMPx->MISR, TAMP_MISR_TAMP2MF) == (TAMP_MISR_TAMP2MF)) ? 1UL : 0UL); 04682 } 04683 #endif /* TAMP_CR1_TAMP2E */ 04684 04685 #if defined(TAMP_CR1_TAMP3E) 04686 /** 04687 * @brief Get tamper 3 interrupt masked flag. 04688 * @rmtoll TAMP_MISR TAMP3MF LL_RTC_IsActiveFlag_TAMP3M 04689 * @param TAMPx TAMP Instance 04690 * @retval State of bit (1 or 0). 04691 */ 04692 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3M(TAMP_TypeDef *TAMPx) 04693 { 04694 return ((READ_BIT(TAMPx->MISR, TAMP_MISR_TAMP3MF) == (TAMP_MISR_TAMP3MF)) ? 1UL : 0UL); 04695 } 04696 #endif /* TAMP_CR1_TAMP3E */ 04697 04698 #if defined(TAMP_CR1_TAMP1E) 04699 /** 04700 * @brief Clear tamper 1 detection flag. 04701 * @rmtoll TAMP_SCR CTAMP1F LL_RTC_ClearFlag_TAMP1 04702 * @param TAMPx TAMP Instance 04703 * @retval None 04704 */ 04705 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP1(TAMP_TypeDef *TAMPx) 04706 { 04707 SET_BIT(TAMPx->SCR, TAMP_SCR_CTAMP1F); 04708 } 04709 #endif /* TAMP_CR1_TAMP1E */ 04710 04711 #if defined(TAMP_CR1_TAMP2E) 04712 /** 04713 * @brief Clear tamper 2 detection flag. 04714 * @rmtoll TAMP_SCR CTAMP2F LL_RTC_ClearFlag_TAMP2 04715 * @param TAMPx TAMP Instance 04716 * @retval None 04717 */ 04718 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP2(TAMP_TypeDef *TAMPx) 04719 { 04720 SET_BIT(TAMPx->SCR, TAMP_SCR_CTAMP2F); 04721 } 04722 #endif /* TAMP_CR1_TAMP2E */ 04723 04724 #if defined(TAMP_CR1_TAMP3E) 04725 /** 04726 * @brief Clear tamper 3 detection flag. 04727 * @rmtoll TAMP_SCR CTAMP3F LL_RTC_ClearFlag_TAMP3 04728 * @param TAMPx TAMP Instance 04729 * @retval None 04730 */ 04731 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP3(TAMP_TypeDef *TAMPx) 04732 { 04733 SET_BIT(TAMPx->SCR, TAMP_SCR_CTAMP3F); 04734 } 04735 #endif /* TAMP_CR1_TAMP3E */ 04736 04737 /** 04738 * @} 04739 */ 04740 04741 /** @defgroup RTC_LL_EF_IT_Management IT_Management 04742 * @{ 04743 */ 04744 04745 /** 04746 * @brief Enable Time-stamp interrupt 04747 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04748 * @rmtoll RTC_CR TSIE LL_RTC_EnableIT_TS 04749 * @param RTCx RTC Instance 04750 * @retval None 04751 */ 04752 __STATIC_INLINE void LL_RTC_EnableIT_TS(RTC_TypeDef *RTCx) 04753 { 04754 SET_BIT(RTCx->CR, RTC_CR_TSIE); 04755 } 04756 04757 /** 04758 * @brief Disable Time-stamp interrupt 04759 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04760 * @rmtoll RTC_CR TSIE LL_RTC_DisableIT_TS 04761 * @param RTCx RTC Instance 04762 * @retval None 04763 */ 04764 __STATIC_INLINE void LL_RTC_DisableIT_TS(RTC_TypeDef *RTCx) 04765 { 04766 CLEAR_BIT(RTCx->CR, RTC_CR_TSIE); 04767 } 04768 04769 /** 04770 * @brief Enable Wakeup timer interrupt 04771 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04772 * @rmtoll RTC_CR WUTIE LL_RTC_EnableIT_WUT 04773 * @param RTCx RTC Instance 04774 * @retval None 04775 */ 04776 __STATIC_INLINE void LL_RTC_EnableIT_WUT(RTC_TypeDef *RTCx) 04777 { 04778 SET_BIT(RTCx->CR, RTC_CR_WUTIE); 04779 } 04780 04781 /** 04782 * @brief Disable Wakeup timer interrupt 04783 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04784 * @rmtoll RTC_CR WUTIE LL_RTC_DisableIT_WUT 04785 * @param RTCx RTC Instance 04786 * @retval None 04787 */ 04788 __STATIC_INLINE void LL_RTC_DisableIT_WUT(RTC_TypeDef *RTCx) 04789 { 04790 CLEAR_BIT(RTCx->CR, RTC_CR_WUTIE); 04791 } 04792 04793 /** 04794 * @brief Enable Alarm B interrupt 04795 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04796 * @rmtoll RTC_CR ALRBIE LL_RTC_EnableIT_ALRB 04797 * @param RTCx RTC Instance 04798 * @retval None 04799 */ 04800 __STATIC_INLINE void LL_RTC_EnableIT_ALRB(RTC_TypeDef *RTCx) 04801 { 04802 SET_BIT(RTCx->CR, RTC_CR_ALRBIE); 04803 } 04804 04805 /** 04806 * @brief Disable Alarm B interrupt 04807 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04808 * @rmtoll RTC_CR ALRBIE LL_RTC_DisableIT_ALRB 04809 * @param RTCx RTC Instance 04810 * @retval None 04811 */ 04812 __STATIC_INLINE void LL_RTC_DisableIT_ALRB(RTC_TypeDef *RTCx) 04813 { 04814 CLEAR_BIT(RTCx->CR, RTC_CR_ALRBIE); 04815 } 04816 04817 /** 04818 * @brief Enable Alarm A interrupt 04819 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04820 * @rmtoll RTC_CR ALRAIE LL_RTC_EnableIT_ALRA 04821 * @param RTCx RTC Instance 04822 * @retval None 04823 */ 04824 __STATIC_INLINE void LL_RTC_EnableIT_ALRA(RTC_TypeDef *RTCx) 04825 { 04826 SET_BIT(RTCx->CR, RTC_CR_ALRAIE); 04827 } 04828 04829 /** 04830 * @brief Disable Alarm A interrupt 04831 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. 04832 * @rmtoll RTC_CR ALRAIE LL_RTC_DisableIT_ALRA 04833 * @param RTCx RTC Instance 04834 * @retval None 04835 */ 04836 __STATIC_INLINE void LL_RTC_DisableIT_ALRA(RTC_TypeDef *RTCx) 04837 { 04838 CLEAR_BIT(RTCx->CR, RTC_CR_ALRAIE); 04839 } 04840 04841 #if defined(RTC_TAMPCR_TAMP3E) 04842 /** 04843 * @brief Enable Tamper 3 interrupt 04844 * @rmtoll TAMPCR TAMP3IE LL_RTC_EnableIT_TAMP3 04845 * @param RTCx RTC Instance 04846 * @retval None 04847 */ 04848 __STATIC_INLINE void LL_RTC_EnableIT_TAMP3(RTC_TypeDef *RTCx) 04849 { 04850 SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE); 04851 } 04852 04853 /** 04854 * @brief Disable Tamper 3 interrupt 04855 * @rmtoll TAMPCR TAMP3IE LL_RTC_DisableIT_TAMP3 04856 * @param RTCx RTC Instance 04857 * @retval None 04858 */ 04859 __STATIC_INLINE void LL_RTC_DisableIT_TAMP3(RTC_TypeDef *RTCx) 04860 { 04861 CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE); 04862 } 04863 #endif /* RTC_TAMPCR_TAMP3E */ 04864 04865 #if defined(RTC_TAMPCR_TAMP2E) 04866 /** 04867 * @brief Enable Tamper 2 interrupt 04868 * @rmtoll TAMPCR TAMP2IE LL_RTC_EnableIT_TAMP2 04869 * @param RTCx RTC Instance 04870 * @retval None 04871 */ 04872 __STATIC_INLINE void LL_RTC_EnableIT_TAMP2(RTC_TypeDef *RTCx) 04873 { 04874 SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE); 04875 } 04876 04877 /** 04878 * @brief Disable Tamper 2 interrupt 04879 * @rmtoll TAMPCR TAMP2IE LL_RTC_DisableIT_TAMP2 04880 * @param RTCx RTC Instance 04881 * @retval None 04882 */ 04883 __STATIC_INLINE void LL_RTC_DisableIT_TAMP2(RTC_TypeDef *RTCx) 04884 { 04885 CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE); 04886 } 04887 #endif /* RTC_TAMPCR_TAMP2E */ 04888 04889 #if defined(RTC_TAMPCR_TAMP1E) 04890 /** 04891 * @brief Enable Tamper 1 interrupt 04892 * @rmtoll TAMPCR TAMP1IE LL_RTC_EnableIT_TAMP1 04893 * @param RTCx RTC Instance 04894 * @retval None 04895 */ 04896 __STATIC_INLINE void LL_RTC_EnableIT_TAMP1(RTC_TypeDef *RTCx) 04897 { 04898 SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE); 04899 } 04900 04901 /** 04902 * @brief Disable Tamper 1 interrupt 04903 * @rmtoll TAMPCR TAMP1IE LL_RTC_DisableIT_TAMP1 04904 * @param RTCx RTC Instance 04905 * @retval None 04906 */ 04907 __STATIC_INLINE void LL_RTC_DisableIT_TAMP1(RTC_TypeDef *RTCx) 04908 { 04909 CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE); 04910 } 04911 #endif /* RTC_TAMPCR_TAMP1E */ 04912 04913 #if defined(RTC_TAMPCR_TAMPIE) 04914 /** 04915 * @brief Enable all Tamper Interrupt 04916 * @rmtoll TAMPCR TAMPIE LL_RTC_EnableIT_TAMP 04917 * @param RTCx RTC Instance 04918 * @retval None 04919 */ 04920 __STATIC_INLINE void LL_RTC_EnableIT_TAMP(RTC_TypeDef *RTCx) 04921 { 04922 SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE); 04923 } 04924 04925 /** 04926 * @brief Disable all Tamper Interrupt 04927 * @rmtoll TAMPCR TAMPIE LL_RTC_DisableIT_TAMP 04928 * @param RTCx RTC Instance 04929 * @retval None 04930 */ 04931 __STATIC_INLINE void LL_RTC_DisableIT_TAMP(RTC_TypeDef *RTCx) 04932 { 04933 CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE); 04934 } 04935 #endif /* RTC_TAMPCR_TAMPIE */ 04936 04937 /** 04938 * @brief Check if Time-stamp interrupt is enabled or not 04939 * @rmtoll CR TSIE LL_RTC_IsEnabledIT_TS 04940 * @param RTCx RTC Instance 04941 * @retval State of bit (1 or 0). 04942 */ 04943 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef *RTCx) 04944 { 04945 return ((READ_BIT(RTCx->CR, RTC_CR_TSIE) == (RTC_CR_TSIE)) ? 1UL : 0UL); 04946 } 04947 04948 /** 04949 * @brief Check if Wakeup timer interrupt is enabled or not 04950 * @rmtoll CR WUTIE LL_RTC_IsEnabledIT_WUT 04951 * @param RTCx RTC Instance 04952 * @retval State of bit (1 or 0). 04953 */ 04954 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef *RTCx) 04955 { 04956 return ((READ_BIT(RTCx->CR, RTC_CR_WUTIE) == (RTC_CR_WUTIE)) ? 1UL : 0UL); 04957 } 04958 04959 /** 04960 * @brief Check if Alarm B interrupt is enabled or not 04961 * @rmtoll CR ALRBIE LL_RTC_IsEnabledIT_ALRB 04962 * @param RTCx RTC Instance 04963 * @retval State of bit (1 or 0). 04964 */ 04965 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef *RTCx) 04966 { 04967 return ((READ_BIT(RTCx->CR, RTC_CR_ALRBIE) == (RTC_CR_ALRBIE)) ? 1UL : 0UL); 04968 } 04969 04970 /** 04971 * @brief Check if Alarm A interrupt is enabled or not 04972 * @rmtoll CR ALRAIE LL_RTC_IsEnabledIT_ALRA 04973 * @param RTCx RTC Instance 04974 * @retval State of bit (1 or 0). 04975 */ 04976 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef *RTCx) 04977 { 04978 return ((READ_BIT(RTCx->CR, RTC_CR_ALRAIE) == (RTC_CR_ALRAIE)) ? 1UL : 0UL); 04979 } 04980 04981 #if defined(RTC_TAMPCR_TAMP3E) 04982 /** 04983 * @brief Check if Tamper 3 interrupt is enabled or not 04984 * @rmtoll TAMPCR TAMP3IE LL_RTC_IsEnabledIT_TAMP3 04985 * @param RTCx RTC Instance 04986 * @retval State of bit (1 or 0). 04987 */ 04988 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef *RTCx) 04989 { 04990 return ((READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE) == (RTC_TAMPCR_TAMP3IE)) ? 1UL : 0UL); 04991 } 04992 #endif /* RTC_TAMPCR_TAMP3E */ 04993 04994 #if defined(RTC_TAMPCR_TAMP2E) 04995 /** 04996 * @brief Check if Tamper 2 interrupt is enabled or not 04997 * @rmtoll TAMPCR TAMP2IE LL_RTC_IsEnabledIT_TAMP2 04998 * @param RTCx RTC Instance 04999 * @retval State of bit (1 or 0). 05000 */ 05001 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP2(RTC_TypeDef *RTCx) 05002 { 05003 return ((READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE) == (RTC_TAMPCR_TAMP2IE)) ? 1UL : 0UL); 05004 05005 } 05006 #endif /* RTC_TAMPCR_TAMP2E */ 05007 05008 #if defined(RTC_TAMPCR_TAMP1E) 05009 /** 05010 * @brief Check if Tamper 1 interrupt is enabled or not 05011 * @rmtoll TAMPCR TAMP1IE LL_RTC_IsEnabledIT_TAMP1 05012 * @param RTCx RTC Instance 05013 * @retval State of bit (1 or 0). 05014 */ 05015 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP1(RTC_TypeDef *RTCx) 05016 { 05017 return ((READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE) == (RTC_TAMPCR_TAMP1IE)) ? 1UL : 0UL); 05018 } 05019 #endif /* RTC_TAMPCR_TAMP1E */ 05020 05021 #if defined(RTC_TAMPCR_TAMPIE) 05022 /** 05023 * @brief Check if all the TAMPER interrupts are enabled or not 05024 * @rmtoll TAMPCR TAMPIE LL_RTC_IsEnabledIT_TAMP 05025 * @param RTCx RTC Instance 05026 * @retval State of bit (1 or 0). 05027 */ 05028 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef *RTCx) 05029 { 05030 return ((READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE) == (RTC_TAMPCR_TAMPIE)) ? 1UL : 0UL); 05031 } 05032 #endif /* RTC_TAMPCR_TAMPIE */ 05033 05034 #if defined(TAMP_CR1_TAMP1E) 05035 /** 05036 * @brief Enable tamper 1 interrupt. 05037 * @rmtoll TAMP_IER TAMP1IE LL_RTC_EnableIT_TAMP1 05038 * @param TAMPx TAMP Instance 05039 * @retval None 05040 */ 05041 __STATIC_INLINE void LL_RTC_EnableIT_TAMP1(TAMP_TypeDef *TAMPx) 05042 { 05043 SET_BIT(TAMPx->IER, TAMP_IER_TAMP1IE); 05044 } 05045 05046 /** 05047 * @brief Disable tamper 1 interrupt. 05048 * @rmtoll TAMP_IER TAMP1IE LL_RTC_DisableIT_TAMP1 05049 * @param TAMPx TAMP Instance 05050 * @retval None 05051 */ 05052 __STATIC_INLINE void LL_RTC_DisableIT_TAMP1(TAMP_TypeDef *TAMPx) 05053 { 05054 CLEAR_BIT(TAMPx->IER, TAMP_IER_TAMP1IE); 05055 } 05056 #endif /* TAMP_CR1_TAMP1E */ 05057 05058 #if defined(TAMP_CR1_TAMP2E) 05059 /** 05060 * @brief Enable tamper 2 interrupt. 05061 * @rmtoll TAMP_IER TAMP2IE LL_RTC_EnableIT_TAMP2 05062 * @param TAMPx TAMP Instance 05063 * @retval None 05064 */ 05065 __STATIC_INLINE void LL_RTC_EnableIT_TAMP2(TAMP_TypeDef *TAMPx) 05066 { 05067 SET_BIT(TAMPx->IER, TAMP_IER_TAMP2IE); 05068 } 05069 05070 /** 05071 * @brief Disable tamper 2 interrupt. 05072 * @rmtoll TAMP_IER TAMP2IE LL_RTC_DisableIT_TAMP2 05073 * @param TAMPx TAMP Instance 05074 * @retval None 05075 */ 05076 __STATIC_INLINE void LL_RTC_DisableIT_TAMP2(TAMP_TypeDef *TAMPx) 05077 { 05078 CLEAR_BIT(TAMPx->IER, TAMP_IER_TAMP2IE); 05079 } 05080 #endif /* TAMP_CR1_TAMP2E */ 05081 05082 #if defined(TAMP_CR1_TAMP3E) 05083 /** 05084 * @brief Enable tamper 3 interrupt. 05085 * @rmtoll TAMP_IER TAMP3IE LL_RTC_EnableIT_TAMP3 05086 * @param TAMPx TAMP Instance 05087 * @retval None 05088 */ 05089 __STATIC_INLINE void LL_RTC_EnableIT_TAMP3(TAMP_TypeDef *TAMPx) 05090 { 05091 SET_BIT(TAMPx->IER, TAMP_IER_TAMP3IE); 05092 } 05093 05094 /** 05095 * @brief Disable tamper 3 interrupt. 05096 * @rmtoll TAMP_IER TAMP3IE LL_RTC_DisableIT_TAMP3 05097 * @param TAMPx TAMP Instance 05098 * @retval None 05099 */ 05100 __STATIC_INLINE void LL_RTC_DisableIT_TAMP3(TAMP_TypeDef *TAMPx) 05101 { 05102 CLEAR_BIT(TAMPx->IER, TAMP_IER_TAMP3IE); 05103 } 05104 #endif /* TAMP_CR1_TAMP3E */ 05105 05106 #if defined(TAMP_CR1_TAMP1E) 05107 /** 05108 * @brief Check if tamper 1 interrupt is enabled or not. 05109 * @rmtoll TAMP_IER TAMP1IE LL_RTC_IsEnabledIT_TAMP1 05110 * @param TAMPx TAMP Instance 05111 * @retval State of bit (1 or 0). 05112 */ 05113 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP1(TAMP_TypeDef *TAMPx) 05114 { 05115 return ((READ_BIT(TAMPx->IER, TAMP_IER_TAMP1IE) == (TAMP_IER_TAMP1IE)) ? 1UL : 0UL); 05116 } 05117 #endif /* TAMP_CR1_TAMP1E */ 05118 05119 #if defined(TAMP_CR1_TAMP2E) 05120 /** 05121 * @brief Check if tamper 2 interrupt is enabled or not. 05122 * @rmtoll TAMP_IER TAMP2IE LL_RTC_IsEnabledIT_TAMP2 05123 * @param TAMPx TAMP Instance 05124 * @retval State of bit (1 or 0). 05125 */ 05126 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP2(TAMP_TypeDef *TAMPx) 05127 { 05128 return ((READ_BIT(TAMPx->IER, TAMP_IER_TAMP2IE) == (TAMP_IER_TAMP2IE)) ? 1UL : 0UL); 05129 } 05130 #endif /* TAMP_CR1_TAMP2E */ 05131 05132 #if defined(TAMP_CR1_TAMP3E) 05133 /** 05134 * @brief Check if tamper 3 interrupt is enabled or not. 05135 * @rmtoll TAMP_IER TAMP3IE LL_RTC_IsEnabledIT_TAMP3 05136 * @param TAMPx TAMP Instance 05137 * @retval State of bit (1 or 0). 05138 */ 05139 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP3(TAMP_TypeDef *TAMPx) 05140 { 05141 return ((READ_BIT(TAMPx->IER, TAMP_IER_TAMP3IE) == (TAMP_IER_TAMP3IE)) ? 1UL : 0UL); 05142 } 05143 #endif /* TAMP_CR1_TAMP3E */ 05144 05145 /** 05146 * @} 05147 */ 05148 05149 #if defined (TAMP_ATCR1_TAMP1AM) 05150 /** @defgroup RTC_LL_EF_Active_Tamper Active Tamper 05151 * @{ 05152 */ 05153 /** 05154 * @brief Enable tamper active mode. 05155 * @rmtoll TAMP_ATCR1 TAMP1AM LL_RTC_TAMPER_ATAMP_EnableActiveMode 05156 * @rmtoll TAMP_ATCR1 TAMP2AM LL_RTC_TAMPER_ATAMP_EnableActiveMode 05157 * @rmtoll TAMP_ATCR1 TAMPxAM LL_RTC_TAMPER_ATAMP_EnableActiveMode 05158 * @param Tamper to configure as active. This parameter can be a combination of the following values: 05159 * @arg @ref RTC_LL_EC_ACTIVE_MODE 05160 * 05161 * @retval None 05162 */ 05163 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_EnableActiveMode(uint32_t Tamper) 05164 { 05165 SET_BIT(TAMP->ATCR1, Tamper); 05166 } 05167 05168 /** 05169 * @brief Disable tamper active mode. 05170 * @rmtoll TAMP_ATCR1 TAMP1AM LL_RTC_TAMPER_ATAMP_DisableActiveMode 05171 * @rmtoll TAMP_ATCR1 TAMP2AM LL_RTC_TAMPER_ATAMP_DisableActiveMode 05172 * @rmtoll TAMP_ATCR1 TAMPxAM LL_RTC_TAMPER_ATAMP_DisableActiveMode 05173 * @param Tamper to configure as active. This parameter can be a combination of the following values: 05174 * @arg @ref RTC_LL_EC_ACTIVE_MODE 05175 * 05176 * @retval None 05177 */ 05178 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_DisableActiveMode(uint32_t Tamper) 05179 { 05180 CLEAR_BIT(TAMP->ATCR1, Tamper); 05181 } 05182 05183 /** 05184 * @brief Enable active tamper filter. 05185 * @rmtoll TAMP_ATCR1 FLTEN LL_RTC_TAMPER_ATAMP_EnableFilter 05186 * @retval None 05187 */ 05188 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_EnableFilter(void) 05189 { 05190 SET_BIT(TAMP->ATCR1, TAMP_ATCR1_FLTEN); 05191 } 05192 05193 /** 05194 * @brief Disable active tamper filter. 05195 * @rmtoll TAMP_ATCR1 FLTEN LL_RTC_TAMPER_ATAMP_DisableFilter 05196 * @retval None 05197 */ 05198 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_DisableFilter(void) 05199 { 05200 CLEAR_BIT(TAMP->ATCR1, TAMP_ATCR1_FLTEN); 05201 } 05202 05203 /** 05204 * @brief Set Active tamper output change period. 05205 * @rmtoll TAMP_ATCR1 ATPER LL_RTC_TAMPER_ATAMP_SetOutputChangePeriod 05206 * @param ActiveOutputChangePeriod This parameter can be a value from 0 to 7 05207 * @retval None 05208 */ 05209 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_SetOutputChangePeriod(uint32_t ActiveOutputChangePeriod) 05210 { 05211 MODIFY_REG(TAMP->ATCR1, TAMP_ATCR1_ATPER, (ActiveOutputChangePeriod << TAMP_ATCR1_ATPER_Pos)); 05212 } 05213 05214 /** 05215 * @brief Get Active tamper output change period. 05216 * @rmtoll TAMP_ATCR1 ATPER LL_RTC_TAMPER_ATAMP_GetOutputChangePeriod 05217 * @retval Output change period. This parameter can be a value from 0 to 7. 05218 */ 05219 __STATIC_INLINE uint32_t LL_RTC_TAMPER_ATAMP_GetOutputChangePeriod(void) 05220 { 05221 return (READ_BIT(TAMP->ATCR1, TAMP_ATCR1_ATPER) >> TAMP_ATCR1_ATPER_Pos); 05222 } 05223 05224 /** 05225 * @brief Set Active tamper asynchronous prescaler clock selection. 05226 * @rmtoll TAMP_ATCR1 ATCKSEL LL_RTC_TAMPER_ATAMP_SetAsyncPrescaler 05227 * @param ActiveAsynvPrescaler Specifies the Active Tamper asynchronous Prescaler clock. 05228 This parameter can be a value of the following values: 05229 * @arg @ref RTC_LL_EC_ACTIVE_ASYNC_PRESCALER 05230 * @retval None 05231 */ 05232 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_SetAsyncPrescaler(uint32_t ActiveAsynvPrescaler) 05233 { 05234 MODIFY_REG(TAMP->ATCR1, TAMP_ATCR1_ATCKSEL, ActiveAsynvPrescaler); 05235 } 05236 05237 /** 05238 * @brief Get Active tamper asynchronous prescaler clock selection. 05239 * @rmtoll TAMP_ATCR1 ATCKSEL LL_RTC_TAMPER_ATAMP_GetAsyncPrescaler 05240 * @retval One of @arg @ref RTC_LL_EC_ACTIVE_ASYNC_PRESCALER 05241 */ 05242 __STATIC_INLINE uint32_t LL_RTC_TAMPER_ATAMP_GetAsyncPrescaler(void) 05243 { 05244 return (READ_BIT(TAMP->ATCR1, TAMP_ATCR1_ATCKSEL)); 05245 } 05246 05247 /** 05248 * @brief Enable active tamper output sharing. 05249 * @rmtoll TAMP_ATCR1 ATOSHARE LL_RTC_TAMPER_ATAMP_EnableOutputSharing 05250 * @retval None 05251 */ 05252 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_EnableOutputSharing(void) 05253 { 05254 SET_BIT(TAMP->ATCR1, TAMP_ATCR1_ATOSHARE); 05255 } 05256 05257 /** 05258 * @brief Disable active tamper output sharing. 05259 * @rmtoll TAMP_ATCR1 ATOSHARE LL_RTC_TAMPER_ATAMP_DisableOutputSharing 05260 * @retval None 05261 */ 05262 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_DisableOutputSharing(void) 05263 { 05264 CLEAR_BIT(TAMP->ATCR1, TAMP_ATCR1_ATOSHARE); 05265 } 05266 05267 /** 05268 * @brief Set Active tamper output selection. 05269 * @rmtoll TAMP_ATCR1 ATCKSEL LL_RTC_TAMPER_ATAMP_SetSharedOuputSelection 05270 * @param OutputSelection Specifies all the output selection of the Active Tamper. 05271 This parameter is a combinasation of the following values: 05272 * One of @arg @ref RTC_LL_EC_ACTIVE_OUTPUT_SELECTION 05273 * @retval None 05274 */ 05275 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_SetSharedOuputSelection(uint32_t OutputSelection) 05276 { 05277 MODIFY_REG(TAMP->ATCR1, (TAMP_ATCR1_ATOSEL1 | TAMP_ATCR1_ATOSEL2 | TAMP_ATCR1_ATOSEL3), \ 05278 OutputSelection); 05279 } 05280 05281 /** 05282 * @brief Get Active tamper asynchronous prescaler clock selection. 05283 * @rmtoll TAMP_ATCR2 ATCKSEL LL_RTC_TAMPER_ATAMP_GetAsyncPrescaler 05284 * @retval A combination of @arg @ref RTC_LL_EC_ACTIVE_OUTPUT_SELECTION 05285 */ 05286 __STATIC_INLINE uint32_t LL_RTC_TAMPER_ATAMP_GetSharedOuputSelection(void) 05287 { 05288 return (READ_BIT(TAMP->ATCR1, (TAMP_ATCR1_ATOSEL1 | TAMP_ATCR1_ATOSEL2 | TAMP_ATCR1_ATOSEL3))); 05289 } 05290 #endif /* TAMP_ATCR1_TAMP1AM */ 05291 05292 #if defined(ATSEEDR) 05293 /** 05294 * @brief Write active tamper seed. 05295 * @rmtoll TAMP_ATSEEDR SEED LL_RTC_TAMPER_ATAMP_WriteSeed 05296 * @param Seed 05297 * @retval None 05298 */ 05299 __STATIC_INLINE void LL_RTC_TAMPER_ATAMP_WriteSeed(uint32_t Seed) 05300 { 05301 WRITE_REG(TAMP->ATSEEDR, Seed); 05302 } 05303 #endif /* ATSEEDR */ 05304 05305 #if defined(TAMP_ATOR_INITS) 05306 /** 05307 * @brief Get active tamper initialization status flag. 05308 * @rmtoll TAMP_ATOR INITS LL_RTC_IsActiveFlag_ATAMP_INITS 05309 * @retval State of bit (1 or 0). 05310 */ 05311 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ATAMP_INITS(void) 05312 { 05313 return ((READ_BIT(TAMP->ATOR, TAMP_ATOR_INITS) == (TAMP_ATOR_INITS)) ? 1U : 0U); 05314 } 05315 05316 /** 05317 * @brief Get active tamper seed running status flag. 05318 * @rmtoll TAMP_ATOR INITS LL_RTC_IsActiveFlag_ATAMP_INITS 05319 * @retval State of bit (1 or 0). 05320 */ 05321 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ATAMP_SEEDF(void) 05322 { 05323 return ((READ_BIT(TAMP->ATOR, TAMP_ATOR_SEEDF) == (TAMP_ATOR_SEEDF)) ? 1U : 0U); 05324 } 05325 #endif /* TAMP_ATOR_INITS */ 05326 05327 /** 05328 * @} 05329 */ 05330 05331 05332 #if defined(USE_FULL_LL_DRIVER) 05333 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions 05334 * @{ 05335 */ 05336 05337 ErrorStatus LL_RTC_DeInit(RTC_TypeDef *RTCx); 05338 ErrorStatus LL_RTC_Init(RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct); 05339 void LL_RTC_StructInit(LL_RTC_InitTypeDef *RTC_InitStruct); 05340 ErrorStatus LL_RTC_TIME_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct); 05341 void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef *RTC_TimeStruct); 05342 ErrorStatus LL_RTC_DATE_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_DateTypeDef *RTC_DateStruct); 05343 void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef *RTC_DateStruct); 05344 ErrorStatus LL_RTC_ALMA_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct); 05345 ErrorStatus LL_RTC_ALMB_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct); 05346 void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct); 05347 void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct); 05348 ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx); 05349 ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx); 05350 ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx); 05351 05352 /** 05353 * @} 05354 */ 05355 #endif /* USE_FULL_LL_DRIVER */ 05356 05357 /** 05358 * @} 05359 */ 05360 05361 /** 05362 * @} 05363 */ 05364 05365 #endif /* defined(RTC) */ 05366 05367 /** 05368 * @} 05369 */ 05370 05371 #ifdef __cplusplus 05372 } 05373 #endif 05374 05375 #endif /* STM32H7xx_LL_RTC_H */ 05376