Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2 | Rev 3 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | /** |
1 | /** |
| 2 | ****************************************************************************** |
2 | ****************************************************************************** |
| 3 | * @file stm32f1xx_hal_rtc_ex.h |
3 | * @file stm32f1xx_hal_rtc_ex.h |
| 4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
| 5 | * @brief Header file of RTC HAL Extension module. |
5 | * @brief Header file of RTC HAL Extension module. |
| 6 | ****************************************************************************** |
6 | ****************************************************************************** |
| 7 | * @attention |
7 | * @attention |
| 8 | * |
8 | * |
| 9 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
9 | * Copyright (c) 2016 STMicroelectronics. |
| 10 | * All rights reserved.</center></h2> |
10 | * All rights reserved. |
| 11 | * |
11 | * |
| 12 | * This software component is licensed by ST under BSD 3-Clause license, |
12 | * This software is licensed under terms that can be found in the LICENSE file |
| 13 | * the "License"; You may not use this file except in compliance with the |
13 | * in the root directory of this software component. |
| 14 | * License. You may obtain a copy of the License at: |
14 | * If no LICENSE file comes with this software, it is provided AS-IS. |
| 15 | * opensource.org/licenses/BSD-3-Clause |
15 | * |
| 16 | * |
16 | ****************************************************************************** |
| 17 | ****************************************************************************** |
17 | */ |
| 18 | */ |
18 | |
| 19 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ |
|
| 20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | #ifndef __STM32F1xx_HAL_RTC_EX_H |
| 21 | #ifndef __STM32F1xx_HAL_RTC_EX_H |
21 | #define __STM32F1xx_HAL_RTC_EX_H |
| 22 | #define __STM32F1xx_HAL_RTC_EX_H |
22 | |
| 23 | 23 | #ifdef __cplusplus |
|
| 24 | #ifdef __cplusplus |
24 | extern "C" { |
| 25 | extern "C" { |
25 | #endif |
| 26 | #endif |
26 | |
| 27 | 27 | /* Includes ------------------------------------------------------------------*/ |
|
| 28 | /* Includes ------------------------------------------------------------------*/ |
28 | #include "stm32f1xx_hal_def.h" |
| 29 | #include "stm32f1xx_hal_def.h" |
29 | |
| 30 | 30 | /** @addtogroup STM32F1xx_HAL_Driver |
|
| 31 | /** @addtogroup STM32F1xx_HAL_Driver |
31 | * @{ |
| 32 | * @{ |
32 | */ |
| 33 | */ |
33 | |
| 34 | 34 | /** @addtogroup RTCEx |
|
| 35 | /** @addtogroup RTCEx |
35 | * @{ |
| 36 | * @{ |
36 | */ |
| 37 | */ |
37 | |
| 38 | 38 | /** @addtogroup RTCEx_Private_Macros |
|
| 39 | /** @addtogroup RTCEx_Private_Macros |
39 | * @{ |
| 40 | * @{ |
40 | */ |
| 41 | */ |
41 | |
| 42 | 42 | /** @defgroup RTCEx_Alias_For_Legacy Alias define maintained for legacy |
|
| 43 | /** @defgroup RTCEx_Alias_For_Legacy Alias define maintained for legacy |
43 | * @{ |
| 44 | * @{ |
44 | */ |
| 45 | */ |
45 | #define HAL_RTCEx_TamperTimeStampIRQHandler HAL_RTCEx_TamperIRQHandler |
| 46 | #define HAL_RTCEx_TamperTimeStampIRQHandler HAL_RTCEx_TamperIRQHandler |
46 | |
| 47 | 47 | /** |
|
| 48 | /** |
48 | * @} |
| 49 | * @} |
49 | */ |
| 50 | */ |
50 | |
| 51 | 51 | /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters |
|
| 52 | /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters |
52 | * @{ |
| 53 | * @{ |
53 | */ |
| 54 | */ |
54 | #define IS_RTC_TAMPER(__TAMPER__) ((__TAMPER__) == RTC_TAMPER_1) |
| 55 | #define IS_RTC_TAMPER(__TAMPER__) ((__TAMPER__) == RTC_TAMPER_1) |
55 | |
| 56 | 56 | #define IS_RTC_TAMPER_TRIGGER(__TRIGGER__) (((__TRIGGER__) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ |
|
| 57 | #define IS_RTC_TAMPER_TRIGGER(__TRIGGER__) (((__TRIGGER__) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ |
57 | ((__TRIGGER__) == RTC_TAMPERTRIGGER_HIGHLEVEL)) |
| 58 | ((__TRIGGER__) == RTC_TAMPERTRIGGER_HIGHLEVEL)) |
58 | |
| 59 | 59 | #if RTC_BKP_NUMBER > 10U |
|
| 60 | #if RTC_BKP_NUMBER > 10U |
60 | #define IS_RTC_BKP(BKP) (((BKP) <= (uint32_t)RTC_BKP_DR10) || (((BKP) >= (uint32_t)RTC_BKP_DR11) && ((BKP) <= (uint32_t)RTC_BKP_DR42))) |
| 61 | #define IS_RTC_BKP(BKP) (((BKP) <= (uint32_t)RTC_BKP_DR10) || (((BKP) >= (uint32_t)RTC_BKP_DR11) && ((BKP) <= (uint32_t)RTC_BKP_DR42))) |
61 | #else |
| 62 | #else |
62 | #define IS_RTC_BKP(BKP) ((BKP) <= (uint32_t)RTC_BKP_NUMBER) |
| 63 | #define IS_RTC_BKP(BKP) ((BKP) <= (uint32_t)RTC_BKP_NUMBER) |
63 | #endif |
| 64 | #endif |
64 | #define IS_RTC_SMOOTH_CALIB_MINUS(__VALUE__) ((__VALUE__) <= 0x0000007FU) |
| 65 | #define IS_RTC_SMOOTH_CALIB_MINUS(__VALUE__) ((__VALUE__) <= 0x0000007FU) |
65 | |
| 66 | 66 | /** |
|
| 67 | /** |
67 | * @} |
| 68 | * @} |
68 | */ |
| 69 | */ |
69 | |
| 70 | 70 | /** |
|
| 71 | /** |
71 | * @} |
| 72 | * @} |
72 | */ |
| 73 | */ |
73 | |
| 74 | 74 | /* Exported types ------------------------------------------------------------*/ |
|
| 75 | /* Exported types ------------------------------------------------------------*/ |
75 | /** @defgroup RTCEx_Exported_Types RTCEx Exported Types |
| 76 | /** @defgroup RTCEx_Exported_Types RTCEx Exported Types |
76 | * @{ |
| 77 | * @{ |
77 | */ |
| 78 | */ |
78 | /** |
| 79 | /** |
79 | * @brief RTC Tamper structure definition |
| 80 | * @brief RTC Tamper structure definition |
80 | */ |
| 81 | */ |
81 | typedef struct |
| 82 | typedef struct |
82 | { |
| 83 | { |
83 | uint32_t Tamper; /*!< Specifies the Tamper Pin. |
| 84 | uint32_t Tamper; /*!< Specifies the Tamper Pin. |
84 | This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ |
| 85 | This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ |
85 | |
| 86 | 86 | uint32_t Trigger; /*!< Specifies the Tamper Trigger. |
|
| 87 | uint32_t Trigger; /*!< Specifies the Tamper Trigger. |
87 | This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ |
| 88 | This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ |
88 | |
| 89 | 89 | } RTC_TamperTypeDef; |
|
| 90 | } RTC_TamperTypeDef; |
90 | |
| 91 | 91 | /** |
|
| 92 | /** |
92 | * @} |
| 93 | * @} |
93 | */ |
| 94 | */ |
94 | |
| 95 | 95 | /* Exported constants --------------------------------------------------------*/ |
|
| 96 | /* Exported constants --------------------------------------------------------*/ |
96 | /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants |
| 97 | /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants |
97 | * @{ |
| 98 | * @{ |
98 | */ |
| 99 | */ |
99 | |
| 100 | 100 | /** @defgroup RTCEx_Tamper_Pins_Definitions Tamper Pins Definitions |
|
| 101 | /** @defgroup RTCEx_Tamper_Pins_Definitions Tamper Pins Definitions |
101 | * @{ |
| 102 | * @{ |
102 | */ |
| 103 | */ |
103 | #define RTC_TAMPER_1 BKP_CR_TPE /*!< Select tamper to be enabled (mainly for legacy purposes) */ |
| 104 | #define RTC_TAMPER_1 BKP_CR_TPE /*!< Select tamper to be enabled (mainly for legacy purposes) */ |
104 | |
| 105 | 105 | /** |
|
| 106 | /** |
106 | * @} |
| 107 | * @} |
107 | */ |
| 108 | */ |
108 | |
| 109 | 109 | /** @defgroup RTCEx_Tamper_Trigger_Definitions Tamper Trigger Definitions |
|
| 110 | /** @defgroup RTCEx_Tamper_Trigger_Definitions Tamper Trigger Definitions |
110 | * @{ |
| 111 | * @{ |
111 | */ |
| 112 | */ |
112 | #define RTC_TAMPERTRIGGER_LOWLEVEL BKP_CR_TPAL /*!< A high level on the TAMPER pin resets all data backup registers (if TPE bit is set) */ |
| 113 | #define RTC_TAMPERTRIGGER_LOWLEVEL BKP_CR_TPAL /*!< A high level on the TAMPER pin resets all data backup registers (if TPE bit is set) */ |
113 | #define RTC_TAMPERTRIGGER_HIGHLEVEL 0x00000000U /*!< A low level on the TAMPER pin resets all data backup registers (if TPE bit is set) */ |
| 114 | #define RTC_TAMPERTRIGGER_HIGHLEVEL 0x00000000U /*!< A low level on the TAMPER pin resets all data backup registers (if TPE bit is set) */ |
114 | |
| 115 | 115 | /** |
|
| 116 | /** |
116 | * @} |
| 117 | * @} |
117 | */ |
| 118 | */ |
118 | |
| 119 | 119 | /** @defgroup RTCEx_Backup_Registers_Definitions Backup Registers Definitions |
|
| 120 | /** @defgroup RTCEx_Backup_Registers_Definitions Backup Registers Definitions |
120 | * @{ |
| 121 | * @{ |
121 | */ |
| 122 | */ |
122 | #if RTC_BKP_NUMBER > 0U |
| 123 | #if RTC_BKP_NUMBER > 0U |
123 | #define RTC_BKP_DR1 0x00000001U |
| 124 | #define RTC_BKP_DR1 0x00000001U |
124 | #define RTC_BKP_DR2 0x00000002U |
| 125 | #define RTC_BKP_DR2 0x00000002U |
125 | #define RTC_BKP_DR3 0x00000003U |
| 126 | #define RTC_BKP_DR3 0x00000003U |
126 | #define RTC_BKP_DR4 0x00000004U |
| 127 | #define RTC_BKP_DR4 0x00000004U |
127 | #define RTC_BKP_DR5 0x00000005U |
| 128 | #define RTC_BKP_DR5 0x00000005U |
128 | #define RTC_BKP_DR6 0x00000006U |
| 129 | #define RTC_BKP_DR6 0x00000006U |
129 | #define RTC_BKP_DR7 0x00000007U |
| 130 | #define RTC_BKP_DR7 0x00000007U |
130 | #define RTC_BKP_DR8 0x00000008U |
| 131 | #define RTC_BKP_DR8 0x00000008U |
131 | #define RTC_BKP_DR9 0x00000009U |
| 132 | #define RTC_BKP_DR9 0x00000009U |
132 | #define RTC_BKP_DR10 0x0000000AU |
| 133 | #define RTC_BKP_DR10 0x0000000AU |
133 | #endif /* RTC_BKP_NUMBER > 0 */ |
| 134 | #endif /* RTC_BKP_NUMBER > 0 */ |
134 | |
| 135 | 135 | #if RTC_BKP_NUMBER > 10U |
|
| 136 | #if RTC_BKP_NUMBER > 10U |
136 | #define RTC_BKP_DR11 0x00000010U |
| 137 | #define RTC_BKP_DR11 0x00000010U |
137 | #define RTC_BKP_DR12 0x00000011U |
| 138 | #define RTC_BKP_DR12 0x00000011U |
138 | #define RTC_BKP_DR13 0x00000012U |
| 139 | #define RTC_BKP_DR13 0x00000012U |
139 | #define RTC_BKP_DR14 0x00000013U |
| 140 | #define RTC_BKP_DR14 0x00000013U |
140 | #define RTC_BKP_DR15 0x00000014U |
| 141 | #define RTC_BKP_DR15 0x00000014U |
141 | #define RTC_BKP_DR16 0x00000015U |
| 142 | #define RTC_BKP_DR16 0x00000015U |
142 | #define RTC_BKP_DR17 0x00000016U |
| 143 | #define RTC_BKP_DR17 0x00000016U |
143 | #define RTC_BKP_DR18 0x00000017U |
| 144 | #define RTC_BKP_DR18 0x00000017U |
144 | #define RTC_BKP_DR19 0x00000018U |
| 145 | #define RTC_BKP_DR19 0x00000018U |
145 | #define RTC_BKP_DR20 0x00000019U |
| 146 | #define RTC_BKP_DR20 0x00000019U |
146 | #define RTC_BKP_DR21 0x0000001AU |
| 147 | #define RTC_BKP_DR21 0x0000001AU |
147 | #define RTC_BKP_DR22 0x0000001BU |
| 148 | #define RTC_BKP_DR22 0x0000001BU |
148 | #define RTC_BKP_DR23 0x0000001CU |
| 149 | #define RTC_BKP_DR23 0x0000001CU |
149 | #define RTC_BKP_DR24 0x0000001DU |
| 150 | #define RTC_BKP_DR24 0x0000001DU |
150 | #define RTC_BKP_DR25 0x0000001EU |
| 151 | #define RTC_BKP_DR25 0x0000001EU |
151 | #define RTC_BKP_DR26 0x0000001FU |
| 152 | #define RTC_BKP_DR26 0x0000001FU |
152 | #define RTC_BKP_DR27 0x00000020U |
| 153 | #define RTC_BKP_DR27 0x00000020U |
153 | #define RTC_BKP_DR28 0x00000021U |
| 154 | #define RTC_BKP_DR28 0x00000021U |
154 | #define RTC_BKP_DR29 0x00000022U |
| 155 | #define RTC_BKP_DR29 0x00000022U |
155 | #define RTC_BKP_DR30 0x00000023U |
| 156 | #define RTC_BKP_DR30 0x00000023U |
156 | #define RTC_BKP_DR31 0x00000024U |
| 157 | #define RTC_BKP_DR31 0x00000024U |
157 | #define RTC_BKP_DR32 0x00000025U |
| 158 | #define RTC_BKP_DR32 0x00000025U |
158 | #define RTC_BKP_DR33 0x00000026U |
| 159 | #define RTC_BKP_DR33 0x00000026U |
159 | #define RTC_BKP_DR34 0x00000027U |
| 160 | #define RTC_BKP_DR34 0x00000027U |
160 | #define RTC_BKP_DR35 0x00000028U |
| 161 | #define RTC_BKP_DR35 0x00000028U |
161 | #define RTC_BKP_DR36 0x00000029U |
| 162 | #define RTC_BKP_DR36 0x00000029U |
162 | #define RTC_BKP_DR37 0x0000002AU |
| 163 | #define RTC_BKP_DR37 0x0000002AU |
163 | #define RTC_BKP_DR38 0x0000002BU |
| 164 | #define RTC_BKP_DR38 0x0000002BU |
164 | #define RTC_BKP_DR39 0x0000002CU |
| 165 | #define RTC_BKP_DR39 0x0000002CU |
165 | #define RTC_BKP_DR40 0x0000002DU |
| 166 | #define RTC_BKP_DR40 0x0000002DU |
166 | #define RTC_BKP_DR41 0x0000002EU |
| 167 | #define RTC_BKP_DR41 0x0000002EU |
167 | #define RTC_BKP_DR42 0x0000002FU |
| 168 | #define RTC_BKP_DR42 0x0000002FU |
168 | #endif /* RTC_BKP_NUMBER > 10 */ |
| 169 | #endif /* RTC_BKP_NUMBER > 10 */ |
169 | |
| 170 | 170 | /** |
|
| 171 | /** |
171 | * @} |
| 172 | * @} |
172 | */ |
| 173 | */ |
173 | |
| 174 | 174 | /** |
|
| 175 | /** |
175 | * @} |
| 176 | * @} |
176 | */ |
| 177 | */ |
177 | |
| 178 | 178 | /* Exported macro ------------------------------------------------------------*/ |
|
| 179 | /* Exported macro ------------------------------------------------------------*/ |
179 | /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros |
| 180 | /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros |
180 | * @{ |
| 181 | * @{ |
181 | */ |
| 182 | */ |
182 | |
| 183 | 183 | /** |
|
| 184 | /** |
184 | * @brief Enable the RTC Tamper interrupt. |
| 185 | * @brief Enable the RTC Tamper interrupt. |
185 | * @param __HANDLE__: specifies the RTC handle. |
| 186 | * @param __HANDLE__: specifies the RTC handle. |
186 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled |
| 187 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled |
187 | * This parameter can be any combination of the following values: |
| 188 | * This parameter can be any combination of the following values: |
188 | * @arg RTC_IT_TAMP1: Tamper A interrupt |
| 189 | * @arg RTC_IT_TAMP1: Tamper A interrupt |
189 | * @retval None |
| 190 | * @retval None |
190 | */ |
| 191 | */ |
191 | #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT(BKP->CSR, (__INTERRUPT__)) |
| 192 | #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT(BKP->CSR, (__INTERRUPT__)) |
192 | |
| 193 | 193 | /** |
|
| 194 | /** |
194 | * @brief Disable the RTC Tamper interrupt. |
| 195 | * @brief Disable the RTC Tamper interrupt. |
195 | * @param __HANDLE__: specifies the RTC handle. |
| 196 | * @param __HANDLE__: specifies the RTC handle. |
196 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled. |
| 197 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled. |
197 | * This parameter can be any combination of the following values: |
| 198 | * This parameter can be any combination of the following values: |
198 | * @arg RTC_IT_TAMP1: Tamper A interrupt |
| 199 | * @arg RTC_IT_TAMP1: Tamper A interrupt |
199 | * @retval None |
| 200 | * @retval None |
200 | */ |
| 201 | */ |
201 | #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT(BKP->CSR, (__INTERRUPT__)) |
| 202 | #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT(BKP->CSR, (__INTERRUPT__)) |
202 | |
| 203 | 203 | /** |
|
| 204 | /** |
204 | * @brief Check whether the specified RTC Tamper interrupt has been enabled or not. |
| 205 | * @brief Check whether the specified RTC Tamper interrupt has been enabled or not. |
205 | * @param __HANDLE__: specifies the RTC handle. |
| 206 | * @param __HANDLE__: specifies the RTC handle. |
206 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be checked. |
| 207 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be checked. |
207 | * This parameter can be: |
| 208 | * This parameter can be: |
208 | * @arg RTC_IT_TAMP1 |
| 209 | * @arg RTC_IT_TAMP1 |
209 | * @retval None |
| 210 | * @retval None |
210 | */ |
| 211 | */ |
211 | #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((BKP->CSR) & ((__INTERRUPT__))) != RESET)? SET : RESET) |
| 212 | #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((BKP->CSR) & ((__INTERRUPT__))) != RESET)? SET : RESET) |
212 | |
| 213 | 213 | /** |
|
| 214 | /** |
214 | * @brief Get the selected RTC Tamper's flag status. |
| 215 | * @brief Get the selected RTC Tamper's flag status. |
215 | * @param __HANDLE__: specifies the RTC handle. |
| 216 | * @param __HANDLE__: specifies the RTC handle. |
216 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
| 217 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
217 | * This parameter can be: |
| 218 | * This parameter can be: |
218 | * @arg RTC_FLAG_TAMP1F |
| 219 | * @arg RTC_FLAG_TAMP1F |
219 | * @retval None |
| 220 | * @retval None |
220 | */ |
| 221 | */ |
221 | #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) ((((BKP->CSR) & (__FLAG__)) != RESET)? SET : RESET) |
| 222 | #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) ((((BKP->CSR) & (__FLAG__)) != RESET)? SET : RESET) |
222 | |
| 223 | 223 | /** |
|
| 224 | /** |
224 | * @brief Get the selected RTC Tamper's flag status. |
| 225 | * @brief Get the selected RTC Tamper's flag status. |
225 | * @param __HANDLE__: specifies the RTC handle. |
| 226 | * @param __HANDLE__: specifies the RTC handle. |
226 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be checked. |
| 227 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be checked. |
227 | * This parameter can be: |
| 228 | * This parameter can be: |
228 | * @arg RTC_IT_TAMP1 |
| 229 | * @arg RTC_IT_TAMP1 |
229 | * @retval None |
| 230 | * @retval None |
230 | */ |
| 231 | */ |
231 | #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) ((((BKP->CSR) & (BKP_CSR_TEF)) != RESET)? SET : RESET) |
| 232 | #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) ((((BKP->CSR) & (BKP_CSR_TEF)) != RESET)? SET : RESET) |
232 | |
| 233 | 233 | /** |
|
| 234 | /** |
234 | * @brief Clear the RTC Tamper's pending flags. |
| 235 | * @brief Clear the RTC Tamper's pending flags. |
235 | * @param __HANDLE__: specifies the RTC handle. |
| 236 | * @param __HANDLE__: specifies the RTC handle. |
236 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
| 237 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
237 | * This parameter can be: |
| 238 | * This parameter can be: |
238 | * @arg RTC_FLAG_TAMP1F |
| 239 | * @arg RTC_FLAG_TAMP1F |
239 | * @retval None |
| 240 | * @retval None |
240 | */ |
| 241 | */ |
241 | #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) SET_BIT(BKP->CSR, BKP_CSR_CTE | BKP_CSR_CTI) |
| 242 | #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) SET_BIT(BKP->CSR, BKP_CSR_CTE | BKP_CSR_CTI) |
242 | |
| 243 | 243 | /** |
|
| 244 | /** |
244 | * @brief Enable the RTC Second interrupt. |
| 245 | * @brief Enable the RTC Second interrupt. |
245 | * @param __HANDLE__: specifies the RTC handle. |
| 246 | * @param __HANDLE__: specifies the RTC handle. |
246 | * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be enabled |
| 247 | * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be enabled |
247 | * This parameter can be any combination of the following values: |
| 248 | * This parameter can be any combination of the following values: |
248 | * @arg RTC_IT_SEC: Second A interrupt |
| 249 | * @arg RTC_IT_SEC: Second A interrupt |
249 | * @retval None |
| 250 | * @retval None |
250 | */ |
| 251 | */ |
251 | #define __HAL_RTC_SECOND_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
| 252 | #define __HAL_RTC_SECOND_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
252 | |
| 253 | 253 | /** |
|
| 254 | /** |
254 | * @brief Disable the RTC Second interrupt. |
| 255 | * @brief Disable the RTC Second interrupt. |
255 | * @param __HANDLE__: specifies the RTC handle. |
| 256 | * @param __HANDLE__: specifies the RTC handle. |
256 | * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be disabled. |
| 257 | * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be disabled. |
257 | * This parameter can be any combination of the following values: |
| 258 | * This parameter can be any combination of the following values: |
258 | * @arg RTC_IT_SEC: Second A interrupt |
| 259 | * @arg RTC_IT_SEC: Second A interrupt |
259 | * @retval None |
| 260 | * @retval None |
260 | */ |
| 261 | */ |
261 | #define __HAL_RTC_SECOND_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
| 262 | #define __HAL_RTC_SECOND_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
262 | |
| 263 | 263 | /** |
|
| 264 | /** |
264 | * @brief Check whether the specified RTC Second interrupt has occurred or not. |
| 265 | * @brief Check whether the specified RTC Second interrupt has occurred or not. |
265 | * @param __HANDLE__: specifies the RTC handle. |
| 266 | * @param __HANDLE__: specifies the RTC handle. |
266 | * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be enabled or disabled. |
| 267 | * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be enabled or disabled. |
267 | * This parameter can be: |
| 268 | * This parameter can be: |
268 | * @arg RTC_IT_SEC: Second A interrupt |
| 269 | * @arg RTC_IT_SEC: Second A interrupt |
269 | * @retval None |
| 270 | * @retval None |
270 | */ |
| 271 | */ |
271 | #define __HAL_RTC_SECOND_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__)))) != RESET)? SET : RESET) |
| 272 | #define __HAL_RTC_SECOND_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__)))) != RESET)? SET : RESET) |
272 | |
| 273 | 273 | /** |
|
| 274 | /** |
274 | * @brief Get the selected RTC Second's flag status. |
| 275 | * @brief Get the selected RTC Second's flag status. |
275 | * @param __HANDLE__: specifies the RTC handle. |
| 276 | * @param __HANDLE__: specifies the RTC handle. |
276 | * @param __FLAG__: specifies the RTC Second Flag sources to be enabled or disabled. |
| 277 | * @param __FLAG__: specifies the RTC Second Flag sources to be enabled or disabled. |
277 | * This parameter can be: |
| 278 | * This parameter can be: |
278 | * @arg RTC_FLAG_SEC |
| 279 | * @arg RTC_FLAG_SEC |
279 | * @retval None |
| 280 | * @retval None |
280 | */ |
| 281 | */ |
281 | #define __HAL_RTC_SECOND_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET) |
| 282 | #define __HAL_RTC_SECOND_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET) |
282 | |
| 283 | 283 | /** |
|
| 284 | /** |
284 | * @brief Clear the RTC Second's pending flags. |
| 285 | * @brief Clear the RTC Second's pending flags. |
285 | * @param __HANDLE__: specifies the RTC handle. |
| 286 | * @param __HANDLE__: specifies the RTC handle. |
286 | * @param __FLAG__: specifies the RTC Second Flag sources to be enabled or disabled. |
| 287 | * @param __FLAG__: specifies the RTC Second Flag sources to be enabled or disabled. |
287 | * This parameter can be: |
| 288 | * This parameter can be: |
288 | * @arg RTC_FLAG_SEC |
| 289 | * @arg RTC_FLAG_SEC |
289 | * @retval None |
| 290 | * @retval None |
290 | */ |
| 291 | */ |
291 | #define __HAL_RTC_SECOND_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) &= ~(__FLAG__) |
| 292 | #define __HAL_RTC_SECOND_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) &= ~(__FLAG__) |
292 | |
| 293 | 293 | /** |
|
| 294 | /** |
294 | * @brief Enable the RTC Overflow interrupt. |
| 295 | * @brief Enable the RTC Overflow interrupt. |
295 | * @param __HANDLE__: specifies the RTC handle. |
| 296 | * @param __HANDLE__: specifies the RTC handle. |
296 | * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be enabled |
| 297 | * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be enabled |
297 | * This parameter can be any combination of the following values: |
| 298 | * This parameter can be any combination of the following values: |
298 | * @arg RTC_IT_OW: Overflow A interrupt |
| 299 | * @arg RTC_IT_OW: Overflow A interrupt |
299 | * @retval None |
| 300 | * @retval None |
300 | */ |
| 301 | */ |
301 | #define __HAL_RTC_OVERFLOW_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
| 302 | #define __HAL_RTC_OVERFLOW_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
302 | |
| 303 | 303 | /** |
|
| 304 | /** |
304 | * @brief Disable the RTC Overflow interrupt. |
| 305 | * @brief Disable the RTC Overflow interrupt. |
305 | * @param __HANDLE__: specifies the RTC handle. |
| 306 | * @param __HANDLE__: specifies the RTC handle. |
306 | * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be disabled. |
| 307 | * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be disabled. |
307 | * This parameter can be any combination of the following values: |
| 308 | * This parameter can be any combination of the following values: |
308 | * @arg RTC_IT_OW: Overflow A interrupt |
| 309 | * @arg RTC_IT_OW: Overflow A interrupt |
309 | * @retval None |
| 310 | * @retval None |
310 | */ |
| 311 | */ |
311 | #define __HAL_RTC_OVERFLOW_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
| 312 | #define __HAL_RTC_OVERFLOW_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
312 | |
| 313 | 313 | /** |
|
| 314 | /** |
314 | * @brief Check whether the specified RTC Overflow interrupt has occurred or not. |
| 315 | * @brief Check whether the specified RTC Overflow interrupt has occurred or not. |
315 | * @param __HANDLE__: specifies the RTC handle. |
| 316 | * @param __HANDLE__: specifies the RTC handle. |
316 | * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be enabled or disabled. |
| 317 | * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be enabled or disabled. |
317 | * This parameter can be: |
| 318 | * This parameter can be: |
318 | * @arg RTC_IT_OW: Overflow A interrupt |
| 319 | * @arg RTC_IT_OW: Overflow A interrupt |
319 | * @retval None |
| 320 | * @retval None |
320 | */ |
| 321 | */ |
321 | #define __HAL_RTC_OVERFLOW_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__))) ) != RESET)? SET : RESET) |
| 322 | #define __HAL_RTC_OVERFLOW_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__))) ) != RESET)? SET : RESET) |
322 | |
| 323 | 323 | /** |
|
| 324 | /** |
324 | * @brief Get the selected RTC Overflow's flag status. |
| 325 | * @brief Get the selected RTC Overflow's flag status. |
325 | * @param __HANDLE__: specifies the RTC handle. |
| 326 | * @param __HANDLE__: specifies the RTC handle. |
326 | * @param __FLAG__: specifies the RTC Overflow Flag sources to be enabled or disabled. |
| 327 | * @param __FLAG__: specifies the RTC Overflow Flag sources to be enabled or disabled. |
327 | * This parameter can be: |
| 328 | * This parameter can be: |
328 | * @arg RTC_FLAG_OW |
| 329 | * @arg RTC_FLAG_OW |
329 | * @retval None |
| 330 | * @retval None |
330 | */ |
| 331 | */ |
331 | #define __HAL_RTC_OVERFLOW_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET) |
| 332 | #define __HAL_RTC_OVERFLOW_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET) |
332 | |
| 333 | 333 | /** |
|
| 334 | /** |
334 | * @brief Clear the RTC Overflow's pending flags. |
| 335 | * @brief Clear the RTC Overflow's pending flags. |
335 | * @param __HANDLE__: specifies the RTC handle. |
| 336 | * @param __HANDLE__: specifies the RTC handle. |
336 | * @param __FLAG__: specifies the RTC Overflow Flag sources to be enabled or disabled. |
| 337 | * @param __FLAG__: specifies the RTC Overflow Flag sources to be enabled or disabled. |
337 | * This parameter can be: |
| 338 | * This parameter can be: |
338 | * @arg RTC_FLAG_OW |
| 339 | * @arg RTC_FLAG_OW |
339 | * @retval None |
| 340 | * @retval None |
340 | */ |
| 341 | */ |
341 | #define __HAL_RTC_OVERFLOW_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) = ~(__FLAG__) |
| 342 | #define __HAL_RTC_OVERFLOW_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) = ~(__FLAG__) |
342 | |
| 343 | 343 | /** |
|
| 344 | /** |
344 | * @} |
| 345 | * @} |
345 | */ |
| 346 | */ |
346 | |
| 347 | 347 | /* Exported functions --------------------------------------------------------*/ |
|
| 348 | /* Exported functions --------------------------------------------------------*/ |
348 | /** @addtogroup RTCEx_Exported_Functions |
| 349 | /** @addtogroup RTCEx_Exported_Functions |
349 | * @{ |
| 350 | * @{ |
350 | */ |
| 351 | */ |
351 | |
| 352 | 352 | /* RTC Tamper functions *****************************************/ |
|
| 353 | /* RTC Tamper functions *****************************************/ |
353 | /** @addtogroup RTCEx_Exported_Functions_Group1 |
| 354 | /** @addtogroup RTCEx_Exported_Functions_Group1 |
354 | * @{ |
| 355 | * @{ |
355 | */ |
| 356 | */ |
356 | HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); |
| 357 | HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); |
357 | HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); |
| 358 | HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); |
358 | HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); |
| 359 | HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); |
359 | void HAL_RTCEx_TamperIRQHandler(RTC_HandleTypeDef *hrtc); |
| 360 | void HAL_RTCEx_TamperIRQHandler(RTC_HandleTypeDef *hrtc); |
360 | void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); |
| 361 | void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); |
361 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
| 362 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
362 | |
| 363 | 363 | /** |
|
| 364 | /** |
364 | * @} |
| 365 | * @} |
365 | */ |
| 366 | */ |
366 | |
| 367 | 367 | /* RTC Second functions *****************************************/ |
|
| 368 | /* RTC Second functions *****************************************/ |
368 | /** @addtogroup RTCEx_Exported_Functions_Group2 |
| 369 | /** @addtogroup RTCEx_Exported_Functions_Group2 |
369 | * @{ |
| 370 | * @{ |
370 | */ |
| 371 | */ |
371 | HAL_StatusTypeDef HAL_RTCEx_SetSecond_IT(RTC_HandleTypeDef *hrtc); |
| 372 | HAL_StatusTypeDef HAL_RTCEx_SetSecond_IT(RTC_HandleTypeDef *hrtc); |
372 | HAL_StatusTypeDef HAL_RTCEx_DeactivateSecond(RTC_HandleTypeDef *hrtc); |
| 373 | HAL_StatusTypeDef HAL_RTCEx_DeactivateSecond(RTC_HandleTypeDef *hrtc); |
373 | void HAL_RTCEx_RTCIRQHandler(RTC_HandleTypeDef *hrtc); |
| 374 | void HAL_RTCEx_RTCIRQHandler(RTC_HandleTypeDef *hrtc); |
374 | void HAL_RTCEx_RTCEventCallback(RTC_HandleTypeDef *hrtc); |
| 375 | void HAL_RTCEx_RTCEventCallback(RTC_HandleTypeDef *hrtc); |
375 | void HAL_RTCEx_RTCEventErrorCallback(RTC_HandleTypeDef *hrtc); |
| 376 | void HAL_RTCEx_RTCEventErrorCallback(RTC_HandleTypeDef *hrtc); |
376 | |
| 377 | 377 | /** |
|
| 378 | /** |
378 | * @} |
| 379 | * @} |
379 | */ |
| 380 | */ |
380 | |
| 381 | 381 | /* Extension Control functions ************************************************/ |
|
| 382 | /* Extension Control functions ************************************************/ |
382 | /** @addtogroup RTCEx_Exported_Functions_Group3 |
| 383 | /** @addtogroup RTCEx_Exported_Functions_Group3 |
383 | * @{ |
| 384 | * @{ |
384 | */ |
| 385 | */ |
385 | void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); |
| 386 | void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); |
386 | uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); |
| 387 | uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); |
387 | |
| 388 | 388 | HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue); |
|
| 389 | HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue); |
389 | /** |
| 390 | /** |
390 | * @} |
| 391 | * @} |
391 | */ |
| 392 | */ |
392 | |
| 393 | 393 | /** |
|
| 394 | /** |
394 | * @} |
| 395 | * @} |
395 | */ |
| 396 | */ |
396 | |
| 397 | 397 | /** |
|
| 398 | /** |
398 | * @} |
| 399 | * @} |
399 | */ |
| 400 | */ |
400 | |
| 401 | 401 | /** |
|
| 402 | /** |
402 | * @} |
| 403 | * @} |
403 | */ |
| 404 | */ |
404 | |
| 405 | 405 | #ifdef __cplusplus |
|
| 406 | #ifdef __cplusplus |
406 | } |
| 407 | } |
407 | #endif |
| 408 | #endif |
408 | |
| 409 | 409 | #endif /* __STM32F1xx_HAL_RTC_EX_H */ |
|
| 410 | #endif /* __STM32F1xx_HAL_RTC_EX_H */ |
- | |
| 411 | - | ||
| 412 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
- | |