The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Kojto
Date:
Tue Feb 14 11:24:20 2017 +0000
Revision:
136:ef9c61f8c49f
Parent:
128:9bcdf88f62b0
Child:
165:d1b4690b3f8b
Release 136 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 128:9bcdf88f62b0 1 /**
<> 128:9bcdf88f62b0 2 ******************************************************************************
<> 128:9bcdf88f62b0 3 * @file stm32l1xx_hal_rtc.h
<> 128:9bcdf88f62b0 4 * @author MCD Application Team
<> 128:9bcdf88f62b0 5 * @version V1.2.0
<> 128:9bcdf88f62b0 6 * @date 01-July-2016
<> 128:9bcdf88f62b0 7 * @brief Header file of RTC HAL module.
<> 128:9bcdf88f62b0 8 ******************************************************************************
<> 128:9bcdf88f62b0 9 * @attention
<> 128:9bcdf88f62b0 10 *
<> 128:9bcdf88f62b0 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 128:9bcdf88f62b0 12 *
<> 128:9bcdf88f62b0 13 * Redistribution and use in source and binary forms, with or without modification,
<> 128:9bcdf88f62b0 14 * are permitted provided that the following conditions are met:
<> 128:9bcdf88f62b0 15 * 1. Redistributions of source code must retain the above copyright notice,
<> 128:9bcdf88f62b0 16 * this list of conditions and the following disclaimer.
<> 128:9bcdf88f62b0 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 128:9bcdf88f62b0 18 * this list of conditions and the following disclaimer in the documentation
<> 128:9bcdf88f62b0 19 * and/or other materials provided with the distribution.
<> 128:9bcdf88f62b0 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 128:9bcdf88f62b0 21 * may be used to endorse or promote products derived from this software
<> 128:9bcdf88f62b0 22 * without specific prior written permission.
<> 128:9bcdf88f62b0 23 *
<> 128:9bcdf88f62b0 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 128:9bcdf88f62b0 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 128:9bcdf88f62b0 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 128:9bcdf88f62b0 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 128:9bcdf88f62b0 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 128:9bcdf88f62b0 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 128:9bcdf88f62b0 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 128:9bcdf88f62b0 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 128:9bcdf88f62b0 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 128:9bcdf88f62b0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 128:9bcdf88f62b0 34 *
<> 128:9bcdf88f62b0 35 ******************************************************************************
<> 128:9bcdf88f62b0 36 */
<> 128:9bcdf88f62b0 37
<> 128:9bcdf88f62b0 38 /* Define to prevent recursive inclusion -------------------------------------*/
<> 128:9bcdf88f62b0 39 #ifndef __STM32L1xx_HAL_RTC_H
<> 128:9bcdf88f62b0 40 #define __STM32L1xx_HAL_RTC_H
<> 128:9bcdf88f62b0 41
<> 128:9bcdf88f62b0 42 #ifdef __cplusplus
<> 128:9bcdf88f62b0 43 extern "C" {
<> 128:9bcdf88f62b0 44 #endif
<> 128:9bcdf88f62b0 45
<> 128:9bcdf88f62b0 46 /* Includes ------------------------------------------------------------------*/
<> 128:9bcdf88f62b0 47 #include "stm32l1xx_hal_def.h"
<> 128:9bcdf88f62b0 48
<> 128:9bcdf88f62b0 49 /** @addtogroup STM32L1xx_HAL_Driver
<> 128:9bcdf88f62b0 50 * @{
<> 128:9bcdf88f62b0 51 */
<> 128:9bcdf88f62b0 52
<> 128:9bcdf88f62b0 53 /** @addtogroup RTC
<> 128:9bcdf88f62b0 54 * @{
<> 128:9bcdf88f62b0 55 */
<> 128:9bcdf88f62b0 56
<> 128:9bcdf88f62b0 57 /* Exported types ------------------------------------------------------------*/
<> 128:9bcdf88f62b0 58 /** @defgroup RTC_Exported_Types RTC Exported Types
<> 128:9bcdf88f62b0 59 * @{
<> 128:9bcdf88f62b0 60 */
<> 128:9bcdf88f62b0 61
<> 128:9bcdf88f62b0 62 /**
<> 128:9bcdf88f62b0 63 * @brief HAL State structures definition
<> 128:9bcdf88f62b0 64 */
<> 128:9bcdf88f62b0 65 typedef enum
<> 128:9bcdf88f62b0 66 {
<> 128:9bcdf88f62b0 67 HAL_RTC_STATE_RESET = 0x00, /*!< RTC not yet initialized or disabled */
<> 128:9bcdf88f62b0 68 HAL_RTC_STATE_READY = 0x01, /*!< RTC initialized and ready for use */
<> 128:9bcdf88f62b0 69 HAL_RTC_STATE_BUSY = 0x02, /*!< RTC process is ongoing */
<> 128:9bcdf88f62b0 70 HAL_RTC_STATE_TIMEOUT = 0x03, /*!< RTC timeout state */
<> 128:9bcdf88f62b0 71 HAL_RTC_STATE_ERROR = 0x04 /*!< RTC error state */
<> 128:9bcdf88f62b0 72
<> 128:9bcdf88f62b0 73 }HAL_RTCStateTypeDef;
<> 128:9bcdf88f62b0 74
<> 128:9bcdf88f62b0 75 /**
<> 128:9bcdf88f62b0 76 * @brief RTC Configuration Structure definition
<> 128:9bcdf88f62b0 77 */
<> 128:9bcdf88f62b0 78 typedef struct
<> 128:9bcdf88f62b0 79 {
<> 128:9bcdf88f62b0 80 uint32_t HourFormat; /*!< Specifies the RTC Hour Format.
<> 128:9bcdf88f62b0 81 This parameter can be a value of @ref RTC_Hour_Formats */
<> 128:9bcdf88f62b0 82
<> 128:9bcdf88f62b0 83 uint32_t AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value.
<> 128:9bcdf88f62b0 84 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F */
<> 128:9bcdf88f62b0 85
<> 128:9bcdf88f62b0 86 uint32_t SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value.
<> 128:9bcdf88f62b0 87 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF */
<> 128:9bcdf88f62b0 88
<> 128:9bcdf88f62b0 89 uint32_t OutPut; /*!< Specifies which signal will be routed to the RTC output.
<> 128:9bcdf88f62b0 90 This parameter can be a value of @ref RTCEx_Output_selection_Definitions */
<> 128:9bcdf88f62b0 91
<> 128:9bcdf88f62b0 92 uint32_t OutPutPolarity; /*!< Specifies the polarity of the output signal.
<> 128:9bcdf88f62b0 93 This parameter can be a value of @ref RTC_Output_Polarity_Definitions */
<> 128:9bcdf88f62b0 94
<> 128:9bcdf88f62b0 95 uint32_t OutPutType; /*!< Specifies the RTC Output Pin mode.
<> 128:9bcdf88f62b0 96 This parameter can be a value of @ref RTC_Output_Type_ALARM_OUT */
<> 128:9bcdf88f62b0 97 }RTC_InitTypeDef;
<> 128:9bcdf88f62b0 98
<> 128:9bcdf88f62b0 99 /**
<> 128:9bcdf88f62b0 100 * @brief RTC Date structure definition
<> 128:9bcdf88f62b0 101 */
<> 128:9bcdf88f62b0 102 typedef struct
<> 128:9bcdf88f62b0 103 {
<> 128:9bcdf88f62b0 104 uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay.
<> 128:9bcdf88f62b0 105 This parameter can be a value of @ref RTC_WeekDay_Definitions */
<> 128:9bcdf88f62b0 106
<> 128:9bcdf88f62b0 107 uint8_t Month; /*!< Specifies the RTC Date Month (in BCD format).
<> 128:9bcdf88f62b0 108 This parameter can be a value of @ref RTC_Month_Date_Definitions */
<> 128:9bcdf88f62b0 109
<> 128:9bcdf88f62b0 110 uint8_t Date; /*!< Specifies the RTC Date.
<> 128:9bcdf88f62b0 111 This parameter must be a number between Min_Data = 1 and Max_Data = 31 */
<> 128:9bcdf88f62b0 112
<> 128:9bcdf88f62b0 113 uint8_t Year; /*!< Specifies the RTC Date Year.
<> 128:9bcdf88f62b0 114 This parameter must be a number between Min_Data = 0 and Max_Data = 99 */
<> 128:9bcdf88f62b0 115
<> 128:9bcdf88f62b0 116 }RTC_DateTypeDef;
<> 128:9bcdf88f62b0 117
<> 128:9bcdf88f62b0 118 /**
<> 128:9bcdf88f62b0 119 * @brief Time Handle Structure definition
<> 128:9bcdf88f62b0 120 */
<> 128:9bcdf88f62b0 121 typedef struct
<> 128:9bcdf88f62b0 122 {
<> 128:9bcdf88f62b0 123 RTC_TypeDef *Instance; /*!< Register base address */
<> 128:9bcdf88f62b0 124
<> 128:9bcdf88f62b0 125 RTC_InitTypeDef Init; /*!< RTC required parameters */
<> 128:9bcdf88f62b0 126
<> 128:9bcdf88f62b0 127 HAL_LockTypeDef Lock; /*!< RTC locking object */
<> 128:9bcdf88f62b0 128
<> 128:9bcdf88f62b0 129 __IO HAL_RTCStateTypeDef State; /*!< Time communication state */
<> 128:9bcdf88f62b0 130
<> 128:9bcdf88f62b0 131 }RTC_HandleTypeDef;
<> 128:9bcdf88f62b0 132
<> 128:9bcdf88f62b0 133 /**
<> 128:9bcdf88f62b0 134 * @}
<> 128:9bcdf88f62b0 135 */
<> 128:9bcdf88f62b0 136
<> 128:9bcdf88f62b0 137 /* Exported constants --------------------------------------------------------*/
<> 128:9bcdf88f62b0 138 /** @defgroup RTC_Exported_Constants RTC Exported Constants
<> 128:9bcdf88f62b0 139 * @{
<> 128:9bcdf88f62b0 140 */
<> 128:9bcdf88f62b0 141
<> 128:9bcdf88f62b0 142 /** @defgroup RTC_Timeout_Value Default Timeout Value
<> 128:9bcdf88f62b0 143 * @{
<> 128:9bcdf88f62b0 144 */
<> 128:9bcdf88f62b0 145 #define RTC_TIMEOUT_VALUE 1000
<> 128:9bcdf88f62b0 146 /**
<> 128:9bcdf88f62b0 147 * @}
<> 128:9bcdf88f62b0 148 */
<> 128:9bcdf88f62b0 149
<> 128:9bcdf88f62b0 150 /** @defgroup RTC_Hour_Formats Hour Formats
<> 128:9bcdf88f62b0 151 * @{
<> 128:9bcdf88f62b0 152 */
<> 128:9bcdf88f62b0 153 #define RTC_HOURFORMAT_24 (0x00000000U)
<> 128:9bcdf88f62b0 154 #define RTC_HOURFORMAT_12 (0x00000040U)
<> 128:9bcdf88f62b0 155
<> 128:9bcdf88f62b0 156 #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \
<> 128:9bcdf88f62b0 157 ((FORMAT) == RTC_HOURFORMAT_24))
<> 128:9bcdf88f62b0 158 /**
<> 128:9bcdf88f62b0 159 * @}
<> 128:9bcdf88f62b0 160 */
<> 128:9bcdf88f62b0 161
<> 128:9bcdf88f62b0 162 /** @defgroup RTC_Output_Polarity_Definitions Outpout Polarity
<> 128:9bcdf88f62b0 163 * @{
<> 128:9bcdf88f62b0 164 */
<> 128:9bcdf88f62b0 165 #define RTC_OUTPUT_POLARITY_HIGH (0x00000000U)
<> 128:9bcdf88f62b0 166 #define RTC_OUTPUT_POLARITY_LOW (0x00100000U)
<> 128:9bcdf88f62b0 167
<> 128:9bcdf88f62b0 168 #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \
<> 128:9bcdf88f62b0 169 ((POL) == RTC_OUTPUT_POLARITY_LOW))
<> 128:9bcdf88f62b0 170 /**
<> 128:9bcdf88f62b0 171 * @}
<> 128:9bcdf88f62b0 172 */
<> 128:9bcdf88f62b0 173
<> 128:9bcdf88f62b0 174 /** @defgroup RTC_Output_Type_ALARM_OUT Alarm Output Type
<> 128:9bcdf88f62b0 175 * @{
<> 128:9bcdf88f62b0 176 */
<> 128:9bcdf88f62b0 177 #define RTC_OUTPUT_TYPE_OPENDRAIN (0x00000000U)
<> 128:9bcdf88f62b0 178 #define RTC_OUTPUT_TYPE_PUSHPULL (0x00040000U)
<> 128:9bcdf88f62b0 179
<> 128:9bcdf88f62b0 180 #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \
<> 128:9bcdf88f62b0 181 ((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL))
<> 128:9bcdf88f62b0 182
<> 128:9bcdf88f62b0 183 /**
<> 128:9bcdf88f62b0 184 * @}
<> 128:9bcdf88f62b0 185 */
<> 128:9bcdf88f62b0 186
<> 128:9bcdf88f62b0 187 /** @defgroup RTC_Asynchronous_Predivider Asynchronous Predivider
<> 128:9bcdf88f62b0 188 * @{
<> 128:9bcdf88f62b0 189 */
<> 128:9bcdf88f62b0 190 #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7F)
<> 128:9bcdf88f62b0 191 /**
<> 128:9bcdf88f62b0 192 * @}
<> 128:9bcdf88f62b0 193 */
<> 128:9bcdf88f62b0 194
<> 128:9bcdf88f62b0 195 /** @defgroup RTC_Time_Definitions Time Definitions
<> 128:9bcdf88f62b0 196 * @{
<> 128:9bcdf88f62b0 197 */
<> 128:9bcdf88f62b0 198 #define IS_RTC_HOUR12(HOUR) (((HOUR) > (uint32_t)0) && ((HOUR) <= (uint32_t)12))
<> 128:9bcdf88f62b0 199 #define IS_RTC_HOUR24(HOUR) ((HOUR) <= (uint32_t)23)
<> 128:9bcdf88f62b0 200 #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= (uint32_t)59)
<> 128:9bcdf88f62b0 201 #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= (uint32_t)59)
<> 128:9bcdf88f62b0 202 /**
<> 128:9bcdf88f62b0 203 * @}
<> 128:9bcdf88f62b0 204 */
<> 128:9bcdf88f62b0 205
<> 128:9bcdf88f62b0 206 /** @defgroup RTC_AM_PM_Definitions AM PM Definitions
<> 128:9bcdf88f62b0 207 * @{
<> 128:9bcdf88f62b0 208 */
<> 128:9bcdf88f62b0 209 #define RTC_HOURFORMAT12_AM ((uint8_t)0x00)
<> 128:9bcdf88f62b0 210 #define RTC_HOURFORMAT12_PM ((uint8_t)0x40)
<> 128:9bcdf88f62b0 211
<> 128:9bcdf88f62b0 212 #define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || ((PM) == RTC_HOURFORMAT12_PM))
<> 128:9bcdf88f62b0 213 /**
<> 128:9bcdf88f62b0 214 * @}
<> 128:9bcdf88f62b0 215 */
<> 128:9bcdf88f62b0 216
<> 128:9bcdf88f62b0 217 /** @defgroup RTC_DayLightSaving_Definitions DayLightSaving
<> 128:9bcdf88f62b0 218 * @{
<> 128:9bcdf88f62b0 219 */
<> 128:9bcdf88f62b0 220 #define RTC_DAYLIGHTSAVING_SUB1H (0x00020000U)
<> 128:9bcdf88f62b0 221 #define RTC_DAYLIGHTSAVING_ADD1H (0x00010000U)
<> 128:9bcdf88f62b0 222 #define RTC_DAYLIGHTSAVING_NONE (0x00000000U)
<> 128:9bcdf88f62b0 223
<> 128:9bcdf88f62b0 224 #define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \
<> 128:9bcdf88f62b0 225 ((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \
<> 128:9bcdf88f62b0 226 ((SAVE) == RTC_DAYLIGHTSAVING_NONE))
<> 128:9bcdf88f62b0 227 /**
<> 128:9bcdf88f62b0 228 * @}
<> 128:9bcdf88f62b0 229 */
<> 128:9bcdf88f62b0 230
<> 128:9bcdf88f62b0 231 /** @defgroup RTC_StoreOperation_Definitions StoreOperation
<> 128:9bcdf88f62b0 232 * @{
<> 128:9bcdf88f62b0 233 */
<> 128:9bcdf88f62b0 234 #define RTC_STOREOPERATION_RESET (0x00000000U)
<> 128:9bcdf88f62b0 235 #define RTC_STOREOPERATION_SET (0x00040000U)
<> 128:9bcdf88f62b0 236
<> 128:9bcdf88f62b0 237 #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \
<> 128:9bcdf88f62b0 238 ((OPERATION) == RTC_STOREOPERATION_SET))
<> 128:9bcdf88f62b0 239 /**
<> 128:9bcdf88f62b0 240 * @}
<> 128:9bcdf88f62b0 241 */
<> 128:9bcdf88f62b0 242
<> 128:9bcdf88f62b0 243 /** @defgroup RTC_Input_parameter_format_definitions Input Parameter Format
<> 128:9bcdf88f62b0 244 * @{
<> 128:9bcdf88f62b0 245 */
<> 128:9bcdf88f62b0 246 #define RTC_FORMAT_BIN (0x000000000U)
<> 128:9bcdf88f62b0 247 #define RTC_FORMAT_BCD (0x000000001U)
<> 128:9bcdf88f62b0 248
<> 128:9bcdf88f62b0 249 #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_FORMAT_BIN) || ((FORMAT) == RTC_FORMAT_BCD))
<> 128:9bcdf88f62b0 250 /**
<> 128:9bcdf88f62b0 251 * @}
<> 128:9bcdf88f62b0 252 */
<> 128:9bcdf88f62b0 253
<> 128:9bcdf88f62b0 254 /** @defgroup RTC_Year_Date_Definitions Year Definitions
<> 128:9bcdf88f62b0 255 * @{
<> 128:9bcdf88f62b0 256 */
<> 128:9bcdf88f62b0 257 #define IS_RTC_YEAR(YEAR) ((YEAR) <= (uint32_t)99)
<> 128:9bcdf88f62b0 258 /**
<> 128:9bcdf88f62b0 259 * @}
<> 128:9bcdf88f62b0 260 */
<> 128:9bcdf88f62b0 261
<> 128:9bcdf88f62b0 262 /** @defgroup RTC_Month_Date_Definitions Month Definitions
<> 128:9bcdf88f62b0 263 * @{
<> 128:9bcdf88f62b0 264 */
<> 128:9bcdf88f62b0 265
<> 128:9bcdf88f62b0 266 /* Coded in BCD format */
<> 128:9bcdf88f62b0 267 #define RTC_MONTH_JANUARY ((uint8_t)0x01)
<> 128:9bcdf88f62b0 268 #define RTC_MONTH_FEBRUARY ((uint8_t)0x02)
<> 128:9bcdf88f62b0 269 #define RTC_MONTH_MARCH ((uint8_t)0x03)
<> 128:9bcdf88f62b0 270 #define RTC_MONTH_APRIL ((uint8_t)0x04)
<> 128:9bcdf88f62b0 271 #define RTC_MONTH_MAY ((uint8_t)0x05)
<> 128:9bcdf88f62b0 272 #define RTC_MONTH_JUNE ((uint8_t)0x06)
<> 128:9bcdf88f62b0 273 #define RTC_MONTH_JULY ((uint8_t)0x07)
<> 128:9bcdf88f62b0 274 #define RTC_MONTH_AUGUST ((uint8_t)0x08)
<> 128:9bcdf88f62b0 275 #define RTC_MONTH_SEPTEMBER ((uint8_t)0x09)
<> 128:9bcdf88f62b0 276 #define RTC_MONTH_OCTOBER ((uint8_t)0x10)
<> 128:9bcdf88f62b0 277 #define RTC_MONTH_NOVEMBER ((uint8_t)0x11)
<> 128:9bcdf88f62b0 278 #define RTC_MONTH_DECEMBER ((uint8_t)0x12)
<> 128:9bcdf88f62b0 279
<> 128:9bcdf88f62b0 280 #define IS_RTC_MONTH(MONTH) (((MONTH) >= (uint32_t)1) && ((MONTH) <= (uint32_t)12))
<> 128:9bcdf88f62b0 281 #define IS_RTC_DATE(DATE) (((DATE) >= (uint32_t)1) && ((DATE) <= (uint32_t)31))
<> 128:9bcdf88f62b0 282 /**
<> 128:9bcdf88f62b0 283 * @}
<> 128:9bcdf88f62b0 284 */
<> 128:9bcdf88f62b0 285
<> 128:9bcdf88f62b0 286 /** @defgroup RTC_WeekDay_Definitions WeekDay Definitions
<> 128:9bcdf88f62b0 287 * @{
<> 128:9bcdf88f62b0 288 */
<> 128:9bcdf88f62b0 289 #define RTC_WEEKDAY_MONDAY ((uint8_t)0x01)
<> 128:9bcdf88f62b0 290 #define RTC_WEEKDAY_TUESDAY ((uint8_t)0x02)
<> 128:9bcdf88f62b0 291 #define RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03)
<> 128:9bcdf88f62b0 292 #define RTC_WEEKDAY_THURSDAY ((uint8_t)0x04)
<> 128:9bcdf88f62b0 293 #define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05)
<> 128:9bcdf88f62b0 294 #define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06)
<> 128:9bcdf88f62b0 295 #define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07)
<> 128:9bcdf88f62b0 296
<> 128:9bcdf88f62b0 297 #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \
<> 128:9bcdf88f62b0 298 ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \
<> 128:9bcdf88f62b0 299 ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \
<> 128:9bcdf88f62b0 300 ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \
<> 128:9bcdf88f62b0 301 ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \
<> 128:9bcdf88f62b0 302 ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \
<> 128:9bcdf88f62b0 303 ((WEEKDAY) == RTC_WEEKDAY_SUNDAY))
<> 128:9bcdf88f62b0 304 /**
<> 128:9bcdf88f62b0 305 * @}
<> 128:9bcdf88f62b0 306 */
<> 128:9bcdf88f62b0 307
<> 128:9bcdf88f62b0 308 /** @defgroup RTC_Alarm_Definitions Alarm Definitions
<> 128:9bcdf88f62b0 309 * @{
<> 128:9bcdf88f62b0 310 */
<> 128:9bcdf88f62b0 311 #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) >(uint32_t) 0) && ((DATE) <= (uint32_t)31))
<> 128:9bcdf88f62b0 312 #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \
<> 128:9bcdf88f62b0 313 ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \
<> 128:9bcdf88f62b0 314 ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \
<> 128:9bcdf88f62b0 315 ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \
<> 128:9bcdf88f62b0 316 ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \
<> 128:9bcdf88f62b0 317 ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \
<> 128:9bcdf88f62b0 318 ((WEEKDAY) == RTC_WEEKDAY_SUNDAY))
<> 128:9bcdf88f62b0 319 /**
<> 128:9bcdf88f62b0 320 * @}
<> 128:9bcdf88f62b0 321 */
<> 128:9bcdf88f62b0 322
<> 128:9bcdf88f62b0 323
<> 128:9bcdf88f62b0 324 /** @defgroup RTC_AlarmDateWeekDay_Definitions AlarmDateWeekDay Definitions
<> 128:9bcdf88f62b0 325 * @{
<> 128:9bcdf88f62b0 326 */
<> 128:9bcdf88f62b0 327 #define RTC_ALARMDATEWEEKDAYSEL_DATE (0x00000000U)
<> 128:9bcdf88f62b0 328 #define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY (0x40000000U)
<> 128:9bcdf88f62b0 329
<> 128:9bcdf88f62b0 330 #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \
<> 128:9bcdf88f62b0 331 ((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY))
<> 128:9bcdf88f62b0 332 /**
<> 128:9bcdf88f62b0 333 * @}
<> 128:9bcdf88f62b0 334 */
<> 128:9bcdf88f62b0 335
<> 128:9bcdf88f62b0 336
<> 128:9bcdf88f62b0 337 /** @defgroup RTC_AlarmMask_Definitions Alarm Mask Definitions
<> 128:9bcdf88f62b0 338 * @{
<> 128:9bcdf88f62b0 339 */
<> 128:9bcdf88f62b0 340 #define RTC_ALARMMASK_NONE (0x00000000U)
<> 128:9bcdf88f62b0 341 #define RTC_ALARMMASK_DATEWEEKDAY RTC_ALRMAR_MSK4
<> 128:9bcdf88f62b0 342 #define RTC_ALARMMASK_HOURS RTC_ALRMAR_MSK3
<> 128:9bcdf88f62b0 343 #define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2
<> 128:9bcdf88f62b0 344 #define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1
<> 128:9bcdf88f62b0 345 #define RTC_ALARMMASK_ALL (0x80808080U)
<> 128:9bcdf88f62b0 346
<> 128:9bcdf88f62b0 347 #define IS_RTC_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET)
<> 128:9bcdf88f62b0 348 /**
<> 128:9bcdf88f62b0 349 * @}
<> 128:9bcdf88f62b0 350 */
<> 128:9bcdf88f62b0 351
<> 128:9bcdf88f62b0 352 /** @defgroup RTC_Alarms_Definitions Alarms Definitions
<> 128:9bcdf88f62b0 353 * @{
<> 128:9bcdf88f62b0 354 */
<> 128:9bcdf88f62b0 355 #define RTC_ALARM_A RTC_CR_ALRAE
<> 128:9bcdf88f62b0 356 #define RTC_ALARM_B RTC_CR_ALRBE
<> 128:9bcdf88f62b0 357
<> 128:9bcdf88f62b0 358 #define IS_RTC_ALARM(ALARM) (((ALARM) == RTC_ALARM_A) || ((ALARM) == RTC_ALARM_B))
<> 128:9bcdf88f62b0 359 /**
<> 128:9bcdf88f62b0 360 * @}
<> 128:9bcdf88f62b0 361 */
<> 128:9bcdf88f62b0 362
<> 128:9bcdf88f62b0 363 /**
<> 128:9bcdf88f62b0 364 * @}
<> 128:9bcdf88f62b0 365 */
<> 128:9bcdf88f62b0 366
<> 128:9bcdf88f62b0 367 /* Exported macro ------------------------------------------------------------*/
<> 128:9bcdf88f62b0 368 /** @defgroup RTC_Exported_macros RTC Exported Macros
<> 128:9bcdf88f62b0 369 * @{
<> 128:9bcdf88f62b0 370 */
<> 128:9bcdf88f62b0 371
<> 128:9bcdf88f62b0 372 /** @brief Reset RTC handle state
<> 128:9bcdf88f62b0 373 * @param __HANDLE__: RTC handle.
<> 128:9bcdf88f62b0 374 * @retval None
<> 128:9bcdf88f62b0 375 */
<> 128:9bcdf88f62b0 376 #define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RTC_STATE_RESET)
<> 128:9bcdf88f62b0 377
<> 128:9bcdf88f62b0 378 /**
<> 128:9bcdf88f62b0 379 * @brief Disable the write protection for RTC registers.
<> 128:9bcdf88f62b0 380 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 381 * @retval None
<> 128:9bcdf88f62b0 382 */
<> 128:9bcdf88f62b0 383 #define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) \
<> 128:9bcdf88f62b0 384 do{ \
<> 128:9bcdf88f62b0 385 (__HANDLE__)->Instance->WPR = 0xCA; \
<> 128:9bcdf88f62b0 386 (__HANDLE__)->Instance->WPR = 0x53; \
<> 128:9bcdf88f62b0 387 } while(0)
<> 128:9bcdf88f62b0 388
<> 128:9bcdf88f62b0 389 /**
<> 128:9bcdf88f62b0 390 * @brief Enable the write protection for RTC registers.
<> 128:9bcdf88f62b0 391 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 392 * @retval None
<> 128:9bcdf88f62b0 393 */
<> 128:9bcdf88f62b0 394 #define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) \
<> 128:9bcdf88f62b0 395 do{ \
<> 128:9bcdf88f62b0 396 (__HANDLE__)->Instance->WPR = 0xFF; \
<> 128:9bcdf88f62b0 397 } while(0)
<> 128:9bcdf88f62b0 398
<> 128:9bcdf88f62b0 399
<> 128:9bcdf88f62b0 400 /**
<> 128:9bcdf88f62b0 401 * @brief Enable the RTC ALARMA peripheral.
<> 128:9bcdf88f62b0 402 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 403 * @retval None
<> 128:9bcdf88f62b0 404 */
<> 128:9bcdf88f62b0 405 #define __HAL_RTC_ALARMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE))
<> 128:9bcdf88f62b0 406
<> 128:9bcdf88f62b0 407 /**
<> 128:9bcdf88f62b0 408 * @brief Disable the RTC ALARMA peripheral.
<> 128:9bcdf88f62b0 409 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 410 * @retval None
<> 128:9bcdf88f62b0 411 */
<> 128:9bcdf88f62b0 412 #define __HAL_RTC_ALARMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE))
<> 128:9bcdf88f62b0 413
<> 128:9bcdf88f62b0 414 /**
<> 128:9bcdf88f62b0 415 * @brief Enable the RTC ALARMB peripheral.
<> 128:9bcdf88f62b0 416 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 417 * @retval None
<> 128:9bcdf88f62b0 418 */
<> 128:9bcdf88f62b0 419 #define __HAL_RTC_ALARMB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRBE))
<> 128:9bcdf88f62b0 420
<> 128:9bcdf88f62b0 421 /**
<> 128:9bcdf88f62b0 422 * @brief Disable the RTC ALARMB peripheral.
<> 128:9bcdf88f62b0 423 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 424 * @retval None
<> 128:9bcdf88f62b0 425 */
<> 128:9bcdf88f62b0 426 #define __HAL_RTC_ALARMB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRBE))
<> 128:9bcdf88f62b0 427
<> 128:9bcdf88f62b0 428 /**
<> 128:9bcdf88f62b0 429 * @brief Enable the RTC Alarm interrupt.
<> 128:9bcdf88f62b0 430 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 431 * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled.
<> 128:9bcdf88f62b0 432 * This parameter can be any combination of the following values:
<> 128:9bcdf88f62b0 433 * @arg RTC_IT_ALRA: Alarm A interrupt
<> 128:9bcdf88f62b0 434 * @arg RTC_IT_ALRB: Alarm B interrupt
<> 128:9bcdf88f62b0 435 * @retval None
<> 128:9bcdf88f62b0 436 */
<> 128:9bcdf88f62b0 437 #define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
<> 128:9bcdf88f62b0 438
<> 128:9bcdf88f62b0 439 /**
<> 128:9bcdf88f62b0 440 * @brief Disable the RTC Alarm interrupt.
<> 128:9bcdf88f62b0 441 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 442 * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled.
<> 128:9bcdf88f62b0 443 * This parameter can be any combination of the following values:
<> 128:9bcdf88f62b0 444 * @arg RTC_IT_ALRA: Alarm A interrupt
<> 128:9bcdf88f62b0 445 * @arg RTC_IT_ALRB: Alarm B interrupt
<> 128:9bcdf88f62b0 446 * @retval None
<> 128:9bcdf88f62b0 447 */
<> 128:9bcdf88f62b0 448 #define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
<> 128:9bcdf88f62b0 449
<> 128:9bcdf88f62b0 450 /**
<> 128:9bcdf88f62b0 451 * @brief Check whether the specified RTC Alarm interrupt has occurred or not.
<> 128:9bcdf88f62b0 452 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 453 * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to check.
<> 128:9bcdf88f62b0 454 * This parameter can be:
<> 128:9bcdf88f62b0 455 * @arg RTC_IT_ALRA: Alarm A interrupt
<> 128:9bcdf88f62b0 456 * @arg RTC_IT_ALRB: Alarm B interrupt
<> 128:9bcdf88f62b0 457 * @retval None
<> 128:9bcdf88f62b0 458 */
<> 128:9bcdf88f62b0 459 #define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR)& ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
<> 128:9bcdf88f62b0 460
<> 128:9bcdf88f62b0 461 /**
<> 128:9bcdf88f62b0 462 * @brief Check whether the specified RTC Alarm interrupt has been enabled or not.
<> 128:9bcdf88f62b0 463 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 464 * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to check.
<> 128:9bcdf88f62b0 465 * This parameter can be:
<> 128:9bcdf88f62b0 466 * @arg RTC_IT_ALRA: Alarm A interrupt
<> 128:9bcdf88f62b0 467 * @arg RTC_IT_ALRB: Alarm B interrupt
<> 128:9bcdf88f62b0 468 * @retval None
<> 128:9bcdf88f62b0 469 */
<> 128:9bcdf88f62b0 470 #define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
<> 128:9bcdf88f62b0 471
<> 128:9bcdf88f62b0 472 /**
<> 128:9bcdf88f62b0 473 * @brief Get the selected RTC Alarm's flag status.
<> 128:9bcdf88f62b0 474 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 475 * @param __FLAG__: specifies the RTC Alarm Flag sources to check.
<> 128:9bcdf88f62b0 476 * This parameter can be:
<> 128:9bcdf88f62b0 477 * @arg RTC_FLAG_ALRAF
<> 128:9bcdf88f62b0 478 * @arg RTC_FLAG_ALRBF
<> 128:9bcdf88f62b0 479 * @arg RTC_FLAG_ALRAWF
<> 128:9bcdf88f62b0 480 * @arg RTC_FLAG_ALRBWF
<> 128:9bcdf88f62b0 481 * @retval None
<> 128:9bcdf88f62b0 482 */
<> 128:9bcdf88f62b0 483 #define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
<> 128:9bcdf88f62b0 484
<> 128:9bcdf88f62b0 485 /**
<> 128:9bcdf88f62b0 486 * @brief Clear the RTC Alarm's pending flags.
<> 128:9bcdf88f62b0 487 * @param __HANDLE__: specifies the RTC handle.
<> 128:9bcdf88f62b0 488 * @param __FLAG__: specifies the RTC Alarm Flag sources to clear.
<> 128:9bcdf88f62b0 489 * This parameter can be:
<> 128:9bcdf88f62b0 490 * @arg RTC_FLAG_ALRAF
<> 128:9bcdf88f62b0 491 * @arg RTC_FLAG_ALRBF
<> 128:9bcdf88f62b0 492 * @retval None
<> 128:9bcdf88f62b0 493 */
<> 128:9bcdf88f62b0 494 #define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT) | ((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
<> 128:9bcdf88f62b0 495
<> 128:9bcdf88f62b0 496 /**
<> 128:9bcdf88f62b0 497 * @brief Enable interrupt on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 498 * @retval None
<> 128:9bcdf88f62b0 499 */
<> 128:9bcdf88f62b0 500 #define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 501
<> 128:9bcdf88f62b0 502 /**
<> 128:9bcdf88f62b0 503 * @brief Disable interrupt on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 504 * @retval None
<> 128:9bcdf88f62b0 505 */
<> 128:9bcdf88f62b0 506 #define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_ALARM_EVENT))
<> 128:9bcdf88f62b0 507
<> 128:9bcdf88f62b0 508 /**
<> 128:9bcdf88f62b0 509 * @brief Enable event on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 510 * @retval None.
<> 128:9bcdf88f62b0 511 */
<> 128:9bcdf88f62b0 512 #define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 513
<> 128:9bcdf88f62b0 514 /**
<> 128:9bcdf88f62b0 515 * @brief Disable event on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 516 * @retval None.
<> 128:9bcdf88f62b0 517 */
<> 128:9bcdf88f62b0 518 #define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_ALARM_EVENT))
<> 128:9bcdf88f62b0 519
<> 128:9bcdf88f62b0 520 /**
<> 128:9bcdf88f62b0 521 * @brief Enable falling edge trigger on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 522 * @retval None.
<> 128:9bcdf88f62b0 523 */
<> 128:9bcdf88f62b0 524 #define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 525
<> 128:9bcdf88f62b0 526 /**
<> 128:9bcdf88f62b0 527 * @brief Disable falling edge trigger on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 528 * @retval None.
<> 128:9bcdf88f62b0 529 */
<> 128:9bcdf88f62b0 530 #define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT))
<> 128:9bcdf88f62b0 531
<> 128:9bcdf88f62b0 532 /**
<> 128:9bcdf88f62b0 533 * @brief Enable rising edge trigger on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 534 * @retval None.
<> 128:9bcdf88f62b0 535 */
<> 128:9bcdf88f62b0 536 #define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 537
<> 128:9bcdf88f62b0 538 /**
<> 128:9bcdf88f62b0 539 * @brief Disable rising edge trigger on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 540 * @retval None.
<> 128:9bcdf88f62b0 541 */
<> 128:9bcdf88f62b0 542 #define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT))
<> 128:9bcdf88f62b0 543
<> 128:9bcdf88f62b0 544 /**
<> 128:9bcdf88f62b0 545 * @brief Enable rising & falling edge trigger on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 546 * @retval None.
<> 128:9bcdf88f62b0 547 */
<> 128:9bcdf88f62b0 548 #define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE(); } while(0);
<> 128:9bcdf88f62b0 549
<> 128:9bcdf88f62b0 550 /**
<> 128:9bcdf88f62b0 551 * @brief Disable rising & falling edge trigger on the RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 552 * @retval None.
<> 128:9bcdf88f62b0 553 */
<> 128:9bcdf88f62b0 554 #define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE(); } while(0);
<> 128:9bcdf88f62b0 555
<> 128:9bcdf88f62b0 556 /**
<> 128:9bcdf88f62b0 557 * @brief Check whether the RTC Alarm associated Exti line interrupt flag is set or not.
<> 128:9bcdf88f62b0 558 * @retval Line Status.
<> 128:9bcdf88f62b0 559 */
<> 128:9bcdf88f62b0 560 #define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 561
<> 128:9bcdf88f62b0 562 /**
<> 128:9bcdf88f62b0 563 * @brief Clear the RTC Alarm associated Exti line flag.
<> 128:9bcdf88f62b0 564 * @retval None.
<> 128:9bcdf88f62b0 565 */
<> 128:9bcdf88f62b0 566 #define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 567
<> 128:9bcdf88f62b0 568 /**
<> 128:9bcdf88f62b0 569 * @brief Generate a Software interrupt on RTC Alarm associated Exti line.
<> 128:9bcdf88f62b0 570 * @retval None.
<> 128:9bcdf88f62b0 571 */
<> 128:9bcdf88f62b0 572 #define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_ALARM_EVENT)
<> 128:9bcdf88f62b0 573
<> 128:9bcdf88f62b0 574 /**
<> 128:9bcdf88f62b0 575 * @}
<> 128:9bcdf88f62b0 576 */
<> 128:9bcdf88f62b0 577
<> 128:9bcdf88f62b0 578 /* Include RTC HAL Extension module */
<> 128:9bcdf88f62b0 579 #include "stm32l1xx_hal_rtc_ex.h"
<> 128:9bcdf88f62b0 580
<> 128:9bcdf88f62b0 581 /* Exported functions --------------------------------------------------------*/
<> 128:9bcdf88f62b0 582 /** @addtogroup RTC_Exported_Functions
<> 128:9bcdf88f62b0 583 * @{
<> 128:9bcdf88f62b0 584 */
<> 128:9bcdf88f62b0 585
<> 128:9bcdf88f62b0 586
<> 128:9bcdf88f62b0 587 /* Initialization and de-initialization functions ****************************/
<> 128:9bcdf88f62b0 588 /** @addtogroup RTC_Exported_Functions_Group1
<> 128:9bcdf88f62b0 589 * @{
<> 128:9bcdf88f62b0 590 */
<> 128:9bcdf88f62b0 591 HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 592 HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 593 void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 594 void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 595 /**
<> 128:9bcdf88f62b0 596 * @}
<> 128:9bcdf88f62b0 597 */
<> 128:9bcdf88f62b0 598
<> 128:9bcdf88f62b0 599 /* RTC Time and Date functions ************************************************/
<> 128:9bcdf88f62b0 600 /** @addtogroup RTC_Exported_Functions_Group1
<> 128:9bcdf88f62b0 601 * @{
<> 128:9bcdf88f62b0 602 */
<> 128:9bcdf88f62b0 603 HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format);
<> 128:9bcdf88f62b0 604 HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format);
<> 128:9bcdf88f62b0 605 HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format);
<> 128:9bcdf88f62b0 606 HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format);
<> 128:9bcdf88f62b0 607 /**
<> 128:9bcdf88f62b0 608 * @}
<> 128:9bcdf88f62b0 609 */
<> 128:9bcdf88f62b0 610
<> 128:9bcdf88f62b0 611 /* RTC Alarm functions ********************************************************/
<> 128:9bcdf88f62b0 612 /** @addtogroup RTC_Exported_Functions_Group2
<> 128:9bcdf88f62b0 613 * @{
<> 128:9bcdf88f62b0 614 */
<> 128:9bcdf88f62b0 615 HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format);
<> 128:9bcdf88f62b0 616 HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format);
<> 128:9bcdf88f62b0 617 HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm);
<> 128:9bcdf88f62b0 618 HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format);
<> 128:9bcdf88f62b0 619 void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 620 HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
<> 128:9bcdf88f62b0 621 void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 622 /**
<> 128:9bcdf88f62b0 623 * @}
<> 128:9bcdf88f62b0 624 */
<> 128:9bcdf88f62b0 625
<> 128:9bcdf88f62b0 626 /* Peripheral Control functions ***********************************************/
<> 128:9bcdf88f62b0 627 /** @addtogroup RTC_Exported_Functions_Group3
<> 128:9bcdf88f62b0 628 * @{
<> 128:9bcdf88f62b0 629 */
<> 128:9bcdf88f62b0 630 HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc);
<> 128:9bcdf88f62b0 631 /**
<> 128:9bcdf88f62b0 632 * @}
<> 128:9bcdf88f62b0 633 */
<> 128:9bcdf88f62b0 634
<> 128:9bcdf88f62b0 635 /* Peripheral State functions *************************************************/
<> 128:9bcdf88f62b0 636 /** @addtogroup RTC_Exported_Functions_Group5
<> 128:9bcdf88f62b0 637 * @{
<> 128:9bcdf88f62b0 638 */
<> 128:9bcdf88f62b0 639 HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc);
<> 128:9bcdf88f62b0 640 /**
<> 128:9bcdf88f62b0 641 * @}
<> 128:9bcdf88f62b0 642 */
<> 128:9bcdf88f62b0 643
<> 128:9bcdf88f62b0 644 /**
<> 128:9bcdf88f62b0 645 * @}
<> 128:9bcdf88f62b0 646 */
<> 128:9bcdf88f62b0 647 /* Private functions **********************************************************/
<> 128:9bcdf88f62b0 648 /** @addtogroup RTC_Internal_Functions
<> 128:9bcdf88f62b0 649 * @{
<> 128:9bcdf88f62b0 650 */
<> 128:9bcdf88f62b0 651 /* Private types -------------------------------------------------------------*/
<> 128:9bcdf88f62b0 652 /* Private variables ---------------------------------------------------------*/
<> 128:9bcdf88f62b0 653 /* Private constants ---------------------------------------------------------*/
<> 128:9bcdf88f62b0 654 /** @defgroup RTC_Private_Constants RTC Private Constants
<> 128:9bcdf88f62b0 655 * @{
<> 128:9bcdf88f62b0 656 */
<> 128:9bcdf88f62b0 657
<> 128:9bcdf88f62b0 658 #define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)EXTI_IMR_MR17) /*!< External interrupt line 17 Connected to the RTC Alarm event */
<> 128:9bcdf88f62b0 659
<> 128:9bcdf88f62b0 660 /**
<> 128:9bcdf88f62b0 661 * @}
<> 128:9bcdf88f62b0 662 */
<> 128:9bcdf88f62b0 663
<> 128:9bcdf88f62b0 664 /* Private macros ------------------------------------------------------------*/
<> 128:9bcdf88f62b0 665 /** @defgroup RTC_Private_Macros RTC Private Macros
<> 128:9bcdf88f62b0 666 * @{
<> 128:9bcdf88f62b0 667 */
<> 128:9bcdf88f62b0 668
<> 128:9bcdf88f62b0 669 /**
<> 128:9bcdf88f62b0 670 * @}
<> 128:9bcdf88f62b0 671 */
<> 128:9bcdf88f62b0 672
<> 128:9bcdf88f62b0 673 /* Private functions ---------------------------------------------------------*/
<> 128:9bcdf88f62b0 674 /** @defgroup RTC_Private_Functions RTC Private Functions
<> 128:9bcdf88f62b0 675 * @{
<> 128:9bcdf88f62b0 676 */
<> 128:9bcdf88f62b0 677 HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc);
<> 128:9bcdf88f62b0 678 uint8_t RTC_ByteToBcd2(uint8_t Value);
<> 128:9bcdf88f62b0 679 uint8_t RTC_Bcd2ToByte(uint8_t Value);
<> 128:9bcdf88f62b0 680
<> 128:9bcdf88f62b0 681 /**
<> 128:9bcdf88f62b0 682 * @}
<> 128:9bcdf88f62b0 683 */
<> 128:9bcdf88f62b0 684
<> 128:9bcdf88f62b0 685 /**
<> 128:9bcdf88f62b0 686 * @}
<> 128:9bcdf88f62b0 687 */
<> 128:9bcdf88f62b0 688
<> 128:9bcdf88f62b0 689 /**
<> 128:9bcdf88f62b0 690 * @}
<> 128:9bcdf88f62b0 691 */
<> 128:9bcdf88f62b0 692
<> 128:9bcdf88f62b0 693 /**
<> 128:9bcdf88f62b0 694 * @}
<> 128:9bcdf88f62b0 695 */
<> 128:9bcdf88f62b0 696
<> 128:9bcdf88f62b0 697 #ifdef __cplusplus
<> 128:9bcdf88f62b0 698 }
<> 128:9bcdf88f62b0 699 #endif
<> 128:9bcdf88f62b0 700
<> 128:9bcdf88f62b0 701 #endif /* __STM32L1xx_HAL_RTC_H */
<> 128:9bcdf88f62b0 702
<> 128:9bcdf88f62b0 703 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/