mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
112:6f327212ef96
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

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