Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed May 13 08:08:21 2015 +0200
Revision:
99:dbbf35b96557
Parent:
86:04dd9b1680ae
Child:
106:ba1f97679dad
Release 99 of the mbed library

Changes:
- new targets - MAXWSNENV, DISCO_L053C8
- STM32F4xx - ST Cube driver
- KSDK mcu - SPI timing fix
- Nordic - update to softdevice s130

Who changed what in which revision?

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