mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Wed Nov 25 13:21:40 2015 +0000
Revision:
110:165afa46840b
Parent:
106:ba1f97679dad
Child:
122:f9eeca106725
Release 110  of the mbed library

Changes:
- new platforms - STM32F410R, DISCO_F429ZI, DISCO_F469NI
- Nucleo L476 - gcc and uvision template
- k22,k64f targets - ADC channels A addition
- EFM32 - bugfixes in sleep, serial and spi
- Delta DFCM NNN40 - pinnames update

Who changed what in which revision?

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