mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

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