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