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