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

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Wed Apr 13 12:29:27 2016 +0000
Revision:
120:2eb10e18b8d7
Parent:
116:c0f6e94411f5
V1.1

Who changed what in which revision?

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