mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
184:08ed48f1de7f
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 149:156823d33999 1 /**
<> 149:156823d33999 2 ******************************************************************************
<> 149:156823d33999 3 * @file stm32l1xx_ll_rtc.h
<> 149:156823d33999 4 * @author MCD Application Team
<> 149:156823d33999 5 * @brief Header file of RTC LL module.
<> 149:156823d33999 6 ******************************************************************************
<> 149:156823d33999 7 * @attention
<> 149:156823d33999 8 *
AnnaBridge 184:08ed48f1de7f 9 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
<> 149:156823d33999 10 *
<> 149:156823d33999 11 * Redistribution and use in source and binary forms, with or without modification,
<> 149:156823d33999 12 * are permitted provided that the following conditions are met:
<> 149:156823d33999 13 * 1. Redistributions of source code must retain the above copyright notice,
<> 149:156823d33999 14 * this list of conditions and the following disclaimer.
<> 149:156823d33999 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 149:156823d33999 16 * this list of conditions and the following disclaimer in the documentation
<> 149:156823d33999 17 * and/or other materials provided with the distribution.
<> 149:156823d33999 18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 149:156823d33999 19 * may be used to endorse or promote products derived from this software
<> 149:156823d33999 20 * without specific prior written permission.
<> 149:156823d33999 21 *
<> 149:156823d33999 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 149:156823d33999 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 149:156823d33999 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 149:156823d33999 25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 149:156823d33999 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 149:156823d33999 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 149:156823d33999 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 149:156823d33999 29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 149:156823d33999 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 149:156823d33999 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 149:156823d33999 32 *
<> 149:156823d33999 33 ******************************************************************************
<> 149:156823d33999 34 */
<> 149:156823d33999 35
<> 149:156823d33999 36 /* Define to prevent recursive inclusion -------------------------------------*/
<> 149:156823d33999 37 #ifndef __STM32L1xx_LL_RTC_H
<> 149:156823d33999 38 #define __STM32L1xx_LL_RTC_H
<> 149:156823d33999 39
<> 149:156823d33999 40 #ifdef __cplusplus
<> 149:156823d33999 41 extern "C" {
<> 149:156823d33999 42 #endif
<> 149:156823d33999 43
<> 149:156823d33999 44 /* Includes ------------------------------------------------------------------*/
<> 149:156823d33999 45 #include "stm32l1xx.h"
<> 149:156823d33999 46
<> 149:156823d33999 47 /** @addtogroup STM32L1xx_LL_Driver
<> 149:156823d33999 48 * @{
<> 149:156823d33999 49 */
<> 149:156823d33999 50
<> 149:156823d33999 51 #if defined(RTC)
<> 149:156823d33999 52
<> 149:156823d33999 53 /** @defgroup RTC_LL RTC
<> 149:156823d33999 54 * @{
<> 149:156823d33999 55 */
<> 149:156823d33999 56
<> 149:156823d33999 57 /* Private types -------------------------------------------------------------*/
<> 149:156823d33999 58 /* Private variables ---------------------------------------------------------*/
<> 149:156823d33999 59 /* Private constants ---------------------------------------------------------*/
<> 149:156823d33999 60 /** @defgroup RTC_LL_Private_Constants RTC Private Constants
<> 149:156823d33999 61 * @{
<> 149:156823d33999 62 */
<> 149:156823d33999 63 /* Masks Definition */
AnnaBridge 184:08ed48f1de7f 64 #define RTC_INIT_MASK (0xFFFFFFFFU)
AnnaBridge 184:08ed48f1de7f 65 #define RTC_RSF_MASK (0xFFFFFF5FU)
<> 149:156823d33999 66
<> 149:156823d33999 67 /* Write protection defines */
<> 149:156823d33999 68 #define RTC_WRITE_PROTECTION_DISABLE ((uint8_t)0xFFU)
<> 149:156823d33999 69 #define RTC_WRITE_PROTECTION_ENABLE_1 ((uint8_t)0xCAU)
<> 149:156823d33999 70 #define RTC_WRITE_PROTECTION_ENABLE_2 ((uint8_t)0x53U)
<> 149:156823d33999 71
<> 149:156823d33999 72 /* Defines used to combine date & time */
AnnaBridge 184:08ed48f1de7f 73 #define RTC_OFFSET_WEEKDAY 24U
AnnaBridge 184:08ed48f1de7f 74 #define RTC_OFFSET_DAY 16U
AnnaBridge 184:08ed48f1de7f 75 #define RTC_OFFSET_MONTH 8U
AnnaBridge 184:08ed48f1de7f 76 #define RTC_OFFSET_HOUR 16U
AnnaBridge 184:08ed48f1de7f 77 #define RTC_OFFSET_MINUTE 8U
<> 149:156823d33999 78
<> 149:156823d33999 79 /**
<> 149:156823d33999 80 * @}
<> 149:156823d33999 81 */
<> 149:156823d33999 82
<> 149:156823d33999 83 /* Private macros ------------------------------------------------------------*/
<> 149:156823d33999 84 #if defined(USE_FULL_LL_DRIVER)
<> 149:156823d33999 85 /** @defgroup RTC_LL_Private_Macros RTC Private Macros
<> 149:156823d33999 86 * @{
<> 149:156823d33999 87 */
<> 149:156823d33999 88 /**
<> 149:156823d33999 89 * @}
<> 149:156823d33999 90 */
<> 149:156823d33999 91 #endif /*USE_FULL_LL_DRIVER*/
<> 149:156823d33999 92
<> 149:156823d33999 93 /* Exported types ------------------------------------------------------------*/
<> 149:156823d33999 94 #if defined(USE_FULL_LL_DRIVER)
<> 149:156823d33999 95 /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure
<> 149:156823d33999 96 * @{
<> 149:156823d33999 97 */
<> 149:156823d33999 98
<> 149:156823d33999 99 /**
<> 149:156823d33999 100 * @brief RTC Init structures definition
<> 149:156823d33999 101 */
<> 149:156823d33999 102 typedef struct
<> 149:156823d33999 103 {
<> 149:156823d33999 104 uint32_t HourFormat; /*!< Specifies the RTC Hours Format.
<> 149:156823d33999 105 This parameter can be a value of @ref RTC_LL_EC_HOURFORMAT
<> 149:156823d33999 106
<> 149:156823d33999 107 This feature can be modified afterwards using unitary function
<> 149:156823d33999 108 @ref LL_RTC_SetHourFormat(). */
<> 149:156823d33999 109
<> 149:156823d33999 110 uint32_t AsynchPrescaler; /*!< Specifies the RTC Asynchronous Predivider value.
<> 149:156823d33999 111 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F
<> 149:156823d33999 112
<> 149:156823d33999 113 This feature can be modified afterwards using unitary function
<> 149:156823d33999 114 @ref LL_RTC_SetAsynchPrescaler(). */
<> 149:156823d33999 115
<> 149:156823d33999 116 uint32_t SynchPrescaler; /*!< Specifies the RTC Synchronous Predivider value.
<> 149:156823d33999 117 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF
<> 149:156823d33999 118
<> 149:156823d33999 119 This feature can be modified afterwards using unitary function
<> 149:156823d33999 120 @ref LL_RTC_SetSynchPrescaler(). */
<> 149:156823d33999 121 } LL_RTC_InitTypeDef;
<> 149:156823d33999 122
<> 149:156823d33999 123 /**
<> 149:156823d33999 124 * @brief RTC Time structure definition
<> 149:156823d33999 125 */
<> 149:156823d33999 126 typedef struct
<> 149:156823d33999 127 {
<> 149:156823d33999 128 uint32_t TimeFormat; /*!< Specifies the RTC AM/PM Time.
<> 149:156823d33999 129 This parameter can be a value of @ref RTC_LL_EC_TIME_FORMAT
<> 149:156823d33999 130
<> 149:156823d33999 131 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetFormat(). */
<> 149:156823d33999 132
<> 149:156823d33999 133 uint8_t Hours; /*!< Specifies the RTC Time Hours.
<> 149:156823d33999 134 This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the @ref LL_RTC_TIME_FORMAT_PM is selected.
<> 149:156823d33999 135 This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the @ref LL_RTC_TIME_FORMAT_AM_OR_24 is selected.
<> 149:156823d33999 136
<> 149:156823d33999 137 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetHour(). */
<> 149:156823d33999 138
<> 149:156823d33999 139 uint8_t Minutes; /*!< Specifies the RTC Time Minutes.
<> 149:156823d33999 140 This parameter must be a number between Min_Data = 0 and Max_Data = 59
<> 149:156823d33999 141
<> 149:156823d33999 142 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetMinute(). */
<> 149:156823d33999 143
<> 149:156823d33999 144 uint8_t Seconds; /*!< Specifies the RTC Time Seconds.
<> 149:156823d33999 145 This parameter must be a number between Min_Data = 0 and Max_Data = 59
<> 149:156823d33999 146
<> 149:156823d33999 147 This feature can be modified afterwards using unitary function @ref LL_RTC_TIME_SetSecond(). */
<> 149:156823d33999 148 } LL_RTC_TimeTypeDef;
<> 149:156823d33999 149
<> 149:156823d33999 150 /**
<> 149:156823d33999 151 * @brief RTC Date structure definition
<> 149:156823d33999 152 */
<> 149:156823d33999 153 typedef struct
<> 149:156823d33999 154 {
<> 149:156823d33999 155 uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay.
<> 149:156823d33999 156 This parameter can be a value of @ref RTC_LL_EC_WEEKDAY
<> 149:156823d33999 157
<> 149:156823d33999 158 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetWeekDay(). */
<> 149:156823d33999 159
<> 149:156823d33999 160 uint8_t Month; /*!< Specifies the RTC Date Month.
<> 149:156823d33999 161 This parameter can be a value of @ref RTC_LL_EC_MONTH
<> 149:156823d33999 162
<> 149:156823d33999 163 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetMonth(). */
<> 149:156823d33999 164
<> 149:156823d33999 165 uint8_t Day; /*!< Specifies the RTC Date Day.
<> 149:156823d33999 166 This parameter must be a number between Min_Data = 1 and Max_Data = 31
<> 149:156823d33999 167
<> 149:156823d33999 168 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetDay(). */
<> 149:156823d33999 169
<> 149:156823d33999 170 uint8_t Year; /*!< Specifies the RTC Date Year.
<> 149:156823d33999 171 This parameter must be a number between Min_Data = 0 and Max_Data = 99
<> 149:156823d33999 172
<> 149:156823d33999 173 This feature can be modified afterwards using unitary function @ref LL_RTC_DATE_SetYear(). */
<> 149:156823d33999 174 } LL_RTC_DateTypeDef;
<> 149:156823d33999 175
<> 149:156823d33999 176 /**
<> 149:156823d33999 177 * @brief RTC Alarm structure definition
<> 149:156823d33999 178 */
<> 149:156823d33999 179 typedef struct
<> 149:156823d33999 180 {
<> 149:156823d33999 181 LL_RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members. */
<> 149:156823d33999 182
<> 149:156823d33999 183 uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks.
<> 149:156823d33999 184 This parameter can be a value of @ref RTC_LL_EC_ALMA_MASK for ALARM A or @ref RTC_LL_EC_ALMB_MASK for ALARM B.
<> 149:156823d33999 185
<> 149:156823d33999 186 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetMask() for ALARM A
<> 149:156823d33999 187 or @ref LL_RTC_ALMB_SetMask() for ALARM B
<> 149:156823d33999 188 */
<> 149:156823d33999 189
<> 149:156823d33999 190 uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on day or WeekDay.
<> 149:156823d33999 191 This parameter can be a value of @ref RTC_LL_EC_ALMA_WEEKDAY_SELECTION for ALARM A or @ref RTC_LL_EC_ALMB_WEEKDAY_SELECTION for ALARM B
<> 149:156823d33999 192
<> 149:156823d33999 193 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_EnableWeekday() or @ref LL_RTC_ALMA_DisableWeekday()
<> 149:156823d33999 194 for ALARM A or @ref LL_RTC_ALMB_EnableWeekday() or @ref LL_RTC_ALMB_DisableWeekday() for ALARM B
<> 149:156823d33999 195 */
<> 149:156823d33999 196
<> 149:156823d33999 197 uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Day/WeekDay.
<> 149:156823d33999 198 If AlarmDateWeekDaySel set to day, this parameter must be a number between Min_Data = 1 and Max_Data = 31.
<> 149:156823d33999 199
<> 149:156823d33999 200 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetDay()
<> 149:156823d33999 201 for ALARM A or @ref LL_RTC_ALMB_SetDay() for ALARM B.
<> 149:156823d33999 202
<> 149:156823d33999 203 If AlarmDateWeekDaySel set to Weekday, this parameter can be a value of @ref RTC_LL_EC_WEEKDAY.
<> 149:156823d33999 204
<> 149:156823d33999 205 This feature can be modified afterwards using unitary function @ref LL_RTC_ALMA_SetWeekDay()
<> 149:156823d33999 206 for ALARM A or @ref LL_RTC_ALMB_SetWeekDay() for ALARM B.
<> 149:156823d33999 207 */
<> 149:156823d33999 208 } LL_RTC_AlarmTypeDef;
<> 149:156823d33999 209
<> 149:156823d33999 210 /**
<> 149:156823d33999 211 * @}
<> 149:156823d33999 212 */
<> 149:156823d33999 213 #endif /* USE_FULL_LL_DRIVER */
<> 149:156823d33999 214
<> 149:156823d33999 215 /* Exported constants --------------------------------------------------------*/
<> 149:156823d33999 216 /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants
<> 149:156823d33999 217 * @{
<> 149:156823d33999 218 */
<> 149:156823d33999 219
<> 149:156823d33999 220 #if defined(USE_FULL_LL_DRIVER)
<> 149:156823d33999 221 /** @defgroup RTC_LL_EC_FORMAT FORMAT
<> 149:156823d33999 222 * @{
<> 149:156823d33999 223 */
AnnaBridge 184:08ed48f1de7f 224 #define LL_RTC_FORMAT_BIN 0x000000000U /*!< Binary data format */
AnnaBridge 184:08ed48f1de7f 225 #define LL_RTC_FORMAT_BCD 0x000000001U /*!< BCD data format */
<> 149:156823d33999 226 /**
<> 149:156823d33999 227 * @}
<> 149:156823d33999 228 */
<> 149:156823d33999 229
<> 149:156823d33999 230 /** @defgroup RTC_LL_EC_ALMA_WEEKDAY_SELECTION RTC Alarm A Date WeekDay
<> 149:156823d33999 231 * @{
<> 149:156823d33999 232 */
AnnaBridge 184:08ed48f1de7f 233 #define LL_RTC_ALMA_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm A Date is selected */
<> 149:156823d33999 234 #define LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL /*!< Alarm A WeekDay is selected */
<> 149:156823d33999 235 /**
<> 149:156823d33999 236 * @}
<> 149:156823d33999 237 */
<> 149:156823d33999 238
<> 149:156823d33999 239 /** @defgroup RTC_LL_EC_ALMB_WEEKDAY_SELECTION RTC Alarm B Date WeekDay
<> 149:156823d33999 240 * @{
<> 149:156823d33999 241 */
AnnaBridge 184:08ed48f1de7f 242 #define LL_RTC_ALMB_DATEWEEKDAYSEL_DATE 0x00000000U /*!< Alarm B Date is selected */
<> 149:156823d33999 243 #define LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY RTC_ALRMBR_WDSEL /*!< Alarm B WeekDay is selected */
<> 149:156823d33999 244 /**
<> 149:156823d33999 245 * @}
<> 149:156823d33999 246 */
<> 149:156823d33999 247
<> 149:156823d33999 248 #endif /* USE_FULL_LL_DRIVER */
<> 149:156823d33999 249
<> 149:156823d33999 250 /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines
<> 149:156823d33999 251 * @brief Flags defines which can be used with LL_RTC_ReadReg function
<> 149:156823d33999 252 * @{
<> 149:156823d33999 253 */
<> 149:156823d33999 254 #if defined(RTC_SMOOTHCALIB_SUPPORT)
<> 149:156823d33999 255 #define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF
<> 149:156823d33999 256 #endif /* RTC_SMOOTHCALIB_SUPPORT */
<> 149:156823d33999 257 #define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F
<> 149:156823d33999 258 #define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F
<> 149:156823d33999 259 #define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F
<> 149:156823d33999 260 #define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF
<> 149:156823d33999 261 #define LL_RTC_ISR_TSF RTC_ISR_TSF
<> 149:156823d33999 262 #define LL_RTC_ISR_WUTF RTC_ISR_WUTF
<> 149:156823d33999 263 #define LL_RTC_ISR_ALRBF RTC_ISR_ALRBF
<> 149:156823d33999 264 #define LL_RTC_ISR_ALRAF RTC_ISR_ALRAF
<> 149:156823d33999 265 #define LL_RTC_ISR_INITF RTC_ISR_INITF
<> 149:156823d33999 266 #define LL_RTC_ISR_RSF RTC_ISR_RSF
<> 149:156823d33999 267 #define LL_RTC_ISR_INITS RTC_ISR_INITS
<> 149:156823d33999 268 #define LL_RTC_ISR_SHPF RTC_ISR_SHPF
<> 149:156823d33999 269 #define LL_RTC_ISR_WUTWF RTC_ISR_WUTWF
<> 149:156823d33999 270 #define LL_RTC_ISR_ALRBWF RTC_ISR_ALRBWF
<> 149:156823d33999 271 #define LL_RTC_ISR_ALRAWF RTC_ISR_ALRAWF
<> 149:156823d33999 272 /**
<> 149:156823d33999 273 * @}
<> 149:156823d33999 274 */
<> 149:156823d33999 275
<> 149:156823d33999 276 /** @defgroup RTC_LL_EC_IT IT Defines
<> 149:156823d33999 277 * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions
<> 149:156823d33999 278 * @{
<> 149:156823d33999 279 */
<> 149:156823d33999 280 #define LL_RTC_CR_TSIE RTC_CR_TSIE
<> 149:156823d33999 281 #define LL_RTC_CR_WUTIE RTC_CR_WUTIE
<> 149:156823d33999 282 #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE
<> 149:156823d33999 283 #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE
<> 149:156823d33999 284 #define LL_RTC_TAFCR_TAMPIE RTC_TAFCR_TAMPIE
<> 149:156823d33999 285 /**
<> 149:156823d33999 286 * @}
<> 149:156823d33999 287 */
<> 149:156823d33999 288
<> 149:156823d33999 289 /** @defgroup RTC_LL_EC_WEEKDAY WEEK DAY
<> 149:156823d33999 290 * @{
<> 149:156823d33999 291 */
<> 149:156823d33999 292 #define LL_RTC_WEEKDAY_MONDAY ((uint8_t)0x01U) /*!< Monday */
<> 149:156823d33999 293 #define LL_RTC_WEEKDAY_TUESDAY ((uint8_t)0x02U) /*!< Tuesday */
<> 149:156823d33999 294 #define LL_RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03U) /*!< Wednesday */
<> 149:156823d33999 295 #define LL_RTC_WEEKDAY_THURSDAY ((uint8_t)0x04U) /*!< Thrusday */
<> 149:156823d33999 296 #define LL_RTC_WEEKDAY_FRIDAY ((uint8_t)0x05U) /*!< Friday */
<> 149:156823d33999 297 #define LL_RTC_WEEKDAY_SATURDAY ((uint8_t)0x06U) /*!< Saturday */
<> 149:156823d33999 298 #define LL_RTC_WEEKDAY_SUNDAY ((uint8_t)0x07U) /*!< Sunday */
<> 149:156823d33999 299 /**
<> 149:156823d33999 300 * @}
<> 149:156823d33999 301 */
<> 149:156823d33999 302
<> 149:156823d33999 303 /** @defgroup RTC_LL_EC_MONTH MONTH
<> 149:156823d33999 304 * @{
<> 149:156823d33999 305 */
<> 149:156823d33999 306 #define LL_RTC_MONTH_JANUARY ((uint8_t)0x01U) /*!< January */
<> 149:156823d33999 307 #define LL_RTC_MONTH_FEBRUARY ((uint8_t)0x02U) /*!< February */
<> 149:156823d33999 308 #define LL_RTC_MONTH_MARCH ((uint8_t)0x03U) /*!< March */
<> 149:156823d33999 309 #define LL_RTC_MONTH_APRIL ((uint8_t)0x04U) /*!< April */
<> 149:156823d33999 310 #define LL_RTC_MONTH_MAY ((uint8_t)0x05U) /*!< May */
<> 149:156823d33999 311 #define LL_RTC_MONTH_JUNE ((uint8_t)0x06U) /*!< June */
<> 149:156823d33999 312 #define LL_RTC_MONTH_JULY ((uint8_t)0x07U) /*!< July */
<> 149:156823d33999 313 #define LL_RTC_MONTH_AUGUST ((uint8_t)0x08U) /*!< August */
<> 149:156823d33999 314 #define LL_RTC_MONTH_SEPTEMBER ((uint8_t)0x09U) /*!< September */
<> 149:156823d33999 315 #define LL_RTC_MONTH_OCTOBER ((uint8_t)0x10U) /*!< October */
<> 149:156823d33999 316 #define LL_RTC_MONTH_NOVEMBER ((uint8_t)0x11U) /*!< November */
<> 149:156823d33999 317 #define LL_RTC_MONTH_DECEMBER ((uint8_t)0x12U) /*!< December */
<> 149:156823d33999 318 /**
<> 149:156823d33999 319 * @}
<> 149:156823d33999 320 */
<> 149:156823d33999 321
<> 149:156823d33999 322 /** @defgroup RTC_LL_EC_HOURFORMAT HOUR FORMAT
<> 149:156823d33999 323 * @{
<> 149:156823d33999 324 */
AnnaBridge 184:08ed48f1de7f 325 #define LL_RTC_HOURFORMAT_24HOUR 0x00000000U /*!< 24 hour/day format */
<> 149:156823d33999 326 #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */
<> 149:156823d33999 327 /**
<> 149:156823d33999 328 * @}
<> 149:156823d33999 329 */
<> 149:156823d33999 330
<> 149:156823d33999 331 /** @defgroup RTC_LL_EC_ALARMOUT ALARM OUTPUT
<> 149:156823d33999 332 * @{
<> 149:156823d33999 333 */
AnnaBridge 184:08ed48f1de7f 334 #define LL_RTC_ALARMOUT_DISABLE 0x00000000U /*!< Output disabled */
<> 149:156823d33999 335 #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */
<> 149:156823d33999 336 #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */
<> 149:156823d33999 337 #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */
<> 149:156823d33999 338 /**
<> 149:156823d33999 339 * @}
<> 149:156823d33999 340 */
<> 149:156823d33999 341
<> 149:156823d33999 342 /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUT TYPE
<> 149:156823d33999 343 * @{
<> 149:156823d33999 344 */
AnnaBridge 184:08ed48f1de7f 345 #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN 0x00000000U /*!< RTC_ALARM, when mapped on PC13, is open-drain output */
<> 149:156823d33999 346 #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_TAFCR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */
<> 149:156823d33999 347 /**
<> 149:156823d33999 348 * @}
<> 149:156823d33999 349 */
<> 149:156823d33999 350
<> 149:156823d33999 351 /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUT POLARITY PIN
<> 149:156823d33999 352 * @{
<> 149:156823d33999 353 */
AnnaBridge 184:08ed48f1de7f 354 #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH 0x00000000U /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/
<> 149:156823d33999 355 #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */
<> 149:156823d33999 356 /**
<> 149:156823d33999 357 * @}
<> 149:156823d33999 358 */
<> 149:156823d33999 359
<> 149:156823d33999 360 /** @defgroup RTC_LL_EC_TIME_FORMAT TIME FORMAT
<> 149:156823d33999 361 * @{
<> 149:156823d33999 362 */
AnnaBridge 184:08ed48f1de7f 363 #define LL_RTC_TIME_FORMAT_AM_OR_24 0x00000000U /*!< AM or 24-hour format */
<> 149:156823d33999 364 #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */
<> 149:156823d33999 365 /**
<> 149:156823d33999 366 * @}
<> 149:156823d33999 367 */
<> 149:156823d33999 368
<> 149:156823d33999 369 #if defined(RTC_SHIFTR_ADD1S)
<> 149:156823d33999 370 /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND
<> 149:156823d33999 371 * @{
<> 149:156823d33999 372 */
AnnaBridge 184:08ed48f1de7f 373 #define LL_RTC_SHIFT_SECOND_DELAY 0x00000000U /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */
<> 149:156823d33999 374 #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */
<> 149:156823d33999 375 /**
<> 149:156823d33999 376 * @}
<> 149:156823d33999 377 */
<> 149:156823d33999 378 #endif /* RTC_SHIFTR_ADD1S */
<> 149:156823d33999 379
<> 149:156823d33999 380 /** @defgroup RTC_LL_EC_ALMA_MASK ALARMA MASK
<> 149:156823d33999 381 * @{
<> 149:156823d33999 382 */
AnnaBridge 184:08ed48f1de7f 383 #define LL_RTC_ALMA_MASK_NONE 0x00000000U /*!< No masks applied on Alarm A*/
<> 149:156823d33999 384 #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */
<> 149:156823d33999 385 #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */
<> 149:156823d33999 386 #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */
<> 149:156823d33999 387 #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */
<> 149:156823d33999 388 #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */
<> 149:156823d33999 389 /**
<> 149:156823d33999 390 * @}
<> 149:156823d33999 391 */
<> 149:156823d33999 392
<> 149:156823d33999 393 /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALARMA TIME FORMAT
<> 149:156823d33999 394 * @{
<> 149:156823d33999 395 */
AnnaBridge 184:08ed48f1de7f 396 #define LL_RTC_ALMA_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
<> 149:156823d33999 397 #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */
<> 149:156823d33999 398 /**
<> 149:156823d33999 399 * @}
<> 149:156823d33999 400 */
<> 149:156823d33999 401
<> 149:156823d33999 402 /** @defgroup RTC_LL_EC_ALMB_MASK ALARMB MASK
<> 149:156823d33999 403 * @{
<> 149:156823d33999 404 */
AnnaBridge 184:08ed48f1de7f 405 #define LL_RTC_ALMB_MASK_NONE 0x00000000U /*!< No masks applied on Alarm B*/
<> 149:156823d33999 406 #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */
<> 149:156823d33999 407 #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */
<> 149:156823d33999 408 #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */
<> 149:156823d33999 409 #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */
<> 149:156823d33999 410 #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */
<> 149:156823d33999 411 /**
<> 149:156823d33999 412 * @}
<> 149:156823d33999 413 */
<> 149:156823d33999 414
<> 149:156823d33999 415 /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALARMB TIME FORMAT
<> 149:156823d33999 416 * @{
<> 149:156823d33999 417 */
AnnaBridge 184:08ed48f1de7f 418 #define LL_RTC_ALMB_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
<> 149:156823d33999 419 #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */
<> 149:156823d33999 420 /**
<> 149:156823d33999 421 * @}
<> 149:156823d33999 422 */
<> 149:156823d33999 423
<> 149:156823d33999 424 /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE
<> 149:156823d33999 425 * @{
<> 149:156823d33999 426 */
AnnaBridge 184:08ed48f1de7f 427 #define LL_RTC_TIMESTAMP_EDGE_RISING 0x00000000U /*!< RTC_TS input rising edge generates a time-stamp event */
<> 149:156823d33999 428 #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */
<> 149:156823d33999 429 /**
<> 149:156823d33999 430 * @}
<> 149:156823d33999 431 */
<> 149:156823d33999 432
<> 149:156823d33999 433 /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TIMESTAMP TIME FORMAT
<> 149:156823d33999 434 * @{
<> 149:156823d33999 435 */
AnnaBridge 184:08ed48f1de7f 436 #define LL_RTC_TS_TIME_FORMAT_AM 0x00000000U /*!< AM or 24-hour format */
<> 149:156823d33999 437 #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */
<> 149:156823d33999 438 /**
<> 149:156823d33999 439 * @}
<> 149:156823d33999 440 */
<> 149:156823d33999 441
<> 149:156823d33999 442 /** @defgroup RTC_LL_EC_TAMPER TAMPER
<> 149:156823d33999 443 * @{
<> 149:156823d33999 444 */
<> 149:156823d33999 445 #if defined(RTC_TAMPER1_SUPPORT)
<> 149:156823d33999 446 #define LL_RTC_TAMPER_1 RTC_TAFCR_TAMP1E /*!< RTC_TAMP1 input detection */
<> 149:156823d33999 447 #endif /* RTC_TAMPER1_SUPPORT */
<> 149:156823d33999 448 #if defined(RTC_TAMPER2_SUPPORT)
<> 149:156823d33999 449 #define LL_RTC_TAMPER_2 RTC_TAFCR_TAMP2E /*!< RTC_TAMP2 input detection */
<> 149:156823d33999 450 #endif /* RTC_TAMPER2_SUPPORT */
<> 149:156823d33999 451 #if defined(RTC_TAMPER3_SUPPORT)
<> 149:156823d33999 452 #define LL_RTC_TAMPER_3 RTC_TAFCR_TAMP3E /*!< RTC_TAMP3 input detection */
<> 149:156823d33999 453 #endif /* RTC_TAMPER3_SUPPORT */
<> 149:156823d33999 454 /**
<> 149:156823d33999 455 * @}
<> 149:156823d33999 456 */
<> 149:156823d33999 457
<> 149:156823d33999 458 /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK
<> 149:156823d33999 459 * @{
<> 149:156823d33999 460 */
<> 149:156823d33999 461 #if defined(RTC_TAMPER1_SUPPORT)
<> 149:156823d33999 462 #define LL_RTC_TAMPER_MASK_TAMPER1 RTC_TAFCR_TAMP1MF /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */
<> 149:156823d33999 463 #endif /* RTC_TAMPER1_SUPPORT */
<> 149:156823d33999 464 #if defined(RTC_TAMPER2_SUPPORT)
<> 149:156823d33999 465 #define LL_RTC_TAMPER_MASK_TAMPER2 RTC_TAFCR_TAMP2MF /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */
<> 149:156823d33999 466 #endif /* RTC_TAMPER2_SUPPORT */
<> 149:156823d33999 467 #if defined(RTC_TAMPER3_SUPPORT)
<> 149:156823d33999 468 #define LL_RTC_TAMPER_MASK_TAMPER3 RTC_TAFCR_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased */
<> 149:156823d33999 469 #endif /* RTC_TAMPER3_SUPPORT */
<> 149:156823d33999 470 /**
<> 149:156823d33999 471 * @}
<> 149:156823d33999 472 */
<> 149:156823d33999 473
<> 149:156823d33999 474 /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NO ERASE
<> 149:156823d33999 475 * @{
<> 149:156823d33999 476 */
<> 149:156823d33999 477 #if defined(RTC_TAMPER1_SUPPORT)
<> 149:156823d33999 478 #define LL_RTC_TAMPER_NOERASE_TAMPER1 RTC_TAFCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */
<> 149:156823d33999 479 #endif /* RTC_TAMPER1_SUPPORT */
<> 149:156823d33999 480 #if defined(RTC_TAMPER2_SUPPORT)
<> 149:156823d33999 481 #define LL_RTC_TAMPER_NOERASE_TAMPER2 RTC_TAFCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */
<> 149:156823d33999 482 #endif /* RTC_TAMPER2_SUPPORT */
<> 149:156823d33999 483 #if defined(RTC_TAMPER3_SUPPORT)
<> 149:156823d33999 484 #define LL_RTC_TAMPER_NOERASE_TAMPER3 RTC_TAFCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */
<> 149:156823d33999 485 #endif /* RTC_TAMPER3_SUPPORT */
<> 149:156823d33999 486 /**
<> 149:156823d33999 487 * @}
<> 149:156823d33999 488 */
<> 149:156823d33999 489
<> 149:156823d33999 490 #if defined(RTC_TAFCR_TAMPPRCH)
<> 149:156823d33999 491 /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION
<> 149:156823d33999 492 * @{
<> 149:156823d33999 493 */
AnnaBridge 184:08ed48f1de7f 494 #define LL_RTC_TAMPER_DURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */
<> 149:156823d33999 495 #define LL_RTC_TAMPER_DURATION_2RTCCLK RTC_TAFCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */
<> 149:156823d33999 496 #define LL_RTC_TAMPER_DURATION_4RTCCLK RTC_TAFCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */
<> 149:156823d33999 497 #define LL_RTC_TAMPER_DURATION_8RTCCLK RTC_TAFCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */
<> 149:156823d33999 498 /**
<> 149:156823d33999 499 * @}
<> 149:156823d33999 500 */
<> 149:156823d33999 501 #endif /* RTC_TAFCR_TAMPPRCH */
<> 149:156823d33999 502
<> 149:156823d33999 503 #if defined(RTC_TAFCR_TAMPFLT)
<> 149:156823d33999 504 /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER
<> 149:156823d33999 505 * @{
<> 149:156823d33999 506 */
AnnaBridge 184:08ed48f1de7f 507 #define LL_RTC_TAMPER_FILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */
<> 149:156823d33999 508 #define LL_RTC_TAMPER_FILTER_2SAMPLE RTC_TAFCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */
<> 149:156823d33999 509 #define LL_RTC_TAMPER_FILTER_4SAMPLE RTC_TAFCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */
<> 149:156823d33999 510 #define LL_RTC_TAMPER_FILTER_8SAMPLE RTC_TAFCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */
<> 149:156823d33999 511 /**
<> 149:156823d33999 512 * @}
<> 149:156823d33999 513 */
<> 149:156823d33999 514 #endif /* RTC_TAFCR_TAMPFLT */
<> 149:156823d33999 515
<> 149:156823d33999 516 #if defined(RTC_TAFCR_TAMPFREQ)
<> 149:156823d33999 517 /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLING FREQUENCY DIVIDER
<> 149:156823d33999 518 * @{
<> 149:156823d33999 519 */
AnnaBridge 184:08ed48f1de7f 520 #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */
<> 149:156823d33999 521 #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 RTC_TAFCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */
<> 149:156823d33999 522 #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 RTC_TAFCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */
<> 149:156823d33999 523 #define LL_RTC_TAMPER_SAMPLFREQDIV_4096 (RTC_TAFCR_TAMPFREQ_1 | RTC_TAFCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */
<> 149:156823d33999 524 #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 RTC_TAFCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */
<> 149:156823d33999 525 #define LL_RTC_TAMPER_SAMPLFREQDIV_1024 (RTC_TAFCR_TAMPFREQ_2 | RTC_TAFCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */
<> 149:156823d33999 526 #define LL_RTC_TAMPER_SAMPLFREQDIV_512 (RTC_TAFCR_TAMPFREQ_2 | RTC_TAFCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */
<> 149:156823d33999 527 #define LL_RTC_TAMPER_SAMPLFREQDIV_256 RTC_TAFCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */
<> 149:156823d33999 528 /**
<> 149:156823d33999 529 * @}
<> 149:156823d33999 530 */
<> 149:156823d33999 531 #endif /* RTC_TAFCR_TAMPFREQ */
<> 149:156823d33999 532
<> 149:156823d33999 533 /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVE LEVEL
<> 149:156823d33999 534 * @{
<> 149:156823d33999 535 */
<> 149:156823d33999 536 #if defined(RTC_TAMPER1_SUPPORT)
<> 149:156823d33999 537 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 RTC_TAFCR_TAMP1TRG /*!< RTC_TAMP1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
<> 149:156823d33999 538 #endif /* RTC_TAMPER1_SUPPORT */
<> 149:156823d33999 539 #if defined(RTC_TAMPER2_SUPPORT)
<> 149:156823d33999 540 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 RTC_TAFCR_TAMP2TRG /*!< RTC_TAMP2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
<> 149:156823d33999 541 #endif /* RTC_TAMPER2_SUPPORT */
<> 149:156823d33999 542 #if defined(RTC_TAMPER3_SUPPORT)
<> 149:156823d33999 543 #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 RTC_TAFCR_TAMP3TRG /*!< RTC_TAMP3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/
<> 149:156823d33999 544 #endif /* RTC_TAMPER3_SUPPORT */
<> 149:156823d33999 545 /**
<> 149:156823d33999 546 * @}
<> 149:156823d33999 547 */
<> 149:156823d33999 548
<> 149:156823d33999 549 /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUP CLOCK DIV
<> 149:156823d33999 550 * @{
<> 149:156823d33999 551 */
AnnaBridge 184:08ed48f1de7f 552 #define LL_RTC_WAKEUPCLOCK_DIV_16 0x00000000U /*!< RTC/16 clock is selected */
<> 149:156823d33999 553 #define LL_RTC_WAKEUPCLOCK_DIV_8 (RTC_CR_WUCKSEL_0) /*!< RTC/8 clock is selected */
<> 149:156823d33999 554 #define LL_RTC_WAKEUPCLOCK_DIV_4 (RTC_CR_WUCKSEL_1) /*!< RTC/4 clock is selected */
<> 149:156823d33999 555 #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */
<> 149:156823d33999 556 #define LL_RTC_WAKEUPCLOCK_CKSPRE (RTC_CR_WUCKSEL_2) /*!< ck_spre (usually 1 Hz) clock is selected */
<> 149:156823d33999 557 #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*/
<> 149:156823d33999 558 /**
<> 149:156823d33999 559 * @}
<> 149:156823d33999 560 */
<> 149:156823d33999 561
<> 149:156823d33999 562 #if defined(RTC_BACKUP_SUPPORT)
<> 149:156823d33999 563 /** @defgroup RTC_LL_EC_BKP BACKUP
<> 149:156823d33999 564 * @{
<> 149:156823d33999 565 */
AnnaBridge 184:08ed48f1de7f 566 #define LL_RTC_BKP_DR0 0x00000000U
AnnaBridge 184:08ed48f1de7f 567 #define LL_RTC_BKP_DR1 0x00000001U
AnnaBridge 184:08ed48f1de7f 568 #define LL_RTC_BKP_DR2 0x00000002U
AnnaBridge 184:08ed48f1de7f 569 #define LL_RTC_BKP_DR3 0x00000003U
AnnaBridge 184:08ed48f1de7f 570 #define LL_RTC_BKP_DR4 0x00000004U
<> 149:156823d33999 571 #if RTC_BKP_NUMBER > 5
AnnaBridge 184:08ed48f1de7f 572 #define LL_RTC_BKP_DR5 0x00000005U
AnnaBridge 184:08ed48f1de7f 573 #define LL_RTC_BKP_DR6 0x00000006U
AnnaBridge 184:08ed48f1de7f 574 #define LL_RTC_BKP_DR7 0x00000007U
AnnaBridge 184:08ed48f1de7f 575 #define LL_RTC_BKP_DR8 0x00000008U
AnnaBridge 184:08ed48f1de7f 576 #define LL_RTC_BKP_DR9 0x00000009U
AnnaBridge 184:08ed48f1de7f 577 #define LL_RTC_BKP_DR10 0x0000000AU
AnnaBridge 184:08ed48f1de7f 578 #define LL_RTC_BKP_DR11 0x0000000BU
AnnaBridge 184:08ed48f1de7f 579 #define LL_RTC_BKP_DR12 0x0000000CU
AnnaBridge 184:08ed48f1de7f 580 #define LL_RTC_BKP_DR13 0x0000000DU
AnnaBridge 184:08ed48f1de7f 581 #define LL_RTC_BKP_DR14 0x0000000EU
AnnaBridge 184:08ed48f1de7f 582 #define LL_RTC_BKP_DR15 0x0000000FU
<> 149:156823d33999 583 #endif /* RTC_BKP_NUMBER > 5 */
<> 149:156823d33999 584
<> 149:156823d33999 585 #if RTC_BKP_NUMBER > 16
AnnaBridge 184:08ed48f1de7f 586 #define LL_RTC_BKP_DR16 0x00000010U
AnnaBridge 184:08ed48f1de7f 587 #define LL_RTC_BKP_DR17 0x00000011U
AnnaBridge 184:08ed48f1de7f 588 #define LL_RTC_BKP_DR18 0x00000012U
AnnaBridge 184:08ed48f1de7f 589 #define LL_RTC_BKP_DR19 0x00000013U
<> 149:156823d33999 590 #endif /* RTC_BKP_NUMBER > 16 */
<> 149:156823d33999 591
<> 149:156823d33999 592 #if RTC_BKP_NUMBER > 20
AnnaBridge 184:08ed48f1de7f 593 #define LL_RTC_BKP_DR20 0x00000014U
AnnaBridge 184:08ed48f1de7f 594 #define LL_RTC_BKP_DR21 0x00000015U
AnnaBridge 184:08ed48f1de7f 595 #define LL_RTC_BKP_DR22 0x00000016U
AnnaBridge 184:08ed48f1de7f 596 #define LL_RTC_BKP_DR23 0x00000017U
AnnaBridge 184:08ed48f1de7f 597 #define LL_RTC_BKP_DR24 0x00000018U
AnnaBridge 184:08ed48f1de7f 598 #define LL_RTC_BKP_DR25 0x00000019U
AnnaBridge 184:08ed48f1de7f 599 #define LL_RTC_BKP_DR26 0x0000001AU
AnnaBridge 184:08ed48f1de7f 600 #define LL_RTC_BKP_DR27 0x0000001BU
AnnaBridge 184:08ed48f1de7f 601 #define LL_RTC_BKP_DR28 0x0000001CU
AnnaBridge 184:08ed48f1de7f 602 #define LL_RTC_BKP_DR29 0x0000001DU
AnnaBridge 184:08ed48f1de7f 603 #define LL_RTC_BKP_DR30 0x0000001EU
AnnaBridge 184:08ed48f1de7f 604 #define LL_RTC_BKP_DR31 0x0000001FU
<> 149:156823d33999 605 #endif /* RTC_BKP_NUMBER > 20 */
<> 149:156823d33999 606 /**
<> 149:156823d33999 607 * @}
<> 149:156823d33999 608 */
<> 149:156823d33999 609 #endif /* RTC_BACKUP_SUPPORT */
<> 149:156823d33999 610
<> 149:156823d33999 611 /** @defgroup RTC_LL_EC_CALIB_OUTPUT Calibration output
<> 149:156823d33999 612 * @{
<> 149:156823d33999 613 */
AnnaBridge 184:08ed48f1de7f 614 #define LL_RTC_CALIB_OUTPUT_NONE 0x00000000U /*!< Calibration output disabled */
<> 149:156823d33999 615 #if defined(RTC_CR_COSEL)
AnnaBridge 184:08ed48f1de7f 616 #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 1 Hz */
<> 149:156823d33999 617 #endif
AnnaBridge 184:08ed48f1de7f 618 #define LL_RTC_CALIB_OUTPUT_512HZ (RTC_CR_COE) /*!< Calibration output is 512 Hz */
<> 149:156823d33999 619 /**
<> 149:156823d33999 620 * @}
<> 149:156823d33999 621 */
<> 149:156823d33999 622
<> 149:156823d33999 623 /** @defgroup RTC_LL_EC_CALIB_SIGN Coarse digital calibration sign
<> 149:156823d33999 624 * @{
<> 149:156823d33999 625 */
AnnaBridge 184:08ed48f1de7f 626 #define LL_RTC_CALIB_SIGN_POSITIVE 0x00000000U /*!< Positive calibration: calendar update frequency is increased */
<> 149:156823d33999 627 #define LL_RTC_CALIB_SIGN_NEGATIVE RTC_CALIBR_DCS /*!< Negative calibration: calendar update frequency is decreased */
<> 149:156823d33999 628 /**
<> 149:156823d33999 629 * @}
<> 149:156823d33999 630 */
<> 149:156823d33999 631
<> 149:156823d33999 632 /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE Calibration pulse insertion
<> 149:156823d33999 633 * @{
<> 149:156823d33999 634 */
AnnaBridge 184:08ed48f1de7f 635 #define LL_RTC_CALIB_INSERTPULSE_NONE 0x00000000U /*!< No RTCCLK pulses are added */
<> 149:156823d33999 636 #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */
<> 149:156823d33999 637 /**
<> 149:156823d33999 638 * @}
<> 149:156823d33999 639 */
<> 149:156823d33999 640
<> 149:156823d33999 641 /** @defgroup RTC_LL_EC_CALIB_PERIOD Calibration period
<> 149:156823d33999 642 * @{
<> 149:156823d33999 643 */
AnnaBridge 184:08ed48f1de7f 644 #define LL_RTC_CALIB_PERIOD_32SEC 0x00000000U /*!< Use a 32-second calibration cycle period */
<> 149:156823d33999 645 #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */
<> 149:156823d33999 646 #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */
<> 149:156823d33999 647 /**
<> 149:156823d33999 648 * @}
<> 149:156823d33999 649 */
<> 149:156823d33999 650
<> 149:156823d33999 651 /**
<> 149:156823d33999 652 * @}
<> 149:156823d33999 653 */
<> 149:156823d33999 654
<> 149:156823d33999 655 /* Exported macro ------------------------------------------------------------*/
<> 149:156823d33999 656 /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros
<> 149:156823d33999 657 * @{
<> 149:156823d33999 658 */
<> 149:156823d33999 659
<> 149:156823d33999 660 /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros
<> 149:156823d33999 661 * @{
<> 149:156823d33999 662 */
<> 149:156823d33999 663
<> 149:156823d33999 664 /**
<> 149:156823d33999 665 * @brief Write a value in RTC register
<> 149:156823d33999 666 * @param __INSTANCE__ RTC Instance
<> 149:156823d33999 667 * @param __REG__ Register to be written
<> 149:156823d33999 668 * @param __VALUE__ Value to be written in the register
<> 149:156823d33999 669 * @retval None
<> 149:156823d33999 670 */
<> 149:156823d33999 671 #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
<> 149:156823d33999 672
<> 149:156823d33999 673 /**
<> 149:156823d33999 674 * @brief Read a value in RTC register
<> 149:156823d33999 675 * @param __INSTANCE__ RTC Instance
<> 149:156823d33999 676 * @param __REG__ Register to be read
<> 149:156823d33999 677 * @retval Register value
<> 149:156823d33999 678 */
<> 149:156823d33999 679 #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
<> 149:156823d33999 680 /**
<> 149:156823d33999 681 * @}
<> 149:156823d33999 682 */
<> 149:156823d33999 683
<> 149:156823d33999 684 /** @defgroup RTC_LL_EM_Convert Convert helper Macros
<> 149:156823d33999 685 * @{
<> 149:156823d33999 686 */
<> 149:156823d33999 687
<> 149:156823d33999 688 /**
<> 149:156823d33999 689 * @brief Helper macro to convert a value from 2 digit decimal format to BCD format
<> 149:156823d33999 690 * @param __VALUE__ Byte to be converted
<> 149:156823d33999 691 * @retval Converted byte
<> 149:156823d33999 692 */
<> 149:156823d33999 693 #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
<> 149:156823d33999 694
<> 149:156823d33999 695 /**
<> 149:156823d33999 696 * @brief Helper macro to convert a value from BCD format to 2 digit decimal format
<> 149:156823d33999 697 * @param __VALUE__ BCD value to be converted
<> 149:156823d33999 698 * @retval Converted byte
<> 149:156823d33999 699 */
<> 149:156823d33999 700 #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U + ((__VALUE__) & (uint8_t)0x0FU))
<> 149:156823d33999 701
<> 149:156823d33999 702 /**
<> 149:156823d33999 703 * @}
<> 149:156823d33999 704 */
<> 149:156823d33999 705
<> 149:156823d33999 706 /** @defgroup RTC_LL_EM_Date Date helper Macros
<> 149:156823d33999 707 * @{
<> 149:156823d33999 708 */
<> 149:156823d33999 709
<> 149:156823d33999 710 /**
<> 149:156823d33999 711 * @brief Helper macro to retrieve weekday.
<> 149:156823d33999 712 * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function.
<> 149:156823d33999 713 * @retval Returned value can be one of the following values:
<> 149:156823d33999 714 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 715 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 716 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 717 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 718 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 719 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 720 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 721 */
<> 149:156823d33999 722 #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FFU)
<> 149:156823d33999 723
<> 149:156823d33999 724 /**
<> 149:156823d33999 725 * @brief Helper macro to retrieve Year in BCD format
<> 149:156823d33999 726 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
<> 149:156823d33999 727 * @retval Year in BCD format (0x00 . . . 0x99)
<> 149:156823d33999 728 */
<> 149:156823d33999 729 #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FFU)
<> 149:156823d33999 730
<> 149:156823d33999 731 /**
<> 149:156823d33999 732 * @brief Helper macro to retrieve Month in BCD format
<> 149:156823d33999 733 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
<> 149:156823d33999 734 * @retval Returned value can be one of the following values:
<> 149:156823d33999 735 * @arg @ref LL_RTC_MONTH_JANUARY
<> 149:156823d33999 736 * @arg @ref LL_RTC_MONTH_FEBRUARY
<> 149:156823d33999 737 * @arg @ref LL_RTC_MONTH_MARCH
<> 149:156823d33999 738 * @arg @ref LL_RTC_MONTH_APRIL
<> 149:156823d33999 739 * @arg @ref LL_RTC_MONTH_MAY
<> 149:156823d33999 740 * @arg @ref LL_RTC_MONTH_JUNE
<> 149:156823d33999 741 * @arg @ref LL_RTC_MONTH_JULY
<> 149:156823d33999 742 * @arg @ref LL_RTC_MONTH_AUGUST
<> 149:156823d33999 743 * @arg @ref LL_RTC_MONTH_SEPTEMBER
<> 149:156823d33999 744 * @arg @ref LL_RTC_MONTH_OCTOBER
<> 149:156823d33999 745 * @arg @ref LL_RTC_MONTH_NOVEMBER
<> 149:156823d33999 746 * @arg @ref LL_RTC_MONTH_DECEMBER
<> 149:156823d33999 747 */
<> 149:156823d33999 748 #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FFU)
<> 149:156823d33999 749
<> 149:156823d33999 750 /**
<> 149:156823d33999 751 * @brief Helper macro to retrieve Day in BCD format
<> 149:156823d33999 752 * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get
<> 149:156823d33999 753 * @retval Day in BCD format (0x01 . . . 0x31)
<> 149:156823d33999 754 */
<> 149:156823d33999 755 #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FFU)
<> 149:156823d33999 756
<> 149:156823d33999 757 /**
<> 149:156823d33999 758 * @}
<> 149:156823d33999 759 */
<> 149:156823d33999 760
<> 149:156823d33999 761 /** @defgroup RTC_LL_EM_Time Time helper Macros
<> 149:156823d33999 762 * @{
<> 149:156823d33999 763 */
<> 149:156823d33999 764
<> 149:156823d33999 765 /**
<> 149:156823d33999 766 * @brief Helper macro to retrieve hour in BCD format
<> 149:156823d33999 767 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
<> 149:156823d33999 768 * @retval Hours in BCD format (0x01. . .0x12 or between Min_Data=0x00 and Max_Data=0x23)
<> 149:156823d33999 769 */
<> 149:156823d33999 770 #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FFU)
<> 149:156823d33999 771
<> 149:156823d33999 772 /**
<> 149:156823d33999 773 * @brief Helper macro to retrieve minute in BCD format
<> 149:156823d33999 774 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
<> 149:156823d33999 775 * @retval Minutes in BCD format (0x00. . .0x59)
<> 149:156823d33999 776 */
<> 149:156823d33999 777 #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FFU)
<> 149:156823d33999 778
<> 149:156823d33999 779 /**
<> 149:156823d33999 780 * @brief Helper macro to retrieve second in BCD format
<> 149:156823d33999 781 * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function
<> 149:156823d33999 782 * @retval Seconds in format (0x00. . .0x59)
<> 149:156823d33999 783 */
<> 149:156823d33999 784 #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FFU)
<> 149:156823d33999 785
<> 149:156823d33999 786 /**
<> 149:156823d33999 787 * @}
<> 149:156823d33999 788 */
<> 149:156823d33999 789
<> 149:156823d33999 790 /**
<> 149:156823d33999 791 * @}
<> 149:156823d33999 792 */
<> 149:156823d33999 793
<> 149:156823d33999 794 /* Exported functions --------------------------------------------------------*/
<> 149:156823d33999 795 /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
<> 149:156823d33999 796 * @{
<> 149:156823d33999 797 */
<> 149:156823d33999 798
<> 149:156823d33999 799 /** @defgroup RTC_LL_EF_Configuration Configuration
<> 149:156823d33999 800 * @{
<> 149:156823d33999 801 */
<> 149:156823d33999 802
<> 149:156823d33999 803 /**
<> 149:156823d33999 804 * @brief Set Hours format (24 hour/day or AM/PM hour format)
<> 149:156823d33999 805 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 806 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 807 * @rmtoll CR FMT LL_RTC_SetHourFormat
<> 149:156823d33999 808 * @param RTCx RTC Instance
<> 149:156823d33999 809 * @param HourFormat This parameter can be one of the following values:
<> 149:156823d33999 810 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
<> 149:156823d33999 811 * @arg @ref LL_RTC_HOURFORMAT_AMPM
<> 149:156823d33999 812 * @retval None
<> 149:156823d33999 813 */
<> 149:156823d33999 814 __STATIC_INLINE void LL_RTC_SetHourFormat(RTC_TypeDef *RTCx, uint32_t HourFormat)
<> 149:156823d33999 815 {
<> 149:156823d33999 816 MODIFY_REG(RTCx->CR, RTC_CR_FMT, HourFormat);
<> 149:156823d33999 817 }
<> 149:156823d33999 818
<> 149:156823d33999 819 /**
<> 149:156823d33999 820 * @brief Get Hours format (24 hour/day or AM/PM hour format)
<> 149:156823d33999 821 * @rmtoll CR FMT LL_RTC_GetHourFormat
<> 149:156823d33999 822 * @param RTCx RTC Instance
<> 149:156823d33999 823 * @retval Returned value can be one of the following values:
<> 149:156823d33999 824 * @arg @ref LL_RTC_HOURFORMAT_24HOUR
<> 149:156823d33999 825 * @arg @ref LL_RTC_HOURFORMAT_AMPM
<> 149:156823d33999 826 */
<> 149:156823d33999 827 __STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx)
<> 149:156823d33999 828 {
<> 149:156823d33999 829 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_FMT));
<> 149:156823d33999 830 }
<> 149:156823d33999 831
<> 149:156823d33999 832 /**
<> 149:156823d33999 833 * @brief Select the flag to be routed to RTC_ALARM output
<> 149:156823d33999 834 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 835 * @rmtoll CR OSEL LL_RTC_SetAlarmOutEvent
<> 149:156823d33999 836 * @param RTCx RTC Instance
<> 149:156823d33999 837 * @param AlarmOutput This parameter can be one of the following values:
<> 149:156823d33999 838 * @arg @ref LL_RTC_ALARMOUT_DISABLE
<> 149:156823d33999 839 * @arg @ref LL_RTC_ALARMOUT_ALMA
<> 149:156823d33999 840 * @arg @ref LL_RTC_ALARMOUT_ALMB
<> 149:156823d33999 841 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
<> 149:156823d33999 842 * @retval None
<> 149:156823d33999 843 */
<> 149:156823d33999 844 __STATIC_INLINE void LL_RTC_SetAlarmOutEvent(RTC_TypeDef *RTCx, uint32_t AlarmOutput)
<> 149:156823d33999 845 {
<> 149:156823d33999 846 MODIFY_REG(RTCx->CR, RTC_CR_OSEL, AlarmOutput);
<> 149:156823d33999 847 }
<> 149:156823d33999 848
<> 149:156823d33999 849 /**
<> 149:156823d33999 850 * @brief Get the flag to be routed to RTC_ALARM output
<> 149:156823d33999 851 * @rmtoll CR OSEL LL_RTC_GetAlarmOutEvent
<> 149:156823d33999 852 * @param RTCx RTC Instance
<> 149:156823d33999 853 * @retval Returned value can be one of the following values:
<> 149:156823d33999 854 * @arg @ref LL_RTC_ALARMOUT_DISABLE
<> 149:156823d33999 855 * @arg @ref LL_RTC_ALARMOUT_ALMA
<> 149:156823d33999 856 * @arg @ref LL_RTC_ALARMOUT_ALMB
<> 149:156823d33999 857 * @arg @ref LL_RTC_ALARMOUT_WAKEUP
<> 149:156823d33999 858 */
<> 149:156823d33999 859 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef *RTCx)
<> 149:156823d33999 860 {
<> 149:156823d33999 861 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_OSEL));
<> 149:156823d33999 862 }
<> 149:156823d33999 863
<> 149:156823d33999 864 /**
<> 149:156823d33999 865 * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output)
<> 149:156823d33999 866 * @note Used only when RTC_ALARM is mapped on PC13
<> 149:156823d33999 867 * @rmtoll TAFCR ALARMOUTTYPE LL_RTC_SetAlarmOutputType
<> 149:156823d33999 868 * @param RTCx RTC Instance
<> 149:156823d33999 869 * @param Output This parameter can be one of the following values:
<> 149:156823d33999 870 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
<> 149:156823d33999 871 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
<> 149:156823d33999 872 * @retval None
<> 149:156823d33999 873 */
<> 149:156823d33999 874 __STATIC_INLINE void LL_RTC_SetAlarmOutputType(RTC_TypeDef *RTCx, uint32_t Output)
<> 149:156823d33999 875 {
<> 149:156823d33999 876 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_ALARMOUTTYPE, Output);
<> 149:156823d33999 877 }
<> 149:156823d33999 878
<> 149:156823d33999 879 /**
<> 149:156823d33999 880 * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output)
<> 149:156823d33999 881 * @note used only when RTC_ALARM is mapped on PC13
<> 149:156823d33999 882 * @rmtoll TAFCR ALARMOUTTYPE LL_RTC_GetAlarmOutputType
<> 149:156823d33999 883 * @param RTCx RTC Instance
<> 149:156823d33999 884 * @retval Returned value can be one of the following values:
<> 149:156823d33999 885 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN
<> 149:156823d33999 886 * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL
<> 149:156823d33999 887 */
<> 149:156823d33999 888 __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef *RTCx)
<> 149:156823d33999 889 {
<> 149:156823d33999 890 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_ALARMOUTTYPE));
<> 149:156823d33999 891 }
<> 149:156823d33999 892
<> 149:156823d33999 893 /**
<> 149:156823d33999 894 * @brief Enable initialization mode
<> 149:156823d33999 895 * @note Initialization mode is used to program time and date register (RTC_TR and RTC_DR)
<> 149:156823d33999 896 * and prescaler register (RTC_PRER).
<> 149:156823d33999 897 * Counters are stopped and start counting from the new value when INIT is reset.
<> 149:156823d33999 898 * @rmtoll ISR INIT LL_RTC_EnableInitMode
<> 149:156823d33999 899 * @param RTCx RTC Instance
<> 149:156823d33999 900 * @retval None
<> 149:156823d33999 901 */
<> 149:156823d33999 902 __STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx)
<> 149:156823d33999 903 {
<> 149:156823d33999 904 /* Set the Initialization mode */
<> 149:156823d33999 905 WRITE_REG(RTCx->ISR, RTC_INIT_MASK);
<> 149:156823d33999 906 }
<> 149:156823d33999 907
<> 149:156823d33999 908 /**
<> 149:156823d33999 909 * @brief Disable initialization mode (Free running mode)
<> 149:156823d33999 910 * @rmtoll ISR INIT LL_RTC_DisableInitMode
<> 149:156823d33999 911 * @param RTCx RTC Instance
<> 149:156823d33999 912 * @retval None
<> 149:156823d33999 913 */
<> 149:156823d33999 914 __STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
<> 149:156823d33999 915 {
<> 149:156823d33999 916 /* Exit Initialization mode */
<> 149:156823d33999 917 WRITE_REG(RTCx->ISR, (uint32_t)~RTC_ISR_INIT);
<> 149:156823d33999 918 }
<> 149:156823d33999 919
<> 149:156823d33999 920 /**
<> 149:156823d33999 921 * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted)
<> 149:156823d33999 922 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 923 * @rmtoll CR POL LL_RTC_SetOutputPolarity
<> 149:156823d33999 924 * @param RTCx RTC Instance
<> 149:156823d33999 925 * @param Polarity This parameter can be one of the following values:
<> 149:156823d33999 926 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
<> 149:156823d33999 927 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
<> 149:156823d33999 928 * @retval None
<> 149:156823d33999 929 */
<> 149:156823d33999 930 __STATIC_INLINE void LL_RTC_SetOutputPolarity(RTC_TypeDef *RTCx, uint32_t Polarity)
<> 149:156823d33999 931 {
<> 149:156823d33999 932 MODIFY_REG(RTCx->CR, RTC_CR_POL, Polarity);
<> 149:156823d33999 933 }
<> 149:156823d33999 934
<> 149:156823d33999 935 /**
<> 149:156823d33999 936 * @brief Get Output polarity
<> 149:156823d33999 937 * @rmtoll CR POL LL_RTC_GetOutputPolarity
<> 149:156823d33999 938 * @param RTCx RTC Instance
<> 149:156823d33999 939 * @retval Returned value can be one of the following values:
<> 149:156823d33999 940 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH
<> 149:156823d33999 941 * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW
<> 149:156823d33999 942 */
<> 149:156823d33999 943 __STATIC_INLINE uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef *RTCx)
<> 149:156823d33999 944 {
<> 149:156823d33999 945 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_POL));
<> 149:156823d33999 946 }
<> 149:156823d33999 947
<> 149:156823d33999 948 #if defined(RTC_CR_BYPSHAD)
<> 149:156823d33999 949 /**
<> 149:156823d33999 950 * @brief Enable Bypass the shadow registers
<> 149:156823d33999 951 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 952 * @rmtoll CR BYPSHAD LL_RTC_EnableShadowRegBypass
<> 149:156823d33999 953 * @param RTCx RTC Instance
<> 149:156823d33999 954 * @retval None
<> 149:156823d33999 955 */
<> 149:156823d33999 956 __STATIC_INLINE void LL_RTC_EnableShadowRegBypass(RTC_TypeDef *RTCx)
<> 149:156823d33999 957 {
<> 149:156823d33999 958 SET_BIT(RTCx->CR, RTC_CR_BYPSHAD);
<> 149:156823d33999 959 }
<> 149:156823d33999 960
<> 149:156823d33999 961 /**
<> 149:156823d33999 962 * @brief Disable Bypass the shadow registers
<> 149:156823d33999 963 * @rmtoll CR BYPSHAD LL_RTC_DisableShadowRegBypass
<> 149:156823d33999 964 * @param RTCx RTC Instance
<> 149:156823d33999 965 * @retval None
<> 149:156823d33999 966 */
<> 149:156823d33999 967 __STATIC_INLINE void LL_RTC_DisableShadowRegBypass(RTC_TypeDef *RTCx)
<> 149:156823d33999 968 {
<> 149:156823d33999 969 CLEAR_BIT(RTCx->CR, RTC_CR_BYPSHAD);
<> 149:156823d33999 970 }
<> 149:156823d33999 971
<> 149:156823d33999 972 /**
<> 149:156823d33999 973 * @brief Check if Shadow registers bypass is enabled or not.
<> 149:156823d33999 974 * @rmtoll CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled
<> 149:156823d33999 975 * @param RTCx RTC Instance
<> 149:156823d33999 976 * @retval State of bit (1 or 0).
<> 149:156823d33999 977 */
<> 149:156823d33999 978 __STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx)
<> 149:156823d33999 979 {
<> 149:156823d33999 980 return (READ_BIT(RTCx->CR, RTC_CR_BYPSHAD) == (RTC_CR_BYPSHAD));
<> 149:156823d33999 981 }
<> 149:156823d33999 982
<> 149:156823d33999 983 #endif /* RTC_CR_BYPSHAD */
<> 149:156823d33999 984 /**
<> 149:156823d33999 985 * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz)
<> 149:156823d33999 986 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 987 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 988 * @rmtoll CR REFCKON LL_RTC_EnableRefClock
<> 149:156823d33999 989 * @param RTCx RTC Instance
<> 149:156823d33999 990 * @retval None
<> 149:156823d33999 991 */
<> 149:156823d33999 992 __STATIC_INLINE void LL_RTC_EnableRefClock(RTC_TypeDef *RTCx)
<> 149:156823d33999 993 {
<> 149:156823d33999 994 SET_BIT(RTCx->CR, RTC_CR_REFCKON);
<> 149:156823d33999 995 }
<> 149:156823d33999 996
<> 149:156823d33999 997 /**
<> 149:156823d33999 998 * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz)
<> 149:156823d33999 999 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1000 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 1001 * @rmtoll CR REFCKON LL_RTC_DisableRefClock
<> 149:156823d33999 1002 * @param RTCx RTC Instance
<> 149:156823d33999 1003 * @retval None
<> 149:156823d33999 1004 */
<> 149:156823d33999 1005 __STATIC_INLINE void LL_RTC_DisableRefClock(RTC_TypeDef *RTCx)
<> 149:156823d33999 1006 {
<> 149:156823d33999 1007 CLEAR_BIT(RTCx->CR, RTC_CR_REFCKON);
<> 149:156823d33999 1008 }
<> 149:156823d33999 1009
<> 149:156823d33999 1010 /**
<> 149:156823d33999 1011 * @brief Set Asynchronous prescaler factor
<> 149:156823d33999 1012 * @rmtoll PRER PREDIV_A LL_RTC_SetAsynchPrescaler
<> 149:156823d33999 1013 * @param RTCx RTC Instance
<> 149:156823d33999 1014 * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7F
<> 149:156823d33999 1015 * @retval None
<> 149:156823d33999 1016 */
<> 149:156823d33999 1017 __STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler)
<> 149:156823d33999 1018 {
AnnaBridge 184:08ed48f1de7f 1019 MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_A, AsynchPrescaler << RTC_PRER_PREDIV_A_Pos);
<> 149:156823d33999 1020 }
<> 149:156823d33999 1021
<> 149:156823d33999 1022 /**
<> 149:156823d33999 1023 * @brief Set Synchronous prescaler factor
<> 149:156823d33999 1024 * @rmtoll PRER PREDIV_S LL_RTC_SetSynchPrescaler
<> 149:156823d33999 1025 * @param RTCx RTC Instance
<> 149:156823d33999 1026 * @param SynchPrescaler Value between Min_Data = 0 and Max_Data = 0x7FFF
<> 149:156823d33999 1027 * @retval None
<> 149:156823d33999 1028 */
<> 149:156823d33999 1029 __STATIC_INLINE void LL_RTC_SetSynchPrescaler(RTC_TypeDef *RTCx, uint32_t SynchPrescaler)
<> 149:156823d33999 1030 {
<> 149:156823d33999 1031 MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_S, SynchPrescaler);
<> 149:156823d33999 1032 }
<> 149:156823d33999 1033
<> 149:156823d33999 1034 /**
<> 149:156823d33999 1035 * @brief Get Asynchronous prescaler factor
<> 149:156823d33999 1036 * @rmtoll PRER PREDIV_A LL_RTC_GetAsynchPrescaler
<> 149:156823d33999 1037 * @param RTCx RTC Instance
<> 149:156823d33999 1038 * @retval Value between Min_Data = 0 and Max_Data = 0x7F
<> 149:156823d33999 1039 */
<> 149:156823d33999 1040 __STATIC_INLINE uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef *RTCx)
<> 149:156823d33999 1041 {
AnnaBridge 184:08ed48f1de7f 1042 return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_A) >> RTC_PRER_PREDIV_A_Pos);
<> 149:156823d33999 1043 }
<> 149:156823d33999 1044
<> 149:156823d33999 1045 /**
<> 149:156823d33999 1046 * @brief Get Synchronous prescaler factor
<> 149:156823d33999 1047 * @rmtoll PRER PREDIV_S LL_RTC_GetSynchPrescaler
<> 149:156823d33999 1048 * @param RTCx RTC Instance
<> 149:156823d33999 1049 * @retval Value between Min_Data = 0 and Max_Data = 0x7FFF
<> 149:156823d33999 1050 */
<> 149:156823d33999 1051 __STATIC_INLINE uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef *RTCx)
<> 149:156823d33999 1052 {
<> 149:156823d33999 1053 return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_S));
<> 149:156823d33999 1054 }
<> 149:156823d33999 1055
<> 149:156823d33999 1056 /**
<> 149:156823d33999 1057 * @brief Enable the write protection for RTC registers.
<> 149:156823d33999 1058 * @rmtoll WPR KEY LL_RTC_EnableWriteProtection
<> 149:156823d33999 1059 * @param RTCx RTC Instance
<> 149:156823d33999 1060 * @retval None
<> 149:156823d33999 1061 */
<> 149:156823d33999 1062 __STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
<> 149:156823d33999 1063 {
<> 149:156823d33999 1064 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_DISABLE);
<> 149:156823d33999 1065 }
<> 149:156823d33999 1066
<> 149:156823d33999 1067 /**
<> 149:156823d33999 1068 * @brief Disable the write protection for RTC registers.
<> 149:156823d33999 1069 * @rmtoll WPR KEY LL_RTC_DisableWriteProtection
<> 149:156823d33999 1070 * @param RTCx RTC Instance
<> 149:156823d33999 1071 * @retval None
<> 149:156823d33999 1072 */
<> 149:156823d33999 1073 __STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
<> 149:156823d33999 1074 {
<> 149:156823d33999 1075 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_1);
<> 149:156823d33999 1076 WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_2);
<> 149:156823d33999 1077 }
<> 149:156823d33999 1078
<> 149:156823d33999 1079 /**
<> 149:156823d33999 1080 * @}
<> 149:156823d33999 1081 */
<> 149:156823d33999 1082
<> 149:156823d33999 1083 /** @defgroup RTC_LL_EF_Time Time
<> 149:156823d33999 1084 * @{
<> 149:156823d33999 1085 */
<> 149:156823d33999 1086
<> 149:156823d33999 1087 /**
<> 149:156823d33999 1088 * @brief Set time format (AM/24-hour or PM notation)
<> 149:156823d33999 1089 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1090 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 1091 * @rmtoll TR PM LL_RTC_TIME_SetFormat
<> 149:156823d33999 1092 * @param RTCx RTC Instance
<> 149:156823d33999 1093 * @param TimeFormat This parameter can be one of the following values:
<> 149:156823d33999 1094 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
<> 149:156823d33999 1095 * @arg @ref LL_RTC_TIME_FORMAT_PM
<> 149:156823d33999 1096 * @retval None
<> 149:156823d33999 1097 */
<> 149:156823d33999 1098 __STATIC_INLINE void LL_RTC_TIME_SetFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
<> 149:156823d33999 1099 {
<> 149:156823d33999 1100 MODIFY_REG(RTCx->TR, RTC_TR_PM, TimeFormat);
<> 149:156823d33999 1101 }
<> 149:156823d33999 1102
<> 149:156823d33999 1103 /**
<> 149:156823d33999 1104 * @brief Get time format (AM or PM notation)
<> 149:156823d33999 1105 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1106 * before reading this bit
<> 149:156823d33999 1107 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
<> 149:156823d33999 1108 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
<> 149:156823d33999 1109 * @rmtoll TR PM LL_RTC_TIME_GetFormat
<> 149:156823d33999 1110 * @param RTCx RTC Instance
<> 149:156823d33999 1111 * @retval Returned value can be one of the following values:
<> 149:156823d33999 1112 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
<> 149:156823d33999 1113 * @arg @ref LL_RTC_TIME_FORMAT_PM
<> 149:156823d33999 1114 */
<> 149:156823d33999 1115 __STATIC_INLINE uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef *RTCx)
<> 149:156823d33999 1116 {
<> 149:156823d33999 1117 return (uint32_t)(READ_BIT(RTCx->TR, RTC_TR_PM));
<> 149:156823d33999 1118 }
<> 149:156823d33999 1119
<> 149:156823d33999 1120 /**
<> 149:156823d33999 1121 * @brief Set Hours in BCD format
<> 149:156823d33999 1122 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1123 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 1124 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format
<> 149:156823d33999 1125 * @rmtoll TR HT LL_RTC_TIME_SetHour\n
<> 149:156823d33999 1126 * TR HU LL_RTC_TIME_SetHour
<> 149:156823d33999 1127 * @param RTCx RTC Instance
<> 149:156823d33999 1128 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 1129 * @retval None
<> 149:156823d33999 1130 */
<> 149:156823d33999 1131 __STATIC_INLINE void LL_RTC_TIME_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
<> 149:156823d33999 1132 {
<> 149:156823d33999 1133 MODIFY_REG(RTCx->TR, (RTC_TR_HT | RTC_TR_HU),
AnnaBridge 184:08ed48f1de7f 1134 (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos)));
<> 149:156823d33999 1135 }
<> 149:156823d33999 1136
<> 149:156823d33999 1137 /**
<> 149:156823d33999 1138 * @brief Get Hours in BCD format
<> 149:156823d33999 1139 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1140 * before reading this bit
<> 149:156823d33999 1141 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
<> 149:156823d33999 1142 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
<> 149:156823d33999 1143 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to
<> 149:156823d33999 1144 * Binary format
<> 149:156823d33999 1145 * @rmtoll TR HT LL_RTC_TIME_GetHour\n
<> 149:156823d33999 1146 * TR HU LL_RTC_TIME_GetHour
<> 149:156823d33999 1147 * @param RTCx RTC Instance
<> 149:156823d33999 1148 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 1149 */
<> 149:156823d33999 1150 __STATIC_INLINE uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef *RTCx)
<> 149:156823d33999 1151 {
<> 149:156823d33999 1152 register uint32_t temp = 0U;
<> 149:156823d33999 1153
<> 149:156823d33999 1154 temp = READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU));
AnnaBridge 184:08ed48f1de7f 1155 return (uint32_t)((((temp & RTC_TR_HT) >> RTC_TR_HT_Pos) << 4U) | ((temp & RTC_TR_HU) >> RTC_TR_HU_Pos));
<> 149:156823d33999 1156 }
<> 149:156823d33999 1157
<> 149:156823d33999 1158 /**
<> 149:156823d33999 1159 * @brief Set Minutes in BCD format
<> 149:156823d33999 1160 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1161 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 1162 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
<> 149:156823d33999 1163 * @rmtoll TR MNT LL_RTC_TIME_SetMinute\n
<> 149:156823d33999 1164 * TR MNU LL_RTC_TIME_SetMinute
<> 149:156823d33999 1165 * @param RTCx RTC Instance
<> 149:156823d33999 1166 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1167 * @retval None
<> 149:156823d33999 1168 */
<> 149:156823d33999 1169 __STATIC_INLINE void LL_RTC_TIME_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
<> 149:156823d33999 1170 {
<> 149:156823d33999 1171 MODIFY_REG(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU),
AnnaBridge 184:08ed48f1de7f 1172 (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)));
<> 149:156823d33999 1173 }
<> 149:156823d33999 1174
<> 149:156823d33999 1175 /**
<> 149:156823d33999 1176 * @brief Get Minutes in BCD format
<> 149:156823d33999 1177 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1178 * before reading this bit
<> 149:156823d33999 1179 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
<> 149:156823d33999 1180 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
<> 149:156823d33999 1181 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD
<> 149:156823d33999 1182 * to Binary format
<> 149:156823d33999 1183 * @rmtoll TR MNT LL_RTC_TIME_GetMinute\n
<> 149:156823d33999 1184 * TR MNU LL_RTC_TIME_GetMinute
<> 149:156823d33999 1185 * @param RTCx RTC Instance
<> 149:156823d33999 1186 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1187 */
<> 149:156823d33999 1188 __STATIC_INLINE uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef *RTCx)
<> 149:156823d33999 1189 {
<> 149:156823d33999 1190 register uint32_t temp = 0U;
<> 149:156823d33999 1191
<> 149:156823d33999 1192 temp = READ_BIT(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU));
AnnaBridge 184:08ed48f1de7f 1193 return (uint32_t)((((temp & RTC_TR_MNT) >> RTC_TR_MNT_Pos) << 4U) | ((temp & RTC_TR_MNU) >> RTC_TR_MNU_Pos));
<> 149:156823d33999 1194 }
<> 149:156823d33999 1195
<> 149:156823d33999 1196 /**
<> 149:156823d33999 1197 * @brief Set Seconds in BCD format
<> 149:156823d33999 1198 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1199 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 1200 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
<> 149:156823d33999 1201 * @rmtoll TR ST LL_RTC_TIME_SetSecond\n
<> 149:156823d33999 1202 * TR SU LL_RTC_TIME_SetSecond
<> 149:156823d33999 1203 * @param RTCx RTC Instance
<> 149:156823d33999 1204 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1205 * @retval None
<> 149:156823d33999 1206 */
<> 149:156823d33999 1207 __STATIC_INLINE void LL_RTC_TIME_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
<> 149:156823d33999 1208 {
<> 149:156823d33999 1209 MODIFY_REG(RTCx->TR, (RTC_TR_ST | RTC_TR_SU),
AnnaBridge 184:08ed48f1de7f 1210 (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos)));
<> 149:156823d33999 1211 }
<> 149:156823d33999 1212
<> 149:156823d33999 1213 /**
<> 149:156823d33999 1214 * @brief Get Seconds in BCD format
<> 149:156823d33999 1215 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1216 * before reading this bit
<> 149:156823d33999 1217 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
<> 149:156823d33999 1218 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
<> 149:156823d33999 1219 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD
<> 149:156823d33999 1220 * to Binary format
<> 149:156823d33999 1221 * @rmtoll TR ST LL_RTC_TIME_GetSecond\n
<> 149:156823d33999 1222 * TR SU LL_RTC_TIME_GetSecond
<> 149:156823d33999 1223 * @param RTCx RTC Instance
<> 149:156823d33999 1224 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1225 */
<> 149:156823d33999 1226 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 1227 {
<> 149:156823d33999 1228 register uint32_t temp = 0U;
<> 149:156823d33999 1229
<> 149:156823d33999 1230 temp = READ_BIT(RTCx->TR, (RTC_TR_ST | RTC_TR_SU));
AnnaBridge 184:08ed48f1de7f 1231 return (uint32_t)((((temp & RTC_TR_ST) >> RTC_TR_ST_Pos) << 4U) | ((temp & RTC_TR_SU) >> RTC_TR_SU_Pos));
<> 149:156823d33999 1232 }
<> 149:156823d33999 1233
<> 149:156823d33999 1234 /**
<> 149:156823d33999 1235 * @brief Set time (hour, minute and second) in BCD format
<> 149:156823d33999 1236 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1237 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 1238 * @note TimeFormat and Hours should follow the same format
<> 149:156823d33999 1239 * @rmtoll TR PM LL_RTC_TIME_Config\n
<> 149:156823d33999 1240 * TR HT LL_RTC_TIME_Config\n
<> 149:156823d33999 1241 * TR HU LL_RTC_TIME_Config\n
<> 149:156823d33999 1242 * TR MNT LL_RTC_TIME_Config\n
<> 149:156823d33999 1243 * TR MNU LL_RTC_TIME_Config\n
<> 149:156823d33999 1244 * TR ST LL_RTC_TIME_Config\n
<> 149:156823d33999 1245 * TR SU LL_RTC_TIME_Config
<> 149:156823d33999 1246 * @param RTCx RTC Instance
<> 149:156823d33999 1247 * @param Format12_24 This parameter can be one of the following values:
<> 149:156823d33999 1248 * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24
<> 149:156823d33999 1249 * @arg @ref LL_RTC_TIME_FORMAT_PM
<> 149:156823d33999 1250 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 1251 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1252 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1253 * @retval None
<> 149:156823d33999 1254 */
<> 149:156823d33999 1255 __STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
<> 149:156823d33999 1256 {
<> 149:156823d33999 1257 register uint32_t temp = 0U;
<> 149:156823d33999 1258
<> 149:156823d33999 1259 temp = Format12_24 | \
AnnaBridge 184:08ed48f1de7f 1260 (((Hours & 0xF0U) << (RTC_TR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_TR_HU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 1261 (((Minutes & 0xF0U) << (RTC_TR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_TR_MNU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 1262 (((Seconds & 0xF0U) << (RTC_TR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_TR_SU_Pos));
<> 149:156823d33999 1263 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);
<> 149:156823d33999 1264 }
<> 149:156823d33999 1265
<> 149:156823d33999 1266 /**
<> 149:156823d33999 1267 * @brief Get time (hour, minute and second) in BCD format
<> 149:156823d33999 1268 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1269 * before reading this bit
<> 149:156823d33999 1270 * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar
<> 149:156823d33999 1271 * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
<> 149:156823d33999 1272 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
<> 149:156823d33999 1273 * are available to get independently each parameter.
<> 149:156823d33999 1274 * @rmtoll TR HT LL_RTC_TIME_Get\n
<> 149:156823d33999 1275 * TR HU LL_RTC_TIME_Get\n
<> 149:156823d33999 1276 * TR MNT LL_RTC_TIME_Get\n
<> 149:156823d33999 1277 * TR MNU LL_RTC_TIME_Get\n
<> 149:156823d33999 1278 * TR ST LL_RTC_TIME_Get\n
<> 149:156823d33999 1279 * TR SU LL_RTC_TIME_Get
<> 149:156823d33999 1280 * @param RTCx RTC Instance
<> 149:156823d33999 1281 * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
<> 149:156823d33999 1282 */
<> 149:156823d33999 1283 __STATIC_INLINE uint32_t LL_RTC_TIME_Get(RTC_TypeDef *RTCx)
<> 149:156823d33999 1284 {
<> 149:156823d33999 1285 return (uint32_t)((LL_RTC_TIME_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_TIME_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_TIME_GetSecond(RTCx));
<> 149:156823d33999 1286 }
<> 149:156823d33999 1287
<> 149:156823d33999 1288 /**
<> 149:156823d33999 1289 * @brief Memorize whether the daylight saving time change has been performed
<> 149:156823d33999 1290 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
AnnaBridge 184:08ed48f1de7f 1291 * @rmtoll CR BKP LL_RTC_TIME_EnableDayLightStore
<> 149:156823d33999 1292 * @param RTCx RTC Instance
<> 149:156823d33999 1293 * @retval None
<> 149:156823d33999 1294 */
<> 149:156823d33999 1295 __STATIC_INLINE void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef *RTCx)
<> 149:156823d33999 1296 {
AnnaBridge 184:08ed48f1de7f 1297 SET_BIT(RTCx->CR, RTC_CR_BKP);
<> 149:156823d33999 1298 }
<> 149:156823d33999 1299
<> 149:156823d33999 1300 /**
<> 149:156823d33999 1301 * @brief Disable memorization whether the daylight saving time change has been performed.
<> 149:156823d33999 1302 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
AnnaBridge 184:08ed48f1de7f 1303 * @rmtoll CR BKP LL_RTC_TIME_DisableDayLightStore
<> 149:156823d33999 1304 * @param RTCx RTC Instance
<> 149:156823d33999 1305 * @retval None
<> 149:156823d33999 1306 */
<> 149:156823d33999 1307 __STATIC_INLINE void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef *RTCx)
<> 149:156823d33999 1308 {
AnnaBridge 184:08ed48f1de7f 1309 CLEAR_BIT(RTCx->CR, RTC_CR_BKP);
<> 149:156823d33999 1310 }
<> 149:156823d33999 1311
<> 149:156823d33999 1312 /**
<> 149:156823d33999 1313 * @brief Check if RTC Day Light Saving stored operation has been enabled or not
AnnaBridge 184:08ed48f1de7f 1314 * @rmtoll CR BKP LL_RTC_TIME_IsDayLightStoreEnabled
<> 149:156823d33999 1315 * @param RTCx RTC Instance
<> 149:156823d33999 1316 * @retval State of bit (1 or 0).
<> 149:156823d33999 1317 */
<> 149:156823d33999 1318 __STATIC_INLINE uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef *RTCx)
<> 149:156823d33999 1319 {
AnnaBridge 184:08ed48f1de7f 1320 return (READ_BIT(RTCx->CR, RTC_CR_BKP) == (RTC_CR_BKP));
<> 149:156823d33999 1321 }
<> 149:156823d33999 1322
<> 149:156823d33999 1323 /**
<> 149:156823d33999 1324 * @brief Subtract 1 hour (winter time change)
<> 149:156823d33999 1325 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1326 * @rmtoll CR SUB1H LL_RTC_TIME_DecHour
<> 149:156823d33999 1327 * @param RTCx RTC Instance
<> 149:156823d33999 1328 * @retval None
<> 149:156823d33999 1329 */
<> 149:156823d33999 1330 __STATIC_INLINE void LL_RTC_TIME_DecHour(RTC_TypeDef *RTCx)
<> 149:156823d33999 1331 {
<> 149:156823d33999 1332 SET_BIT(RTCx->CR, RTC_CR_SUB1H);
<> 149:156823d33999 1333 }
<> 149:156823d33999 1334
<> 149:156823d33999 1335 /**
<> 149:156823d33999 1336 * @brief Add 1 hour (summer time change)
<> 149:156823d33999 1337 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1338 * @rmtoll CR ADD1H LL_RTC_TIME_IncHour
<> 149:156823d33999 1339 * @param RTCx RTC Instance
<> 149:156823d33999 1340 * @retval None
<> 149:156823d33999 1341 */
<> 149:156823d33999 1342 __STATIC_INLINE void LL_RTC_TIME_IncHour(RTC_TypeDef *RTCx)
<> 149:156823d33999 1343 {
<> 149:156823d33999 1344 SET_BIT(RTCx->CR, RTC_CR_ADD1H);
<> 149:156823d33999 1345 }
<> 149:156823d33999 1346
<> 149:156823d33999 1347 #if defined(RTC_SUBSECOND_SUPPORT)
<> 149:156823d33999 1348 /**
<> 149:156823d33999 1349 * @brief Get Sub second value in the synchronous prescaler counter.
<> 149:156823d33999 1350 * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through
<> 149:156823d33999 1351 * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar
<> 149:156823d33999 1352 * SubSeconds value in second fraction ratio with time unit following
<> 149:156823d33999 1353 * generic formula:
<> 149:156823d33999 1354 * ==> Seconds fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit
<> 149:156823d33999 1355 * This conversion can be performed only if no shift operation is pending
<> 149:156823d33999 1356 * (ie. SHFP=0) when PREDIV_S >= SS.
<> 149:156823d33999 1357 * @rmtoll SSR SS LL_RTC_TIME_GetSubSecond
<> 149:156823d33999 1358 * @param RTCx RTC Instance
<> 149:156823d33999 1359 * @retval Sub second value (number between 0 and 65535)
<> 149:156823d33999 1360 */
<> 149:156823d33999 1361 __STATIC_INLINE uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 1362 {
<> 149:156823d33999 1363 return (uint32_t)(READ_BIT(RTCx->SSR, RTC_SSR_SS));
<> 149:156823d33999 1364 }
<> 149:156823d33999 1365 #endif /* RTC_SUBSECOND_SUPPORT */
<> 149:156823d33999 1366
<> 149:156823d33999 1367 #if defined(RTC_SHIFTR_ADD1S)
<> 149:156823d33999 1368 /**
<> 149:156823d33999 1369 * @brief Synchronize to a remote clock with a high degree of precision.
<> 149:156823d33999 1370 * @note This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
<> 149:156823d33999 1371 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1372 * @note When REFCKON is set, firmware must not write to Shift control register.
<> 149:156823d33999 1373 * @rmtoll SHIFTR ADD1S LL_RTC_TIME_Synchronize\n
<> 149:156823d33999 1374 * SHIFTR SUBFS LL_RTC_TIME_Synchronize
<> 149:156823d33999 1375 * @param RTCx RTC Instance
<> 149:156823d33999 1376 * @param ShiftSecond This parameter can be one of the following values:
<> 149:156823d33999 1377 * @arg @ref LL_RTC_SHIFT_SECOND_DELAY
<> 149:156823d33999 1378 * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE
<> 149:156823d33999 1379 * @param Fraction Number of Seconds Fractions (any value from 0 to 0x7FFF)
<> 149:156823d33999 1380 * @retval None
<> 149:156823d33999 1381 */
<> 149:156823d33999 1382 __STATIC_INLINE void LL_RTC_TIME_Synchronize(RTC_TypeDef *RTCx, uint32_t ShiftSecond, uint32_t Fraction)
<> 149:156823d33999 1383 {
<> 149:156823d33999 1384 WRITE_REG(RTCx->SHIFTR, ShiftSecond | Fraction);
<> 149:156823d33999 1385 }
<> 149:156823d33999 1386 #endif /* RTC_SHIFTR_ADD1S */
<> 149:156823d33999 1387
<> 149:156823d33999 1388 /**
<> 149:156823d33999 1389 * @}
<> 149:156823d33999 1390 */
<> 149:156823d33999 1391
<> 149:156823d33999 1392 /** @defgroup RTC_LL_EF_Date Date
<> 149:156823d33999 1393 * @{
<> 149:156823d33999 1394 */
<> 149:156823d33999 1395
<> 149:156823d33999 1396 /**
<> 149:156823d33999 1397 * @brief Set Year in BCD format
<> 149:156823d33999 1398 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format
<> 149:156823d33999 1399 * @rmtoll DR YT LL_RTC_DATE_SetYear\n
<> 149:156823d33999 1400 * DR YU LL_RTC_DATE_SetYear
<> 149:156823d33999 1401 * @param RTCx RTC Instance
<> 149:156823d33999 1402 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
<> 149:156823d33999 1403 * @retval None
<> 149:156823d33999 1404 */
<> 149:156823d33999 1405 __STATIC_INLINE void LL_RTC_DATE_SetYear(RTC_TypeDef *RTCx, uint32_t Year)
<> 149:156823d33999 1406 {
<> 149:156823d33999 1407 MODIFY_REG(RTCx->DR, (RTC_DR_YT | RTC_DR_YU),
AnnaBridge 184:08ed48f1de7f 1408 (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos)));
<> 149:156823d33999 1409 }
<> 149:156823d33999 1410
<> 149:156823d33999 1411 /**
<> 149:156823d33999 1412 * @brief Get Year in BCD format
<> 149:156823d33999 1413 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1414 * before reading this bit
<> 149:156823d33999 1415 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format
<> 149:156823d33999 1416 * @rmtoll DR YT LL_RTC_DATE_GetYear\n
<> 149:156823d33999 1417 * DR YU LL_RTC_DATE_GetYear
<> 149:156823d33999 1418 * @param RTCx RTC Instance
<> 149:156823d33999 1419 * @retval Value between Min_Data=0x00 and Max_Data=0x99
<> 149:156823d33999 1420 */
<> 149:156823d33999 1421 __STATIC_INLINE uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef *RTCx)
<> 149:156823d33999 1422 {
<> 149:156823d33999 1423 register uint32_t temp = 0U;
<> 149:156823d33999 1424
<> 149:156823d33999 1425 temp = READ_BIT(RTCx->DR, (RTC_DR_YT | RTC_DR_YU));
AnnaBridge 184:08ed48f1de7f 1426 return (uint32_t)((((temp & RTC_DR_YT) >> RTC_DR_YT_Pos) << 4U) | ((temp & RTC_DR_YU) >> RTC_DR_YU_Pos));
<> 149:156823d33999 1427 }
<> 149:156823d33999 1428
<> 149:156823d33999 1429 /**
<> 149:156823d33999 1430 * @brief Set Week day
<> 149:156823d33999 1431 * @rmtoll DR WDU LL_RTC_DATE_SetWeekDay
<> 149:156823d33999 1432 * @param RTCx RTC Instance
<> 149:156823d33999 1433 * @param WeekDay This parameter can be one of the following values:
<> 149:156823d33999 1434 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 1435 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 1436 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 1437 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 1438 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 1439 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 1440 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 1441 * @retval None
<> 149:156823d33999 1442 */
<> 149:156823d33999 1443 __STATIC_INLINE void LL_RTC_DATE_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
<> 149:156823d33999 1444 {
AnnaBridge 184:08ed48f1de7f 1445 MODIFY_REG(RTCx->DR, RTC_DR_WDU, WeekDay << RTC_DR_WDU_Pos);
<> 149:156823d33999 1446 }
<> 149:156823d33999 1447
<> 149:156823d33999 1448 /**
<> 149:156823d33999 1449 * @brief Get Week day
<> 149:156823d33999 1450 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1451 * before reading this bit
<> 149:156823d33999 1452 * @rmtoll DR WDU LL_RTC_DATE_GetWeekDay
<> 149:156823d33999 1453 * @param RTCx RTC Instance
<> 149:156823d33999 1454 * @retval Returned value can be one of the following values:
<> 149:156823d33999 1455 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 1456 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 1457 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 1458 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 1459 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 1460 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 1461 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 1462 */
<> 149:156823d33999 1463 __STATIC_INLINE uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 1464 {
AnnaBridge 184:08ed48f1de7f 1465 return (uint32_t)(READ_BIT(RTCx->DR, RTC_DR_WDU) >> RTC_DR_WDU_Pos);
<> 149:156823d33999 1466 }
<> 149:156823d33999 1467
<> 149:156823d33999 1468 /**
<> 149:156823d33999 1469 * @brief Set Month in BCD format
<> 149:156823d33999 1470 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format
<> 149:156823d33999 1471 * @rmtoll DR MT LL_RTC_DATE_SetMonth\n
<> 149:156823d33999 1472 * DR MU LL_RTC_DATE_SetMonth
<> 149:156823d33999 1473 * @param RTCx RTC Instance
<> 149:156823d33999 1474 * @param Month This parameter can be one of the following values:
<> 149:156823d33999 1475 * @arg @ref LL_RTC_MONTH_JANUARY
<> 149:156823d33999 1476 * @arg @ref LL_RTC_MONTH_FEBRUARY
<> 149:156823d33999 1477 * @arg @ref LL_RTC_MONTH_MARCH
<> 149:156823d33999 1478 * @arg @ref LL_RTC_MONTH_APRIL
<> 149:156823d33999 1479 * @arg @ref LL_RTC_MONTH_MAY
<> 149:156823d33999 1480 * @arg @ref LL_RTC_MONTH_JUNE
<> 149:156823d33999 1481 * @arg @ref LL_RTC_MONTH_JULY
<> 149:156823d33999 1482 * @arg @ref LL_RTC_MONTH_AUGUST
<> 149:156823d33999 1483 * @arg @ref LL_RTC_MONTH_SEPTEMBER
<> 149:156823d33999 1484 * @arg @ref LL_RTC_MONTH_OCTOBER
<> 149:156823d33999 1485 * @arg @ref LL_RTC_MONTH_NOVEMBER
<> 149:156823d33999 1486 * @arg @ref LL_RTC_MONTH_DECEMBER
<> 149:156823d33999 1487 * @retval None
<> 149:156823d33999 1488 */
<> 149:156823d33999 1489 __STATIC_INLINE void LL_RTC_DATE_SetMonth(RTC_TypeDef *RTCx, uint32_t Month)
<> 149:156823d33999 1490 {
<> 149:156823d33999 1491 MODIFY_REG(RTCx->DR, (RTC_DR_MT | RTC_DR_MU),
AnnaBridge 184:08ed48f1de7f 1492 (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)));
<> 149:156823d33999 1493 }
<> 149:156823d33999 1494
<> 149:156823d33999 1495 /**
<> 149:156823d33999 1496 * @brief Get Month in BCD format
<> 149:156823d33999 1497 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1498 * before reading this bit
<> 149:156823d33999 1499 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
<> 149:156823d33999 1500 * @rmtoll DR MT LL_RTC_DATE_GetMonth\n
<> 149:156823d33999 1501 * DR MU LL_RTC_DATE_GetMonth
<> 149:156823d33999 1502 * @param RTCx RTC Instance
<> 149:156823d33999 1503 * @retval Returned value can be one of the following values:
<> 149:156823d33999 1504 * @arg @ref LL_RTC_MONTH_JANUARY
<> 149:156823d33999 1505 * @arg @ref LL_RTC_MONTH_FEBRUARY
<> 149:156823d33999 1506 * @arg @ref LL_RTC_MONTH_MARCH
<> 149:156823d33999 1507 * @arg @ref LL_RTC_MONTH_APRIL
<> 149:156823d33999 1508 * @arg @ref LL_RTC_MONTH_MAY
<> 149:156823d33999 1509 * @arg @ref LL_RTC_MONTH_JUNE
<> 149:156823d33999 1510 * @arg @ref LL_RTC_MONTH_JULY
<> 149:156823d33999 1511 * @arg @ref LL_RTC_MONTH_AUGUST
<> 149:156823d33999 1512 * @arg @ref LL_RTC_MONTH_SEPTEMBER
<> 149:156823d33999 1513 * @arg @ref LL_RTC_MONTH_OCTOBER
<> 149:156823d33999 1514 * @arg @ref LL_RTC_MONTH_NOVEMBER
<> 149:156823d33999 1515 * @arg @ref LL_RTC_MONTH_DECEMBER
<> 149:156823d33999 1516 */
<> 149:156823d33999 1517 __STATIC_INLINE uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef *RTCx)
<> 149:156823d33999 1518 {
<> 149:156823d33999 1519 register uint32_t temp = 0U;
<> 149:156823d33999 1520
<> 149:156823d33999 1521 temp = READ_BIT(RTCx->DR, (RTC_DR_MT | RTC_DR_MU));
AnnaBridge 184:08ed48f1de7f 1522 return (uint32_t)((((temp & RTC_DR_MT) >> RTC_DR_MT_Pos) << 4U) | ((temp & RTC_DR_MU) >> RTC_DR_MU_Pos));
<> 149:156823d33999 1523 }
<> 149:156823d33999 1524
<> 149:156823d33999 1525 /**
<> 149:156823d33999 1526 * @brief Set Day in BCD format
<> 149:156823d33999 1527 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
<> 149:156823d33999 1528 * @rmtoll DR DT LL_RTC_DATE_SetDay\n
<> 149:156823d33999 1529 * DR DU LL_RTC_DATE_SetDay
<> 149:156823d33999 1530 * @param RTCx RTC Instance
<> 149:156823d33999 1531 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 1532 * @retval None
<> 149:156823d33999 1533 */
<> 149:156823d33999 1534 __STATIC_INLINE void LL_RTC_DATE_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
<> 149:156823d33999 1535 {
<> 149:156823d33999 1536 MODIFY_REG(RTCx->DR, (RTC_DR_DT | RTC_DR_DU),
AnnaBridge 184:08ed48f1de7f 1537 (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos)));
<> 149:156823d33999 1538 }
<> 149:156823d33999 1539
<> 149:156823d33999 1540 /**
<> 149:156823d33999 1541 * @brief Get Day in BCD format
<> 149:156823d33999 1542 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1543 * before reading this bit
<> 149:156823d33999 1544 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
<> 149:156823d33999 1545 * @rmtoll DR DT LL_RTC_DATE_GetDay\n
<> 149:156823d33999 1546 * DR DU LL_RTC_DATE_GetDay
<> 149:156823d33999 1547 * @param RTCx RTC Instance
<> 149:156823d33999 1548 * @retval Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 1549 */
<> 149:156823d33999 1550 __STATIC_INLINE uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 1551 {
<> 149:156823d33999 1552 register uint32_t temp = 0U;
<> 149:156823d33999 1553
<> 149:156823d33999 1554 temp = READ_BIT(RTCx->DR, (RTC_DR_DT | RTC_DR_DU));
AnnaBridge 184:08ed48f1de7f 1555 return (uint32_t)((((temp & RTC_DR_DT) >> RTC_DR_DT_Pos) << 4U) | ((temp & RTC_DR_DU) >> RTC_DR_DU_Pos));
<> 149:156823d33999 1556 }
<> 149:156823d33999 1557
<> 149:156823d33999 1558 /**
<> 149:156823d33999 1559 * @brief Set date (WeekDay, Day, Month and Year) in BCD format
<> 149:156823d33999 1560 * @rmtoll DR WDU LL_RTC_DATE_Config\n
<> 149:156823d33999 1561 * DR MT LL_RTC_DATE_Config\n
<> 149:156823d33999 1562 * DR MU LL_RTC_DATE_Config\n
<> 149:156823d33999 1563 * DR DT LL_RTC_DATE_Config\n
<> 149:156823d33999 1564 * DR DU LL_RTC_DATE_Config\n
<> 149:156823d33999 1565 * DR YT LL_RTC_DATE_Config\n
<> 149:156823d33999 1566 * DR YU LL_RTC_DATE_Config
<> 149:156823d33999 1567 * @param RTCx RTC Instance
<> 149:156823d33999 1568 * @param WeekDay This parameter can be one of the following values:
<> 149:156823d33999 1569 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 1570 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 1571 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 1572 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 1573 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 1574 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 1575 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 1576 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 1577 * @param Month This parameter can be one of the following values:
<> 149:156823d33999 1578 * @arg @ref LL_RTC_MONTH_JANUARY
<> 149:156823d33999 1579 * @arg @ref LL_RTC_MONTH_FEBRUARY
<> 149:156823d33999 1580 * @arg @ref LL_RTC_MONTH_MARCH
<> 149:156823d33999 1581 * @arg @ref LL_RTC_MONTH_APRIL
<> 149:156823d33999 1582 * @arg @ref LL_RTC_MONTH_MAY
<> 149:156823d33999 1583 * @arg @ref LL_RTC_MONTH_JUNE
<> 149:156823d33999 1584 * @arg @ref LL_RTC_MONTH_JULY
<> 149:156823d33999 1585 * @arg @ref LL_RTC_MONTH_AUGUST
<> 149:156823d33999 1586 * @arg @ref LL_RTC_MONTH_SEPTEMBER
<> 149:156823d33999 1587 * @arg @ref LL_RTC_MONTH_OCTOBER
<> 149:156823d33999 1588 * @arg @ref LL_RTC_MONTH_NOVEMBER
<> 149:156823d33999 1589 * @arg @ref LL_RTC_MONTH_DECEMBER
<> 149:156823d33999 1590 * @param Year Value between Min_Data=0x00 and Max_Data=0x99
<> 149:156823d33999 1591 * @retval None
<> 149:156823d33999 1592 */
<> 149:156823d33999 1593 __STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uint32_t Day, uint32_t Month, uint32_t Year)
<> 149:156823d33999 1594 {
<> 149:156823d33999 1595 register uint32_t temp = 0U;
<> 149:156823d33999 1596
AnnaBridge 184:08ed48f1de7f 1597 temp = (WeekDay << RTC_DR_WDU_Pos) | \
AnnaBridge 184:08ed48f1de7f 1598 (((Year & 0xF0U) << (RTC_DR_YT_Pos - 4U)) | ((Year & 0x0FU) << RTC_DR_YU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 1599 (((Month & 0xF0U) << (RTC_DR_MT_Pos - 4U)) | ((Month & 0x0FU) << RTC_DR_MU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 1600 (((Day & 0xF0U) << (RTC_DR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_DR_DU_Pos));
<> 149:156823d33999 1601
<> 149:156823d33999 1602 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);
<> 149:156823d33999 1603 }
<> 149:156823d33999 1604
<> 149:156823d33999 1605 /**
<> 149:156823d33999 1606 * @brief Get date (WeekDay, Day, Month and Year) in BCD format
<> 149:156823d33999 1607 * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set
<> 149:156823d33999 1608 * before reading this bit
<> 149:156823d33999 1609 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH,
<> 149:156823d33999 1610 * and __LL_RTC_GET_DAY are available to get independently each parameter.
<> 149:156823d33999 1611 * @rmtoll DR WDU LL_RTC_DATE_Get\n
<> 149:156823d33999 1612 * DR MT LL_RTC_DATE_Get\n
<> 149:156823d33999 1613 * DR MU LL_RTC_DATE_Get\n
<> 149:156823d33999 1614 * DR DT LL_RTC_DATE_Get\n
<> 149:156823d33999 1615 * DR DU LL_RTC_DATE_Get\n
<> 149:156823d33999 1616 * DR YT LL_RTC_DATE_Get\n
<> 149:156823d33999 1617 * DR YU LL_RTC_DATE_Get
<> 149:156823d33999 1618 * @param RTCx RTC Instance
<> 149:156823d33999 1619 * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY).
<> 149:156823d33999 1620 */
<> 149:156823d33999 1621 __STATIC_INLINE uint32_t LL_RTC_DATE_Get(RTC_TypeDef *RTCx)
<> 149:156823d33999 1622 {
<> 149:156823d33999 1623 return (uint32_t)((LL_RTC_DATE_GetWeekDay(RTCx) << RTC_OFFSET_WEEKDAY) | (LL_RTC_DATE_GetDay(RTCx) << RTC_OFFSET_DAY) | (LL_RTC_DATE_GetMonth(RTCx) << RTC_OFFSET_MONTH) | LL_RTC_DATE_GetYear(RTCx));
<> 149:156823d33999 1624 }
<> 149:156823d33999 1625
<> 149:156823d33999 1626 /**
<> 149:156823d33999 1627 * @}
<> 149:156823d33999 1628 */
<> 149:156823d33999 1629
<> 149:156823d33999 1630 /** @defgroup RTC_LL_EF_ALARMA ALARMA
<> 149:156823d33999 1631 * @{
<> 149:156823d33999 1632 */
<> 149:156823d33999 1633
<> 149:156823d33999 1634 /**
<> 149:156823d33999 1635 * @brief Enable Alarm A
<> 149:156823d33999 1636 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1637 * @rmtoll CR ALRAE LL_RTC_ALMA_Enable
<> 149:156823d33999 1638 * @param RTCx RTC Instance
<> 149:156823d33999 1639 * @retval None
<> 149:156823d33999 1640 */
<> 149:156823d33999 1641 __STATIC_INLINE void LL_RTC_ALMA_Enable(RTC_TypeDef *RTCx)
<> 149:156823d33999 1642 {
<> 149:156823d33999 1643 SET_BIT(RTCx->CR, RTC_CR_ALRAE);
<> 149:156823d33999 1644 }
<> 149:156823d33999 1645
<> 149:156823d33999 1646 /**
<> 149:156823d33999 1647 * @brief Disable Alarm A
<> 149:156823d33999 1648 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 1649 * @rmtoll CR ALRAE LL_RTC_ALMA_Disable
<> 149:156823d33999 1650 * @param RTCx RTC Instance
<> 149:156823d33999 1651 * @retval None
<> 149:156823d33999 1652 */
<> 149:156823d33999 1653 __STATIC_INLINE void LL_RTC_ALMA_Disable(RTC_TypeDef *RTCx)
<> 149:156823d33999 1654 {
<> 149:156823d33999 1655 CLEAR_BIT(RTCx->CR, RTC_CR_ALRAE);
<> 149:156823d33999 1656 }
<> 149:156823d33999 1657
<> 149:156823d33999 1658 /**
<> 149:156823d33999 1659 * @brief Specify the Alarm A masks.
<> 149:156823d33999 1660 * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_SetMask\n
<> 149:156823d33999 1661 * ALRMAR MSK3 LL_RTC_ALMA_SetMask\n
<> 149:156823d33999 1662 * ALRMAR MSK2 LL_RTC_ALMA_SetMask\n
<> 149:156823d33999 1663 * ALRMAR MSK1 LL_RTC_ALMA_SetMask
<> 149:156823d33999 1664 * @param RTCx RTC Instance
<> 149:156823d33999 1665 * @param Mask This parameter can be a combination of the following values:
<> 149:156823d33999 1666 * @arg @ref LL_RTC_ALMA_MASK_NONE
<> 149:156823d33999 1667 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
<> 149:156823d33999 1668 * @arg @ref LL_RTC_ALMA_MASK_HOURS
<> 149:156823d33999 1669 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
<> 149:156823d33999 1670 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
<> 149:156823d33999 1671 * @arg @ref LL_RTC_ALMA_MASK_ALL
<> 149:156823d33999 1672 * @retval None
<> 149:156823d33999 1673 */
<> 149:156823d33999 1674 __STATIC_INLINE void LL_RTC_ALMA_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
<> 149:156823d33999 1675 {
<> 149:156823d33999 1676 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1, Mask);
<> 149:156823d33999 1677 }
<> 149:156823d33999 1678
<> 149:156823d33999 1679 /**
<> 149:156823d33999 1680 * @brief Get the Alarm A masks.
<> 149:156823d33999 1681 * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_GetMask\n
<> 149:156823d33999 1682 * ALRMAR MSK3 LL_RTC_ALMA_GetMask\n
<> 149:156823d33999 1683 * ALRMAR MSK2 LL_RTC_ALMA_GetMask\n
<> 149:156823d33999 1684 * ALRMAR MSK1 LL_RTC_ALMA_GetMask
<> 149:156823d33999 1685 * @param RTCx RTC Instance
<> 149:156823d33999 1686 * @retval Returned value can be can be a combination of the following values:
<> 149:156823d33999 1687 * @arg @ref LL_RTC_ALMA_MASK_NONE
<> 149:156823d33999 1688 * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY
<> 149:156823d33999 1689 * @arg @ref LL_RTC_ALMA_MASK_HOURS
<> 149:156823d33999 1690 * @arg @ref LL_RTC_ALMA_MASK_MINUTES
<> 149:156823d33999 1691 * @arg @ref LL_RTC_ALMA_MASK_SECONDS
<> 149:156823d33999 1692 * @arg @ref LL_RTC_ALMA_MASK_ALL
<> 149:156823d33999 1693 */
<> 149:156823d33999 1694 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef *RTCx)
<> 149:156823d33999 1695 {
<> 149:156823d33999 1696 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1));
<> 149:156823d33999 1697 }
<> 149:156823d33999 1698
<> 149:156823d33999 1699 /**
<> 149:156823d33999 1700 * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
<> 149:156823d33999 1701 * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday
<> 149:156823d33999 1702 * @param RTCx RTC Instance
<> 149:156823d33999 1703 * @retval None
<> 149:156823d33999 1704 */
<> 149:156823d33999 1705 __STATIC_INLINE void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef *RTCx)
<> 149:156823d33999 1706 {
<> 149:156823d33999 1707 SET_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL);
<> 149:156823d33999 1708 }
<> 149:156823d33999 1709
<> 149:156823d33999 1710 /**
<> 149:156823d33999 1711 * @brief Disable AlarmA Week day selection (DU[3:0] represents the date )
<> 149:156823d33999 1712 * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday
<> 149:156823d33999 1713 * @param RTCx RTC Instance
<> 149:156823d33999 1714 * @retval None
<> 149:156823d33999 1715 */
<> 149:156823d33999 1716 __STATIC_INLINE void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef *RTCx)
<> 149:156823d33999 1717 {
<> 149:156823d33999 1718 CLEAR_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL);
<> 149:156823d33999 1719 }
<> 149:156823d33999 1720
<> 149:156823d33999 1721 /**
<> 149:156823d33999 1722 * @brief Set ALARM A Day in BCD format
<> 149:156823d33999 1723 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
<> 149:156823d33999 1724 * @rmtoll ALRMAR DT LL_RTC_ALMA_SetDay\n
<> 149:156823d33999 1725 * ALRMAR DU LL_RTC_ALMA_SetDay
<> 149:156823d33999 1726 * @param RTCx RTC Instance
<> 149:156823d33999 1727 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 1728 * @retval None
<> 149:156823d33999 1729 */
<> 149:156823d33999 1730 __STATIC_INLINE void LL_RTC_ALMA_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
<> 149:156823d33999 1731 {
<> 149:156823d33999 1732 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU),
AnnaBridge 184:08ed48f1de7f 1733 (((Day & 0xF0U) << (RTC_ALRMAR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMAR_DU_Pos)));
<> 149:156823d33999 1734 }
<> 149:156823d33999 1735
<> 149:156823d33999 1736 /**
<> 149:156823d33999 1737 * @brief Get ALARM A Day in BCD format
<> 149:156823d33999 1738 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
<> 149:156823d33999 1739 * @rmtoll ALRMAR DT LL_RTC_ALMA_GetDay\n
<> 149:156823d33999 1740 * ALRMAR DU LL_RTC_ALMA_GetDay
<> 149:156823d33999 1741 * @param RTCx RTC Instance
<> 149:156823d33999 1742 * @retval Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 1743 */
<> 149:156823d33999 1744 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 1745 {
<> 149:156823d33999 1746 register uint32_t temp = 0U;
<> 149:156823d33999 1747
<> 149:156823d33999 1748 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU));
AnnaBridge 184:08ed48f1de7f 1749 return (uint32_t)((((temp & RTC_ALRMAR_DT) >> RTC_ALRMAR_DT_Pos) << 4U) | ((temp & RTC_ALRMAR_DU) >> RTC_ALRMAR_DU_Pos));
<> 149:156823d33999 1750 }
<> 149:156823d33999 1751
<> 149:156823d33999 1752 /**
<> 149:156823d33999 1753 * @brief Set ALARM A Weekday
<> 149:156823d33999 1754 * @rmtoll ALRMAR DU LL_RTC_ALMA_SetWeekDay
<> 149:156823d33999 1755 * @param RTCx RTC Instance
<> 149:156823d33999 1756 * @param WeekDay This parameter can be one of the following values:
<> 149:156823d33999 1757 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 1758 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 1759 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 1760 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 1761 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 1762 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 1763 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 1764 * @retval None
<> 149:156823d33999 1765 */
<> 149:156823d33999 1766 __STATIC_INLINE void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
<> 149:156823d33999 1767 {
AnnaBridge 184:08ed48f1de7f 1768 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_DU, WeekDay << RTC_ALRMAR_DU_Pos);
<> 149:156823d33999 1769 }
<> 149:156823d33999 1770
<> 149:156823d33999 1771 /**
<> 149:156823d33999 1772 * @brief Get ALARM A Weekday
<> 149:156823d33999 1773 * @rmtoll ALRMAR DU LL_RTC_ALMA_GetWeekDay
<> 149:156823d33999 1774 * @param RTCx RTC Instance
<> 149:156823d33999 1775 * @retval Returned value can be one of the following values:
<> 149:156823d33999 1776 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 1777 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 1778 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 1779 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 1780 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 1781 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 1782 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 1783 */
<> 149:156823d33999 1784 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 1785 {
AnnaBridge 184:08ed48f1de7f 1786 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_DU) >> RTC_ALRMAR_DU_Pos);
<> 149:156823d33999 1787 }
<> 149:156823d33999 1788
<> 149:156823d33999 1789 /**
<> 149:156823d33999 1790 * @brief Set Alarm A time format (AM/24-hour or PM notation)
<> 149:156823d33999 1791 * @rmtoll ALRMAR PM LL_RTC_ALMA_SetTimeFormat
<> 149:156823d33999 1792 * @param RTCx RTC Instance
<> 149:156823d33999 1793 * @param TimeFormat This parameter can be one of the following values:
<> 149:156823d33999 1794 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
<> 149:156823d33999 1795 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
<> 149:156823d33999 1796 * @retval None
<> 149:156823d33999 1797 */
<> 149:156823d33999 1798 __STATIC_INLINE void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
<> 149:156823d33999 1799 {
<> 149:156823d33999 1800 MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM, TimeFormat);
<> 149:156823d33999 1801 }
<> 149:156823d33999 1802
<> 149:156823d33999 1803 /**
<> 149:156823d33999 1804 * @brief Get Alarm A time format (AM or PM notation)
<> 149:156823d33999 1805 * @rmtoll ALRMAR PM LL_RTC_ALMA_GetTimeFormat
<> 149:156823d33999 1806 * @param RTCx RTC Instance
<> 149:156823d33999 1807 * @retval Returned value can be one of the following values:
<> 149:156823d33999 1808 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
<> 149:156823d33999 1809 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
<> 149:156823d33999 1810 */
<> 149:156823d33999 1811 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef *RTCx)
<> 149:156823d33999 1812 {
<> 149:156823d33999 1813 return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_PM));
<> 149:156823d33999 1814 }
<> 149:156823d33999 1815
<> 149:156823d33999 1816 /**
<> 149:156823d33999 1817 * @brief Set ALARM A Hours in BCD format
<> 149:156823d33999 1818 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
<> 149:156823d33999 1819 * @rmtoll ALRMAR HT LL_RTC_ALMA_SetHour\n
<> 149:156823d33999 1820 * ALRMAR HU LL_RTC_ALMA_SetHour
<> 149:156823d33999 1821 * @param RTCx RTC Instance
<> 149:156823d33999 1822 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 1823 * @retval None
<> 149:156823d33999 1824 */
<> 149:156823d33999 1825 __STATIC_INLINE void LL_RTC_ALMA_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
<> 149:156823d33999 1826 {
<> 149:156823d33999 1827 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU),
AnnaBridge 184:08ed48f1de7f 1828 (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos)));
<> 149:156823d33999 1829 }
<> 149:156823d33999 1830
<> 149:156823d33999 1831 /**
<> 149:156823d33999 1832 * @brief Get ALARM A Hours in BCD format
<> 149:156823d33999 1833 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
<> 149:156823d33999 1834 * @rmtoll ALRMAR HT LL_RTC_ALMA_GetHour\n
<> 149:156823d33999 1835 * ALRMAR HU LL_RTC_ALMA_GetHour
<> 149:156823d33999 1836 * @param RTCx RTC Instance
<> 149:156823d33999 1837 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 1838 */
<> 149:156823d33999 1839 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef *RTCx)
<> 149:156823d33999 1840 {
<> 149:156823d33999 1841 register uint32_t temp = 0U;
<> 149:156823d33999 1842
<> 149:156823d33999 1843 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU));
AnnaBridge 184:08ed48f1de7f 1844 return (uint32_t)((((temp & RTC_ALRMAR_HT) >> RTC_ALRMAR_HT_Pos) << 4U) | ((temp & RTC_ALRMAR_HU) >> RTC_ALRMAR_HU_Pos));
<> 149:156823d33999 1845 }
<> 149:156823d33999 1846
<> 149:156823d33999 1847 /**
<> 149:156823d33999 1848 * @brief Set ALARM A Minutes in BCD format
<> 149:156823d33999 1849 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
<> 149:156823d33999 1850 * @rmtoll ALRMAR MNT LL_RTC_ALMA_SetMinute\n
<> 149:156823d33999 1851 * ALRMAR MNU LL_RTC_ALMA_SetMinute
<> 149:156823d33999 1852 * @param RTCx RTC Instance
<> 149:156823d33999 1853 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1854 * @retval None
<> 149:156823d33999 1855 */
<> 149:156823d33999 1856 __STATIC_INLINE void LL_RTC_ALMA_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
<> 149:156823d33999 1857 {
<> 149:156823d33999 1858 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU),
AnnaBridge 184:08ed48f1de7f 1859 (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)));
<> 149:156823d33999 1860 }
<> 149:156823d33999 1861
<> 149:156823d33999 1862 /**
<> 149:156823d33999 1863 * @brief Get ALARM A Minutes in BCD format
<> 149:156823d33999 1864 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
<> 149:156823d33999 1865 * @rmtoll ALRMAR MNT LL_RTC_ALMA_GetMinute\n
<> 149:156823d33999 1866 * ALRMAR MNU LL_RTC_ALMA_GetMinute
<> 149:156823d33999 1867 * @param RTCx RTC Instance
<> 149:156823d33999 1868 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1869 */
<> 149:156823d33999 1870 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef *RTCx)
<> 149:156823d33999 1871 {
<> 149:156823d33999 1872 register uint32_t temp = 0U;
<> 149:156823d33999 1873
<> 149:156823d33999 1874 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU));
AnnaBridge 184:08ed48f1de7f 1875 return (uint32_t)((((temp & RTC_ALRMAR_MNT) >> RTC_ALRMAR_MNT_Pos) << 4U) | ((temp & RTC_ALRMAR_MNU) >> RTC_ALRMAR_MNU_Pos));
<> 149:156823d33999 1876 }
<> 149:156823d33999 1877
<> 149:156823d33999 1878 /**
<> 149:156823d33999 1879 * @brief Set ALARM A Seconds in BCD format
<> 149:156823d33999 1880 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
<> 149:156823d33999 1881 * @rmtoll ALRMAR ST LL_RTC_ALMA_SetSecond\n
<> 149:156823d33999 1882 * ALRMAR SU LL_RTC_ALMA_SetSecond
<> 149:156823d33999 1883 * @param RTCx RTC Instance
<> 149:156823d33999 1884 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1885 * @retval None
<> 149:156823d33999 1886 */
<> 149:156823d33999 1887 __STATIC_INLINE void LL_RTC_ALMA_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
<> 149:156823d33999 1888 {
<> 149:156823d33999 1889 MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU),
AnnaBridge 184:08ed48f1de7f 1890 (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos)));
<> 149:156823d33999 1891 }
<> 149:156823d33999 1892
<> 149:156823d33999 1893 /**
<> 149:156823d33999 1894 * @brief Get ALARM A Seconds in BCD format
<> 149:156823d33999 1895 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
<> 149:156823d33999 1896 * @rmtoll ALRMAR ST LL_RTC_ALMA_GetSecond\n
<> 149:156823d33999 1897 * ALRMAR SU LL_RTC_ALMA_GetSecond
<> 149:156823d33999 1898 * @param RTCx RTC Instance
<> 149:156823d33999 1899 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1900 */
<> 149:156823d33999 1901 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 1902 {
<> 149:156823d33999 1903 register uint32_t temp = 0U;
<> 149:156823d33999 1904
<> 149:156823d33999 1905 temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU));
AnnaBridge 184:08ed48f1de7f 1906 return (uint32_t)((((temp & RTC_ALRMAR_ST) >> RTC_ALRMAR_ST_Pos) << 4U) | ((temp & RTC_ALRMAR_SU) >> RTC_ALRMAR_SU_Pos));
<> 149:156823d33999 1907 }
<> 149:156823d33999 1908
<> 149:156823d33999 1909 /**
<> 149:156823d33999 1910 * @brief Set Alarm A Time (hour, minute and second) in BCD format
<> 149:156823d33999 1911 * @rmtoll ALRMAR PM LL_RTC_ALMA_ConfigTime\n
<> 149:156823d33999 1912 * ALRMAR HT LL_RTC_ALMA_ConfigTime\n
<> 149:156823d33999 1913 * ALRMAR HU LL_RTC_ALMA_ConfigTime\n
<> 149:156823d33999 1914 * ALRMAR MNT LL_RTC_ALMA_ConfigTime\n
<> 149:156823d33999 1915 * ALRMAR MNU LL_RTC_ALMA_ConfigTime\n
<> 149:156823d33999 1916 * ALRMAR ST LL_RTC_ALMA_ConfigTime\n
<> 149:156823d33999 1917 * ALRMAR SU LL_RTC_ALMA_ConfigTime
<> 149:156823d33999 1918 * @param RTCx RTC Instance
<> 149:156823d33999 1919 * @param Format12_24 This parameter can be one of the following values:
<> 149:156823d33999 1920 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM
<> 149:156823d33999 1921 * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM
<> 149:156823d33999 1922 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 1923 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1924 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 1925 * @retval None
<> 149:156823d33999 1926 */
<> 149:156823d33999 1927 __STATIC_INLINE void LL_RTC_ALMA_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
<> 149:156823d33999 1928 {
<> 149:156823d33999 1929 register uint32_t temp = 0U;
<> 149:156823d33999 1930
AnnaBridge 184:08ed48f1de7f 1931 temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMAR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMAR_HU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 1932 (((Minutes & 0xF0U) << (RTC_ALRMAR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMAR_MNU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 1933 (((Seconds & 0xF0U) << (RTC_ALRMAR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMAR_SU_Pos));
<> 149:156823d33999 1934
<> 149:156823d33999 1935 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);
<> 149:156823d33999 1936 }
<> 149:156823d33999 1937
<> 149:156823d33999 1938 /**
<> 149:156823d33999 1939 * @brief Get Alarm B Time (hour, minute and second) in BCD format
<> 149:156823d33999 1940 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
<> 149:156823d33999 1941 * are available to get independently each parameter.
<> 149:156823d33999 1942 * @rmtoll ALRMAR HT LL_RTC_ALMA_GetTime\n
<> 149:156823d33999 1943 * ALRMAR HU LL_RTC_ALMA_GetTime\n
<> 149:156823d33999 1944 * ALRMAR MNT LL_RTC_ALMA_GetTime\n
<> 149:156823d33999 1945 * ALRMAR MNU LL_RTC_ALMA_GetTime\n
<> 149:156823d33999 1946 * ALRMAR ST LL_RTC_ALMA_GetTime\n
<> 149:156823d33999 1947 * ALRMAR SU LL_RTC_ALMA_GetTime
<> 149:156823d33999 1948 * @param RTCx RTC Instance
<> 149:156823d33999 1949 * @retval Combination of hours, minutes and seconds.
<> 149:156823d33999 1950 */
<> 149:156823d33999 1951 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef *RTCx)
<> 149:156823d33999 1952 {
<> 149:156823d33999 1953 return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMA_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMA_GetSecond(RTCx));
<> 149:156823d33999 1954 }
<> 149:156823d33999 1955
<> 149:156823d33999 1956 #if defined(RTC_SUBSECOND_SUPPORT)
<> 149:156823d33999 1957 /**
<> 149:156823d33999 1958 * @brief Set Alarm A Mask the most-significant bits starting at this bit
<> 149:156823d33999 1959 * @note This register can be written only when ALRAE is reset in RTC_CR register,
<> 149:156823d33999 1960 * or in initialization mode.
<> 149:156823d33999 1961 * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask
<> 149:156823d33999 1962 * @param RTCx RTC Instance
<> 149:156823d33999 1963 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
<> 149:156823d33999 1964 * @retval None
<> 149:156823d33999 1965 */
<> 149:156823d33999 1966 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask)
<> 149:156823d33999 1967 {
AnnaBridge 184:08ed48f1de7f 1968 MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS, Mask << RTC_ALRMASSR_MASKSS_Pos);
<> 149:156823d33999 1969 }
<> 149:156823d33999 1970
<> 149:156823d33999 1971 /**
<> 149:156823d33999 1972 * @brief Get Alarm A Mask the most-significant bits starting at this bit
<> 149:156823d33999 1973 * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask
<> 149:156823d33999 1974 * @param RTCx RTC Instance
<> 149:156823d33999 1975 * @retval Value between Min_Data=0x00 and Max_Data=0xF
<> 149:156823d33999 1976 */
<> 149:156823d33999 1977 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef *RTCx)
<> 149:156823d33999 1978 {
AnnaBridge 184:08ed48f1de7f 1979 return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS) >> RTC_ALRMASSR_MASKSS_Pos);
<> 149:156823d33999 1980 }
<> 149:156823d33999 1981
<> 149:156823d33999 1982 /**
<> 149:156823d33999 1983 * @brief Set Alarm A Sub seconds value
<> 149:156823d33999 1984 * @rmtoll ALRMASSR SS LL_RTC_ALMA_SetSubSecond
<> 149:156823d33999 1985 * @param RTCx RTC Instance
<> 149:156823d33999 1986 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
<> 149:156823d33999 1987 * @retval None
<> 149:156823d33999 1988 */
<> 149:156823d33999 1989 __STATIC_INLINE void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond)
<> 149:156823d33999 1990 {
<> 149:156823d33999 1991 MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_SS, Subsecond);
<> 149:156823d33999 1992 }
<> 149:156823d33999 1993
<> 149:156823d33999 1994 /**
<> 149:156823d33999 1995 * @brief Get Alarm A Sub seconds value
<> 149:156823d33999 1996 * @rmtoll ALRMASSR SS LL_RTC_ALMA_GetSubSecond
<> 149:156823d33999 1997 * @param RTCx RTC Instance
<> 149:156823d33999 1998 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
<> 149:156823d33999 1999 */
<> 149:156823d33999 2000 __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 2001 {
<> 149:156823d33999 2002 return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_SS));
<> 149:156823d33999 2003 }
<> 149:156823d33999 2004 #endif /* RTC_SUBSECOND_SUPPORT */
<> 149:156823d33999 2005
<> 149:156823d33999 2006 /**
<> 149:156823d33999 2007 * @}
<> 149:156823d33999 2008 */
<> 149:156823d33999 2009
<> 149:156823d33999 2010 /** @defgroup RTC_LL_EF_ALARMB ALARMB
<> 149:156823d33999 2011 * @{
<> 149:156823d33999 2012 */
<> 149:156823d33999 2013
<> 149:156823d33999 2014 /**
<> 149:156823d33999 2015 * @brief Enable Alarm B
<> 149:156823d33999 2016 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2017 * @rmtoll CR ALRBE LL_RTC_ALMB_Enable
<> 149:156823d33999 2018 * @param RTCx RTC Instance
<> 149:156823d33999 2019 * @retval None
<> 149:156823d33999 2020 */
<> 149:156823d33999 2021 __STATIC_INLINE void LL_RTC_ALMB_Enable(RTC_TypeDef *RTCx)
<> 149:156823d33999 2022 {
<> 149:156823d33999 2023 SET_BIT(RTCx->CR, RTC_CR_ALRBE);
<> 149:156823d33999 2024 }
<> 149:156823d33999 2025
<> 149:156823d33999 2026 /**
<> 149:156823d33999 2027 * @brief Disable Alarm B
<> 149:156823d33999 2028 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2029 * @rmtoll CR ALRBE LL_RTC_ALMB_Disable
<> 149:156823d33999 2030 * @param RTCx RTC Instance
<> 149:156823d33999 2031 * @retval None
<> 149:156823d33999 2032 */
<> 149:156823d33999 2033 __STATIC_INLINE void LL_RTC_ALMB_Disable(RTC_TypeDef *RTCx)
<> 149:156823d33999 2034 {
<> 149:156823d33999 2035 CLEAR_BIT(RTCx->CR, RTC_CR_ALRBE);
<> 149:156823d33999 2036 }
<> 149:156823d33999 2037
<> 149:156823d33999 2038 /**
<> 149:156823d33999 2039 * @brief Specify the Alarm B masks.
<> 149:156823d33999 2040 * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_SetMask\n
<> 149:156823d33999 2041 * ALRMBR MSK3 LL_RTC_ALMB_SetMask\n
<> 149:156823d33999 2042 * ALRMBR MSK2 LL_RTC_ALMB_SetMask\n
<> 149:156823d33999 2043 * ALRMBR MSK1 LL_RTC_ALMB_SetMask
<> 149:156823d33999 2044 * @param RTCx RTC Instance
<> 149:156823d33999 2045 * @param Mask This parameter can be a combination of the following values:
<> 149:156823d33999 2046 * @arg @ref LL_RTC_ALMB_MASK_NONE
<> 149:156823d33999 2047 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
<> 149:156823d33999 2048 * @arg @ref LL_RTC_ALMB_MASK_HOURS
<> 149:156823d33999 2049 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
<> 149:156823d33999 2050 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
<> 149:156823d33999 2051 * @arg @ref LL_RTC_ALMB_MASK_ALL
<> 149:156823d33999 2052 * @retval None
<> 149:156823d33999 2053 */
<> 149:156823d33999 2054 __STATIC_INLINE void LL_RTC_ALMB_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
<> 149:156823d33999 2055 {
<> 149:156823d33999 2056 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1, Mask);
<> 149:156823d33999 2057 }
<> 149:156823d33999 2058
<> 149:156823d33999 2059 /**
<> 149:156823d33999 2060 * @brief Get the Alarm B masks.
<> 149:156823d33999 2061 * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_GetMask\n
<> 149:156823d33999 2062 * ALRMBR MSK3 LL_RTC_ALMB_GetMask\n
<> 149:156823d33999 2063 * ALRMBR MSK2 LL_RTC_ALMB_GetMask\n
<> 149:156823d33999 2064 * ALRMBR MSK1 LL_RTC_ALMB_GetMask
<> 149:156823d33999 2065 * @param RTCx RTC Instance
<> 149:156823d33999 2066 * @retval Returned value can be can be a combination of the following values:
<> 149:156823d33999 2067 * @arg @ref LL_RTC_ALMB_MASK_NONE
<> 149:156823d33999 2068 * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY
<> 149:156823d33999 2069 * @arg @ref LL_RTC_ALMB_MASK_HOURS
<> 149:156823d33999 2070 * @arg @ref LL_RTC_ALMB_MASK_MINUTES
<> 149:156823d33999 2071 * @arg @ref LL_RTC_ALMB_MASK_SECONDS
<> 149:156823d33999 2072 * @arg @ref LL_RTC_ALMB_MASK_ALL
<> 149:156823d33999 2073 */
<> 149:156823d33999 2074 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef *RTCx)
<> 149:156823d33999 2075 {
<> 149:156823d33999 2076 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1));
<> 149:156823d33999 2077 }
<> 149:156823d33999 2078
<> 149:156823d33999 2079 /**
<> 149:156823d33999 2080 * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care)
<> 149:156823d33999 2081 * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday
<> 149:156823d33999 2082 * @param RTCx RTC Instance
<> 149:156823d33999 2083 * @retval None
<> 149:156823d33999 2084 */
<> 149:156823d33999 2085 __STATIC_INLINE void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef *RTCx)
<> 149:156823d33999 2086 {
<> 149:156823d33999 2087 SET_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL);
<> 149:156823d33999 2088 }
<> 149:156823d33999 2089
<> 149:156823d33999 2090 /**
<> 149:156823d33999 2091 * @brief Disable AlarmB Week day selection (DU[3:0] represents the date )
<> 149:156823d33999 2092 * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday
<> 149:156823d33999 2093 * @param RTCx RTC Instance
<> 149:156823d33999 2094 * @retval None
<> 149:156823d33999 2095 */
<> 149:156823d33999 2096 __STATIC_INLINE void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef *RTCx)
<> 149:156823d33999 2097 {
<> 149:156823d33999 2098 CLEAR_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL);
<> 149:156823d33999 2099 }
<> 149:156823d33999 2100
<> 149:156823d33999 2101 /**
<> 149:156823d33999 2102 * @brief Set ALARM B Day in BCD format
<> 149:156823d33999 2103 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format
<> 149:156823d33999 2104 * @rmtoll ALRMBR DT LL_RTC_ALMB_SetDay\n
<> 149:156823d33999 2105 * ALRMBR DU LL_RTC_ALMB_SetDay
<> 149:156823d33999 2106 * @param RTCx RTC Instance
<> 149:156823d33999 2107 * @param Day Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 2108 * @retval None
<> 149:156823d33999 2109 */
<> 149:156823d33999 2110 __STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
<> 149:156823d33999 2111 {
<> 149:156823d33999 2112 MODIFY_REG(RTC->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU),
AnnaBridge 184:08ed48f1de7f 2113 (((Day & 0xF0U) << (RTC_ALRMBR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMBR_DU_Pos)));
<> 149:156823d33999 2114 }
<> 149:156823d33999 2115
<> 149:156823d33999 2116 /**
<> 149:156823d33999 2117 * @brief Get ALARM B Day in BCD format
<> 149:156823d33999 2118 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
<> 149:156823d33999 2119 * @rmtoll ALRMBR DT LL_RTC_ALMB_GetDay\n
<> 149:156823d33999 2120 * ALRMBR DU LL_RTC_ALMB_GetDay
<> 149:156823d33999 2121 * @param RTCx RTC Instance
<> 149:156823d33999 2122 * @retval Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 2123 */
<> 149:156823d33999 2124 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 2125 {
<> 149:156823d33999 2126 register uint32_t temp = 0U;
<> 149:156823d33999 2127
<> 149:156823d33999 2128 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU));
AnnaBridge 184:08ed48f1de7f 2129 return (uint32_t)((((temp & RTC_ALRMBR_DT) >> RTC_ALRMBR_DT_Pos) << 4U) | ((temp & RTC_ALRMBR_DU) >> RTC_ALRMBR_DU_Pos));
<> 149:156823d33999 2130 }
<> 149:156823d33999 2131
<> 149:156823d33999 2132 /**
<> 149:156823d33999 2133 * @brief Set ALARM B Weekday
<> 149:156823d33999 2134 * @rmtoll ALRMBR DU LL_RTC_ALMB_SetWeekDay
<> 149:156823d33999 2135 * @param RTCx RTC Instance
<> 149:156823d33999 2136 * @param WeekDay This parameter can be one of the following values:
<> 149:156823d33999 2137 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 2138 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 2139 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 2140 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 2141 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 2142 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 2143 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 2144 * @retval None
<> 149:156823d33999 2145 */
<> 149:156823d33999 2146 __STATIC_INLINE void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
<> 149:156823d33999 2147 {
AnnaBridge 184:08ed48f1de7f 2148 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_DU, WeekDay << RTC_ALRMBR_DU_Pos);
<> 149:156823d33999 2149 }
<> 149:156823d33999 2150
<> 149:156823d33999 2151 /**
<> 149:156823d33999 2152 * @brief Get ALARM B Weekday
<> 149:156823d33999 2153 * @rmtoll ALRMBR DU LL_RTC_ALMB_GetWeekDay
<> 149:156823d33999 2154 * @param RTCx RTC Instance
<> 149:156823d33999 2155 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2156 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 2157 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 2158 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 2159 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 2160 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 2161 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 2162 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 2163 */
<> 149:156823d33999 2164 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 2165 {
AnnaBridge 184:08ed48f1de7f 2166 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_DU) >> RTC_ALRMBR_DU_Pos);
<> 149:156823d33999 2167 }
<> 149:156823d33999 2168
<> 149:156823d33999 2169 /**
<> 149:156823d33999 2170 * @brief Set ALARM B time format (AM/24-hour or PM notation)
<> 149:156823d33999 2171 * @rmtoll ALRMBR PM LL_RTC_ALMB_SetTimeFormat
<> 149:156823d33999 2172 * @param RTCx RTC Instance
<> 149:156823d33999 2173 * @param TimeFormat This parameter can be one of the following values:
<> 149:156823d33999 2174 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
<> 149:156823d33999 2175 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
<> 149:156823d33999 2176 * @retval None
<> 149:156823d33999 2177 */
<> 149:156823d33999 2178 __STATIC_INLINE void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t TimeFormat)
<> 149:156823d33999 2179 {
<> 149:156823d33999 2180 MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM, TimeFormat);
<> 149:156823d33999 2181 }
<> 149:156823d33999 2182
<> 149:156823d33999 2183 /**
<> 149:156823d33999 2184 * @brief Get ALARM B time format (AM or PM notation)
<> 149:156823d33999 2185 * @rmtoll ALRMBR PM LL_RTC_ALMB_GetTimeFormat
<> 149:156823d33999 2186 * @param RTCx RTC Instance
<> 149:156823d33999 2187 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2188 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
<> 149:156823d33999 2189 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
<> 149:156823d33999 2190 */
<> 149:156823d33999 2191 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef *RTCx)
<> 149:156823d33999 2192 {
<> 149:156823d33999 2193 return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_PM));
<> 149:156823d33999 2194 }
<> 149:156823d33999 2195
<> 149:156823d33999 2196 /**
<> 149:156823d33999 2197 * @brief Set ALARM B Hours in BCD format
<> 149:156823d33999 2198 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hours from binary to BCD format
<> 149:156823d33999 2199 * @rmtoll ALRMBR HT LL_RTC_ALMB_SetHour\n
<> 149:156823d33999 2200 * ALRMBR HU LL_RTC_ALMB_SetHour
<> 149:156823d33999 2201 * @param RTCx RTC Instance
<> 149:156823d33999 2202 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 2203 * @retval None
<> 149:156823d33999 2204 */
<> 149:156823d33999 2205 __STATIC_INLINE void LL_RTC_ALMB_SetHour(RTC_TypeDef *RTCx, uint32_t Hours)
<> 149:156823d33999 2206 {
<> 149:156823d33999 2207 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU),
AnnaBridge 184:08ed48f1de7f 2208 (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos)));
<> 149:156823d33999 2209 }
<> 149:156823d33999 2210
<> 149:156823d33999 2211 /**
<> 149:156823d33999 2212 * @brief Get ALARM B Hours in BCD format
<> 149:156823d33999 2213 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
<> 149:156823d33999 2214 * @rmtoll ALRMBR HT LL_RTC_ALMB_GetHour\n
<> 149:156823d33999 2215 * ALRMBR HU LL_RTC_ALMB_GetHour
<> 149:156823d33999 2216 * @param RTCx RTC Instance
<> 149:156823d33999 2217 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 2218 */
<> 149:156823d33999 2219 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef *RTCx)
<> 149:156823d33999 2220 {
<> 149:156823d33999 2221 register uint32_t temp = 0U;
<> 149:156823d33999 2222
<> 149:156823d33999 2223 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU));
AnnaBridge 184:08ed48f1de7f 2224 return (uint32_t)((((temp & RTC_ALRMBR_HT) >> RTC_ALRMBR_HT_Pos) << 4U) | ((temp & RTC_ALRMBR_HU) >> RTC_ALRMBR_HU_Pos));
<> 149:156823d33999 2225 }
<> 149:156823d33999 2226
<> 149:156823d33999 2227 /**
<> 149:156823d33999 2228 * @brief Set ALARM B Minutes in BCD format
<> 149:156823d33999 2229 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minutes from binary to BCD format
<> 149:156823d33999 2230 * @rmtoll ALRMBR MNT LL_RTC_ALMB_SetMinute\n
<> 149:156823d33999 2231 * ALRMBR MNU LL_RTC_ALMB_SetMinute
<> 149:156823d33999 2232 * @param RTCx RTC Instance
<> 149:156823d33999 2233 * @param Minutes between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2234 * @retval None
<> 149:156823d33999 2235 */
<> 149:156823d33999 2236 __STATIC_INLINE void LL_RTC_ALMB_SetMinute(RTC_TypeDef *RTCx, uint32_t Minutes)
<> 149:156823d33999 2237 {
<> 149:156823d33999 2238 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU),
AnnaBridge 184:08ed48f1de7f 2239 (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)));
<> 149:156823d33999 2240 }
<> 149:156823d33999 2241
<> 149:156823d33999 2242 /**
<> 149:156823d33999 2243 * @brief Get ALARM B Minutes in BCD format
<> 149:156823d33999 2244 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
<> 149:156823d33999 2245 * @rmtoll ALRMBR MNT LL_RTC_ALMB_GetMinute\n
<> 149:156823d33999 2246 * ALRMBR MNU LL_RTC_ALMB_GetMinute
<> 149:156823d33999 2247 * @param RTCx RTC Instance
<> 149:156823d33999 2248 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2249 */
<> 149:156823d33999 2250 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef *RTCx)
<> 149:156823d33999 2251 {
<> 149:156823d33999 2252 register uint32_t temp = 0U;
<> 149:156823d33999 2253
<> 149:156823d33999 2254 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU));
AnnaBridge 184:08ed48f1de7f 2255 return (uint32_t)((((temp & RTC_ALRMBR_MNT) >> RTC_ALRMBR_MNT_Pos) << 4U) | ((temp & RTC_ALRMBR_MNU) >> RTC_ALRMBR_MNU_Pos));
<> 149:156823d33999 2256 }
<> 149:156823d33999 2257
<> 149:156823d33999 2258 /**
<> 149:156823d33999 2259 * @brief Set ALARM B Seconds in BCD format
<> 149:156823d33999 2260 * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Seconds from binary to BCD format
<> 149:156823d33999 2261 * @rmtoll ALRMBR ST LL_RTC_ALMB_SetSecond\n
<> 149:156823d33999 2262 * ALRMBR SU LL_RTC_ALMB_SetSecond
<> 149:156823d33999 2263 * @param RTCx RTC Instance
<> 149:156823d33999 2264 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2265 * @retval None
<> 149:156823d33999 2266 */
<> 149:156823d33999 2267 __STATIC_INLINE void LL_RTC_ALMB_SetSecond(RTC_TypeDef *RTCx, uint32_t Seconds)
<> 149:156823d33999 2268 {
<> 149:156823d33999 2269 MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU),
AnnaBridge 184:08ed48f1de7f 2270 (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos)));
<> 149:156823d33999 2271 }
<> 149:156823d33999 2272
<> 149:156823d33999 2273 /**
<> 149:156823d33999 2274 * @brief Get ALARM B Seconds in BCD format
<> 149:156823d33999 2275 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
<> 149:156823d33999 2276 * @rmtoll ALRMBR ST LL_RTC_ALMB_GetSecond\n
<> 149:156823d33999 2277 * ALRMBR SU LL_RTC_ALMB_GetSecond
<> 149:156823d33999 2278 * @param RTCx RTC Instance
<> 149:156823d33999 2279 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2280 */
<> 149:156823d33999 2281 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 2282 {
<> 149:156823d33999 2283 register uint32_t temp = 0U;
<> 149:156823d33999 2284
<> 149:156823d33999 2285 temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU));
AnnaBridge 184:08ed48f1de7f 2286 return (uint32_t)((((temp & RTC_ALRMBR_ST) >> RTC_ALRMBR_ST_Pos) << 4U) | ((temp & RTC_ALRMBR_SU) >> RTC_ALRMBR_SU_Pos));
<> 149:156823d33999 2287 }
<> 149:156823d33999 2288
<> 149:156823d33999 2289 /**
<> 149:156823d33999 2290 * @brief Set Alarm B Time (hour, minute and second) in BCD format
<> 149:156823d33999 2291 * @rmtoll ALRMBR PM LL_RTC_ALMB_ConfigTime\n
<> 149:156823d33999 2292 * ALRMBR HT LL_RTC_ALMB_ConfigTime\n
<> 149:156823d33999 2293 * ALRMBR HU LL_RTC_ALMB_ConfigTime\n
<> 149:156823d33999 2294 * ALRMBR MNT LL_RTC_ALMB_ConfigTime\n
<> 149:156823d33999 2295 * ALRMBR MNU LL_RTC_ALMB_ConfigTime\n
<> 149:156823d33999 2296 * ALRMBR ST LL_RTC_ALMB_ConfigTime\n
<> 149:156823d33999 2297 * ALRMBR SU LL_RTC_ALMB_ConfigTime
<> 149:156823d33999 2298 * @param RTCx RTC Instance
<> 149:156823d33999 2299 * @param Format12_24 This parameter can be one of the following values:
<> 149:156823d33999 2300 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM
<> 149:156823d33999 2301 * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM
<> 149:156823d33999 2302 * @param Hours Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 2303 * @param Minutes Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2304 * @param Seconds Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2305 * @retval None
<> 149:156823d33999 2306 */
<> 149:156823d33999 2307 __STATIC_INLINE void LL_RTC_ALMB_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
<> 149:156823d33999 2308 {
<> 149:156823d33999 2309 register uint32_t temp = 0U;
<> 149:156823d33999 2310
AnnaBridge 184:08ed48f1de7f 2311 temp = Format12_24 | (((Hours & 0xF0U) << (RTC_ALRMBR_HT_Pos - 4U)) | ((Hours & 0x0FU) << RTC_ALRMBR_HU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 2312 (((Minutes & 0xF0U) << (RTC_ALRMBR_MNT_Pos - 4U)) | ((Minutes & 0x0FU) << RTC_ALRMBR_MNU_Pos)) | \
AnnaBridge 184:08ed48f1de7f 2313 (((Seconds & 0xF0U) << (RTC_ALRMBR_ST_Pos - 4U)) | ((Seconds & 0x0FU) << RTC_ALRMBR_SU_Pos));
<> 149:156823d33999 2314
<> 149:156823d33999 2315 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);
<> 149:156823d33999 2316 }
<> 149:156823d33999 2317
<> 149:156823d33999 2318 /**
<> 149:156823d33999 2319 * @brief Get Alarm B Time (hour, minute and second) in BCD format
<> 149:156823d33999 2320 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
<> 149:156823d33999 2321 * are available to get independently each parameter.
<> 149:156823d33999 2322 * @rmtoll ALRMBR HT LL_RTC_ALMB_GetTime\n
<> 149:156823d33999 2323 * ALRMBR HU LL_RTC_ALMB_GetTime\n
<> 149:156823d33999 2324 * ALRMBR MNT LL_RTC_ALMB_GetTime\n
<> 149:156823d33999 2325 * ALRMBR MNU LL_RTC_ALMB_GetTime\n
<> 149:156823d33999 2326 * ALRMBR ST LL_RTC_ALMB_GetTime\n
<> 149:156823d33999 2327 * ALRMBR SU LL_RTC_ALMB_GetTime
<> 149:156823d33999 2328 * @param RTCx RTC Instance
<> 149:156823d33999 2329 * @retval Combination of hours, minutes and seconds.
<> 149:156823d33999 2330 */
<> 149:156823d33999 2331 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef *RTCx)
<> 149:156823d33999 2332 {
<> 149:156823d33999 2333 return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMB_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMB_GetSecond(RTCx));
<> 149:156823d33999 2334 }
<> 149:156823d33999 2335
<> 149:156823d33999 2336 #if defined(RTC_SUBSECOND_SUPPORT)
<> 149:156823d33999 2337 /**
<> 149:156823d33999 2338 * @brief Set Alarm B Mask the most-significant bits starting at this bit
<> 149:156823d33999 2339 * @note This register can be written only when ALRBE is reset in RTC_CR register,
<> 149:156823d33999 2340 * or in initialization mode.
<> 149:156823d33999 2341 * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask
<> 149:156823d33999 2342 * @param RTCx RTC Instance
<> 149:156823d33999 2343 * @param Mask Value between Min_Data=0x00 and Max_Data=0xF
<> 149:156823d33999 2344 * @retval None
<> 149:156823d33999 2345 */
<> 149:156823d33999 2346 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask)
<> 149:156823d33999 2347 {
AnnaBridge 184:08ed48f1de7f 2348 MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS, Mask << RTC_ALRMBSSR_MASKSS_Pos);
<> 149:156823d33999 2349 }
<> 149:156823d33999 2350
<> 149:156823d33999 2351 /**
<> 149:156823d33999 2352 * @brief Get Alarm B Mask the most-significant bits starting at this bit
<> 149:156823d33999 2353 * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask
<> 149:156823d33999 2354 * @param RTCx RTC Instance
<> 149:156823d33999 2355 * @retval Value between Min_Data=0x00 and Max_Data=0xF
<> 149:156823d33999 2356 */
<> 149:156823d33999 2357 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef *RTCx)
<> 149:156823d33999 2358 {
AnnaBridge 184:08ed48f1de7f 2359 return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS) >> RTC_ALRMBSSR_MASKSS_Pos);
<> 149:156823d33999 2360 }
<> 149:156823d33999 2361
<> 149:156823d33999 2362 /**
<> 149:156823d33999 2363 * @brief Set Alarm B Sub seconds value
<> 149:156823d33999 2364 * @rmtoll ALRMBSSR SS LL_RTC_ALMB_SetSubSecond
<> 149:156823d33999 2365 * @param RTCx RTC Instance
<> 149:156823d33999 2366 * @param Subsecond Value between Min_Data=0x00 and Max_Data=0x7FFF
<> 149:156823d33999 2367 * @retval None
<> 149:156823d33999 2368 */
<> 149:156823d33999 2369 __STATIC_INLINE void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond)
<> 149:156823d33999 2370 {
<> 149:156823d33999 2371 MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS, Subsecond);
<> 149:156823d33999 2372 }
<> 149:156823d33999 2373
<> 149:156823d33999 2374 /**
<> 149:156823d33999 2375 * @brief Get Alarm B Sub seconds value
<> 149:156823d33999 2376 * @rmtoll ALRMBSSR SS LL_RTC_ALMB_GetSubSecond
<> 149:156823d33999 2377 * @param RTCx RTC Instance
<> 149:156823d33999 2378 * @retval Value between Min_Data=0x00 and Max_Data=0x7FFF
<> 149:156823d33999 2379 */
<> 149:156823d33999 2380 __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 2381 {
<> 149:156823d33999 2382 return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS));
<> 149:156823d33999 2383 }
<> 149:156823d33999 2384 #endif /* RTC_SUBSECOND_SUPPORT */
<> 149:156823d33999 2385
<> 149:156823d33999 2386 /**
<> 149:156823d33999 2387 * @}
<> 149:156823d33999 2388 */
<> 149:156823d33999 2389
<> 149:156823d33999 2390 /** @defgroup RTC_LL_EF_Timestamp Timestamp
<> 149:156823d33999 2391 * @{
<> 149:156823d33999 2392 */
<> 149:156823d33999 2393
<> 149:156823d33999 2394 /**
<> 149:156823d33999 2395 * @brief Enable Timestamp
<> 149:156823d33999 2396 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2397 * @rmtoll CR TSE LL_RTC_TS_Enable
<> 149:156823d33999 2398 * @param RTCx RTC Instance
<> 149:156823d33999 2399 * @retval None
<> 149:156823d33999 2400 */
<> 149:156823d33999 2401 __STATIC_INLINE void LL_RTC_TS_Enable(RTC_TypeDef *RTCx)
<> 149:156823d33999 2402 {
<> 149:156823d33999 2403 SET_BIT(RTCx->CR, RTC_CR_TSE);
<> 149:156823d33999 2404 }
<> 149:156823d33999 2405
<> 149:156823d33999 2406 /**
<> 149:156823d33999 2407 * @brief Disable Timestamp
<> 149:156823d33999 2408 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2409 * @rmtoll CR TSE LL_RTC_TS_Disable
<> 149:156823d33999 2410 * @param RTCx RTC Instance
<> 149:156823d33999 2411 * @retval None
<> 149:156823d33999 2412 */
<> 149:156823d33999 2413 __STATIC_INLINE void LL_RTC_TS_Disable(RTC_TypeDef *RTCx)
<> 149:156823d33999 2414 {
<> 149:156823d33999 2415 CLEAR_BIT(RTCx->CR, RTC_CR_TSE);
<> 149:156823d33999 2416 }
<> 149:156823d33999 2417
<> 149:156823d33999 2418 /**
<> 149:156823d33999 2419 * @brief Set Time-stamp event active edge
<> 149:156823d33999 2420 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2421 * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting
<> 149:156823d33999 2422 * @rmtoll CR TSEDGE LL_RTC_TS_SetActiveEdge
<> 149:156823d33999 2423 * @param RTCx RTC Instance
<> 149:156823d33999 2424 * @param Edge This parameter can be one of the following values:
<> 149:156823d33999 2425 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
<> 149:156823d33999 2426 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
<> 149:156823d33999 2427 * @retval None
<> 149:156823d33999 2428 */
<> 149:156823d33999 2429 __STATIC_INLINE void LL_RTC_TS_SetActiveEdge(RTC_TypeDef *RTCx, uint32_t Edge)
<> 149:156823d33999 2430 {
<> 149:156823d33999 2431 MODIFY_REG(RTCx->CR, RTC_CR_TSEDGE, Edge);
<> 149:156823d33999 2432 }
<> 149:156823d33999 2433
<> 149:156823d33999 2434 /**
<> 149:156823d33999 2435 * @brief Get Time-stamp event active edge
<> 149:156823d33999 2436 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2437 * @rmtoll CR TSEDGE LL_RTC_TS_GetActiveEdge
<> 149:156823d33999 2438 * @param RTCx RTC Instance
<> 149:156823d33999 2439 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2440 * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING
<> 149:156823d33999 2441 * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING
<> 149:156823d33999 2442 */
<> 149:156823d33999 2443 __STATIC_INLINE uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef *RTCx)
<> 149:156823d33999 2444 {
<> 149:156823d33999 2445 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_TSEDGE));
<> 149:156823d33999 2446 }
<> 149:156823d33999 2447
<> 149:156823d33999 2448 /**
<> 149:156823d33999 2449 * @brief Get Timestamp AM/PM notation (AM or 24-hour format)
<> 149:156823d33999 2450 * @rmtoll TSTR PM LL_RTC_TS_GetTimeFormat
<> 149:156823d33999 2451 * @param RTCx RTC Instance
<> 149:156823d33999 2452 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2453 * @arg @ref LL_RTC_TS_TIME_FORMAT_AM
<> 149:156823d33999 2454 * @arg @ref LL_RTC_TS_TIME_FORMAT_PM
<> 149:156823d33999 2455 */
<> 149:156823d33999 2456 __STATIC_INLINE uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef *RTCx)
<> 149:156823d33999 2457 {
<> 149:156823d33999 2458 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_PM));
<> 149:156823d33999 2459 }
<> 149:156823d33999 2460
<> 149:156823d33999 2461 /**
<> 149:156823d33999 2462 * @brief Get Timestamp Hours in BCD format
<> 149:156823d33999 2463 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hours from BCD to Binary format
<> 149:156823d33999 2464 * @rmtoll TSTR HT LL_RTC_TS_GetHour\n
<> 149:156823d33999 2465 * TSTR HU LL_RTC_TS_GetHour
<> 149:156823d33999 2466 * @param RTCx RTC Instance
<> 149:156823d33999 2467 * @retval Value between Min_Data=0x01 and Max_Data=0x12 or between Min_Data=0x00 and Max_Data=0x23
<> 149:156823d33999 2468 */
<> 149:156823d33999 2469 __STATIC_INLINE uint32_t LL_RTC_TS_GetHour(RTC_TypeDef *RTCx)
<> 149:156823d33999 2470 {
AnnaBridge 184:08ed48f1de7f 2471 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_HT | RTC_TSTR_HU) >> RTC_TSTR_HU_Pos);
<> 149:156823d33999 2472 }
<> 149:156823d33999 2473
<> 149:156823d33999 2474 /**
<> 149:156823d33999 2475 * @brief Get Timestamp Minutes in BCD format
<> 149:156823d33999 2476 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minutes from BCD to Binary format
<> 149:156823d33999 2477 * @rmtoll TSTR MNT LL_RTC_TS_GetMinute\n
<> 149:156823d33999 2478 * TSTR MNU LL_RTC_TS_GetMinute
<> 149:156823d33999 2479 * @param RTCx RTC Instance
<> 149:156823d33999 2480 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2481 */
<> 149:156823d33999 2482 __STATIC_INLINE uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef *RTCx)
<> 149:156823d33999 2483 {
AnnaBridge 184:08ed48f1de7f 2484 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_MNT | RTC_TSTR_MNU) >> RTC_TSTR_MNU_Pos);
<> 149:156823d33999 2485 }
<> 149:156823d33999 2486
<> 149:156823d33999 2487 /**
<> 149:156823d33999 2488 * @brief Get Timestamp Seconds in BCD format
<> 149:156823d33999 2489 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Seconds from BCD to Binary format
<> 149:156823d33999 2490 * @rmtoll TSTR ST LL_RTC_TS_GetSecond\n
<> 149:156823d33999 2491 * TSTR SU LL_RTC_TS_GetSecond
<> 149:156823d33999 2492 * @param RTCx RTC Instance
<> 149:156823d33999 2493 * @retval Value between Min_Data=0x00 and Max_Data=0x59
<> 149:156823d33999 2494 */
<> 149:156823d33999 2495 __STATIC_INLINE uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 2496 {
<> 149:156823d33999 2497 return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_ST | RTC_TSTR_SU));
<> 149:156823d33999 2498 }
<> 149:156823d33999 2499
<> 149:156823d33999 2500 /**
<> 149:156823d33999 2501 * @brief Get Timestamp time (hour, minute and second) in BCD format
<> 149:156823d33999 2502 * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND
<> 149:156823d33999 2503 * are available to get independently each parameter.
<> 149:156823d33999 2504 * @rmtoll TSTR HT LL_RTC_TS_GetTime\n
<> 149:156823d33999 2505 * TSTR HU LL_RTC_TS_GetTime\n
<> 149:156823d33999 2506 * TSTR MNT LL_RTC_TS_GetTime\n
<> 149:156823d33999 2507 * TSTR MNU LL_RTC_TS_GetTime\n
<> 149:156823d33999 2508 * TSTR ST LL_RTC_TS_GetTime\n
<> 149:156823d33999 2509 * TSTR SU LL_RTC_TS_GetTime
<> 149:156823d33999 2510 * @param RTCx RTC Instance
<> 149:156823d33999 2511 * @retval Combination of hours, minutes and seconds.
<> 149:156823d33999 2512 */
<> 149:156823d33999 2513 __STATIC_INLINE uint32_t LL_RTC_TS_GetTime(RTC_TypeDef *RTCx)
<> 149:156823d33999 2514 {
<> 149:156823d33999 2515 return (uint32_t)(READ_BIT(RTCx->TSTR,
<> 149:156823d33999 2516 RTC_TSTR_HT | RTC_TSTR_HU | RTC_TSTR_MNT | RTC_TSTR_MNU | RTC_TSTR_ST | RTC_TSTR_SU));
<> 149:156823d33999 2517 }
<> 149:156823d33999 2518
<> 149:156823d33999 2519 /**
<> 149:156823d33999 2520 * @brief Get Timestamp Week day
<> 149:156823d33999 2521 * @rmtoll TSDR WDU LL_RTC_TS_GetWeekDay
<> 149:156823d33999 2522 * @param RTCx RTC Instance
<> 149:156823d33999 2523 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2524 * @arg @ref LL_RTC_WEEKDAY_MONDAY
<> 149:156823d33999 2525 * @arg @ref LL_RTC_WEEKDAY_TUESDAY
<> 149:156823d33999 2526 * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY
<> 149:156823d33999 2527 * @arg @ref LL_RTC_WEEKDAY_THURSDAY
<> 149:156823d33999 2528 * @arg @ref LL_RTC_WEEKDAY_FRIDAY
<> 149:156823d33999 2529 * @arg @ref LL_RTC_WEEKDAY_SATURDAY
<> 149:156823d33999 2530 * @arg @ref LL_RTC_WEEKDAY_SUNDAY
<> 149:156823d33999 2531 */
<> 149:156823d33999 2532 __STATIC_INLINE uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 2533 {
AnnaBridge 184:08ed48f1de7f 2534 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU) >> RTC_TSDR_WDU_Pos);
<> 149:156823d33999 2535 }
<> 149:156823d33999 2536
<> 149:156823d33999 2537 /**
<> 149:156823d33999 2538 * @brief Get Timestamp Month in BCD format
<> 149:156823d33999 2539 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format
<> 149:156823d33999 2540 * @rmtoll TSDR MT LL_RTC_TS_GetMonth\n
<> 149:156823d33999 2541 * TSDR MU LL_RTC_TS_GetMonth
<> 149:156823d33999 2542 * @param RTCx RTC Instance
<> 149:156823d33999 2543 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2544 * @arg @ref LL_RTC_MONTH_JANUARY
<> 149:156823d33999 2545 * @arg @ref LL_RTC_MONTH_FEBRUARY
<> 149:156823d33999 2546 * @arg @ref LL_RTC_MONTH_MARCH
<> 149:156823d33999 2547 * @arg @ref LL_RTC_MONTH_APRIL
<> 149:156823d33999 2548 * @arg @ref LL_RTC_MONTH_MAY
<> 149:156823d33999 2549 * @arg @ref LL_RTC_MONTH_JUNE
<> 149:156823d33999 2550 * @arg @ref LL_RTC_MONTH_JULY
<> 149:156823d33999 2551 * @arg @ref LL_RTC_MONTH_AUGUST
<> 149:156823d33999 2552 * @arg @ref LL_RTC_MONTH_SEPTEMBER
<> 149:156823d33999 2553 * @arg @ref LL_RTC_MONTH_OCTOBER
<> 149:156823d33999 2554 * @arg @ref LL_RTC_MONTH_NOVEMBER
<> 149:156823d33999 2555 * @arg @ref LL_RTC_MONTH_DECEMBER
<> 149:156823d33999 2556 */
<> 149:156823d33999 2557 __STATIC_INLINE uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef *RTCx)
<> 149:156823d33999 2558 {
AnnaBridge 184:08ed48f1de7f 2559 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_MT | RTC_TSDR_MU) >> RTC_TSDR_MU_Pos);
<> 149:156823d33999 2560 }
<> 149:156823d33999 2561
<> 149:156823d33999 2562 /**
<> 149:156823d33999 2563 * @brief Get Timestamp Day in BCD format
<> 149:156823d33999 2564 * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format
<> 149:156823d33999 2565 * @rmtoll TSDR DT LL_RTC_TS_GetDay\n
<> 149:156823d33999 2566 * TSDR DU LL_RTC_TS_GetDay
<> 149:156823d33999 2567 * @param RTCx RTC Instance
<> 149:156823d33999 2568 * @retval Value between Min_Data=0x01 and Max_Data=0x31
<> 149:156823d33999 2569 */
<> 149:156823d33999 2570 __STATIC_INLINE uint32_t LL_RTC_TS_GetDay(RTC_TypeDef *RTCx)
<> 149:156823d33999 2571 {
<> 149:156823d33999 2572 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_DT | RTC_TSDR_DU));
<> 149:156823d33999 2573 }
<> 149:156823d33999 2574
<> 149:156823d33999 2575 /**
<> 149:156823d33999 2576 * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format
<> 149:156823d33999 2577 * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH,
<> 149:156823d33999 2578 * and __LL_RTC_GET_DAY are available to get independently each parameter.
<> 149:156823d33999 2579 * @rmtoll TSDR WDU LL_RTC_TS_GetDate\n
<> 149:156823d33999 2580 * TSDR MT LL_RTC_TS_GetDate\n
<> 149:156823d33999 2581 * TSDR MU LL_RTC_TS_GetDate\n
<> 149:156823d33999 2582 * TSDR DT LL_RTC_TS_GetDate\n
<> 149:156823d33999 2583 * TSDR DU LL_RTC_TS_GetDate
<> 149:156823d33999 2584 * @param RTCx RTC Instance
<> 149:156823d33999 2585 * @retval Combination of Weekday, Day and Month
<> 149:156823d33999 2586 */
<> 149:156823d33999 2587 __STATIC_INLINE uint32_t LL_RTC_TS_GetDate(RTC_TypeDef *RTCx)
<> 149:156823d33999 2588 {
<> 149:156823d33999 2589 return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU | RTC_TSDR_MT | RTC_TSDR_MU | RTC_TSDR_DT | RTC_TSDR_DU));
<> 149:156823d33999 2590 }
<> 149:156823d33999 2591
<> 149:156823d33999 2592 #if defined(RTC_SUBSECOND_SUPPORT)
<> 149:156823d33999 2593 /**
<> 149:156823d33999 2594 * @brief Get time-stamp sub second value
<> 149:156823d33999 2595 * @rmtoll TSSSR SS LL_RTC_TS_GetSubSecond
<> 149:156823d33999 2596 * @param RTCx RTC Instance
<> 149:156823d33999 2597 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
<> 149:156823d33999 2598 */
<> 149:156823d33999 2599 __STATIC_INLINE uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef *RTCx)
<> 149:156823d33999 2600 {
<> 149:156823d33999 2601 return (uint32_t)(READ_BIT(RTCx->TSSSR, RTC_TSSSR_SS));
<> 149:156823d33999 2602 }
<> 149:156823d33999 2603 #endif /* RTC_SUBSECOND_SUPPORT */
<> 149:156823d33999 2604
<> 149:156823d33999 2605 #if defined(RTC_TAFCR_TAMPTS)
<> 149:156823d33999 2606 /**
<> 149:156823d33999 2607 * @brief Activate timestamp on tamper detection event
<> 149:156823d33999 2608 * @rmtoll TAFCR TAMPTS LL_RTC_TS_EnableOnTamper
<> 149:156823d33999 2609 * @param RTCx RTC Instance
<> 149:156823d33999 2610 * @retval None
<> 149:156823d33999 2611 */
<> 149:156823d33999 2612 __STATIC_INLINE void LL_RTC_TS_EnableOnTamper(RTC_TypeDef *RTCx)
<> 149:156823d33999 2613 {
<> 149:156823d33999 2614 SET_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPTS);
<> 149:156823d33999 2615 }
<> 149:156823d33999 2616
<> 149:156823d33999 2617 /**
<> 149:156823d33999 2618 * @brief Disable timestamp on tamper detection event
<> 149:156823d33999 2619 * @rmtoll TAFCR TAMPTS LL_RTC_TS_DisableOnTamper
<> 149:156823d33999 2620 * @param RTCx RTC Instance
<> 149:156823d33999 2621 * @retval None
<> 149:156823d33999 2622 */
<> 149:156823d33999 2623 __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx)
<> 149:156823d33999 2624 {
<> 149:156823d33999 2625 CLEAR_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPTS);
<> 149:156823d33999 2626 }
<> 149:156823d33999 2627 #endif /* RTC_TAFCR_TAMPTS */
<> 149:156823d33999 2628
<> 149:156823d33999 2629 /**
<> 149:156823d33999 2630 * @}
<> 149:156823d33999 2631 */
<> 149:156823d33999 2632
<> 149:156823d33999 2633 /** @defgroup RTC_LL_EF_Tamper Tamper
<> 149:156823d33999 2634 * @{
<> 149:156823d33999 2635 */
<> 149:156823d33999 2636
<> 149:156823d33999 2637 /**
<> 149:156823d33999 2638 * @brief Enable RTC_TAMPx input detection
<> 149:156823d33999 2639 * @rmtoll TAFCR TAMP1E LL_RTC_TAMPER_Enable\n
<> 149:156823d33999 2640 * TAFCR TAMP2E LL_RTC_TAMPER_Enable\n
<> 149:156823d33999 2641 * TAFCR TAMP3E LL_RTC_TAMPER_Enable
<> 149:156823d33999 2642 * @param RTCx RTC Instance
<> 149:156823d33999 2643 * @param Tamper This parameter can be a combination of the following values:
<> 149:156823d33999 2644 * @arg @ref LL_RTC_TAMPER_1
<> 149:156823d33999 2645 * @arg @ref LL_RTC_TAMPER_2 (*)
<> 149:156823d33999 2646 * @arg @ref LL_RTC_TAMPER_3 (*)
<> 149:156823d33999 2647 *
<> 149:156823d33999 2648 * (*) value not defined in all devices.
<> 149:156823d33999 2649 * @retval None
<> 149:156823d33999 2650 */
<> 149:156823d33999 2651 __STATIC_INLINE void LL_RTC_TAMPER_Enable(RTC_TypeDef *RTCx, uint32_t Tamper)
<> 149:156823d33999 2652 {
<> 149:156823d33999 2653 SET_BIT(RTCx->TAFCR, Tamper);
<> 149:156823d33999 2654 }
<> 149:156823d33999 2655
<> 149:156823d33999 2656 /**
<> 149:156823d33999 2657 * @brief Clear RTC_TAMPx input detection
<> 149:156823d33999 2658 * @rmtoll TAFCR TAMP1E LL_RTC_TAMPER_Disable\n
<> 149:156823d33999 2659 * TAFCR TAMP2E LL_RTC_TAMPER_Disable\n
<> 149:156823d33999 2660 * TAFCR TAMP3E LL_RTC_TAMPER_Disable
<> 149:156823d33999 2661 * @param RTCx RTC Instance
<> 149:156823d33999 2662 * @param Tamper This parameter can be a combination of the following values:
<> 149:156823d33999 2663 * @arg @ref LL_RTC_TAMPER_1
<> 149:156823d33999 2664 * @arg @ref LL_RTC_TAMPER_2 (*)
<> 149:156823d33999 2665 * @arg @ref LL_RTC_TAMPER_3 (*)
<> 149:156823d33999 2666 *
<> 149:156823d33999 2667 * (*) value not defined in all devices.
<> 149:156823d33999 2668 * @retval None
<> 149:156823d33999 2669 */
<> 149:156823d33999 2670 __STATIC_INLINE void LL_RTC_TAMPER_Disable(RTC_TypeDef *RTCx, uint32_t Tamper)
<> 149:156823d33999 2671 {
<> 149:156823d33999 2672 CLEAR_BIT(RTCx->TAFCR, Tamper);
<> 149:156823d33999 2673 }
<> 149:156823d33999 2674
<> 149:156823d33999 2675 #if defined(RTC_TAFCR_TAMPPUDIS)
<> 149:156823d33999 2676 /**
<> 149:156823d33999 2677 * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins)
<> 149:156823d33999 2678 * @rmtoll TAFCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp
<> 149:156823d33999 2679 * @param RTCx RTC Instance
<> 149:156823d33999 2680 * @retval None
<> 149:156823d33999 2681 */
<> 149:156823d33999 2682 __STATIC_INLINE void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef *RTCx)
<> 149:156823d33999 2683 {
<> 149:156823d33999 2684 SET_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPPUDIS);
<> 149:156823d33999 2685 }
<> 149:156823d33999 2686
<> 149:156823d33999 2687 /**
<> 149:156823d33999 2688 * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling)
<> 149:156823d33999 2689 * @rmtoll TAFCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp
<> 149:156823d33999 2690 * @param RTCx RTC Instance
<> 149:156823d33999 2691 * @retval None
<> 149:156823d33999 2692 */
<> 149:156823d33999 2693 __STATIC_INLINE void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef *RTCx)
<> 149:156823d33999 2694 {
<> 149:156823d33999 2695 CLEAR_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPPUDIS);
<> 149:156823d33999 2696 }
<> 149:156823d33999 2697 #endif /* RTC_TAFCR_TAMPPUDIS */
<> 149:156823d33999 2698
<> 149:156823d33999 2699 #if defined(RTC_TAFCR_TAMPPRCH)
<> 149:156823d33999 2700 /**
<> 149:156823d33999 2701 * @brief Set RTC_TAMPx precharge duration
<> 149:156823d33999 2702 * @rmtoll TAFCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge
<> 149:156823d33999 2703 * @param RTCx RTC Instance
<> 149:156823d33999 2704 * @param Duration This parameter can be one of the following values:
<> 149:156823d33999 2705 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
<> 149:156823d33999 2706 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
<> 149:156823d33999 2707 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
<> 149:156823d33999 2708 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
<> 149:156823d33999 2709 * @retval None
<> 149:156823d33999 2710 */
<> 149:156823d33999 2711 __STATIC_INLINE void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef *RTCx, uint32_t Duration)
<> 149:156823d33999 2712 {
<> 149:156823d33999 2713 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_TAMPPRCH, Duration);
<> 149:156823d33999 2714 }
<> 149:156823d33999 2715
<> 149:156823d33999 2716 /**
<> 149:156823d33999 2717 * @brief Get RTC_TAMPx precharge duration
<> 149:156823d33999 2718 * @rmtoll TAFCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge
<> 149:156823d33999 2719 * @param RTCx RTC Instance
<> 149:156823d33999 2720 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2721 * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK
<> 149:156823d33999 2722 * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK
<> 149:156823d33999 2723 * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK
<> 149:156823d33999 2724 * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK
<> 149:156823d33999 2725 */
<> 149:156823d33999 2726 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef *RTCx)
<> 149:156823d33999 2727 {
<> 149:156823d33999 2728 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPPRCH));
<> 149:156823d33999 2729 }
<> 149:156823d33999 2730 #endif /* RTC_TAFCR_TAMPPRCH */
<> 149:156823d33999 2731
<> 149:156823d33999 2732 #if defined(RTC_TAFCR_TAMPFLT)
<> 149:156823d33999 2733 /**
<> 149:156823d33999 2734 * @brief Set RTC_TAMPx filter count
<> 149:156823d33999 2735 * @rmtoll TAFCR TAMPFLT LL_RTC_TAMPER_SetFilterCount
<> 149:156823d33999 2736 * @param RTCx RTC Instance
<> 149:156823d33999 2737 * @param FilterCount This parameter can be one of the following values:
<> 149:156823d33999 2738 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
<> 149:156823d33999 2739 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
<> 149:156823d33999 2740 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
<> 149:156823d33999 2741 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
<> 149:156823d33999 2742 * @retval None
<> 149:156823d33999 2743 */
<> 149:156823d33999 2744 __STATIC_INLINE void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef *RTCx, uint32_t FilterCount)
<> 149:156823d33999 2745 {
<> 149:156823d33999 2746 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_TAMPFLT, FilterCount);
<> 149:156823d33999 2747 }
<> 149:156823d33999 2748
<> 149:156823d33999 2749 /**
<> 149:156823d33999 2750 * @brief Get RTC_TAMPx filter count
<> 149:156823d33999 2751 * @rmtoll TAFCR TAMPFLT LL_RTC_TAMPER_GetFilterCount
<> 149:156823d33999 2752 * @param RTCx RTC Instance
<> 149:156823d33999 2753 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2754 * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE
<> 149:156823d33999 2755 * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE
<> 149:156823d33999 2756 * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE
<> 149:156823d33999 2757 * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE
<> 149:156823d33999 2758 */
<> 149:156823d33999 2759 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef *RTCx)
<> 149:156823d33999 2760 {
<> 149:156823d33999 2761 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPFLT));
<> 149:156823d33999 2762 }
<> 149:156823d33999 2763 #endif /* RTC_TAFCR_TAMPFLT */
<> 149:156823d33999 2764
<> 149:156823d33999 2765 #if defined(RTC_TAFCR_TAMPFREQ)
<> 149:156823d33999 2766 /**
<> 149:156823d33999 2767 * @brief Set Tamper sampling frequency
<> 149:156823d33999 2768 * @rmtoll TAFCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq
<> 149:156823d33999 2769 * @param RTCx RTC Instance
<> 149:156823d33999 2770 * @param SamplingFreq This parameter can be one of the following values:
<> 149:156823d33999 2771 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
<> 149:156823d33999 2772 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
<> 149:156823d33999 2773 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
<> 149:156823d33999 2774 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
<> 149:156823d33999 2775 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
<> 149:156823d33999 2776 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
<> 149:156823d33999 2777 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
<> 149:156823d33999 2778 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
<> 149:156823d33999 2779 * @retval None
<> 149:156823d33999 2780 */
<> 149:156823d33999 2781 __STATIC_INLINE void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef *RTCx, uint32_t SamplingFreq)
<> 149:156823d33999 2782 {
<> 149:156823d33999 2783 MODIFY_REG(RTCx->TAFCR, RTC_TAFCR_TAMPFREQ, SamplingFreq);
<> 149:156823d33999 2784 }
<> 149:156823d33999 2785
<> 149:156823d33999 2786 /**
<> 149:156823d33999 2787 * @brief Get Tamper sampling frequency
<> 149:156823d33999 2788 * @rmtoll TAFCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq
<> 149:156823d33999 2789 * @param RTCx RTC Instance
<> 149:156823d33999 2790 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2791 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768
<> 149:156823d33999 2792 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384
<> 149:156823d33999 2793 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192
<> 149:156823d33999 2794 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096
<> 149:156823d33999 2795 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048
<> 149:156823d33999 2796 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024
<> 149:156823d33999 2797 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512
<> 149:156823d33999 2798 * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256
<> 149:156823d33999 2799 */
<> 149:156823d33999 2800 __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef *RTCx)
<> 149:156823d33999 2801 {
<> 149:156823d33999 2802 return (uint32_t)(READ_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPFREQ));
<> 149:156823d33999 2803 }
<> 149:156823d33999 2804 #endif /* RTC_TAFCR_TAMPFREQ */
<> 149:156823d33999 2805
<> 149:156823d33999 2806 /**
<> 149:156823d33999 2807 * @brief Enable Active level for Tamper input
<> 149:156823d33999 2808 * @rmtoll TAFCR TAMP1TRG LL_RTC_TAMPER_EnableActiveLevel\n
<> 149:156823d33999 2809 * TAFCR TAMP2TRG LL_RTC_TAMPER_EnableActiveLevel\n
<> 149:156823d33999 2810 * TAFCR TAMP3TRG LL_RTC_TAMPER_EnableActiveLevel
<> 149:156823d33999 2811 * @param RTCx RTC Instance
<> 149:156823d33999 2812 * @param Tamper This parameter can be a combination of the following values:
<> 149:156823d33999 2813 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
<> 149:156823d33999 2814 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 (*)
<> 149:156823d33999 2815 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 (*)
<> 149:156823d33999 2816 *
<> 149:156823d33999 2817 * (*) value not defined in all devices.
<> 149:156823d33999 2818 * @retval None
<> 149:156823d33999 2819 */
<> 149:156823d33999 2820 __STATIC_INLINE void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper)
<> 149:156823d33999 2821 {
<> 149:156823d33999 2822 SET_BIT(RTCx->TAFCR, Tamper);
<> 149:156823d33999 2823 }
<> 149:156823d33999 2824
<> 149:156823d33999 2825 /**
<> 149:156823d33999 2826 * @brief Disable Active level for Tamper input
<> 149:156823d33999 2827 * @rmtoll TAFCR TAMP1TRG LL_RTC_TAMPER_DisableActiveLevel\n
<> 149:156823d33999 2828 * TAFCR TAMP2TRG LL_RTC_TAMPER_DisableActiveLevel\n
<> 149:156823d33999 2829 * TAFCR TAMP3TRG LL_RTC_TAMPER_DisableActiveLevel
<> 149:156823d33999 2830 * @param RTCx RTC Instance
<> 149:156823d33999 2831 * @param Tamper This parameter can be a combination of the following values:
<> 149:156823d33999 2832 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1
<> 149:156823d33999 2833 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 (*)
<> 149:156823d33999 2834 * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 (*)
<> 149:156823d33999 2835 *
<> 149:156823d33999 2836 * (*) value not defined in all devices.
<> 149:156823d33999 2837 * @retval None
<> 149:156823d33999 2838 */
<> 149:156823d33999 2839 __STATIC_INLINE void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper)
<> 149:156823d33999 2840 {
<> 149:156823d33999 2841 CLEAR_BIT(RTCx->TAFCR, Tamper);
<> 149:156823d33999 2842 }
<> 149:156823d33999 2843
<> 149:156823d33999 2844 /**
<> 149:156823d33999 2845 * @}
<> 149:156823d33999 2846 */
<> 149:156823d33999 2847
<> 149:156823d33999 2848 #if defined(RTC_WAKEUP_SUPPORT)
<> 149:156823d33999 2849 /** @defgroup RTC_LL_EF_Wakeup Wakeup
<> 149:156823d33999 2850 * @{
<> 149:156823d33999 2851 */
<> 149:156823d33999 2852
<> 149:156823d33999 2853 /**
<> 149:156823d33999 2854 * @brief Enable Wakeup timer
<> 149:156823d33999 2855 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2856 * @rmtoll CR WUTE LL_RTC_WAKEUP_Enable
<> 149:156823d33999 2857 * @param RTCx RTC Instance
<> 149:156823d33999 2858 * @retval None
<> 149:156823d33999 2859 */
<> 149:156823d33999 2860 __STATIC_INLINE void LL_RTC_WAKEUP_Enable(RTC_TypeDef *RTCx)
<> 149:156823d33999 2861 {
<> 149:156823d33999 2862 SET_BIT(RTCx->CR, RTC_CR_WUTE);
<> 149:156823d33999 2863 }
<> 149:156823d33999 2864
<> 149:156823d33999 2865 /**
<> 149:156823d33999 2866 * @brief Disable Wakeup timer
<> 149:156823d33999 2867 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2868 * @rmtoll CR WUTE LL_RTC_WAKEUP_Disable
<> 149:156823d33999 2869 * @param RTCx RTC Instance
<> 149:156823d33999 2870 * @retval None
<> 149:156823d33999 2871 */
<> 149:156823d33999 2872 __STATIC_INLINE void LL_RTC_WAKEUP_Disable(RTC_TypeDef *RTCx)
<> 149:156823d33999 2873 {
<> 149:156823d33999 2874 CLEAR_BIT(RTCx->CR, RTC_CR_WUTE);
<> 149:156823d33999 2875 }
<> 149:156823d33999 2876
<> 149:156823d33999 2877 /**
<> 149:156823d33999 2878 * @brief Check if Wakeup timer is enabled or not
<> 149:156823d33999 2879 * @rmtoll CR WUTE LL_RTC_WAKEUP_IsEnabled
<> 149:156823d33999 2880 * @param RTCx RTC Instance
<> 149:156823d33999 2881 * @retval State of bit (1 or 0).
<> 149:156823d33999 2882 */
<> 149:156823d33999 2883 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef *RTCx)
<> 149:156823d33999 2884 {
<> 149:156823d33999 2885 return (READ_BIT(RTCx->CR, RTC_CR_WUTE) == (RTC_CR_WUTE));
<> 149:156823d33999 2886 }
<> 149:156823d33999 2887
<> 149:156823d33999 2888 /**
<> 149:156823d33999 2889 * @brief Select Wakeup clock
<> 149:156823d33999 2890 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 2891 * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1
<> 149:156823d33999 2892 * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_SetClock
<> 149:156823d33999 2893 * @param RTCx RTC Instance
<> 149:156823d33999 2894 * @param WakeupClock This parameter can be one of the following values:
<> 149:156823d33999 2895 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
<> 149:156823d33999 2896 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
<> 149:156823d33999 2897 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
<> 149:156823d33999 2898 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
<> 149:156823d33999 2899 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
<> 149:156823d33999 2900 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
<> 149:156823d33999 2901 * @retval None
<> 149:156823d33999 2902 */
<> 149:156823d33999 2903 __STATIC_INLINE void LL_RTC_WAKEUP_SetClock(RTC_TypeDef *RTCx, uint32_t WakeupClock)
<> 149:156823d33999 2904 {
<> 149:156823d33999 2905 MODIFY_REG(RTCx->CR, RTC_CR_WUCKSEL, WakeupClock);
<> 149:156823d33999 2906 }
<> 149:156823d33999 2907
<> 149:156823d33999 2908 /**
<> 149:156823d33999 2909 * @brief Get Wakeup clock
<> 149:156823d33999 2910 * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_GetClock
<> 149:156823d33999 2911 * @param RTCx RTC Instance
<> 149:156823d33999 2912 * @retval Returned value can be one of the following values:
<> 149:156823d33999 2913 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16
<> 149:156823d33999 2914 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8
<> 149:156823d33999 2915 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4
<> 149:156823d33999 2916 * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2
<> 149:156823d33999 2917 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE
<> 149:156823d33999 2918 * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT
<> 149:156823d33999 2919 */
<> 149:156823d33999 2920 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef *RTCx)
<> 149:156823d33999 2921 {
<> 149:156823d33999 2922 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_WUCKSEL));
<> 149:156823d33999 2923 }
<> 149:156823d33999 2924
<> 149:156823d33999 2925 /**
<> 149:156823d33999 2926 * @brief Set Wakeup auto-reload value
<> 149:156823d33999 2927 * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR
<> 149:156823d33999 2928 * @rmtoll WUTR WUT LL_RTC_WAKEUP_SetAutoReload
<> 149:156823d33999 2929 * @param RTCx RTC Instance
<> 149:156823d33999 2930 * @param Value Value between Min_Data=0x00 and Max_Data=0xFFFF
<> 149:156823d33999 2931 * @retval None
<> 149:156823d33999 2932 */
<> 149:156823d33999 2933 __STATIC_INLINE void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef *RTCx, uint32_t Value)
<> 149:156823d33999 2934 {
<> 149:156823d33999 2935 MODIFY_REG(RTCx->WUTR, RTC_WUTR_WUT, Value);
<> 149:156823d33999 2936 }
<> 149:156823d33999 2937
<> 149:156823d33999 2938 /**
<> 149:156823d33999 2939 * @brief Get Wakeup auto-reload value
<> 149:156823d33999 2940 * @rmtoll WUTR WUT LL_RTC_WAKEUP_GetAutoReload
<> 149:156823d33999 2941 * @param RTCx RTC Instance
<> 149:156823d33999 2942 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFF
<> 149:156823d33999 2943 */
<> 149:156823d33999 2944 __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef *RTCx)
<> 149:156823d33999 2945 {
<> 149:156823d33999 2946 return (uint32_t)(READ_BIT(RTCx->WUTR, RTC_WUTR_WUT));
<> 149:156823d33999 2947 }
<> 149:156823d33999 2948
<> 149:156823d33999 2949 /**
<> 149:156823d33999 2950 * @}
<> 149:156823d33999 2951 */
<> 149:156823d33999 2952 #endif /* RTC_WAKEUP_SUPPORT */
<> 149:156823d33999 2953
<> 149:156823d33999 2954 #if defined(RTC_BACKUP_SUPPORT)
<> 149:156823d33999 2955 /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
<> 149:156823d33999 2956 * @{
<> 149:156823d33999 2957 */
<> 149:156823d33999 2958
<> 149:156823d33999 2959 /**
<> 149:156823d33999 2960 * @brief Writes a data in a specified RTC Backup data register.
<> 149:156823d33999 2961 * @rmtoll BKPxR BKP LL_RTC_BAK_SetRegister
<> 149:156823d33999 2962 * @param RTCx RTC Instance
<> 149:156823d33999 2963 * @param BackupRegister This parameter can be one of the following values:
<> 149:156823d33999 2964 * @arg @ref LL_RTC_BKP_DR0
<> 149:156823d33999 2965 * @arg @ref LL_RTC_BKP_DR1
<> 149:156823d33999 2966 * @arg @ref LL_RTC_BKP_DR2
<> 149:156823d33999 2967 * @arg @ref LL_RTC_BKP_DR3
<> 149:156823d33999 2968 * @arg @ref LL_RTC_BKP_DR4
<> 149:156823d33999 2969 * @arg @ref LL_RTC_BKP_DR5 (*)
<> 149:156823d33999 2970 * @arg @ref LL_RTC_BKP_DR6 (*)
<> 149:156823d33999 2971 * @arg @ref LL_RTC_BKP_DR7 (*)
<> 149:156823d33999 2972 * @arg @ref LL_RTC_BKP_DR8 (*)
<> 149:156823d33999 2973 * @arg @ref LL_RTC_BKP_DR9 (*)
<> 149:156823d33999 2974 * @arg @ref LL_RTC_BKP_DR10 (*)
<> 149:156823d33999 2975 * @arg @ref LL_RTC_BKP_DR11 (*)
<> 149:156823d33999 2976 * @arg @ref LL_RTC_BKP_DR12 (*)
<> 149:156823d33999 2977 * @arg @ref LL_RTC_BKP_DR13 (*)
<> 149:156823d33999 2978 * @arg @ref LL_RTC_BKP_DR14 (*)
<> 149:156823d33999 2979 * @arg @ref LL_RTC_BKP_DR15 (*)
<> 149:156823d33999 2980 * @arg @ref LL_RTC_BKP_DR16 (*)
<> 149:156823d33999 2981 * @arg @ref LL_RTC_BKP_DR17 (*)
<> 149:156823d33999 2982 * @arg @ref LL_RTC_BKP_DR18 (*)
<> 149:156823d33999 2983 * @arg @ref LL_RTC_BKP_DR19 (*)
<> 149:156823d33999 2984 * @arg @ref LL_RTC_BKP_DR20 (*)
<> 149:156823d33999 2985 * @arg @ref LL_RTC_BKP_DR21 (*)
<> 149:156823d33999 2986 * @arg @ref LL_RTC_BKP_DR22 (*)
<> 149:156823d33999 2987 * @arg @ref LL_RTC_BKP_DR23 (*)
<> 149:156823d33999 2988 * @arg @ref LL_RTC_BKP_DR24 (*)
<> 149:156823d33999 2989 * @arg @ref LL_RTC_BKP_DR25 (*)
<> 149:156823d33999 2990 * @arg @ref LL_RTC_BKP_DR26 (*)
<> 149:156823d33999 2991 * @arg @ref LL_RTC_BKP_DR27 (*)
<> 149:156823d33999 2992 * @arg @ref LL_RTC_BKP_DR28 (*)
<> 149:156823d33999 2993 * @arg @ref LL_RTC_BKP_DR29 (*)
<> 149:156823d33999 2994 * @arg @ref LL_RTC_BKP_DR30 (*)
<> 149:156823d33999 2995 * @arg @ref LL_RTC_BKP_DR31 (*)
<> 149:156823d33999 2996 *
<> 149:156823d33999 2997 * (*) value not defined in all devices.
<> 149:156823d33999 2998 * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
<> 149:156823d33999 2999 * @retval None
<> 149:156823d33999 3000 */
<> 149:156823d33999 3001 __STATIC_INLINE void LL_RTC_BAK_SetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister, uint32_t Data)
<> 149:156823d33999 3002 {
<> 149:156823d33999 3003 register uint32_t tmp = 0U;
<> 149:156823d33999 3004
<> 149:156823d33999 3005 tmp = (uint32_t)(&(RTCx->BKP0R));
<> 149:156823d33999 3006 tmp += (BackupRegister * 4U);
<> 149:156823d33999 3007
<> 149:156823d33999 3008 /* Write the specified register */
<> 149:156823d33999 3009 *(__IO uint32_t *)tmp = (uint32_t)Data;
<> 149:156823d33999 3010 }
<> 149:156823d33999 3011
<> 149:156823d33999 3012 /**
<> 149:156823d33999 3013 * @brief Reads data from the specified RTC Backup data Register.
<> 149:156823d33999 3014 * @rmtoll BKPxR BKP LL_RTC_BAK_GetRegister
<> 149:156823d33999 3015 * @param RTCx RTC Instance
<> 149:156823d33999 3016 * @param BackupRegister This parameter can be one of the following values:
<> 149:156823d33999 3017 * @arg @ref LL_RTC_BKP_DR0
<> 149:156823d33999 3018 * @arg @ref LL_RTC_BKP_DR1
<> 149:156823d33999 3019 * @arg @ref LL_RTC_BKP_DR2
<> 149:156823d33999 3020 * @arg @ref LL_RTC_BKP_DR3
<> 149:156823d33999 3021 * @arg @ref LL_RTC_BKP_DR4
<> 149:156823d33999 3022 * @arg @ref LL_RTC_BKP_DR5 (*)
<> 149:156823d33999 3023 * @arg @ref LL_RTC_BKP_DR6 (*)
<> 149:156823d33999 3024 * @arg @ref LL_RTC_BKP_DR7 (*)
<> 149:156823d33999 3025 * @arg @ref LL_RTC_BKP_DR8 (*)
<> 149:156823d33999 3026 * @arg @ref LL_RTC_BKP_DR9 (*)
<> 149:156823d33999 3027 * @arg @ref LL_RTC_BKP_DR10 (*)
<> 149:156823d33999 3028 * @arg @ref LL_RTC_BKP_DR11 (*)
<> 149:156823d33999 3029 * @arg @ref LL_RTC_BKP_DR12 (*)
<> 149:156823d33999 3030 * @arg @ref LL_RTC_BKP_DR13 (*)
<> 149:156823d33999 3031 * @arg @ref LL_RTC_BKP_DR14 (*)
<> 149:156823d33999 3032 * @arg @ref LL_RTC_BKP_DR15 (*)
<> 149:156823d33999 3033 * @arg @ref LL_RTC_BKP_DR16 (*)
<> 149:156823d33999 3034 * @arg @ref LL_RTC_BKP_DR17 (*)
<> 149:156823d33999 3035 * @arg @ref LL_RTC_BKP_DR18 (*)
<> 149:156823d33999 3036 * @arg @ref LL_RTC_BKP_DR19 (*)
<> 149:156823d33999 3037 * @arg @ref LL_RTC_BKP_DR20 (*)
<> 149:156823d33999 3038 * @arg @ref LL_RTC_BKP_DR21 (*)
<> 149:156823d33999 3039 * @arg @ref LL_RTC_BKP_DR22 (*)
<> 149:156823d33999 3040 * @arg @ref LL_RTC_BKP_DR23 (*)
<> 149:156823d33999 3041 * @arg @ref LL_RTC_BKP_DR24 (*)
<> 149:156823d33999 3042 * @arg @ref LL_RTC_BKP_DR25 (*)
<> 149:156823d33999 3043 * @arg @ref LL_RTC_BKP_DR26 (*)
<> 149:156823d33999 3044 * @arg @ref LL_RTC_BKP_DR27 (*)
<> 149:156823d33999 3045 * @arg @ref LL_RTC_BKP_DR28 (*)
<> 149:156823d33999 3046 * @arg @ref LL_RTC_BKP_DR29 (*)
<> 149:156823d33999 3047 * @arg @ref LL_RTC_BKP_DR30 (*)
<> 149:156823d33999 3048 * @arg @ref LL_RTC_BKP_DR31 (*)
<> 149:156823d33999 3049 *
<> 149:156823d33999 3050 * (*) value not defined in all devices.
<> 149:156823d33999 3051 * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
<> 149:156823d33999 3052 */
<> 149:156823d33999 3053 __STATIC_INLINE uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister)
<> 149:156823d33999 3054 {
<> 149:156823d33999 3055 register uint32_t tmp = 0U;
<> 149:156823d33999 3056
<> 149:156823d33999 3057 tmp = (uint32_t)(&(RTCx->BKP0R));
<> 149:156823d33999 3058 tmp += (BackupRegister * 4U);
<> 149:156823d33999 3059
<> 149:156823d33999 3060 /* Read the specified register */
<> 149:156823d33999 3061 return (*(__IO uint32_t *)tmp);
<> 149:156823d33999 3062 }
<> 149:156823d33999 3063
<> 149:156823d33999 3064 /**
<> 149:156823d33999 3065 * @}
<> 149:156823d33999 3066 */
<> 149:156823d33999 3067 #endif /* RTC_BACKUP_SUPPORT */
<> 149:156823d33999 3068
<> 149:156823d33999 3069 /** @defgroup RTC_LL_EF_Calibration Calibration
<> 149:156823d33999 3070 * @{
<> 149:156823d33999 3071 */
<> 149:156823d33999 3072
<> 149:156823d33999 3073 /**
<> 149:156823d33999 3074 * @brief Set Calibration output frequency (1 Hz or 512 Hz)
<> 149:156823d33999 3075 * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3076 * @rmtoll CR COE LL_RTC_CAL_SetOutputFreq\n
<> 149:156823d33999 3077 * CR COSEL LL_RTC_CAL_SetOutputFreq
<> 149:156823d33999 3078 * @param RTCx RTC Instance
<> 149:156823d33999 3079 * @param Frequency This parameter can be one of the following values:
<> 149:156823d33999 3080 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
<> 149:156823d33999 3081 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ (*)
<> 149:156823d33999 3082 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
<> 149:156823d33999 3083 *
<> 149:156823d33999 3084 * (*) value not defined in all devices.
<> 149:156823d33999 3085 * @retval None
<> 149:156823d33999 3086 */
<> 149:156823d33999 3087 __STATIC_INLINE void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef *RTCx, uint32_t Frequency)
<> 149:156823d33999 3088 {
<> 149:156823d33999 3089 #if defined(RTC_CR_COSEL)
<> 149:156823d33999 3090 MODIFY_REG(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL, Frequency);
<> 149:156823d33999 3091 #else
<> 149:156823d33999 3092 MODIFY_REG(RTCx->CR, RTC_CR_COE, Frequency);
<> 149:156823d33999 3093 #endif /* RTC_CR_COSEL */
<> 149:156823d33999 3094 }
<> 149:156823d33999 3095
<> 149:156823d33999 3096 /**
<> 149:156823d33999 3097 * @brief Get Calibration output frequency (1 Hz or 512 Hz)
<> 149:156823d33999 3098 * @rmtoll CR COE LL_RTC_CAL_GetOutputFreq\n
<> 149:156823d33999 3099 * CR COSEL LL_RTC_CAL_GetOutputFreq
<> 149:156823d33999 3100 * @param RTCx RTC Instance
<> 149:156823d33999 3101 * @retval Returned value can be one of the following values:
<> 149:156823d33999 3102 * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
<> 149:156823d33999 3103 * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ (*)
<> 149:156823d33999 3104 * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ
<> 149:156823d33999 3105 *
<> 149:156823d33999 3106 * (*) value not defined in all devices.
<> 149:156823d33999 3107 */
<> 149:156823d33999 3108 __STATIC_INLINE uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef *RTCx)
<> 149:156823d33999 3109 {
<> 149:156823d33999 3110 #if defined(RTC_CR_COSEL)
<> 149:156823d33999 3111 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL));
<> 149:156823d33999 3112 #else
<> 149:156823d33999 3113 return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_COE));
<> 149:156823d33999 3114 #endif /* RTC_CR_COSEL */
<> 149:156823d33999 3115 }
<> 149:156823d33999 3116
<> 149:156823d33999 3117 /**
<> 149:156823d33999 3118 * @brief Enable Coarse digital calibration
<> 149:156823d33999 3119 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3120 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 3121 * @rmtoll CR DCE LL_RTC_CAL_EnableCoarseDigital
<> 149:156823d33999 3122 * @param RTCx RTC Instance
<> 149:156823d33999 3123 * @retval None
<> 149:156823d33999 3124 */
<> 149:156823d33999 3125 __STATIC_INLINE void LL_RTC_CAL_EnableCoarseDigital(RTC_TypeDef *RTCx)
<> 149:156823d33999 3126 {
<> 149:156823d33999 3127 SET_BIT(RTCx->CR, RTC_CR_DCE);
<> 149:156823d33999 3128 }
<> 149:156823d33999 3129
<> 149:156823d33999 3130 /**
<> 149:156823d33999 3131 * @brief Disable Coarse digital calibration
<> 149:156823d33999 3132 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3133 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 3134 * @rmtoll CR DCE LL_RTC_CAL_DisableCoarseDigital
<> 149:156823d33999 3135 * @param RTCx RTC Instance
<> 149:156823d33999 3136 * @retval None
<> 149:156823d33999 3137 */
<> 149:156823d33999 3138 __STATIC_INLINE void LL_RTC_CAL_DisableCoarseDigital(RTC_TypeDef *RTCx)
<> 149:156823d33999 3139 {
<> 149:156823d33999 3140 CLEAR_BIT(RTCx->CR, RTC_CR_DCE);
<> 149:156823d33999 3141 }
<> 149:156823d33999 3142
<> 149:156823d33999 3143 /**
<> 149:156823d33999 3144 * @brief Set the coarse digital calibration
<> 149:156823d33999 3145 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3146 * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function)
<> 149:156823d33999 3147 * @rmtoll CALIBR DCS LL_RTC_CAL_ConfigCoarseDigital\n
<> 149:156823d33999 3148 * CALIBR DC LL_RTC_CAL_ConfigCoarseDigital
<> 149:156823d33999 3149 * @param RTCx RTC Instance
<> 149:156823d33999 3150 * @param Sign This parameter can be one of the following values:
<> 149:156823d33999 3151 * @arg @ref LL_RTC_CALIB_SIGN_POSITIVE
<> 149:156823d33999 3152 * @arg @ref LL_RTC_CALIB_SIGN_NEGATIVE
<> 149:156823d33999 3153 * @param Value value of coarse calibration expressed in ppm (coded on 5 bits)
<> 149:156823d33999 3154 * @note This Calibration value should be between 0 and 63 when using negative sign with a 2-ppm step.
<> 149:156823d33999 3155 * @note This Calibration value should be between 0 and 126 when using positive sign with a 4-ppm step.
<> 149:156823d33999 3156 * @retval None
<> 149:156823d33999 3157 */
<> 149:156823d33999 3158 __STATIC_INLINE void LL_RTC_CAL_ConfigCoarseDigital(RTC_TypeDef* RTCx, uint32_t Sign, uint32_t Value)
<> 149:156823d33999 3159 {
<> 149:156823d33999 3160 MODIFY_REG(RTCx->CALIBR, RTC_CALIBR_DCS | RTC_CALIBR_DC, Sign | Value);
<> 149:156823d33999 3161 }
<> 149:156823d33999 3162
<> 149:156823d33999 3163 /**
<> 149:156823d33999 3164 * @brief Get the coarse digital calibration value
<> 149:156823d33999 3165 * @rmtoll CALIBR DC LL_RTC_CAL_GetCoarseDigitalValue
<> 149:156823d33999 3166 * @param RTCx RTC Instance
<> 149:156823d33999 3167 * @retval value of coarse calibration expressed in ppm (coded on 5 bits)
<> 149:156823d33999 3168 */
<> 149:156823d33999 3169 __STATIC_INLINE uint32_t LL_RTC_CAL_GetCoarseDigitalValue(RTC_TypeDef *RTCx)
<> 149:156823d33999 3170 {
<> 149:156823d33999 3171 return (uint32_t)(READ_BIT(RTCx->CALIBR, RTC_CALIBR_DC));
<> 149:156823d33999 3172 }
<> 149:156823d33999 3173
<> 149:156823d33999 3174 /**
<> 149:156823d33999 3175 * @brief Get the coarse digital calibration sign
<> 149:156823d33999 3176 * @rmtoll CALIBR DCS LL_RTC_CAL_GetCoarseDigitalSign
<> 149:156823d33999 3177 * @param RTCx RTC Instance
<> 149:156823d33999 3178 * @retval Returned value can be one of the following values:
<> 149:156823d33999 3179 * @arg @ref LL_RTC_CALIB_SIGN_POSITIVE
<> 149:156823d33999 3180 * @arg @ref LL_RTC_CALIB_SIGN_NEGATIVE
<> 149:156823d33999 3181 */
<> 149:156823d33999 3182 __STATIC_INLINE uint32_t LL_RTC_CAL_GetCoarseDigitalSign(RTC_TypeDef* RTCx)
<> 149:156823d33999 3183 {
<> 149:156823d33999 3184 return (uint32_t)(READ_BIT(RTCx->CALIBR, RTC_CALIBR_DCS));
<> 149:156823d33999 3185 }
<> 149:156823d33999 3186
<> 149:156823d33999 3187 #if defined(RTC_SMOOTHCALIB_SUPPORT)
<> 149:156823d33999 3188 /**
<> 149:156823d33999 3189 * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm)
<> 149:156823d33999 3190 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3191 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
<> 149:156823d33999 3192 * @rmtoll CALR CALP LL_RTC_CAL_SetPulse
<> 149:156823d33999 3193 * @param RTCx RTC Instance
<> 149:156823d33999 3194 * @param Pulse This parameter can be one of the following values:
<> 149:156823d33999 3195 * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE
<> 149:156823d33999 3196 * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET
<> 149:156823d33999 3197 * @retval None
<> 149:156823d33999 3198 */
<> 149:156823d33999 3199 __STATIC_INLINE void LL_RTC_CAL_SetPulse(RTC_TypeDef *RTCx, uint32_t Pulse)
<> 149:156823d33999 3200 {
<> 149:156823d33999 3201 MODIFY_REG(RTCx->CALR, RTC_CALR_CALP, Pulse);
<> 149:156823d33999 3202 }
<> 149:156823d33999 3203
<> 149:156823d33999 3204 /**
<> 149:156823d33999 3205 * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm)
<> 149:156823d33999 3206 * @rmtoll CALR CALP LL_RTC_CAL_IsPulseInserted
<> 149:156823d33999 3207 * @param RTCx RTC Instance
<> 149:156823d33999 3208 * @retval State of bit (1 or 0).
<> 149:156823d33999 3209 */
<> 149:156823d33999 3210 __STATIC_INLINE uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef *RTCx)
<> 149:156823d33999 3211 {
<> 149:156823d33999 3212 return (READ_BIT(RTCx->CALR, RTC_CALR_CALP) == (RTC_CALR_CALP));
<> 149:156823d33999 3213 }
<> 149:156823d33999 3214
<> 149:156823d33999 3215 /**
<> 149:156823d33999 3216 * @brief Set the calibration cycle period
<> 149:156823d33999 3217 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3218 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
<> 149:156823d33999 3219 * @rmtoll CALR CALW8 LL_RTC_CAL_SetPeriod\n
<> 149:156823d33999 3220 * CALR CALW16 LL_RTC_CAL_SetPeriod
<> 149:156823d33999 3221 * @param RTCx RTC Instance
<> 149:156823d33999 3222 * @param Period This parameter can be one of the following values:
<> 149:156823d33999 3223 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
<> 149:156823d33999 3224 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
<> 149:156823d33999 3225 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
<> 149:156823d33999 3226 * @retval None
<> 149:156823d33999 3227 */
<> 149:156823d33999 3228 __STATIC_INLINE void LL_RTC_CAL_SetPeriod(RTC_TypeDef *RTCx, uint32_t Period)
<> 149:156823d33999 3229 {
<> 149:156823d33999 3230 MODIFY_REG(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16, Period);
<> 149:156823d33999 3231 }
<> 149:156823d33999 3232
<> 149:156823d33999 3233 /**
<> 149:156823d33999 3234 * @brief Get the calibration cycle period
<> 149:156823d33999 3235 * @rmtoll CALR CALW8 LL_RTC_CAL_GetPeriod\n
<> 149:156823d33999 3236 * CALR CALW16 LL_RTC_CAL_GetPeriod
<> 149:156823d33999 3237 * @param RTCx RTC Instance
<> 149:156823d33999 3238 * @retval Returned value can be one of the following values:
<> 149:156823d33999 3239 * @arg @ref LL_RTC_CALIB_PERIOD_32SEC
<> 149:156823d33999 3240 * @arg @ref LL_RTC_CALIB_PERIOD_16SEC
<> 149:156823d33999 3241 * @arg @ref LL_RTC_CALIB_PERIOD_8SEC
<> 149:156823d33999 3242 */
<> 149:156823d33999 3243 __STATIC_INLINE uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef *RTCx)
<> 149:156823d33999 3244 {
<> 149:156823d33999 3245 return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16));
<> 149:156823d33999 3246 }
<> 149:156823d33999 3247
<> 149:156823d33999 3248 /**
<> 149:156823d33999 3249 * @brief Set Calibration minus
<> 149:156823d33999 3250 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3251 * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR
<> 149:156823d33999 3252 * @rmtoll CALR CALM LL_RTC_CAL_SetMinus
<> 149:156823d33999 3253 * @param RTCx RTC Instance
<> 149:156823d33999 3254 * @param CalibMinus Value between Min_Data=0x00 and Max_Data=0x1FF
<> 149:156823d33999 3255 * @retval None
<> 149:156823d33999 3256 */
<> 149:156823d33999 3257 __STATIC_INLINE void LL_RTC_CAL_SetMinus(RTC_TypeDef *RTCx, uint32_t CalibMinus)
<> 149:156823d33999 3258 {
<> 149:156823d33999 3259 MODIFY_REG(RTCx->CALR, RTC_CALR_CALM, CalibMinus);
<> 149:156823d33999 3260 }
<> 149:156823d33999 3261
<> 149:156823d33999 3262 /**
<> 149:156823d33999 3263 * @brief Get Calibration minus
<> 149:156823d33999 3264 * @rmtoll CALR CALM LL_RTC_CAL_GetMinus
<> 149:156823d33999 3265 * @param RTCx RTC Instance
<> 149:156823d33999 3266 * @retval Value between Min_Data=0x00 and Max_Data= 0x1FF
<> 149:156823d33999 3267 */
<> 149:156823d33999 3268 __STATIC_INLINE uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef *RTCx)
<> 149:156823d33999 3269 {
<> 149:156823d33999 3270 return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALM));
<> 149:156823d33999 3271 }
<> 149:156823d33999 3272 #endif /* RTC_SMOOTHCALIB_SUPPORT */
<> 149:156823d33999 3273
<> 149:156823d33999 3274 /**
<> 149:156823d33999 3275 * @}
<> 149:156823d33999 3276 */
<> 149:156823d33999 3277
<> 149:156823d33999 3278 /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
<> 149:156823d33999 3279 * @{
<> 149:156823d33999 3280 */
<> 149:156823d33999 3281
<> 149:156823d33999 3282 #if defined(RTC_SMOOTHCALIB_SUPPORT)
<> 149:156823d33999 3283 /**
<> 149:156823d33999 3284 * @brief Get Recalibration pending Flag
<> 149:156823d33999 3285 * @rmtoll ISR RECALPF LL_RTC_IsActiveFlag_RECALP
<> 149:156823d33999 3286 * @param RTCx RTC Instance
<> 149:156823d33999 3287 * @retval State of bit (1 or 0).
<> 149:156823d33999 3288 */
<> 149:156823d33999 3289 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef *RTCx)
<> 149:156823d33999 3290 {
<> 149:156823d33999 3291 return (READ_BIT(RTCx->ISR, RTC_ISR_RECALPF) == (RTC_ISR_RECALPF));
<> 149:156823d33999 3292 }
<> 149:156823d33999 3293 #endif /* RTC_SMOOTHCALIB_SUPPORT */
<> 149:156823d33999 3294
<> 149:156823d33999 3295 #if defined(RTC_TAMPER3_SUPPORT)
<> 149:156823d33999 3296 /**
<> 149:156823d33999 3297 * @brief Get RTC_TAMP3 detection flag
<> 149:156823d33999 3298 * @rmtoll ISR TAMP3F LL_RTC_IsActiveFlag_TAMP3
<> 149:156823d33999 3299 * @param RTCx RTC Instance
<> 149:156823d33999 3300 * @retval State of bit (1 or 0).
<> 149:156823d33999 3301 */
<> 149:156823d33999 3302 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef *RTCx)
<> 149:156823d33999 3303 {
<> 149:156823d33999 3304 return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP3F) == (RTC_ISR_TAMP3F));
<> 149:156823d33999 3305 }
<> 149:156823d33999 3306 #endif /* RTC_TAMPER3_SUPPORT */
<> 149:156823d33999 3307
<> 149:156823d33999 3308 #if defined(RTC_TAMPER2_SUPPORT)
<> 149:156823d33999 3309 /**
<> 149:156823d33999 3310 * @brief Get RTC_TAMP2 detection flag
<> 149:156823d33999 3311 * @rmtoll ISR TAMP2F LL_RTC_IsActiveFlag_TAMP2
<> 149:156823d33999 3312 * @param RTCx RTC Instance
<> 149:156823d33999 3313 * @retval State of bit (1 or 0).
<> 149:156823d33999 3314 */
<> 149:156823d33999 3315 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef *RTCx)
<> 149:156823d33999 3316 {
<> 149:156823d33999 3317 return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP2F) == (RTC_ISR_TAMP2F));
<> 149:156823d33999 3318 }
<> 149:156823d33999 3319 #endif /* RTC_TAMPER2_SUPPORT */
<> 149:156823d33999 3320
<> 149:156823d33999 3321 #if defined(RTC_TAMPER1_SUPPORT)
<> 149:156823d33999 3322 /**
<> 149:156823d33999 3323 * @brief Get RTC_TAMP1 detection flag
<> 149:156823d33999 3324 * @rmtoll ISR TAMP1F LL_RTC_IsActiveFlag_TAMP1
<> 149:156823d33999 3325 * @param RTCx RTC Instance
<> 149:156823d33999 3326 * @retval State of bit (1 or 0).
<> 149:156823d33999 3327 */
<> 149:156823d33999 3328 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef *RTCx)
<> 149:156823d33999 3329 {
<> 149:156823d33999 3330 return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP1F) == (RTC_ISR_TAMP1F));
<> 149:156823d33999 3331 }
<> 149:156823d33999 3332 #endif /* RTC_TAMPER1_SUPPORT */
<> 149:156823d33999 3333
<> 149:156823d33999 3334 /**
<> 149:156823d33999 3335 * @brief Get Time-stamp overflow flag
<> 149:156823d33999 3336 * @rmtoll ISR TSOVF LL_RTC_IsActiveFlag_TSOV
<> 149:156823d33999 3337 * @param RTCx RTC Instance
<> 149:156823d33999 3338 * @retval State of bit (1 or 0).
<> 149:156823d33999 3339 */
<> 149:156823d33999 3340 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef *RTCx)
<> 149:156823d33999 3341 {
<> 149:156823d33999 3342 return (READ_BIT(RTCx->ISR, RTC_ISR_TSOVF) == (RTC_ISR_TSOVF));
<> 149:156823d33999 3343 }
<> 149:156823d33999 3344
<> 149:156823d33999 3345 /**
<> 149:156823d33999 3346 * @brief Get Time-stamp flag
<> 149:156823d33999 3347 * @rmtoll ISR TSF LL_RTC_IsActiveFlag_TS
<> 149:156823d33999 3348 * @param RTCx RTC Instance
<> 149:156823d33999 3349 * @retval State of bit (1 or 0).
<> 149:156823d33999 3350 */
<> 149:156823d33999 3351 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3352 {
<> 149:156823d33999 3353 return (READ_BIT(RTCx->ISR, RTC_ISR_TSF) == (RTC_ISR_TSF));
<> 149:156823d33999 3354 }
<> 149:156823d33999 3355
<> 149:156823d33999 3356 #if defined(RTC_WAKEUP_SUPPORT)
<> 149:156823d33999 3357 /**
<> 149:156823d33999 3358 * @brief Get Wakeup timer flag
<> 149:156823d33999 3359 * @rmtoll ISR WUTF LL_RTC_IsActiveFlag_WUT
<> 149:156823d33999 3360 * @param RTCx RTC Instance
<> 149:156823d33999 3361 * @retval State of bit (1 or 0).
<> 149:156823d33999 3362 */
<> 149:156823d33999 3363 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef *RTCx)
<> 149:156823d33999 3364 {
<> 149:156823d33999 3365 return (READ_BIT(RTCx->ISR, RTC_ISR_WUTF) == (RTC_ISR_WUTF));
<> 149:156823d33999 3366 }
<> 149:156823d33999 3367 #endif /* RTC_WAKEUP_SUPPORT */
<> 149:156823d33999 3368
<> 149:156823d33999 3369 /**
<> 149:156823d33999 3370 * @brief Get Alarm B flag
<> 149:156823d33999 3371 * @rmtoll ISR ALRBF LL_RTC_IsActiveFlag_ALRB
<> 149:156823d33999 3372 * @param RTCx RTC Instance
<> 149:156823d33999 3373 * @retval State of bit (1 or 0).
<> 149:156823d33999 3374 */
<> 149:156823d33999 3375 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef *RTCx)
<> 149:156823d33999 3376 {
<> 149:156823d33999 3377 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBF) == (RTC_ISR_ALRBF));
<> 149:156823d33999 3378 }
<> 149:156823d33999 3379
<> 149:156823d33999 3380 /**
<> 149:156823d33999 3381 * @brief Get Alarm A flag
<> 149:156823d33999 3382 * @rmtoll ISR ALRAF LL_RTC_IsActiveFlag_ALRA
<> 149:156823d33999 3383 * @param RTCx RTC Instance
<> 149:156823d33999 3384 * @retval State of bit (1 or 0).
<> 149:156823d33999 3385 */
<> 149:156823d33999 3386 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef *RTCx)
<> 149:156823d33999 3387 {
<> 149:156823d33999 3388 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAF) == (RTC_ISR_ALRAF));
<> 149:156823d33999 3389 }
<> 149:156823d33999 3390
<> 149:156823d33999 3391 #if defined(RTC_TAMPER3_SUPPORT)
<> 149:156823d33999 3392 /**
<> 149:156823d33999 3393 * @brief Clear RTC_TAMP3 detection flag
<> 149:156823d33999 3394 * @rmtoll ISR TAMP3F LL_RTC_ClearFlag_TAMP3
<> 149:156823d33999 3395 * @param RTCx RTC Instance
<> 149:156823d33999 3396 * @retval None
<> 149:156823d33999 3397 */
<> 149:156823d33999 3398 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef *RTCx)
<> 149:156823d33999 3399 {
<> 149:156823d33999 3400 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP3F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3401 }
<> 149:156823d33999 3402 #endif /* RTC_TAMPER3_SUPPORT */
<> 149:156823d33999 3403
<> 149:156823d33999 3404 #if defined(RTC_TAMPER2_SUPPORT)
<> 149:156823d33999 3405 /**
<> 149:156823d33999 3406 * @brief Clear RTC_TAMP2 detection flag
<> 149:156823d33999 3407 * @rmtoll ISR TAMP2F LL_RTC_ClearFlag_TAMP2
<> 149:156823d33999 3408 * @param RTCx RTC Instance
<> 149:156823d33999 3409 * @retval None
<> 149:156823d33999 3410 */
<> 149:156823d33999 3411 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef *RTCx)
<> 149:156823d33999 3412 {
<> 149:156823d33999 3413 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP2F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3414 }
<> 149:156823d33999 3415 #endif /* RTC_TAMPER2_SUPPORT */
<> 149:156823d33999 3416
<> 149:156823d33999 3417 #if defined(RTC_TAMPER1_SUPPORT)
<> 149:156823d33999 3418 /**
<> 149:156823d33999 3419 * @brief Clear RTC_TAMP1 detection flag
<> 149:156823d33999 3420 * @rmtoll ISR TAMP1F LL_RTC_ClearFlag_TAMP1
<> 149:156823d33999 3421 * @param RTCx RTC Instance
<> 149:156823d33999 3422 * @retval None
<> 149:156823d33999 3423 */
<> 149:156823d33999 3424 __STATIC_INLINE void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef *RTCx)
<> 149:156823d33999 3425 {
<> 149:156823d33999 3426 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP1F | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3427 }
<> 149:156823d33999 3428 #endif /* RTC_TAMPER1_SUPPORT */
<> 149:156823d33999 3429
<> 149:156823d33999 3430 /**
<> 149:156823d33999 3431 * @brief Clear Time-stamp overflow flag
<> 149:156823d33999 3432 * @rmtoll ISR TSOVF LL_RTC_ClearFlag_TSOV
<> 149:156823d33999 3433 * @param RTCx RTC Instance
<> 149:156823d33999 3434 * @retval None
<> 149:156823d33999 3435 */
<> 149:156823d33999 3436 __STATIC_INLINE void LL_RTC_ClearFlag_TSOV(RTC_TypeDef *RTCx)
<> 149:156823d33999 3437 {
<> 149:156823d33999 3438 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSOVF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3439 }
<> 149:156823d33999 3440
<> 149:156823d33999 3441 /**
<> 149:156823d33999 3442 * @brief Clear Time-stamp flag
<> 149:156823d33999 3443 * @rmtoll ISR TSF LL_RTC_ClearFlag_TS
<> 149:156823d33999 3444 * @param RTCx RTC Instance
<> 149:156823d33999 3445 * @retval None
<> 149:156823d33999 3446 */
<> 149:156823d33999 3447 __STATIC_INLINE void LL_RTC_ClearFlag_TS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3448 {
<> 149:156823d33999 3449 WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3450 }
<> 149:156823d33999 3451
<> 149:156823d33999 3452 #if defined(RTC_WAKEUP_SUPPORT)
<> 149:156823d33999 3453 /**
<> 149:156823d33999 3454 * @brief Clear Wakeup timer flag
<> 149:156823d33999 3455 * @rmtoll ISR WUTF LL_RTC_ClearFlag_WUT
<> 149:156823d33999 3456 * @param RTCx RTC Instance
<> 149:156823d33999 3457 * @retval None
<> 149:156823d33999 3458 */
<> 149:156823d33999 3459 __STATIC_INLINE void LL_RTC_ClearFlag_WUT(RTC_TypeDef *RTCx)
<> 149:156823d33999 3460 {
<> 149:156823d33999 3461 WRITE_REG(RTCx->ISR, (~((RTC_ISR_WUTF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3462 }
<> 149:156823d33999 3463 #endif /* RTC_WAKEUP_SUPPORT */
<> 149:156823d33999 3464
<> 149:156823d33999 3465 /**
<> 149:156823d33999 3466 * @brief Clear Alarm B flag
<> 149:156823d33999 3467 * @rmtoll ISR ALRBF LL_RTC_ClearFlag_ALRB
<> 149:156823d33999 3468 * @param RTCx RTC Instance
<> 149:156823d33999 3469 * @retval None
<> 149:156823d33999 3470 */
<> 149:156823d33999 3471 __STATIC_INLINE void LL_RTC_ClearFlag_ALRB(RTC_TypeDef *RTCx)
<> 149:156823d33999 3472 {
<> 149:156823d33999 3473 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRBF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3474 }
<> 149:156823d33999 3475
<> 149:156823d33999 3476 /**
<> 149:156823d33999 3477 * @brief Clear Alarm A flag
<> 149:156823d33999 3478 * @rmtoll ISR ALRAF LL_RTC_ClearFlag_ALRA
<> 149:156823d33999 3479 * @param RTCx RTC Instance
<> 149:156823d33999 3480 * @retval None
<> 149:156823d33999 3481 */
<> 149:156823d33999 3482 __STATIC_INLINE void LL_RTC_ClearFlag_ALRA(RTC_TypeDef *RTCx)
<> 149:156823d33999 3483 {
<> 149:156823d33999 3484 WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRAF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3485 }
<> 149:156823d33999 3486
<> 149:156823d33999 3487 /**
<> 149:156823d33999 3488 * @brief Get Initialization flag
<> 149:156823d33999 3489 * @rmtoll ISR INITF LL_RTC_IsActiveFlag_INIT
<> 149:156823d33999 3490 * @param RTCx RTC Instance
<> 149:156823d33999 3491 * @retval State of bit (1 or 0).
<> 149:156823d33999 3492 */
<> 149:156823d33999 3493 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx)
<> 149:156823d33999 3494 {
<> 149:156823d33999 3495 return (READ_BIT(RTCx->ISR, RTC_ISR_INITF) == (RTC_ISR_INITF));
<> 149:156823d33999 3496 }
<> 149:156823d33999 3497
<> 149:156823d33999 3498 /**
<> 149:156823d33999 3499 * @brief Get Registers synchronization flag
<> 149:156823d33999 3500 * @rmtoll ISR RSF LL_RTC_IsActiveFlag_RS
<> 149:156823d33999 3501 * @param RTCx RTC Instance
<> 149:156823d33999 3502 * @retval State of bit (1 or 0).
<> 149:156823d33999 3503 */
<> 149:156823d33999 3504 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3505 {
<> 149:156823d33999 3506 return (READ_BIT(RTCx->ISR, RTC_ISR_RSF) == (RTC_ISR_RSF));
<> 149:156823d33999 3507 }
<> 149:156823d33999 3508
<> 149:156823d33999 3509 /**
<> 149:156823d33999 3510 * @brief Clear Registers synchronization flag
<> 149:156823d33999 3511 * @rmtoll ISR RSF LL_RTC_ClearFlag_RS
<> 149:156823d33999 3512 * @param RTCx RTC Instance
<> 149:156823d33999 3513 * @retval None
<> 149:156823d33999 3514 */
<> 149:156823d33999 3515 __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3516 {
<> 149:156823d33999 3517 WRITE_REG(RTCx->ISR, (~((RTC_ISR_RSF | RTC_ISR_INIT) & 0x0000FFFFU) | (RTCx->ISR & RTC_ISR_INIT)));
<> 149:156823d33999 3518 }
<> 149:156823d33999 3519
<> 149:156823d33999 3520 /**
<> 149:156823d33999 3521 * @brief Get Initialization status flag
<> 149:156823d33999 3522 * @rmtoll ISR INITS LL_RTC_IsActiveFlag_INITS
<> 149:156823d33999 3523 * @param RTCx RTC Instance
<> 149:156823d33999 3524 * @retval State of bit (1 or 0).
<> 149:156823d33999 3525 */
<> 149:156823d33999 3526 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3527 {
<> 149:156823d33999 3528 return (READ_BIT(RTCx->ISR, RTC_ISR_INITS) == (RTC_ISR_INITS));
<> 149:156823d33999 3529 }
<> 149:156823d33999 3530
<> 149:156823d33999 3531 #if defined(RTC_ISR_SHPF)
<> 149:156823d33999 3532 /**
<> 149:156823d33999 3533 * @brief Get Shift operation pending flag
<> 149:156823d33999 3534 * @rmtoll ISR SHPF LL_RTC_IsActiveFlag_SHP
<> 149:156823d33999 3535 * @param RTCx RTC Instance
<> 149:156823d33999 3536 * @retval State of bit (1 or 0).
<> 149:156823d33999 3537 */
<> 149:156823d33999 3538 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef *RTCx)
<> 149:156823d33999 3539 {
<> 149:156823d33999 3540 return (READ_BIT(RTCx->ISR, RTC_ISR_SHPF) == (RTC_ISR_SHPF));
<> 149:156823d33999 3541 }
<> 149:156823d33999 3542 #endif /* RTC_ISR_SHPF */
<> 149:156823d33999 3543
<> 149:156823d33999 3544 #if defined(RTC_WAKEUP_SUPPORT)
<> 149:156823d33999 3545 /**
<> 149:156823d33999 3546 * @brief Get Wakeup timer write flag
<> 149:156823d33999 3547 * @rmtoll ISR WUTWF LL_RTC_IsActiveFlag_WUTW
<> 149:156823d33999 3548 * @param RTCx RTC Instance
<> 149:156823d33999 3549 * @retval State of bit (1 or 0).
<> 149:156823d33999 3550 */
<> 149:156823d33999 3551 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef *RTCx)
<> 149:156823d33999 3552 {
<> 149:156823d33999 3553 return (READ_BIT(RTCx->ISR, RTC_ISR_WUTWF) == (RTC_ISR_WUTWF));
<> 149:156823d33999 3554 }
<> 149:156823d33999 3555 #endif /* RTC_WAKEUP_SUPPORT */
<> 149:156823d33999 3556
<> 149:156823d33999 3557 /**
<> 149:156823d33999 3558 * @brief Get Alarm B write flag
<> 149:156823d33999 3559 * @rmtoll ISR ALRBWF LL_RTC_IsActiveFlag_ALRBW
<> 149:156823d33999 3560 * @param RTCx RTC Instance
<> 149:156823d33999 3561 * @retval State of bit (1 or 0).
<> 149:156823d33999 3562 */
<> 149:156823d33999 3563 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef *RTCx)
<> 149:156823d33999 3564 {
<> 149:156823d33999 3565 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBWF) == (RTC_ISR_ALRBWF));
<> 149:156823d33999 3566 }
<> 149:156823d33999 3567
<> 149:156823d33999 3568 /**
<> 149:156823d33999 3569 * @brief Get Alarm A write flag
<> 149:156823d33999 3570 * @rmtoll ISR ALRAWF LL_RTC_IsActiveFlag_ALRAW
<> 149:156823d33999 3571 * @param RTCx RTC Instance
<> 149:156823d33999 3572 * @retval State of bit (1 or 0).
<> 149:156823d33999 3573 */
<> 149:156823d33999 3574 __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef *RTCx)
<> 149:156823d33999 3575 {
<> 149:156823d33999 3576 return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAWF) == (RTC_ISR_ALRAWF));
<> 149:156823d33999 3577 }
<> 149:156823d33999 3578
<> 149:156823d33999 3579 /**
<> 149:156823d33999 3580 * @}
<> 149:156823d33999 3581 */
<> 149:156823d33999 3582
<> 149:156823d33999 3583 /** @defgroup RTC_LL_EF_IT_Management IT_Management
<> 149:156823d33999 3584 * @{
<> 149:156823d33999 3585 */
<> 149:156823d33999 3586
<> 149:156823d33999 3587 /**
<> 149:156823d33999 3588 * @brief Enable Time-stamp interrupt
<> 149:156823d33999 3589 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3590 * @rmtoll CR TSIE LL_RTC_EnableIT_TS
<> 149:156823d33999 3591 * @param RTCx RTC Instance
<> 149:156823d33999 3592 * @retval None
<> 149:156823d33999 3593 */
<> 149:156823d33999 3594 __STATIC_INLINE void LL_RTC_EnableIT_TS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3595 {
<> 149:156823d33999 3596 SET_BIT(RTCx->CR, RTC_CR_TSIE);
<> 149:156823d33999 3597 }
<> 149:156823d33999 3598
<> 149:156823d33999 3599 /**
<> 149:156823d33999 3600 * @brief Disable Time-stamp interrupt
<> 149:156823d33999 3601 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3602 * @rmtoll CR TSIE LL_RTC_DisableIT_TS
<> 149:156823d33999 3603 * @param RTCx RTC Instance
<> 149:156823d33999 3604 * @retval None
<> 149:156823d33999 3605 */
<> 149:156823d33999 3606 __STATIC_INLINE void LL_RTC_DisableIT_TS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3607 {
<> 149:156823d33999 3608 CLEAR_BIT(RTCx->CR, RTC_CR_TSIE);
<> 149:156823d33999 3609 }
<> 149:156823d33999 3610
<> 149:156823d33999 3611 #if defined(RTC_WAKEUP_SUPPORT)
<> 149:156823d33999 3612 /**
<> 149:156823d33999 3613 * @brief Enable Wakeup timer interrupt
<> 149:156823d33999 3614 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3615 * @rmtoll CR WUTIE LL_RTC_EnableIT_WUT
<> 149:156823d33999 3616 * @param RTCx RTC Instance
<> 149:156823d33999 3617 * @retval None
<> 149:156823d33999 3618 */
<> 149:156823d33999 3619 __STATIC_INLINE void LL_RTC_EnableIT_WUT(RTC_TypeDef *RTCx)
<> 149:156823d33999 3620 {
<> 149:156823d33999 3621 SET_BIT(RTCx->CR, RTC_CR_WUTIE);
<> 149:156823d33999 3622 }
<> 149:156823d33999 3623
<> 149:156823d33999 3624 /**
<> 149:156823d33999 3625 * @brief Disable Wakeup timer interrupt
<> 149:156823d33999 3626 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3627 * @rmtoll CR WUTIE LL_RTC_DisableIT_WUT
<> 149:156823d33999 3628 * @param RTCx RTC Instance
<> 149:156823d33999 3629 * @retval None
<> 149:156823d33999 3630 */
<> 149:156823d33999 3631 __STATIC_INLINE void LL_RTC_DisableIT_WUT(RTC_TypeDef *RTCx)
<> 149:156823d33999 3632 {
<> 149:156823d33999 3633 CLEAR_BIT(RTCx->CR, RTC_CR_WUTIE);
<> 149:156823d33999 3634 }
<> 149:156823d33999 3635 #endif /* RTC_WAKEUP_SUPPORT */
<> 149:156823d33999 3636
<> 149:156823d33999 3637 /**
<> 149:156823d33999 3638 * @brief Enable Alarm B interrupt
<> 149:156823d33999 3639 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3640 * @rmtoll CR ALRBIE LL_RTC_EnableIT_ALRB
<> 149:156823d33999 3641 * @param RTCx RTC Instance
<> 149:156823d33999 3642 * @retval None
<> 149:156823d33999 3643 */
<> 149:156823d33999 3644 __STATIC_INLINE void LL_RTC_EnableIT_ALRB(RTC_TypeDef *RTCx)
<> 149:156823d33999 3645 {
<> 149:156823d33999 3646 SET_BIT(RTCx->CR, RTC_CR_ALRBIE);
<> 149:156823d33999 3647 }
<> 149:156823d33999 3648
<> 149:156823d33999 3649 /**
<> 149:156823d33999 3650 * @brief Disable Alarm B interrupt
<> 149:156823d33999 3651 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3652 * @rmtoll CR ALRBIE LL_RTC_DisableIT_ALRB
<> 149:156823d33999 3653 * @param RTCx RTC Instance
<> 149:156823d33999 3654 * @retval None
<> 149:156823d33999 3655 */
<> 149:156823d33999 3656 __STATIC_INLINE void LL_RTC_DisableIT_ALRB(RTC_TypeDef *RTCx)
<> 149:156823d33999 3657 {
<> 149:156823d33999 3658 CLEAR_BIT(RTCx->CR, RTC_CR_ALRBIE);
<> 149:156823d33999 3659 }
<> 149:156823d33999 3660
<> 149:156823d33999 3661 /**
<> 149:156823d33999 3662 * @brief Enable Alarm A interrupt
<> 149:156823d33999 3663 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3664 * @rmtoll CR ALRAIE LL_RTC_EnableIT_ALRA
<> 149:156823d33999 3665 * @param RTCx RTC Instance
<> 149:156823d33999 3666 * @retval None
<> 149:156823d33999 3667 */
<> 149:156823d33999 3668 __STATIC_INLINE void LL_RTC_EnableIT_ALRA(RTC_TypeDef *RTCx)
<> 149:156823d33999 3669 {
<> 149:156823d33999 3670 SET_BIT(RTCx->CR, RTC_CR_ALRAIE);
<> 149:156823d33999 3671 }
<> 149:156823d33999 3672
<> 149:156823d33999 3673 /**
<> 149:156823d33999 3674 * @brief Disable Alarm A interrupt
<> 149:156823d33999 3675 * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
<> 149:156823d33999 3676 * @rmtoll CR ALRAIE LL_RTC_DisableIT_ALRA
<> 149:156823d33999 3677 * @param RTCx RTC Instance
<> 149:156823d33999 3678 * @retval None
<> 149:156823d33999 3679 */
<> 149:156823d33999 3680 __STATIC_INLINE void LL_RTC_DisableIT_ALRA(RTC_TypeDef *RTCx)
<> 149:156823d33999 3681 {
<> 149:156823d33999 3682 CLEAR_BIT(RTCx->CR, RTC_CR_ALRAIE);
<> 149:156823d33999 3683 }
<> 149:156823d33999 3684
<> 149:156823d33999 3685 /**
<> 149:156823d33999 3686 * @brief Enable all Tamper Interrupt
<> 149:156823d33999 3687 * @rmtoll TAFCR TAMPIE LL_RTC_EnableIT_TAMP
<> 149:156823d33999 3688 * @param RTCx RTC Instance
<> 149:156823d33999 3689 * @retval None
<> 149:156823d33999 3690 */
<> 149:156823d33999 3691 __STATIC_INLINE void LL_RTC_EnableIT_TAMP(RTC_TypeDef *RTCx)
<> 149:156823d33999 3692 {
<> 149:156823d33999 3693 SET_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPIE);
<> 149:156823d33999 3694 }
<> 149:156823d33999 3695
<> 149:156823d33999 3696 /**
<> 149:156823d33999 3697 * @brief Disable all Tamper Interrupt
<> 149:156823d33999 3698 * @rmtoll TAFCR TAMPIE LL_RTC_DisableIT_TAMP
<> 149:156823d33999 3699 * @param RTCx RTC Instance
<> 149:156823d33999 3700 * @retval None
<> 149:156823d33999 3701 */
<> 149:156823d33999 3702 __STATIC_INLINE void LL_RTC_DisableIT_TAMP(RTC_TypeDef *RTCx)
<> 149:156823d33999 3703 {
<> 149:156823d33999 3704 CLEAR_BIT(RTCx->TAFCR, RTC_TAFCR_TAMPIE);
<> 149:156823d33999 3705 }
<> 149:156823d33999 3706
<> 149:156823d33999 3707 /**
<> 149:156823d33999 3708 * @brief Check if Time-stamp interrupt is enabled or not
<> 149:156823d33999 3709 * @rmtoll CR TSIE LL_RTC_IsEnabledIT_TS
<> 149:156823d33999 3710 * @param RTCx RTC Instance
<> 149:156823d33999 3711 * @retval State of bit (1 or 0).
<> 149:156823d33999 3712 */
<> 149:156823d33999 3713 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef *RTCx)
<> 149:156823d33999 3714 {
<> 149:156823d33999 3715 return (READ_BIT(RTCx->CR, RTC_CR_TSIE) == (RTC_CR_TSIE));
<> 149:156823d33999 3716 }
<> 149:156823d33999 3717
<> 149:156823d33999 3718 #if defined(RTC_WAKEUP_SUPPORT)
<> 149:156823d33999 3719 /**
<> 149:156823d33999 3720 * @brief Check if Wakeup timer interrupt is enabled or not
<> 149:156823d33999 3721 * @rmtoll CR WUTIE LL_RTC_IsEnabledIT_WUT
<> 149:156823d33999 3722 * @param RTCx RTC Instance
<> 149:156823d33999 3723 * @retval State of bit (1 or 0).
<> 149:156823d33999 3724 */
<> 149:156823d33999 3725 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef *RTCx)
<> 149:156823d33999 3726 {
<> 149:156823d33999 3727 return (READ_BIT(RTCx->CR, RTC_CR_WUTIE) == (RTC_CR_WUTIE));
<> 149:156823d33999 3728 }
<> 149:156823d33999 3729 #endif /* RTC_WAKEUP_SUPPORT */
<> 149:156823d33999 3730
<> 149:156823d33999 3731 /**
<> 149:156823d33999 3732 * @brief Check if Alarm B interrupt is enabled or not
<> 149:156823d33999 3733 * @rmtoll CR ALRBIE LL_RTC_IsEnabledIT_ALRB
<> 149:156823d33999 3734 * @param RTCx RTC Instance
<> 149:156823d33999 3735 * @retval State of bit (1 or 0).
<> 149:156823d33999 3736 */
<> 149:156823d33999 3737 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef *RTCx)
<> 149:156823d33999 3738 {
<> 149:156823d33999 3739 return (READ_BIT(RTCx->CR, RTC_CR_ALRBIE) == (RTC_CR_ALRBIE));
<> 149:156823d33999 3740 }
<> 149:156823d33999 3741
<> 149:156823d33999 3742 /**
<> 149:156823d33999 3743 * @brief Check if Alarm A interrupt is enabled or not
<> 149:156823d33999 3744 * @rmtoll CR ALRAIE LL_RTC_IsEnabledIT_ALRA
<> 149:156823d33999 3745 * @param RTCx RTC Instance
<> 149:156823d33999 3746 * @retval State of bit (1 or 0).
<> 149:156823d33999 3747 */
<> 149:156823d33999 3748 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef *RTCx)
<> 149:156823d33999 3749 {
<> 149:156823d33999 3750 return (READ_BIT(RTCx->CR, RTC_CR_ALRAIE) == (RTC_CR_ALRAIE));
<> 149:156823d33999 3751 }
<> 149:156823d33999 3752
<> 149:156823d33999 3753 /**
<> 149:156823d33999 3754 * @brief Check if all the TAMPER interrupts are enabled or not
<> 149:156823d33999 3755 * @rmtoll TAFCR TAMPIE LL_RTC_IsEnabledIT_TAMP
<> 149:156823d33999 3756 * @param RTCx RTC Instance
<> 149:156823d33999 3757 * @retval State of bit (1 or 0).
<> 149:156823d33999 3758 */
<> 149:156823d33999 3759 __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef *RTCx)
<> 149:156823d33999 3760 {
<> 149:156823d33999 3761 return (READ_BIT(RTCx->TAFCR,
<> 149:156823d33999 3762 RTC_TAFCR_TAMPIE) == (RTC_TAFCR_TAMPIE));
<> 149:156823d33999 3763 }
<> 149:156823d33999 3764
<> 149:156823d33999 3765 /**
<> 149:156823d33999 3766 * @}
<> 149:156823d33999 3767 */
<> 149:156823d33999 3768
<> 149:156823d33999 3769 #if defined(USE_FULL_LL_DRIVER)
<> 149:156823d33999 3770 /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
<> 149:156823d33999 3771 * @{
<> 149:156823d33999 3772 */
<> 149:156823d33999 3773
<> 149:156823d33999 3774 ErrorStatus LL_RTC_DeInit(RTC_TypeDef *RTCx);
<> 149:156823d33999 3775 ErrorStatus LL_RTC_Init(RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct);
<> 149:156823d33999 3776 void LL_RTC_StructInit(LL_RTC_InitTypeDef *RTC_InitStruct);
<> 149:156823d33999 3777 ErrorStatus LL_RTC_TIME_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct);
<> 149:156823d33999 3778 void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef *RTC_TimeStruct);
<> 149:156823d33999 3779 ErrorStatus LL_RTC_DATE_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_DateTypeDef *RTC_DateStruct);
<> 149:156823d33999 3780 void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef *RTC_DateStruct);
<> 149:156823d33999 3781 ErrorStatus LL_RTC_ALMA_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
<> 149:156823d33999 3782 ErrorStatus LL_RTC_ALMB_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
<> 149:156823d33999 3783 void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
<> 149:156823d33999 3784 void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
<> 149:156823d33999 3785 ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx);
<> 149:156823d33999 3786 ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx);
<> 149:156823d33999 3787 ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx);
<> 149:156823d33999 3788
<> 149:156823d33999 3789 /**
<> 149:156823d33999 3790 * @}
<> 149:156823d33999 3791 */
<> 149:156823d33999 3792 #endif /* USE_FULL_LL_DRIVER */
<> 149:156823d33999 3793
<> 149:156823d33999 3794 /**
<> 149:156823d33999 3795 * @}
<> 149:156823d33999 3796 */
<> 149:156823d33999 3797
<> 149:156823d33999 3798 /**
<> 149:156823d33999 3799 * @}
<> 149:156823d33999 3800 */
<> 149:156823d33999 3801
<> 149:156823d33999 3802 #endif /* defined(RTC) */
<> 149:156823d33999 3803
<> 149:156823d33999 3804 /**
<> 149:156823d33999 3805 * @}
<> 149:156823d33999 3806 */
<> 149:156823d33999 3807
<> 149:156823d33999 3808 #ifdef __cplusplus
<> 149:156823d33999 3809 }
<> 149:156823d33999 3810 #endif
<> 149:156823d33999 3811
<> 149:156823d33999 3812 #endif /* __STM32L1xx_LL_RTC_H */
<> 149:156823d33999 3813
<> 149:156823d33999 3814 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/