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 mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
100:cbbeb26dbd92
.

Who changed what in which revision?

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