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