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