inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

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