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