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