The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NUCLEO_F030R8/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_rtc.h@143:86740a56073b, 2017-05-26 (annotated)
- Committer:
- AnnaBridge
- Date:
- Fri May 26 12:30:20 2017 +0100
- Revision:
- 143:86740a56073b
- Parent:
- 134:ad3be0349dc5
Release 143 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 85:024bf7f99721 | 1 | /** |
bogdanm | 85:024bf7f99721 | 2 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 3 | * @file stm32f0xx_hal_rtc.h |
bogdanm | 85:024bf7f99721 | 4 | * @author MCD Application Team |
<> | 134:ad3be0349dc5 | 5 | * @version V1.5.0 |
<> | 134:ad3be0349dc5 | 6 | * @date 04-November-2016 |
bogdanm | 85:024bf7f99721 | 7 | * @brief Header file of RTC HAL module. |
bogdanm | 85:024bf7f99721 | 8 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 9 | * @attention |
bogdanm | 85:024bf7f99721 | 10 | * |
Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
bogdanm | 85:024bf7f99721 | 12 | * |
bogdanm | 85:024bf7f99721 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 85:024bf7f99721 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 85:024bf7f99721 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 85:024bf7f99721 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 85:024bf7f99721 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 85:024bf7f99721 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 85:024bf7f99721 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 85:024bf7f99721 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 85:024bf7f99721 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 85:024bf7f99721 | 22 | * without specific prior written permission. |
bogdanm | 85:024bf7f99721 | 23 | * |
bogdanm | 85:024bf7f99721 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 85:024bf7f99721 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 85:024bf7f99721 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 85:024bf7f99721 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 85:024bf7f99721 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 85:024bf7f99721 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 85:024bf7f99721 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 85:024bf7f99721 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 85:024bf7f99721 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 85:024bf7f99721 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 85:024bf7f99721 | 34 | * |
Kojto | 108:34e6b704fe68 | 35 | ****************************************************************************** |
Kojto | 108:34e6b704fe68 | 36 | */ |
bogdanm | 85:024bf7f99721 | 37 | |
bogdanm | 85:024bf7f99721 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 39 | #ifndef __STM32F0xx_HAL_RTC_H |
bogdanm | 85:024bf7f99721 | 40 | #define __STM32F0xx_HAL_RTC_H |
bogdanm | 85:024bf7f99721 | 41 | |
bogdanm | 85:024bf7f99721 | 42 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 43 | extern "C" { |
bogdanm | 85:024bf7f99721 | 44 | #endif |
bogdanm | 85:024bf7f99721 | 45 | |
bogdanm | 85:024bf7f99721 | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 47 | #include "stm32f0xx_hal_def.h" |
bogdanm | 85:024bf7f99721 | 48 | |
bogdanm | 85:024bf7f99721 | 49 | /** @addtogroup STM32F0xx_HAL_Driver |
bogdanm | 85:024bf7f99721 | 50 | * @{ |
bogdanm | 85:024bf7f99721 | 51 | */ |
bogdanm | 85:024bf7f99721 | 52 | |
Kojto | 108:34e6b704fe68 | 53 | /** @defgroup RTC RTC |
bogdanm | 85:024bf7f99721 | 54 | * @{ |
Kojto | 108:34e6b704fe68 | 55 | */ |
bogdanm | 85:024bf7f99721 | 56 | |
Kojto | 108:34e6b704fe68 | 57 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 58 | /** @defgroup RTC_Exported_Types RTC Exported Types |
bogdanm | 92:4fc01daae5a5 | 59 | * @{ |
bogdanm | 92:4fc01daae5a5 | 60 | */ |
Kojto | 108:34e6b704fe68 | 61 | |
bogdanm | 85:024bf7f99721 | 62 | /** |
bogdanm | 85:024bf7f99721 | 63 | * @brief HAL State structures definition |
Kojto | 108:34e6b704fe68 | 64 | */ |
bogdanm | 85:024bf7f99721 | 65 | typedef enum |
bogdanm | 85:024bf7f99721 | 66 | { |
<> | 134:ad3be0349dc5 | 67 | HAL_RTC_STATE_RESET = 0x00U, /*!< RTC not yet initialized or disabled */ |
<> | 134:ad3be0349dc5 | 68 | HAL_RTC_STATE_READY = 0x01U, /*!< RTC initialized and ready for use */ |
<> | 134:ad3be0349dc5 | 69 | HAL_RTC_STATE_BUSY = 0x02U, /*!< RTC process is ongoing */ |
<> | 134:ad3be0349dc5 | 70 | HAL_RTC_STATE_TIMEOUT = 0x03U, /*!< RTC timeout state */ |
<> | 134:ad3be0349dc5 | 71 | HAL_RTC_STATE_ERROR = 0x04U /*!< RTC error state */ |
Kojto | 108:34e6b704fe68 | 72 | |
bogdanm | 85:024bf7f99721 | 73 | }HAL_RTCStateTypeDef; |
bogdanm | 85:024bf7f99721 | 74 | |
bogdanm | 85:024bf7f99721 | 75 | /** |
Kojto | 108:34e6b704fe68 | 76 | * @brief RTC Configuration Structure definition |
bogdanm | 85:024bf7f99721 | 77 | */ |
bogdanm | 85:024bf7f99721 | 78 | typedef struct |
bogdanm | 85:024bf7f99721 | 79 | { |
bogdanm | 85:024bf7f99721 | 80 | uint32_t HourFormat; /*!< Specifies the RTC Hour Format. |
Kojto | 108:34e6b704fe68 | 81 | This parameter can be a value of @ref RTC_Hour_Formats */ |
bogdanm | 85:024bf7f99721 | 82 | |
bogdanm | 85:024bf7f99721 | 83 | uint32_t AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value. |
Kojto | 108:34e6b704fe68 | 84 | This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F */ |
bogdanm | 85:024bf7f99721 | 85 | |
bogdanm | 85:024bf7f99721 | 86 | uint32_t SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value. |
Kojto | 108:34e6b704fe68 | 87 | This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF */ |
Kojto | 108:34e6b704fe68 | 88 | |
Kojto | 108:34e6b704fe68 | 89 | uint32_t OutPut; /*!< Specifies which signal will be routed to the RTC output. |
bogdanm | 85:024bf7f99721 | 90 | This parameter can be a value of @ref RTCEx_Output_selection_Definitions */ |
bogdanm | 85:024bf7f99721 | 91 | |
bogdanm | 85:024bf7f99721 | 92 | uint32_t OutPutPolarity; /*!< Specifies the polarity of the output signal. |
Kojto | 108:34e6b704fe68 | 93 | This parameter can be a value of @ref RTC_Output_Polarity_Definitions */ |
Kojto | 108:34e6b704fe68 | 94 | |
Kojto | 108:34e6b704fe68 | 95 | uint32_t OutPutType; /*!< Specifies the RTC Output Pin mode. |
Kojto | 108:34e6b704fe68 | 96 | This parameter can be a value of @ref RTC_Output_Type_ALARM_OUT */ |
bogdanm | 85:024bf7f99721 | 97 | }RTC_InitTypeDef; |
bogdanm | 85:024bf7f99721 | 98 | |
bogdanm | 85:024bf7f99721 | 99 | /** |
bogdanm | 85:024bf7f99721 | 100 | * @brief RTC Time structure definition |
bogdanm | 85:024bf7f99721 | 101 | */ |
bogdanm | 85:024bf7f99721 | 102 | typedef struct |
bogdanm | 85:024bf7f99721 | 103 | { |
bogdanm | 85:024bf7f99721 | 104 | uint8_t Hours; /*!< Specifies the RTC Time Hour. |
bogdanm | 85:024bf7f99721 | 105 | This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the RTC_HourFormat_12 is selected. |
Kojto | 108:34e6b704fe68 | 106 | This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HourFormat_24 is selected */ |
bogdanm | 85:024bf7f99721 | 107 | |
bogdanm | 85:024bf7f99721 | 108 | uint8_t Minutes; /*!< Specifies the RTC Time Minutes. |
bogdanm | 85:024bf7f99721 | 109 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 108:34e6b704fe68 | 110 | |
bogdanm | 85:024bf7f99721 | 111 | uint8_t Seconds; /*!< Specifies the RTC Time Seconds. |
bogdanm | 85:024bf7f99721 | 112 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
bogdanm | 85:024bf7f99721 | 113 | |
bogdanm | 85:024bf7f99721 | 114 | uint8_t TimeFormat; /*!< Specifies the RTC AM/PM Time. |
Kojto | 122:f9eeca106725 | 115 | This parameter can be a value of @ref RTC_AM_PM_Definitions */ |
Kojto | 122:f9eeca106725 | 116 | |
Kojto | 122:f9eeca106725 | 117 | uint32_t SubSeconds; /*!< Specifies the RTC_SSR RTC Sub Second register content. |
Kojto | 122:f9eeca106725 | 118 | This parameter corresponds to a time unit range between [0-1] Second |
Kojto | 122:f9eeca106725 | 119 | with [1 Sec / SecondFraction +1] granularity */ |
Kojto | 122:f9eeca106725 | 120 | |
Kojto | 122:f9eeca106725 | 121 | uint32_t SecondFraction; /*!< Specifies the range or granularity of Sub Second register content |
Kojto | 122:f9eeca106725 | 122 | corresponding to Synchronous pre-scaler factor value (PREDIV_S) |
Kojto | 122:f9eeca106725 | 123 | This parameter corresponds to a time unit range between [0-1] Second |
Kojto | 122:f9eeca106725 | 124 | with [1 Sec / SecondFraction +1] granularity. |
Kojto | 122:f9eeca106725 | 125 | This field will be used only by HAL_RTC_GetTime function */ |
Kojto | 108:34e6b704fe68 | 126 | |
bogdanm | 85:024bf7f99721 | 127 | uint32_t DayLightSaving; /*!< Specifies RTC_DayLightSaveOperation: the value of hour adjustment. |
bogdanm | 85:024bf7f99721 | 128 | This parameter can be a value of @ref RTC_DayLightSaving_Definitions */ |
Kojto | 108:34e6b704fe68 | 129 | |
bogdanm | 85:024bf7f99721 | 130 | uint32_t StoreOperation; /*!< Specifies RTC_StoreOperation value to be written in the BCK bit |
bogdanm | 85:024bf7f99721 | 131 | in CR register to store the operation. |
bogdanm | 85:024bf7f99721 | 132 | This parameter can be a value of @ref RTC_StoreOperation_Definitions */ |
Kojto | 108:34e6b704fe68 | 133 | }RTC_TimeTypeDef; |
Kojto | 108:34e6b704fe68 | 134 | |
bogdanm | 85:024bf7f99721 | 135 | /** |
Kojto | 108:34e6b704fe68 | 136 | * @brief RTC Date structure definition |
bogdanm | 85:024bf7f99721 | 137 | */ |
bogdanm | 85:024bf7f99721 | 138 | typedef struct |
bogdanm | 85:024bf7f99721 | 139 | { |
bogdanm | 85:024bf7f99721 | 140 | uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay. |
bogdanm | 85:024bf7f99721 | 141 | This parameter can be a value of @ref RTC_WeekDay_Definitions */ |
Kojto | 108:34e6b704fe68 | 142 | |
bogdanm | 85:024bf7f99721 | 143 | uint8_t Month; /*!< Specifies the RTC Date Month (in BCD format). |
bogdanm | 85:024bf7f99721 | 144 | This parameter can be a value of @ref RTC_Month_Date_Definitions */ |
bogdanm | 85:024bf7f99721 | 145 | |
bogdanm | 85:024bf7f99721 | 146 | uint8_t Date; /*!< Specifies the RTC Date. |
bogdanm | 85:024bf7f99721 | 147 | This parameter must be a number between Min_Data = 1 and Max_Data = 31 */ |
Kojto | 108:34e6b704fe68 | 148 | |
bogdanm | 85:024bf7f99721 | 149 | uint8_t Year; /*!< Specifies the RTC Date Year. |
bogdanm | 85:024bf7f99721 | 150 | This parameter must be a number between Min_Data = 0 and Max_Data = 99 */ |
Kojto | 108:34e6b704fe68 | 151 | |
bogdanm | 85:024bf7f99721 | 152 | }RTC_DateTypeDef; |
bogdanm | 85:024bf7f99721 | 153 | |
bogdanm | 85:024bf7f99721 | 154 | /** |
Kojto | 108:34e6b704fe68 | 155 | * @brief RTC Alarm structure definition |
bogdanm | 85:024bf7f99721 | 156 | */ |
bogdanm | 85:024bf7f99721 | 157 | typedef struct |
bogdanm | 85:024bf7f99721 | 158 | { |
bogdanm | 85:024bf7f99721 | 159 | RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members */ |
Kojto | 108:34e6b704fe68 | 160 | |
bogdanm | 85:024bf7f99721 | 161 | uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks. |
bogdanm | 85:024bf7f99721 | 162 | This parameter can be a value of @ref RTC_AlarmMask_Definitions */ |
bogdanm | 85:024bf7f99721 | 163 | |
bogdanm | 85:024bf7f99721 | 164 | uint32_t AlarmSubSecondMask; /*!< Specifies the RTC Alarm SubSeconds Masks. |
Kojto | 108:34e6b704fe68 | 165 | This parameter can be a value of @ref RTC_Alarm_Sub_Seconds_Masks_Definitions */ |
bogdanm | 85:024bf7f99721 | 166 | |
bogdanm | 85:024bf7f99721 | 167 | uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay. |
Kojto | 108:34e6b704fe68 | 168 | This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */ |
Kojto | 108:34e6b704fe68 | 169 | |
bogdanm | 85:024bf7f99721 | 170 | uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay. |
bogdanm | 85:024bf7f99721 | 171 | If the Alarm Date is selected, this parameter must be set to a value in the 1-31 range. |
bogdanm | 85:024bf7f99721 | 172 | If the Alarm WeekDay is selected, this parameter can be a value of @ref RTC_WeekDay_Definitions */ |
Kojto | 108:34e6b704fe68 | 173 | |
bogdanm | 85:024bf7f99721 | 174 | uint32_t Alarm; /*!< Specifies the alarm . |
Kojto | 108:34e6b704fe68 | 175 | This parameter can be a value of @ref RTC_Alarms_Definitions */ |
bogdanm | 85:024bf7f99721 | 176 | }RTC_AlarmTypeDef; |
bogdanm | 85:024bf7f99721 | 177 | |
bogdanm | 85:024bf7f99721 | 178 | /** |
Kojto | 108:34e6b704fe68 | 179 | * @brief RTC Handle Structure definition |
Kojto | 108:34e6b704fe68 | 180 | */ |
bogdanm | 85:024bf7f99721 | 181 | typedef struct |
bogdanm | 85:024bf7f99721 | 182 | { |
Kojto | 108:34e6b704fe68 | 183 | RTC_TypeDef *Instance; /*!< Register base address */ |
Kojto | 108:34e6b704fe68 | 184 | |
Kojto | 108:34e6b704fe68 | 185 | RTC_InitTypeDef Init; /*!< RTC required parameters */ |
Kojto | 108:34e6b704fe68 | 186 | |
Kojto | 108:34e6b704fe68 | 187 | HAL_LockTypeDef Lock; /*!< RTC locking object */ |
Kojto | 108:34e6b704fe68 | 188 | |
Kojto | 108:34e6b704fe68 | 189 | __IO HAL_RTCStateTypeDef State; /*!< Time communication state */ |
Kojto | 108:34e6b704fe68 | 190 | |
Kojto | 108:34e6b704fe68 | 191 | }RTC_HandleTypeDef; |
bogdanm | 85:024bf7f99721 | 192 | |
bogdanm | 92:4fc01daae5a5 | 193 | /** |
bogdanm | 92:4fc01daae5a5 | 194 | * @} |
bogdanm | 92:4fc01daae5a5 | 195 | */ |
Kojto | 108:34e6b704fe68 | 196 | |
bogdanm | 85:024bf7f99721 | 197 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 198 | /** @defgroup RTC_Exported_Constants RTC Exported Constants |
bogdanm | 85:024bf7f99721 | 199 | * @{ |
bogdanm | 85:024bf7f99721 | 200 | */ |
bogdanm | 85:024bf7f99721 | 201 | |
bogdanm | 92:4fc01daae5a5 | 202 | /** @defgroup RTC_Hour_Formats RTC Hour Formats |
bogdanm | 85:024bf7f99721 | 203 | * @{ |
Kojto | 108:34e6b704fe68 | 204 | */ |
<> | 134:ad3be0349dc5 | 205 | #define RTC_HOURFORMAT_24 (0x00000000U) |
<> | 134:ad3be0349dc5 | 206 | #define RTC_HOURFORMAT_12 (0x00000040U) |
bogdanm | 85:024bf7f99721 | 207 | |
bogdanm | 85:024bf7f99721 | 208 | /** |
bogdanm | 85:024bf7f99721 | 209 | * @} |
Kojto | 108:34e6b704fe68 | 210 | */ |
bogdanm | 85:024bf7f99721 | 211 | |
bogdanm | 92:4fc01daae5a5 | 212 | /** @defgroup RTC_Output_Polarity_Definitions RTC Output Polarity Definitions |
bogdanm | 85:024bf7f99721 | 213 | * @{ |
Kojto | 108:34e6b704fe68 | 214 | */ |
<> | 134:ad3be0349dc5 | 215 | #define RTC_OUTPUT_POLARITY_HIGH (0x00000000U) |
<> | 134:ad3be0349dc5 | 216 | #define RTC_OUTPUT_POLARITY_LOW (0x00100000U) |
bogdanm | 85:024bf7f99721 | 217 | /** |
bogdanm | 85:024bf7f99721 | 218 | * @} |
Kojto | 108:34e6b704fe68 | 219 | */ |
bogdanm | 85:024bf7f99721 | 220 | |
bogdanm | 92:4fc01daae5a5 | 221 | /** @defgroup RTC_Output_Type_ALARM_OUT RTC Output Type ALARM OUT |
bogdanm | 85:024bf7f99721 | 222 | * @{ |
Kojto | 108:34e6b704fe68 | 223 | */ |
<> | 134:ad3be0349dc5 | 224 | #define RTC_OUTPUT_TYPE_OPENDRAIN (0x00000000U) |
<> | 134:ad3be0349dc5 | 225 | #define RTC_OUTPUT_TYPE_PUSHPULL (0x00040000U) |
Kojto | 108:34e6b704fe68 | 226 | /** |
Kojto | 108:34e6b704fe68 | 227 | * @} |
Kojto | 108:34e6b704fe68 | 228 | */ |
bogdanm | 85:024bf7f99721 | 229 | |
Kojto | 108:34e6b704fe68 | 230 | /** @defgroup RTC_AM_PM_Definitions RTC AM PM Definitions |
Kojto | 108:34e6b704fe68 | 231 | * @{ |
Kojto | 108:34e6b704fe68 | 232 | */ |
<> | 134:ad3be0349dc5 | 233 | #define RTC_HOURFORMAT12_AM ((uint8_t)0x00U) |
<> | 134:ad3be0349dc5 | 234 | #define RTC_HOURFORMAT12_PM ((uint8_t)0x40U) |
Kojto | 108:34e6b704fe68 | 235 | /** |
Kojto | 108:34e6b704fe68 | 236 | * @} |
Kojto | 108:34e6b704fe68 | 237 | */ |
bogdanm | 85:024bf7f99721 | 238 | |
Kojto | 108:34e6b704fe68 | 239 | /** @defgroup RTC_DayLightSaving_Definitions RTC DayLight Saving Definitions |
Kojto | 108:34e6b704fe68 | 240 | * @{ |
Kojto | 108:34e6b704fe68 | 241 | */ |
<> | 134:ad3be0349dc5 | 242 | #define RTC_DAYLIGHTSAVING_SUB1H (0x00020000U) |
<> | 134:ad3be0349dc5 | 243 | #define RTC_DAYLIGHTSAVING_ADD1H (0x00010000U) |
<> | 134:ad3be0349dc5 | 244 | #define RTC_DAYLIGHTSAVING_NONE (0x00000000U) |
bogdanm | 85:024bf7f99721 | 245 | /** |
bogdanm | 85:024bf7f99721 | 246 | * @} |
bogdanm | 85:024bf7f99721 | 247 | */ |
bogdanm | 85:024bf7f99721 | 248 | |
Kojto | 108:34e6b704fe68 | 249 | /** @defgroup RTC_StoreOperation_Definitions RTC Store Operation Definitions |
bogdanm | 85:024bf7f99721 | 250 | * @{ |
Kojto | 108:34e6b704fe68 | 251 | */ |
<> | 134:ad3be0349dc5 | 252 | #define RTC_STOREOPERATION_RESET (0x00000000U) |
<> | 134:ad3be0349dc5 | 253 | #define RTC_STOREOPERATION_SET (0x00040000U) |
bogdanm | 85:024bf7f99721 | 254 | /** |
bogdanm | 85:024bf7f99721 | 255 | * @} |
bogdanm | 85:024bf7f99721 | 256 | */ |
bogdanm | 85:024bf7f99721 | 257 | |
bogdanm | 92:4fc01daae5a5 | 258 | /** @defgroup RTC_Input_parameter_format_definitions RTC Input parameter format definitions |
bogdanm | 85:024bf7f99721 | 259 | * @{ |
Kojto | 108:34e6b704fe68 | 260 | */ |
<> | 134:ad3be0349dc5 | 261 | #define RTC_FORMAT_BIN (0x000000000U) |
<> | 134:ad3be0349dc5 | 262 | #define RTC_FORMAT_BCD (0x000000001U) |
bogdanm | 85:024bf7f99721 | 263 | /** |
bogdanm | 85:024bf7f99721 | 264 | * @} |
bogdanm | 85:024bf7f99721 | 265 | */ |
bogdanm | 85:024bf7f99721 | 266 | |
bogdanm | 92:4fc01daae5a5 | 267 | /** @defgroup RTC_Month_Date_Definitions RTC Month Date Definitions |
bogdanm | 85:024bf7f99721 | 268 | * @{ |
Kojto | 108:34e6b704fe68 | 269 | */ |
bogdanm | 85:024bf7f99721 | 270 | /* Coded in BCD format */ |
<> | 134:ad3be0349dc5 | 271 | #define RTC_MONTH_JANUARY ((uint8_t)0x01U) |
<> | 134:ad3be0349dc5 | 272 | #define RTC_MONTH_FEBRUARY ((uint8_t)0x02U) |
<> | 134:ad3be0349dc5 | 273 | #define RTC_MONTH_MARCH ((uint8_t)0x03U) |
<> | 134:ad3be0349dc5 | 274 | #define RTC_MONTH_APRIL ((uint8_t)0x04U) |
<> | 134:ad3be0349dc5 | 275 | #define RTC_MONTH_MAY ((uint8_t)0x05U) |
<> | 134:ad3be0349dc5 | 276 | #define RTC_MONTH_JUNE ((uint8_t)0x06U) |
<> | 134:ad3be0349dc5 | 277 | #define RTC_MONTH_JULY ((uint8_t)0x07U) |
<> | 134:ad3be0349dc5 | 278 | #define RTC_MONTH_AUGUST ((uint8_t)0x08U) |
<> | 134:ad3be0349dc5 | 279 | #define RTC_MONTH_SEPTEMBER ((uint8_t)0x09U) |
<> | 134:ad3be0349dc5 | 280 | #define RTC_MONTH_OCTOBER ((uint8_t)0x10U) |
<> | 134:ad3be0349dc5 | 281 | #define RTC_MONTH_NOVEMBER ((uint8_t)0x11U) |
<> | 134:ad3be0349dc5 | 282 | #define RTC_MONTH_DECEMBER ((uint8_t)0x12U) |
bogdanm | 85:024bf7f99721 | 283 | /** |
bogdanm | 85:024bf7f99721 | 284 | * @} |
Kojto | 108:34e6b704fe68 | 285 | */ |
bogdanm | 85:024bf7f99721 | 286 | |
bogdanm | 92:4fc01daae5a5 | 287 | /** @defgroup RTC_WeekDay_Definitions RTC WeekDay Definitions |
bogdanm | 85:024bf7f99721 | 288 | * @{ |
Kojto | 108:34e6b704fe68 | 289 | */ |
<> | 134:ad3be0349dc5 | 290 | #define RTC_WEEKDAY_MONDAY ((uint8_t)0x01U) |
<> | 134:ad3be0349dc5 | 291 | #define RTC_WEEKDAY_TUESDAY ((uint8_t)0x02U) |
<> | 134:ad3be0349dc5 | 292 | #define RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03U) |
<> | 134:ad3be0349dc5 | 293 | #define RTC_WEEKDAY_THURSDAY ((uint8_t)0x04U) |
<> | 134:ad3be0349dc5 | 294 | #define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05U) |
<> | 134:ad3be0349dc5 | 295 | #define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06U) |
<> | 134:ad3be0349dc5 | 296 | #define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07U) |
bogdanm | 85:024bf7f99721 | 297 | /** |
bogdanm | 85:024bf7f99721 | 298 | * @} |
Kojto | 108:34e6b704fe68 | 299 | */ |
bogdanm | 85:024bf7f99721 | 300 | |
Kojto | 108:34e6b704fe68 | 301 | /** @defgroup RTC_AlarmDateWeekDay_Definitions RTC Alarm Date WeekDay Definitions |
bogdanm | 85:024bf7f99721 | 302 | * @{ |
Kojto | 108:34e6b704fe68 | 303 | */ |
<> | 134:ad3be0349dc5 | 304 | #define RTC_ALARMDATEWEEKDAYSEL_DATE (0x00000000U) |
<> | 134:ad3be0349dc5 | 305 | #define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY (0x40000000U) |
bogdanm | 85:024bf7f99721 | 306 | /** |
bogdanm | 85:024bf7f99721 | 307 | * @} |
Kojto | 108:34e6b704fe68 | 308 | */ |
bogdanm | 85:024bf7f99721 | 309 | |
Kojto | 108:34e6b704fe68 | 310 | /** @defgroup RTC_AlarmMask_Definitions RTC Alarm Mask Definitions |
bogdanm | 85:024bf7f99721 | 311 | * @{ |
Kojto | 108:34e6b704fe68 | 312 | */ |
<> | 134:ad3be0349dc5 | 313 | #define RTC_ALARMMASK_NONE (0x00000000U) |
bogdanm | 85:024bf7f99721 | 314 | #define RTC_ALARMMASK_DATEWEEKDAY RTC_ALRMAR_MSK4 |
bogdanm | 85:024bf7f99721 | 315 | #define RTC_ALARMMASK_HOURS RTC_ALRMAR_MSK3 |
bogdanm | 85:024bf7f99721 | 316 | #define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2 |
bogdanm | 85:024bf7f99721 | 317 | #define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1 |
<> | 134:ad3be0349dc5 | 318 | #define RTC_ALARMMASK_ALL (0x80808080U) |
bogdanm | 85:024bf7f99721 | 319 | /** |
bogdanm | 85:024bf7f99721 | 320 | * @} |
Kojto | 108:34e6b704fe68 | 321 | */ |
bogdanm | 85:024bf7f99721 | 322 | |
bogdanm | 92:4fc01daae5a5 | 323 | /** @defgroup RTC_Alarms_Definitions RTC Alarms Definitions |
bogdanm | 85:024bf7f99721 | 324 | * @{ |
Kojto | 108:34e6b704fe68 | 325 | */ |
bogdanm | 85:024bf7f99721 | 326 | #define RTC_ALARM_A RTC_CR_ALRAE |
bogdanm | 85:024bf7f99721 | 327 | |
bogdanm | 85:024bf7f99721 | 328 | /** |
bogdanm | 85:024bf7f99721 | 329 | * @} |
Kojto | 108:34e6b704fe68 | 330 | */ |
bogdanm | 85:024bf7f99721 | 331 | |
Kojto | 108:34e6b704fe68 | 332 | /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions RTC Alarm Sub Seconds Masks Definitions |
bogdanm | 85:024bf7f99721 | 333 | * @{ |
Kojto | 108:34e6b704fe68 | 334 | */ |
<> | 134:ad3be0349dc5 | 335 | #define RTC_ALARMSUBSECONDMASK_ALL (0x00000000U) /*!< All Alarm SS fields are masked. |
Kojto | 108:34e6b704fe68 | 336 | There is no comparison on sub seconds |
bogdanm | 85:024bf7f99721 | 337 | for Alarm */ |
<> | 134:ad3be0349dc5 | 338 | #define RTC_ALARMSUBSECONDMASK_SS14_1 (0x01000000U) /*!< SS[14:1] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 339 | comparison. Only SS[0] is compared. */ |
<> | 134:ad3be0349dc5 | 340 | #define RTC_ALARMSUBSECONDMASK_SS14_2 (0x02000000U) /*!< SS[14:2] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 341 | comparison. Only SS[1:0] are compared */ |
<> | 134:ad3be0349dc5 | 342 | #define RTC_ALARMSUBSECONDMASK_SS14_3 (0x03000000U) /*!< SS[14:3] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 343 | comparison. Only SS[2:0] are compared */ |
<> | 134:ad3be0349dc5 | 344 | #define RTC_ALARMSUBSECONDMASK_SS14_4 (0x04000000U) /*!< SS[14:4] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 345 | comparison. Only SS[3:0] are compared */ |
<> | 134:ad3be0349dc5 | 346 | #define RTC_ALARMSUBSECONDMASK_SS14_5 (0x05000000U) /*!< SS[14:5] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 347 | comparison. Only SS[4:0] are compared */ |
<> | 134:ad3be0349dc5 | 348 | #define RTC_ALARMSUBSECONDMASK_SS14_6 (0x06000000U) /*!< SS[14:6] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 349 | comparison. Only SS[5:0] are compared */ |
<> | 134:ad3be0349dc5 | 350 | #define RTC_ALARMSUBSECONDMASK_SS14_7 (0x07000000U) /*!< SS[14:7] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 351 | comparison. Only SS[6:0] are compared */ |
<> | 134:ad3be0349dc5 | 352 | #define RTC_ALARMSUBSECONDMASK_SS14_8 (0x08000000U) /*!< SS[14:8] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 353 | comparison. Only SS[7:0] are compared */ |
<> | 134:ad3be0349dc5 | 354 | #define RTC_ALARMSUBSECONDMASK_SS14_9 (0x09000000U) /*!< SS[14:9] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 355 | comparison. Only SS[8:0] are compared */ |
<> | 134:ad3be0349dc5 | 356 | #define RTC_ALARMSUBSECONDMASK_SS14_10 (0x0A000000U) /*!< SS[14:10] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 357 | comparison. Only SS[9:0] are compared */ |
<> | 134:ad3be0349dc5 | 358 | #define RTC_ALARMSUBSECONDMASK_SS14_11 (0x0B000000U) /*!< SS[14:11] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 359 | comparison. Only SS[10:0] are compared */ |
<> | 134:ad3be0349dc5 | 360 | #define RTC_ALARMSUBSECONDMASK_SS14_12 (0x0C000000U) /*!< SS[14:12] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 361 | comparison.Only SS[11:0] are compared */ |
<> | 134:ad3be0349dc5 | 362 | #define RTC_ALARMSUBSECONDMASK_SS14_13 (0x0D000000U) /*!< SS[14:13] are don't care in Alarm |
bogdanm | 85:024bf7f99721 | 363 | comparison. Only SS[12:0] are compared */ |
<> | 134:ad3be0349dc5 | 364 | #define RTC_ALARMSUBSECONDMASK_SS14 (0x0E000000U) /*!< SS[14] is don't care in Alarm |
bogdanm | 85:024bf7f99721 | 365 | comparison.Only SS[13:0] are compared */ |
<> | 134:ad3be0349dc5 | 366 | #define RTC_ALARMSUBSECONDMASK_NONE (0x0F000000U) /*!< SS[14:0] are compared and must match |
bogdanm | 85:024bf7f99721 | 367 | to activate alarm. */ |
bogdanm | 85:024bf7f99721 | 368 | /** |
bogdanm | 85:024bf7f99721 | 369 | * @} |
Kojto | 108:34e6b704fe68 | 370 | */ |
bogdanm | 85:024bf7f99721 | 371 | |
bogdanm | 92:4fc01daae5a5 | 372 | /** @defgroup RTC_Interrupts_Definitions RTC Interrupts Definitions |
bogdanm | 85:024bf7f99721 | 373 | * @{ |
bogdanm | 85:024bf7f99721 | 374 | */ |
<> | 134:ad3be0349dc5 | 375 | #define RTC_IT_TS (0x00008000U) |
<> | 134:ad3be0349dc5 | 376 | #define RTC_IT_WUT (0x00004000U) |
<> | 134:ad3be0349dc5 | 377 | #define RTC_IT_ALRA (0x00001000U) |
<> | 134:ad3be0349dc5 | 378 | #define RTC_IT_TAMP (0x00000004U) /* Used only to Enable the Tamper Interrupt */ |
<> | 134:ad3be0349dc5 | 379 | #define RTC_IT_TAMP1 (0x00020000U) /*only for RTC_ISR flag check*/ |
<> | 134:ad3be0349dc5 | 380 | #define RTC_IT_TAMP2 (0x00040000U) /*only for RTC_ISR flag check*/ |
<> | 134:ad3be0349dc5 | 381 | #define RTC_IT_TAMP3 (0x00080000U) /*only for RTC_ISR flag check*/ |
bogdanm | 85:024bf7f99721 | 382 | /** |
bogdanm | 85:024bf7f99721 | 383 | * @} |
bogdanm | 85:024bf7f99721 | 384 | */ |
bogdanm | 85:024bf7f99721 | 385 | |
bogdanm | 92:4fc01daae5a5 | 386 | /** @defgroup RTC_Flags_Definitions RTC Flags Definitions |
bogdanm | 85:024bf7f99721 | 387 | * @{ |
bogdanm | 85:024bf7f99721 | 388 | */ |
<> | 134:ad3be0349dc5 | 389 | #define RTC_FLAG_RECALPF (0x00010000U) |
<> | 134:ad3be0349dc5 | 390 | #define RTC_FLAG_TAMP3F (0x00008000U) |
<> | 134:ad3be0349dc5 | 391 | #define RTC_FLAG_TAMP2F (0x00004000U) |
<> | 134:ad3be0349dc5 | 392 | #define RTC_FLAG_TAMP1F (0x00002000U) |
<> | 134:ad3be0349dc5 | 393 | #define RTC_FLAG_TSOVF (0x00001000U) |
<> | 134:ad3be0349dc5 | 394 | #define RTC_FLAG_TSF (0x00000800U) |
<> | 134:ad3be0349dc5 | 395 | #define RTC_FLAG_WUTF (0x00000400U) |
<> | 134:ad3be0349dc5 | 396 | #define RTC_FLAG_ALRAF (0x00000100U) |
<> | 134:ad3be0349dc5 | 397 | #define RTC_FLAG_INITF (0x00000040U) |
<> | 134:ad3be0349dc5 | 398 | #define RTC_FLAG_RSF (0x00000020U) |
<> | 134:ad3be0349dc5 | 399 | #define RTC_FLAG_INITS (0x00000010U) |
<> | 134:ad3be0349dc5 | 400 | #define RTC_FLAG_SHPF (0x00000008U) |
<> | 134:ad3be0349dc5 | 401 | #define RTC_FLAG_WUTWF (0x00000004U) |
<> | 134:ad3be0349dc5 | 402 | #define RTC_FLAG_ALRAWF (0x00000001U) |
bogdanm | 85:024bf7f99721 | 403 | /** |
bogdanm | 85:024bf7f99721 | 404 | * @} |
bogdanm | 85:024bf7f99721 | 405 | */ |
bogdanm | 85:024bf7f99721 | 406 | |
bogdanm | 85:024bf7f99721 | 407 | /** |
bogdanm | 85:024bf7f99721 | 408 | * @} |
Kojto | 108:34e6b704fe68 | 409 | */ |
Kojto | 108:34e6b704fe68 | 410 | |
Kojto | 108:34e6b704fe68 | 411 | /* Exported macros ------------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 412 | /** @defgroup RTC_Exported_Macros RTC Exported Macros |
bogdanm | 92:4fc01daae5a5 | 413 | * @{ |
bogdanm | 92:4fc01daae5a5 | 414 | */ |
Kojto | 108:34e6b704fe68 | 415 | |
Kojto | 108:34e6b704fe68 | 416 | /** @brief Reset RTC handle state |
bogdanm | 85:024bf7f99721 | 417 | * @param __HANDLE__: RTC handle. |
bogdanm | 85:024bf7f99721 | 418 | * @retval None |
bogdanm | 85:024bf7f99721 | 419 | */ |
bogdanm | 85:024bf7f99721 | 420 | #define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RTC_STATE_RESET) |
bogdanm | 85:024bf7f99721 | 421 | |
bogdanm | 85:024bf7f99721 | 422 | /** |
bogdanm | 85:024bf7f99721 | 423 | * @brief Disable the write protection for RTC registers. |
bogdanm | 85:024bf7f99721 | 424 | * @param __HANDLE__: specifies the RTC handle. |
bogdanm | 85:024bf7f99721 | 425 | * @retval None |
bogdanm | 85:024bf7f99721 | 426 | */ |
bogdanm | 85:024bf7f99721 | 427 | #define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) \ |
bogdanm | 85:024bf7f99721 | 428 | do{ \ |
<> | 134:ad3be0349dc5 | 429 | (__HANDLE__)->Instance->WPR = 0xCAU; \ |
<> | 134:ad3be0349dc5 | 430 | (__HANDLE__)->Instance->WPR = 0x53U; \ |
bogdanm | 85:024bf7f99721 | 431 | } while(0) |
bogdanm | 85:024bf7f99721 | 432 | |
bogdanm | 85:024bf7f99721 | 433 | /** |
bogdanm | 85:024bf7f99721 | 434 | * @brief Enable the write protection for RTC registers. |
bogdanm | 85:024bf7f99721 | 435 | * @param __HANDLE__: specifies the RTC handle. |
bogdanm | 85:024bf7f99721 | 436 | * @retval None |
bogdanm | 85:024bf7f99721 | 437 | */ |
bogdanm | 85:024bf7f99721 | 438 | #define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) \ |
bogdanm | 85:024bf7f99721 | 439 | do{ \ |
<> | 134:ad3be0349dc5 | 440 | (__HANDLE__)->Instance->WPR = 0xFFU; \ |
Kojto | 108:34e6b704fe68 | 441 | } while(0) |
Kojto | 108:34e6b704fe68 | 442 | |
bogdanm | 85:024bf7f99721 | 443 | /** |
bogdanm | 85:024bf7f99721 | 444 | * @brief Enable the RTC ALARMA peripheral. |
bogdanm | 85:024bf7f99721 | 445 | * @param __HANDLE__: specifies the RTC handle. |
bogdanm | 85:024bf7f99721 | 446 | * @retval None |
bogdanm | 85:024bf7f99721 | 447 | */ |
bogdanm | 85:024bf7f99721 | 448 | #define __HAL_RTC_ALARMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE)) |
bogdanm | 85:024bf7f99721 | 449 | |
bogdanm | 85:024bf7f99721 | 450 | /** |
bogdanm | 85:024bf7f99721 | 451 | * @brief Disable the RTC ALARMA peripheral. |
bogdanm | 85:024bf7f99721 | 452 | * @param __HANDLE__: specifies the RTC handle. |
bogdanm | 85:024bf7f99721 | 453 | * @retval None |
bogdanm | 85:024bf7f99721 | 454 | */ |
bogdanm | 85:024bf7f99721 | 455 | #define __HAL_RTC_ALARMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE)) |
bogdanm | 85:024bf7f99721 | 456 | |
bogdanm | 85:024bf7f99721 | 457 | /** |
bogdanm | 85:024bf7f99721 | 458 | * @brief Enable the RTC Alarm interrupt. |
bogdanm | 85:024bf7f99721 | 459 | * @param __HANDLE__: specifies the RTC handle. |
bogdanm | 85:024bf7f99721 | 460 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled. |
bogdanm | 85:024bf7f99721 | 461 | * This parameter can be any combination of the following values: |
bogdanm | 85:024bf7f99721 | 462 | * @arg RTC_IT_ALRA: Alarm A interrupt |
bogdanm | 85:024bf7f99721 | 463 | * @retval None |
bogdanm | 85:024bf7f99721 | 464 | */ |
bogdanm | 85:024bf7f99721 | 465 | #define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
bogdanm | 85:024bf7f99721 | 466 | |
bogdanm | 85:024bf7f99721 | 467 | /** |
bogdanm | 85:024bf7f99721 | 468 | * @brief Disable the RTC Alarm interrupt. |
bogdanm | 85:024bf7f99721 | 469 | * @param __HANDLE__: specifies the RTC handle. |
bogdanm | 85:024bf7f99721 | 470 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled. |
bogdanm | 85:024bf7f99721 | 471 | * This parameter can be any combination of the following values: |
bogdanm | 85:024bf7f99721 | 472 | * @arg RTC_IT_ALRA: Alarm A interrupt |
bogdanm | 85:024bf7f99721 | 473 | * @retval None |
bogdanm | 85:024bf7f99721 | 474 | */ |
bogdanm | 85:024bf7f99721 | 475 | #define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
bogdanm | 85:024bf7f99721 | 476 | |
bogdanm | 85:024bf7f99721 | 477 | /** |
bogdanm | 85:024bf7f99721 | 478 | * @brief Check whether the specified RTC Alarm interrupt has occurred or not. |
bogdanm | 85:024bf7f99721 | 479 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 108:34e6b704fe68 | 480 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt to check. |
bogdanm | 85:024bf7f99721 | 481 | * This parameter can be: |
bogdanm | 85:024bf7f99721 | 482 | * @arg RTC_IT_ALRA: Alarm A interrupt |
bogdanm | 85:024bf7f99721 | 483 | * @retval None |
bogdanm | 85:024bf7f99721 | 484 | */ |
<> | 134:ad3be0349dc5 | 485 | #define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR)& ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
Kojto | 108:34e6b704fe68 | 486 | |
Kojto | 108:34e6b704fe68 | 487 | /** |
Kojto | 108:34e6b704fe68 | 488 | * @brief Check whether the specified RTC Alarm interrupt has been enabled or not. |
Kojto | 108:34e6b704fe68 | 489 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 108:34e6b704fe68 | 490 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to check. |
Kojto | 108:34e6b704fe68 | 491 | * This parameter can be: |
Kojto | 108:34e6b704fe68 | 492 | * @arg RTC_IT_ALRA: Alarm A interrupt |
Kojto | 108:34e6b704fe68 | 493 | * @retval None |
Kojto | 108:34e6b704fe68 | 494 | */ |
Kojto | 108:34e6b704fe68 | 495 | #define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
bogdanm | 85:024bf7f99721 | 496 | |
bogdanm | 85:024bf7f99721 | 497 | /** |
bogdanm | 85:024bf7f99721 | 498 | * @brief Get the selected RTC Alarm's flag status. |
bogdanm | 85:024bf7f99721 | 499 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 108:34e6b704fe68 | 500 | * @param __FLAG__: specifies the RTC Alarm Flag sources to check. |
bogdanm | 85:024bf7f99721 | 501 | * This parameter can be: |
bogdanm | 85:024bf7f99721 | 502 | * @arg RTC_FLAG_ALRAF |
bogdanm | 85:024bf7f99721 | 503 | * @arg RTC_FLAG_ALRAWF |
bogdanm | 85:024bf7f99721 | 504 | * @retval None |
bogdanm | 85:024bf7f99721 | 505 | */ |
bogdanm | 85:024bf7f99721 | 506 | #define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
bogdanm | 85:024bf7f99721 | 507 | |
bogdanm | 85:024bf7f99721 | 508 | /** |
bogdanm | 85:024bf7f99721 | 509 | * @brief Clear the RTC Alarm's pending flags. |
bogdanm | 85:024bf7f99721 | 510 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 108:34e6b704fe68 | 511 | * @param __FLAG__: specifies the RTC Alarm Flag sources to clear. |
bogdanm | 85:024bf7f99721 | 512 | * This parameter can be: |
bogdanm | 85:024bf7f99721 | 513 | * @arg RTC_FLAG_ALRAF |
bogdanm | 85:024bf7f99721 | 514 | * @retval None |
bogdanm | 85:024bf7f99721 | 515 | */ |
Kojto | 122:f9eeca106725 | 516 | #define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT) | ((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
Kojto | 122:f9eeca106725 | 517 | |
Kojto | 108:34e6b704fe68 | 518 | /** |
Kojto | 108:34e6b704fe68 | 519 | * @brief Enable interrupt on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 520 | * @retval None |
Kojto | 108:34e6b704fe68 | 521 | */ |
Kojto | 108:34e6b704fe68 | 522 | #define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_ALARM_EVENT) |
bogdanm | 85:024bf7f99721 | 523 | |
bogdanm | 85:024bf7f99721 | 524 | /** |
Kojto | 108:34e6b704fe68 | 525 | * @brief Disable interrupt on the RTC Alarm associated Exti line. |
bogdanm | 85:024bf7f99721 | 526 | * @retval None |
bogdanm | 85:024bf7f99721 | 527 | */ |
Kojto | 108:34e6b704fe68 | 528 | #define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 108:34e6b704fe68 | 529 | |
Kojto | 108:34e6b704fe68 | 530 | /** |
Kojto | 108:34e6b704fe68 | 531 | * @brief Enable event on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 532 | * @retval None. |
Kojto | 108:34e6b704fe68 | 533 | */ |
Kojto | 108:34e6b704fe68 | 534 | #define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 108:34e6b704fe68 | 535 | |
Kojto | 108:34e6b704fe68 | 536 | /** |
Kojto | 108:34e6b704fe68 | 537 | * @brief Disable event on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 538 | * @retval None. |
Kojto | 108:34e6b704fe68 | 539 | */ |
Kojto | 108:34e6b704fe68 | 540 | #define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
bogdanm | 85:024bf7f99721 | 541 | |
Kojto | 108:34e6b704fe68 | 542 | /** |
Kojto | 108:34e6b704fe68 | 543 | * @brief Enable falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 544 | * @retval None. |
Kojto | 108:34e6b704fe68 | 545 | */ |
Kojto | 108:34e6b704fe68 | 546 | #define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 108:34e6b704fe68 | 547 | |
Kojto | 108:34e6b704fe68 | 548 | /** |
Kojto | 108:34e6b704fe68 | 549 | * @brief Disable falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 550 | * @retval None. |
Kojto | 108:34e6b704fe68 | 551 | */ |
Kojto | 108:34e6b704fe68 | 552 | #define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 108:34e6b704fe68 | 553 | |
Kojto | 108:34e6b704fe68 | 554 | /** |
Kojto | 108:34e6b704fe68 | 555 | * @brief Enable rising edge trigger on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 556 | * @retval None. |
Kojto | 108:34e6b704fe68 | 557 | */ |
Kojto | 108:34e6b704fe68 | 558 | #define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_ALARM_EVENT) |
bogdanm | 85:024bf7f99721 | 559 | |
bogdanm | 85:024bf7f99721 | 560 | /** |
Kojto | 108:34e6b704fe68 | 561 | * @brief Disable rising edge trigger on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 562 | * @retval None. |
bogdanm | 85:024bf7f99721 | 563 | */ |
Kojto | 108:34e6b704fe68 | 564 | #define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 108:34e6b704fe68 | 565 | |
Kojto | 108:34e6b704fe68 | 566 | /** |
Kojto | 108:34e6b704fe68 | 567 | * @brief Enable rising & falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 568 | * @retval None. |
Kojto | 108:34e6b704fe68 | 569 | */ |
Kojto | 108:34e6b704fe68 | 570 | #define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE(); |
bogdanm | 85:024bf7f99721 | 571 | |
bogdanm | 85:024bf7f99721 | 572 | /** |
Kojto | 108:34e6b704fe68 | 573 | * @brief Disable rising & falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 574 | * @retval None. |
Kojto | 108:34e6b704fe68 | 575 | */ |
Kojto | 108:34e6b704fe68 | 576 | #define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE(); |
Kojto | 108:34e6b704fe68 | 577 | |
Kojto | 108:34e6b704fe68 | 578 | /** |
Kojto | 108:34e6b704fe68 | 579 | * @brief Check whether the RTC Alarm associated Exti line interrupt flag is set or not. |
Kojto | 108:34e6b704fe68 | 580 | * @retval Line Status. |
bogdanm | 85:024bf7f99721 | 581 | */ |
Kojto | 108:34e6b704fe68 | 582 | #define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_ALARM_EVENT) |
bogdanm | 85:024bf7f99721 | 583 | |
Kojto | 108:34e6b704fe68 | 584 | /** |
Kojto | 108:34e6b704fe68 | 585 | * @brief Clear the RTC Alarm associated Exti line flag. |
Kojto | 108:34e6b704fe68 | 586 | * @retval None. |
Kojto | 108:34e6b704fe68 | 587 | */ |
Kojto | 108:34e6b704fe68 | 588 | #define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_ALARM_EVENT) |
bogdanm | 85:024bf7f99721 | 589 | |
bogdanm | 92:4fc01daae5a5 | 590 | /** |
Kojto | 108:34e6b704fe68 | 591 | * @brief Generate a Software interrupt on RTC Alarm associated Exti line. |
Kojto | 108:34e6b704fe68 | 592 | * @retval None. |
Kojto | 108:34e6b704fe68 | 593 | */ |
Kojto | 108:34e6b704fe68 | 594 | #define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 108:34e6b704fe68 | 595 | /** |
bogdanm | 92:4fc01daae5a5 | 596 | * @} |
bogdanm | 92:4fc01daae5a5 | 597 | */ |
bogdanm | 92:4fc01daae5a5 | 598 | |
Kojto | 108:34e6b704fe68 | 599 | /* Include RTC HAL Extended module */ |
bogdanm | 85:024bf7f99721 | 600 | #include "stm32f0xx_hal_rtc_ex.h" |
bogdanm | 85:024bf7f99721 | 601 | |
bogdanm | 85:024bf7f99721 | 602 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 603 | /** @defgroup RTC_Exported_Functions RTC Exported Functions |
bogdanm | 92:4fc01daae5a5 | 604 | * @{ |
bogdanm | 92:4fc01daae5a5 | 605 | */ |
bogdanm | 85:024bf7f99721 | 606 | |
Kojto | 108:34e6b704fe68 | 607 | /** @defgroup RTC_Exported_Functions_Group1 Initialization and de-initialization functions |
bogdanm | 92:4fc01daae5a5 | 608 | * @{ |
bogdanm | 92:4fc01daae5a5 | 609 | */ |
bogdanm | 92:4fc01daae5a5 | 610 | |
bogdanm | 85:024bf7f99721 | 611 | /* Initialization and de-initialization functions ****************************/ |
bogdanm | 85:024bf7f99721 | 612 | HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc); |
bogdanm | 85:024bf7f99721 | 613 | HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc); |
bogdanm | 85:024bf7f99721 | 614 | void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc); |
bogdanm | 85:024bf7f99721 | 615 | void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc); |
bogdanm | 92:4fc01daae5a5 | 616 | /** |
bogdanm | 92:4fc01daae5a5 | 617 | * @} |
bogdanm | 92:4fc01daae5a5 | 618 | */ |
bogdanm | 85:024bf7f99721 | 619 | |
Kojto | 108:34e6b704fe68 | 620 | /** @defgroup RTC_Exported_Functions_Group2 RTC Time and Date functions |
bogdanm | 92:4fc01daae5a5 | 621 | * @{ |
bogdanm | 92:4fc01daae5a5 | 622 | */ |
bogdanm | 92:4fc01daae5a5 | 623 | |
bogdanm | 85:024bf7f99721 | 624 | /* RTC Time and Date functions ************************************************/ |
bogdanm | 85:024bf7f99721 | 625 | HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); |
bogdanm | 85:024bf7f99721 | 626 | HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); |
bogdanm | 85:024bf7f99721 | 627 | HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); |
bogdanm | 85:024bf7f99721 | 628 | HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); |
bogdanm | 92:4fc01daae5a5 | 629 | /** |
bogdanm | 92:4fc01daae5a5 | 630 | * @} |
bogdanm | 92:4fc01daae5a5 | 631 | */ |
bogdanm | 92:4fc01daae5a5 | 632 | |
Kojto | 108:34e6b704fe68 | 633 | /** @defgroup RTC_Exported_Functions_Group3 RTC Alarm functions |
bogdanm | 92:4fc01daae5a5 | 634 | * @{ |
bogdanm | 92:4fc01daae5a5 | 635 | */ |
bogdanm | 85:024bf7f99721 | 636 | /* RTC Alarm functions ********************************************************/ |
bogdanm | 85:024bf7f99721 | 637 | HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); |
bogdanm | 85:024bf7f99721 | 638 | HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); |
bogdanm | 85:024bf7f99721 | 639 | HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm); |
bogdanm | 85:024bf7f99721 | 640 | HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format); |
bogdanm | 85:024bf7f99721 | 641 | void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc); |
bogdanm | 85:024bf7f99721 | 642 | HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
bogdanm | 85:024bf7f99721 | 643 | void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc); |
bogdanm | 92:4fc01daae5a5 | 644 | /** |
bogdanm | 92:4fc01daae5a5 | 645 | * @} |
bogdanm | 92:4fc01daae5a5 | 646 | */ |
bogdanm | 85:024bf7f99721 | 647 | |
Kojto | 108:34e6b704fe68 | 648 | /** @defgroup RTC_Exported_Functions_Group4 Peripheral Control functions |
bogdanm | 92:4fc01daae5a5 | 649 | * @{ |
bogdanm | 92:4fc01daae5a5 | 650 | */ |
bogdanm | 85:024bf7f99721 | 651 | /* Peripheral Control functions ***********************************************/ |
bogdanm | 85:024bf7f99721 | 652 | HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc); |
bogdanm | 92:4fc01daae5a5 | 653 | /** |
bogdanm | 92:4fc01daae5a5 | 654 | * @} |
bogdanm | 92:4fc01daae5a5 | 655 | */ |
bogdanm | 85:024bf7f99721 | 656 | |
Kojto | 108:34e6b704fe68 | 657 | /** @defgroup RTC_Exported_Functions_Group5 Peripheral State functions |
bogdanm | 92:4fc01daae5a5 | 658 | * @{ |
bogdanm | 92:4fc01daae5a5 | 659 | */ |
bogdanm | 85:024bf7f99721 | 660 | /* Peripheral State functions *************************************************/ |
bogdanm | 85:024bf7f99721 | 661 | HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc); |
bogdanm | 85:024bf7f99721 | 662 | /** |
bogdanm | 85:024bf7f99721 | 663 | * @} |
bogdanm | 85:024bf7f99721 | 664 | */ |
bogdanm | 85:024bf7f99721 | 665 | |
bogdanm | 85:024bf7f99721 | 666 | /** |
bogdanm | 85:024bf7f99721 | 667 | * @} |
bogdanm | 92:4fc01daae5a5 | 668 | */ |
bogdanm | 92:4fc01daae5a5 | 669 | |
Kojto | 108:34e6b704fe68 | 670 | /* Private types -------------------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 671 | /* Private variables ---------------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 672 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 673 | /** @defgroup RTC_Private_Constants RTC Private Constants |
Kojto | 108:34e6b704fe68 | 674 | * @{ |
Kojto | 108:34e6b704fe68 | 675 | */ |
Kojto | 108:34e6b704fe68 | 676 | /* Masks Definition */ |
<> | 134:ad3be0349dc5 | 677 | #define RTC_TR_RESERVED_MASK (0x007F7F7FU) |
<> | 134:ad3be0349dc5 | 678 | #define RTC_DR_RESERVED_MASK (0x00FFFF3FU) |
<> | 134:ad3be0349dc5 | 679 | #define RTC_INIT_MASK (0xFFFFFFFFU) |
<> | 134:ad3be0349dc5 | 680 | #define RTC_RSF_MASK (0xFFFFFF5FU) |
Kojto | 122:f9eeca106725 | 681 | #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \ |
Kojto | 122:f9eeca106725 | 682 | RTC_FLAG_TAMP1F| RTC_FLAG_TSOVF | RTC_FLAG_TSF | \ |
Kojto | 122:f9eeca106725 | 683 | RTC_FLAG_WUTF | RTC_FLAG_ALRAF | \ |
Kojto | 122:f9eeca106725 | 684 | RTC_FLAG_INITF | RTC_FLAG_RSF | RTC_FLAG_INITS | \ |
Kojto | 122:f9eeca106725 | 685 | RTC_FLAG_SHPF | RTC_FLAG_WUTWF | RTC_FLAG_ALRAWF)) |
Kojto | 108:34e6b704fe68 | 686 | |
<> | 134:ad3be0349dc5 | 687 | #define RTC_TIMEOUT_VALUE 1000U |
Kojto | 108:34e6b704fe68 | 688 | |
Kojto | 108:34e6b704fe68 | 689 | #define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)EXTI_IMR_MR17) /*!< External interrupt line 17 Connected to the RTC Alarm event */ |
Kojto | 108:34e6b704fe68 | 690 | /** |
Kojto | 108:34e6b704fe68 | 691 | * @} |
Kojto | 108:34e6b704fe68 | 692 | */ |
Kojto | 108:34e6b704fe68 | 693 | |
Kojto | 108:34e6b704fe68 | 694 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 695 | /** @defgroup RTC_Private_Macros RTC Private Macros |
Kojto | 108:34e6b704fe68 | 696 | * @{ |
Kojto | 108:34e6b704fe68 | 697 | */ |
Kojto | 108:34e6b704fe68 | 698 | |
Kojto | 108:34e6b704fe68 | 699 | /** @defgroup RTC_IS_RTC_Definitions RTC Private macros to check input parameters |
bogdanm | 92:4fc01daae5a5 | 700 | * @{ |
Kojto | 108:34e6b704fe68 | 701 | */ |
Kojto | 108:34e6b704fe68 | 702 | #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \ |
Kojto | 108:34e6b704fe68 | 703 | ((FORMAT) == RTC_HOURFORMAT_24)) |
Kojto | 108:34e6b704fe68 | 704 | |
Kojto | 108:34e6b704fe68 | 705 | #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \ |
Kojto | 108:34e6b704fe68 | 706 | ((POL) == RTC_OUTPUT_POLARITY_LOW)) |
Kojto | 108:34e6b704fe68 | 707 | #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \ |
Kojto | 108:34e6b704fe68 | 708 | ((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL)) |
<> | 134:ad3be0349dc5 | 709 | #define IS_RTC_HOUR12(HOUR) (((HOUR) > 0U) && ((HOUR) <= 12U)) |
<> | 134:ad3be0349dc5 | 710 | #define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23U) |
<> | 134:ad3be0349dc5 | 711 | #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FU) |
<> | 134:ad3be0349dc5 | 712 | #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FFFU) |
<> | 134:ad3be0349dc5 | 713 | #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59U) |
<> | 134:ad3be0349dc5 | 714 | #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59U) |
Kojto | 108:34e6b704fe68 | 715 | |
Kojto | 122:f9eeca106725 | 716 | #define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || \ |
Kojto | 122:f9eeca106725 | 717 | ((PM) == RTC_HOURFORMAT12_PM)) |
Kojto | 122:f9eeca106725 | 718 | |
Kojto | 108:34e6b704fe68 | 719 | #define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \ |
Kojto | 108:34e6b704fe68 | 720 | ((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \ |
Kojto | 108:34e6b704fe68 | 721 | ((SAVE) == RTC_DAYLIGHTSAVING_NONE)) |
Kojto | 108:34e6b704fe68 | 722 | #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \ |
Kojto | 108:34e6b704fe68 | 723 | ((OPERATION) == RTC_STOREOPERATION_SET)) |
Kojto | 108:34e6b704fe68 | 724 | #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_FORMAT_BIN) || ((FORMAT) == RTC_FORMAT_BCD)) |
<> | 134:ad3be0349dc5 | 725 | #define IS_RTC_YEAR(YEAR) ((YEAR) <= 99U) |
<> | 134:ad3be0349dc5 | 726 | #define IS_RTC_MONTH(MONTH) (((MONTH) >= 1U) && ((MONTH) <= 12U)) |
<> | 134:ad3be0349dc5 | 727 | #define IS_RTC_DATE(DATE) (((DATE) >= 1U) && ((DATE) <= 31U)) |
Kojto | 108:34e6b704fe68 | 728 | #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ |
Kojto | 108:34e6b704fe68 | 729 | ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ |
Kojto | 108:34e6b704fe68 | 730 | ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ |
Kojto | 108:34e6b704fe68 | 731 | ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ |
Kojto | 108:34e6b704fe68 | 732 | ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ |
Kojto | 108:34e6b704fe68 | 733 | ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ |
Kojto | 108:34e6b704fe68 | 734 | ((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) |
<> | 134:ad3be0349dc5 | 735 | #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0U) && ((DATE) <= 31U)) |
Kojto | 108:34e6b704fe68 | 736 | #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ |
Kojto | 108:34e6b704fe68 | 737 | ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ |
Kojto | 108:34e6b704fe68 | 738 | ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ |
Kojto | 108:34e6b704fe68 | 739 | ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ |
Kojto | 108:34e6b704fe68 | 740 | ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ |
Kojto | 108:34e6b704fe68 | 741 | ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ |
Kojto | 108:34e6b704fe68 | 742 | ((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) |
Kojto | 108:34e6b704fe68 | 743 | #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \ |
Kojto | 108:34e6b704fe68 | 744 | ((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY)) |
<> | 134:ad3be0349dc5 | 745 | #define IS_RTC_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7FU) == (uint32_t)RESET) |
Kojto | 108:34e6b704fe68 | 746 | #define IS_RTC_ALARM(ALARM) ((ALARM) == RTC_ALARM_A) |
<> | 134:ad3be0349dc5 | 747 | #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= 0x00007FFFU) |
Kojto | 108:34e6b704fe68 | 748 | |
Kojto | 108:34e6b704fe68 | 749 | #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \ |
Kojto | 108:34e6b704fe68 | 750 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \ |
Kojto | 108:34e6b704fe68 | 751 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \ |
Kojto | 108:34e6b704fe68 | 752 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \ |
Kojto | 108:34e6b704fe68 | 753 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \ |
Kojto | 108:34e6b704fe68 | 754 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \ |
Kojto | 108:34e6b704fe68 | 755 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \ |
Kojto | 108:34e6b704fe68 | 756 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \ |
Kojto | 108:34e6b704fe68 | 757 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \ |
Kojto | 108:34e6b704fe68 | 758 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \ |
Kojto | 108:34e6b704fe68 | 759 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \ |
Kojto | 108:34e6b704fe68 | 760 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \ |
Kojto | 108:34e6b704fe68 | 761 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \ |
Kojto | 108:34e6b704fe68 | 762 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \ |
Kojto | 108:34e6b704fe68 | 763 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \ |
Kojto | 108:34e6b704fe68 | 764 | ((MASK) == RTC_ALARMSUBSECONDMASK_NONE)) |
Kojto | 108:34e6b704fe68 | 765 | /** |
Kojto | 108:34e6b704fe68 | 766 | * @} |
Kojto | 108:34e6b704fe68 | 767 | */ |
Kojto | 108:34e6b704fe68 | 768 | |
Kojto | 108:34e6b704fe68 | 769 | /** |
Kojto | 108:34e6b704fe68 | 770 | * @} |
Kojto | 108:34e6b704fe68 | 771 | */ |
Kojto | 108:34e6b704fe68 | 772 | |
Kojto | 108:34e6b704fe68 | 773 | /* Private functions ---------------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 774 | /** @defgroup RTC_Private_Functions RTC Private Functions |
Kojto | 108:34e6b704fe68 | 775 | * @{ |
Kojto | 108:34e6b704fe68 | 776 | */ |
bogdanm | 92:4fc01daae5a5 | 777 | HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc); |
bogdanm | 92:4fc01daae5a5 | 778 | uint8_t RTC_ByteToBcd2(uint8_t Value); |
bogdanm | 92:4fc01daae5a5 | 779 | uint8_t RTC_Bcd2ToByte(uint8_t Value); |
bogdanm | 92:4fc01daae5a5 | 780 | /** |
bogdanm | 92:4fc01daae5a5 | 781 | * @} |
Kojto | 108:34e6b704fe68 | 782 | */ |
bogdanm | 92:4fc01daae5a5 | 783 | |
bogdanm | 92:4fc01daae5a5 | 784 | /** |
bogdanm | 92:4fc01daae5a5 | 785 | * @} |
Kojto | 108:34e6b704fe68 | 786 | */ |
Kojto | 108:34e6b704fe68 | 787 | |
Kojto | 108:34e6b704fe68 | 788 | /** |
bogdanm | 92:4fc01daae5a5 | 789 | * @} |
Kojto | 108:34e6b704fe68 | 790 | */ |
bogdanm | 92:4fc01daae5a5 | 791 | |
bogdanm | 85:024bf7f99721 | 792 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 793 | } |
bogdanm | 85:024bf7f99721 | 794 | #endif |
bogdanm | 85:024bf7f99721 | 795 | |
bogdanm | 85:024bf7f99721 | 796 | #endif /* __STM32F0xx_HAL_RTC_H */ |
bogdanm | 85:024bf7f99721 | 797 | |
bogdanm | 85:024bf7f99721 | 798 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
bogdanm | 92:4fc01daae5a5 | 799 |