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