提交 | 用户 | age
|
483170
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file stm32f0xx_hal_rtc_ex.h |
|
4 |
* @author MCD Application Team |
|
5 |
* @brief Header file of RTC HAL Extended module. |
|
6 |
****************************************************************************** |
|
7 |
* @attention |
|
8 |
* |
|
9 |
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
|
10 |
* |
|
11 |
* Redistribution and use in source and binary forms, with or without modification, |
|
12 |
* are permitted provided that the following conditions are met: |
|
13 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
14 |
* this list of conditions and the following disclaimer. |
|
15 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
16 |
* this list of conditions and the following disclaimer in the documentation |
|
17 |
* and/or other materials provided with the distribution. |
|
18 |
* 3. Neither the name of STMicroelectronics nor the names of its contributors |
|
19 |
* may be used to endorse or promote products derived from this software |
|
20 |
* without specific prior written permission. |
|
21 |
* |
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
23 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
24 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
25 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
|
26 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
27 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
28 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
29 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
30 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
31 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
32 |
* |
|
33 |
****************************************************************************** |
|
34 |
*/ |
|
35 |
|
|
36 |
/* Define to prevent recursive inclusion -------------------------------------*/ |
|
37 |
#ifndef __STM32F0xx_HAL_RTC_EX_H |
|
38 |
#define __STM32F0xx_HAL_RTC_EX_H |
|
39 |
|
|
40 |
#ifdef __cplusplus |
|
41 |
extern "C" { |
|
42 |
#endif |
|
43 |
|
|
44 |
/* Includes ------------------------------------------------------------------*/ |
|
45 |
#include "stm32f0xx_hal_def.h" |
|
46 |
|
|
47 |
/** @addtogroup STM32F0xx_HAL_Driver |
|
48 |
* @{ |
|
49 |
*/ |
|
50 |
|
|
51 |
/** @defgroup RTCEx RTCEx |
|
52 |
* @{ |
|
53 |
*/ |
|
54 |
|
|
55 |
/* Exported types ------------------------------------------------------------*/ |
|
56 |
|
|
57 |
/** @defgroup RTCEx_Exported_Types RTCEx Exported Types |
|
58 |
* @{ |
|
59 |
*/ |
|
60 |
|
|
61 |
/** |
|
62 |
* @brief RTC Tamper structure definition |
|
63 |
*/ |
|
64 |
typedef struct |
|
65 |
{ |
|
66 |
uint32_t Tamper; /*!< Specifies the Tamper Pin. |
|
67 |
This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ |
|
68 |
|
|
69 |
uint32_t Trigger; /*!< Specifies the Tamper Trigger. |
|
70 |
This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ |
|
71 |
|
|
72 |
uint32_t Filter; /*!< Specifies the RTC Filter Tamper. |
|
73 |
This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */ |
|
74 |
|
|
75 |
uint32_t SamplingFrequency; /*!< Specifies the sampling frequency. |
|
76 |
This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */ |
|
77 |
|
|
78 |
uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration . |
|
79 |
This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */ |
|
80 |
|
|
81 |
uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp . |
|
82 |
This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */ |
|
83 |
|
|
84 |
uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. |
|
85 |
This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ |
|
86 |
}RTC_TamperTypeDef; |
|
87 |
/** |
|
88 |
* @} |
|
89 |
*/ |
|
90 |
|
|
91 |
/* Exported constants --------------------------------------------------------*/ |
|
92 |
/** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants |
|
93 |
* @{ |
|
94 |
*/ |
|
95 |
|
|
96 |
/** @defgroup RTCEx_Output_selection_Definitions RTCEx Output Selection Definition |
|
97 |
* @{ |
|
98 |
*/ |
|
99 |
#define RTC_OUTPUT_DISABLE 0x00000000U |
|
100 |
#define RTC_OUTPUT_ALARMA 0x00200000U |
|
101 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
102 |
#define RTC_OUTPUT_WAKEUP 0x00600000U |
|
103 |
#endif |
|
104 |
|
|
105 |
/** |
|
106 |
* @} |
|
107 |
*/ |
|
108 |
|
|
109 |
#if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB) |
|
110 |
/** @defgroup RTCEx_Backup_Registers_Definitions RTCEx Backup Registers Definition |
|
111 |
* @{ |
|
112 |
*/ |
|
113 |
#define RTC_BKP_DR0 0x00000000U |
|
114 |
#define RTC_BKP_DR1 0x00000001U |
|
115 |
#define RTC_BKP_DR2 0x00000002U |
|
116 |
#define RTC_BKP_DR3 0x00000003U |
|
117 |
#define RTC_BKP_DR4 0x00000004U |
|
118 |
/** |
|
119 |
* @} |
|
120 |
*/ |
|
121 |
#endif /* !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB) */ |
|
122 |
|
|
123 |
/** @defgroup RTCEx_Time_Stamp_Edges_definitions RTCEx Time Stamp Edges definition |
|
124 |
* @{ |
|
125 |
*/ |
|
126 |
#define RTC_TIMESTAMPEDGE_RISING 0x00000000U |
|
127 |
#define RTC_TIMESTAMPEDGE_FALLING 0x00000008U |
|
128 |
|
|
129 |
/** |
|
130 |
* @} |
|
131 |
*/ |
|
132 |
|
|
133 |
/** @defgroup RTCEx_TimeStamp_Pin_Selections RTCEx TimeStamp Pin Selection |
|
134 |
* @{ |
|
135 |
*/ |
|
136 |
#define RTC_TIMESTAMPPIN_DEFAULT 0x00000000U |
|
137 |
|
|
138 |
/** |
|
139 |
* @} |
|
140 |
*/ |
|
141 |
|
|
142 |
|
|
143 |
/** @defgroup RTCEx_Tamper_Pins_Definitions RTCEx Tamper Pins Definition |
|
144 |
* @{ |
|
145 |
*/ |
|
146 |
#define RTC_TAMPER_1 RTC_TAFCR_TAMP1E |
|
147 |
#define RTC_TAMPER_2 RTC_TAFCR_TAMP2E |
|
148 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) |
|
149 |
#define RTC_TAMPER_3 RTC_TAFCR_TAMP3E |
|
150 |
#endif |
|
151 |
|
|
152 |
/** |
|
153 |
* @} |
|
154 |
*/ |
|
155 |
|
|
156 |
|
|
157 |
|
|
158 |
/** @defgroup RTCEx_Tamper_Trigger_Definitions RTCEx Tamper Trigger Definition |
|
159 |
* @{ |
|
160 |
*/ |
|
161 |
#define RTC_TAMPERTRIGGER_RISINGEDGE 0x00000000U |
|
162 |
#define RTC_TAMPERTRIGGER_FALLINGEDGE 0x00000002U |
|
163 |
#define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE |
|
164 |
#define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE |
|
165 |
|
|
166 |
|
|
167 |
/** |
|
168 |
* @} |
|
169 |
*/ |
|
170 |
|
|
171 |
/** @defgroup RTCEx_Tamper_Filter_Definitions RTCEx Tamper Filter Definition |
|
172 |
* @{ |
|
173 |
*/ |
|
174 |
#define RTC_TAMPERFILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */ |
|
175 |
|
|
176 |
#define RTC_TAMPERFILTER_2SAMPLE 0x00000800U /*!< Tamper is activated after 2 |
|
177 |
consecutive samples at the active level */ |
|
178 |
#define RTC_TAMPERFILTER_4SAMPLE 0x00001000U /*!< Tamper is activated after 4 |
|
179 |
consecutive samples at the active level */ |
|
180 |
#define RTC_TAMPERFILTER_8SAMPLE 0x00001800U /*!< Tamper is activated after 8 |
|
181 |
consecutive samples at the active level. */ |
|
182 |
|
|
183 |
/** |
|
184 |
* @} |
|
185 |
*/ |
|
186 |
|
|
187 |
/** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTCEx Tamper Sampling Frequencies Definition |
|
188 |
* @{ |
|
189 |
*/ |
|
190 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 0x00000000U /*!< Each of the tamper inputs are sampled |
|
191 |
with a frequency = RTCCLK / 32768 */ |
|
192 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 0x00000100U /*!< Each of the tamper inputs are sampled |
|
193 |
with a frequency = RTCCLK / 16384 */ |
|
194 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 0x00000200U /*!< Each of the tamper inputs are sampled |
|
195 |
with a frequency = RTCCLK / 8192 */ |
|
196 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 0x00000300U /*!< Each of the tamper inputs are sampled |
|
197 |
with a frequency = RTCCLK / 4096 */ |
|
198 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 0x00000400U /*!< Each of the tamper inputs are sampled |
|
199 |
with a frequency = RTCCLK / 2048 */ |
|
200 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 0x00000500U /*!< Each of the tamper inputs are sampled |
|
201 |
with a frequency = RTCCLK / 1024 */ |
|
202 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 0x00000600U /*!< Each of the tamper inputs are sampled |
|
203 |
with a frequency = RTCCLK / 512 */ |
|
204 |
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 0x00000700U /*!< Each of the tamper inputs are sampled |
|
205 |
with a frequency = RTCCLK / 256 */ |
|
206 |
|
|
207 |
/** |
|
208 |
* @} |
|
209 |
*/ |
|
210 |
|
|
211 |
/** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTCEx Tamper Pin Precharge Duration Definition |
|
212 |
* @{ |
|
213 |
*/ |
|
214 |
#define RTC_TAMPERPRECHARGEDURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before |
|
215 |
sampling during 1 RTCCLK cycle */ |
|
216 |
#define RTC_TAMPERPRECHARGEDURATION_2RTCCLK 0x00002000U /*!< Tamper pins are pre-charged before |
|
217 |
sampling during 2 RTCCLK cycles */ |
|
218 |
#define RTC_TAMPERPRECHARGEDURATION_4RTCCLK 0x00004000U /*!< Tamper pins are pre-charged before |
|
219 |
sampling during 4 RTCCLK cycles */ |
|
220 |
#define RTC_TAMPERPRECHARGEDURATION_8RTCCLK 0x00006000U /*!< Tamper pins are pre-charged before |
|
221 |
sampling during 8 RTCCLK cycles */ |
|
222 |
|
|
223 |
/** |
|
224 |
* @} |
|
225 |
*/ |
|
226 |
|
|
227 |
/** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTCEx Tamper TimeStampOnTamperDetection Definition |
|
228 |
* @{ |
|
229 |
*/ |
|
230 |
#define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */ |
|
231 |
#define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE 0x00000000U /*!< TimeStamp on Tamper Detection event is not saved */ |
|
232 |
|
|
233 |
/** |
|
234 |
* @} |
|
235 |
*/ |
|
236 |
|
|
237 |
/** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTCEx Tamper Pull UP Definition |
|
238 |
* @{ |
|
239 |
*/ |
|
240 |
#define RTC_TAMPER_PULLUP_ENABLE 0x00000000U /*!< Tamper pins are pre-charged before sampling */ |
|
241 |
#define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< Tamper pins are not pre-charged before sampling */ |
|
242 |
|
|
243 |
/** |
|
244 |
* @} |
|
245 |
*/ |
|
246 |
|
|
247 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
248 |
/** @defgroup RTCEx_Wakeup_Timer_Definitions RTCEx Wakeup Timer Definition |
|
249 |
* @{ |
|
250 |
*/ |
|
251 |
#define RTC_WAKEUPCLOCK_RTCCLK_DIV16 0x00000000U |
|
252 |
#define RTC_WAKEUPCLOCK_RTCCLK_DIV8 0x00000001U |
|
253 |
#define RTC_WAKEUPCLOCK_RTCCLK_DIV4 0x00000002U |
|
254 |
#define RTC_WAKEUPCLOCK_RTCCLK_DIV2 0x00000003U |
|
255 |
#define RTC_WAKEUPCLOCK_CK_SPRE_16BITS 0x00000004U |
|
256 |
#define RTC_WAKEUPCLOCK_CK_SPRE_17BITS 0x00000006U |
|
257 |
|
|
258 |
|
|
259 |
/** |
|
260 |
* @} |
|
261 |
*/ |
|
262 |
#endif /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) */ |
|
263 |
|
|
264 |
/** @defgroup RTCEx_Smooth_calib_period_Definitions RTCEx Smooth calib period Definition |
|
265 |
* @{ |
|
266 |
*/ |
|
267 |
#define RTC_SMOOTHCALIB_PERIOD_32SEC 0x00000000U /*!< If RTCCLK = 32768 Hz, Smooth calibation |
|
268 |
period is 32s, else 2exp20 RTCCLK seconds */ |
|
269 |
#define RTC_SMOOTHCALIB_PERIOD_16SEC 0x00002000U /*!< If RTCCLK = 32768 Hz, Smooth calibation |
|
270 |
period is 16s, else 2exp19 RTCCLK seconds */ |
|
271 |
#define RTC_SMOOTHCALIB_PERIOD_8SEC 0x00004000U /*!< If RTCCLK = 32768 Hz, Smooth calibation |
|
272 |
period is 8s, else 2exp18 RTCCLK seconds */ |
|
273 |
|
|
274 |
/** |
|
275 |
* @} |
|
276 |
*/ |
|
277 |
|
|
278 |
/** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTCEx Smooth calib Plus pulses Definition |
|
279 |
* @{ |
|
280 |
*/ |
|
281 |
#define RTC_SMOOTHCALIB_PLUSPULSES_SET 0x00008000U /*!< The number of RTCCLK pulses added |
|
282 |
during a X -second window = Y - CALM[8:0] |
|
283 |
with Y = 512, 256, 128 when X = 32, 16, 8 */ |
|
284 |
#define RTC_SMOOTHCALIB_PLUSPULSES_RESET 0x00000000U /*!< The number of RTCCLK pulses subbstited |
|
285 |
during a 32-second window = CALM[8:0] */ |
|
286 |
|
|
287 |
/** |
|
288 |
* @} |
|
289 |
*/ |
|
290 |
/** @defgroup RTCEx_Calib_Output_selection_Definitions RTCEx Calib Output selection Definitions |
|
291 |
* @{ |
|
292 |
*/ |
|
293 |
#define RTC_CALIBOUTPUT_512HZ 0x00000000U |
|
294 |
#define RTC_CALIBOUTPUT_1HZ 0x00080000U |
|
295 |
|
|
296 |
/** |
|
297 |
* @} |
|
298 |
*/ |
|
299 |
|
|
300 |
/** @defgroup RTCEx_Add_1_Second_Parameter_Definition RTCEx Add 1 Second Parameter Definition |
|
301 |
* @{ |
|
302 |
*/ |
|
303 |
#define RTC_SHIFTADD1S_RESET 0x00000000U |
|
304 |
#define RTC_SHIFTADD1S_SET 0x80000000U |
|
305 |
|
|
306 |
/** |
|
307 |
* @} |
|
308 |
*/ |
|
309 |
|
|
310 |
/** |
|
311 |
* @} |
|
312 |
*/ |
|
313 |
|
|
314 |
/* Exported macros -----------------------------------------------------------*/ |
|
315 |
/** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros |
|
316 |
* @{ |
|
317 |
*/ |
|
318 |
|
|
319 |
/* ---------------------------------WAKEUPTIMER---------------------------------*/ |
|
320 |
/** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer |
|
321 |
* @{ |
|
322 |
*/ |
|
323 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
324 |
/** |
|
325 |
* @brief Enable the RTC WakeUp Timer peripheral. |
|
326 |
* @param __HANDLE__ specifies the RTC handle. |
|
327 |
* @retval None |
|
328 |
*/ |
|
329 |
#define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) |
|
330 |
|
|
331 |
/** |
|
332 |
* @brief Disable the RTC WakeUp Timer peripheral. |
|
333 |
* @param __HANDLE__ specifies the RTC handle. |
|
334 |
* @retval None |
|
335 |
*/ |
|
336 |
#define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) |
|
337 |
|
|
338 |
/** |
|
339 |
* @brief Enable the RTC WakeUpTimer interrupt. |
|
340 |
* @param __HANDLE__ specifies the RTC handle. |
|
341 |
* @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to be enabled. |
|
342 |
* This parameter can be: |
|
343 |
* @arg RTC_IT_WUT: WakeUpTimer interrupt |
|
344 |
* @retval None |
|
345 |
*/ |
|
346 |
#define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
|
347 |
|
|
348 |
/** |
|
349 |
* @brief Disable the RTC WakeUpTimer interrupt. |
|
350 |
* @param __HANDLE__ specifies the RTC handle. |
|
351 |
* @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to be disabled. |
|
352 |
* This parameter can be: |
|
353 |
* @arg RTC_IT_WUT: WakeUpTimer interrupt |
|
354 |
* @retval None |
|
355 |
*/ |
|
356 |
#define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
|
357 |
|
|
358 |
/** |
|
359 |
* @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. |
|
360 |
* @param __HANDLE__ specifies the RTC handle. |
|
361 |
* @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt to check. |
|
362 |
* This parameter can be: |
|
363 |
* @arg RTC_IT_WUT: WakeUpTimer interrupt |
|
364 |
* @retval None |
|
365 |
*/ |
|
366 |
#define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET) ? SET : RESET) |
|
367 |
|
|
368 |
/** |
|
369 |
* @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not. |
|
370 |
* @param __HANDLE__ specifies the RTC handle. |
|
371 |
* @param __INTERRUPT__ specifies the RTC Wake Up timer interrupt sources to check. |
|
372 |
* This parameter can be: |
|
373 |
* @arg RTC_IT_WUT: WakeUpTimer interrupt |
|
374 |
* @retval None |
|
375 |
*/ |
|
376 |
#define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
|
377 |
|
|
378 |
/** |
|
379 |
* @brief Get the selected RTC WakeUpTimer's flag status. |
|
380 |
* @param __HANDLE__ specifies the RTC handle. |
|
381 |
* @param __FLAG__ specifies the RTC WakeUpTimer Flag is pending or not. |
|
382 |
* This parameter can be: |
|
383 |
* @arg RTC_FLAG_WUTF |
|
384 |
* @arg RTC_FLAG_WUTWF |
|
385 |
* @retval None |
|
386 |
*/ |
|
387 |
#define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET) |
|
388 |
|
|
389 |
/** |
|
390 |
* @brief Clear the RTC Wake Up timer's pending flags. |
|
391 |
* @param __HANDLE__ specifies the RTC handle. |
|
392 |
* @param __FLAG__ specifies the RTC WakeUpTimer Flag to clear. |
|
393 |
* This parameter can be: |
|
394 |
* @arg RTC_FLAG_WUTF |
|
395 |
* @retval None |
|
396 |
*/ |
|
397 |
#define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
|
398 |
|
|
399 |
/* WAKE-UP TIMER EXTI */ |
|
400 |
/* ------------------ */ |
|
401 |
/** |
|
402 |
* @brief Enable interrupt on the RTC WakeUp Timer associated Exti line. |
|
403 |
* @retval None |
|
404 |
*/ |
|
405 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
406 |
|
|
407 |
/** |
|
408 |
* @brief Disable interrupt on the RTC WakeUp Timer associated Exti line. |
|
409 |
* @retval None |
|
410 |
*/ |
|
411 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
|
412 |
|
|
413 |
/** |
|
414 |
* @brief Enable event on the RTC WakeUp Timer associated Exti line. |
|
415 |
* @retval None. |
|
416 |
*/ |
|
417 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
418 |
|
|
419 |
/** |
|
420 |
* @brief Disable event on the RTC WakeUp Timer associated Exti line. |
|
421 |
* @retval None. |
|
422 |
*/ |
|
423 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
|
424 |
|
|
425 |
/** |
|
426 |
* @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line. |
|
427 |
* @retval None. |
|
428 |
*/ |
|
429 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
430 |
|
|
431 |
/** |
|
432 |
* @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line. |
|
433 |
* @retval None. |
|
434 |
*/ |
|
435 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
|
436 |
|
|
437 |
/** |
|
438 |
* @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line. |
|
439 |
* @retval None. |
|
440 |
*/ |
|
441 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
442 |
|
|
443 |
/** |
|
444 |
* @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line. |
|
445 |
* @retval None. |
|
446 |
*/ |
|
447 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
|
448 |
|
|
449 |
/** |
|
450 |
* @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. |
|
451 |
* @retval None. |
|
452 |
*/ |
|
453 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); |
|
454 |
|
|
455 |
/** |
|
456 |
* @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. |
|
457 |
* This parameter can be: |
|
458 |
* @retval None. |
|
459 |
*/ |
|
460 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); |
|
461 |
|
|
462 |
/** |
|
463 |
* @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not. |
|
464 |
* @retval Line Status. |
|
465 |
*/ |
|
466 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
467 |
|
|
468 |
/** |
|
469 |
* @brief Clear the RTC WakeUp Timer associated Exti line flag. |
|
470 |
* @retval None. |
|
471 |
*/ |
|
472 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
473 |
|
|
474 |
/** |
|
475 |
* @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line. |
|
476 |
* @retval None. |
|
477 |
*/ |
|
478 |
#define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
|
479 |
#endif /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) */ |
|
480 |
/** |
|
481 |
* @} |
|
482 |
*/ |
|
483 |
|
|
484 |
/* ---------------------------------TIMESTAMP---------------------------------*/ |
|
485 |
/** @defgroup RTCEx_Timestamp RTC Timestamp |
|
486 |
* @{ |
|
487 |
*/ |
|
488 |
/** |
|
489 |
* @brief Enable the RTC TimeStamp peripheral. |
|
490 |
* @param __HANDLE__ specifies the RTC handle. |
|
491 |
* @retval None |
|
492 |
*/ |
|
493 |
#define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) |
|
494 |
|
|
495 |
/** |
|
496 |
* @brief Disable the RTC TimeStamp peripheral. |
|
497 |
* @param __HANDLE__ specifies the RTC handle. |
|
498 |
* @retval None |
|
499 |
*/ |
|
500 |
#define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) |
|
501 |
|
|
502 |
/** |
|
503 |
* @brief Enable the RTC TimeStamp interrupt. |
|
504 |
* @param __HANDLE__ specifies the RTC handle. |
|
505 |
* @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to be enabled. |
|
506 |
* This parameter can be: |
|
507 |
* @arg RTC_IT_TS: TimeStamp interrupt |
|
508 |
* @retval None |
|
509 |
*/ |
|
510 |
#define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
|
511 |
|
|
512 |
/** |
|
513 |
* @brief Disable the RTC TimeStamp interrupt. |
|
514 |
* @param __HANDLE__ specifies the RTC handle. |
|
515 |
* @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to be disabled. |
|
516 |
* This parameter can be: |
|
517 |
* @arg RTC_IT_TS: TimeStamp interrupt |
|
518 |
* @retval None |
|
519 |
*/ |
|
520 |
#define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
|
521 |
|
|
522 |
/** |
|
523 |
* @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. |
|
524 |
* @param __HANDLE__ specifies the RTC handle. |
|
525 |
* @param __INTERRUPT__ specifies the RTC TimeStamp interrupt to check. |
|
526 |
* This parameter can be: |
|
527 |
* @arg RTC_IT_TS: TimeStamp interrupt |
|
528 |
* @retval None |
|
529 |
*/ |
|
530 |
#define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
|
531 |
|
|
532 |
/** |
|
533 |
* @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not. |
|
534 |
* @param __HANDLE__ specifies the RTC handle. |
|
535 |
* @param __INTERRUPT__ specifies the RTC Time Stamp interrupt source to check. |
|
536 |
* This parameter can be: |
|
537 |
* @arg RTC_IT_TS: TimeStamp interrupt |
|
538 |
* @retval None |
|
539 |
*/ |
|
540 |
#define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
|
541 |
|
|
542 |
/** |
|
543 |
* @brief Get the selected RTC TimeStamp's flag status. |
|
544 |
* @param __HANDLE__ specifies the RTC handle. |
|
545 |
* @param __FLAG__ specifies the RTC TimeStamp Flag is pending or not. |
|
546 |
* This parameter can be: |
|
547 |
* @arg RTC_FLAG_TSF |
|
548 |
* @arg RTC_FLAG_TSOVF |
|
549 |
* @retval None |
|
550 |
*/ |
|
551 |
#define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
|
552 |
|
|
553 |
/** |
|
554 |
* @brief Clear the RTC Time Stamp's pending flags. |
|
555 |
* @param __HANDLE__ specifies the RTC handle. |
|
556 |
* @param __FLAG__ specifies the RTC Alarm Flag to clear. |
|
557 |
* This parameter can be: |
|
558 |
* @arg RTC_FLAG_TSF |
|
559 |
* @retval None |
|
560 |
*/ |
|
561 |
#define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
|
562 |
|
|
563 |
/** |
|
564 |
* @} |
|
565 |
*/ |
|
566 |
|
|
567 |
/* ---------------------------------TAMPER------------------------------------*/ |
|
568 |
/** @defgroup RTCEx_Tamper RTC Tamper |
|
569 |
* @{ |
|
570 |
*/ |
|
571 |
|
|
572 |
/** |
|
573 |
* @brief Enable the RTC Tamper1 input detection. |
|
574 |
* @param __HANDLE__ specifies the RTC handle. |
|
575 |
* @retval None |
|
576 |
*/ |
|
577 |
#define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E)) |
|
578 |
|
|
579 |
/** |
|
580 |
* @brief Disable the RTC Tamper1 input detection. |
|
581 |
* @param __HANDLE__ specifies the RTC handle. |
|
582 |
* @retval None |
|
583 |
*/ |
|
584 |
#define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E)) |
|
585 |
|
|
586 |
/** |
|
587 |
* @brief Enable the RTC Tamper2 input detection. |
|
588 |
* @param __HANDLE__ specifies the RTC handle. |
|
589 |
* @retval None |
|
590 |
*/ |
|
591 |
#define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E)) |
|
592 |
|
|
593 |
/** |
|
594 |
* @brief Disable the RTC Tamper2 input detection. |
|
595 |
* @param __HANDLE__ specifies the RTC handle. |
|
596 |
* @retval None |
|
597 |
*/ |
|
598 |
#define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E)) |
|
599 |
|
|
600 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
601 |
/** |
|
602 |
* @brief Enable the RTC Tamper3 input detection. |
|
603 |
* @param __HANDLE__ specifies the RTC handle. |
|
604 |
* @retval None |
|
605 |
*/ |
|
606 |
#define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP3E)) |
|
607 |
|
|
608 |
/** |
|
609 |
* @brief Disable the RTC Tamper3 input detection. |
|
610 |
* @param __HANDLE__ specifies the RTC handle. |
|
611 |
* @retval None |
|
612 |
*/ |
|
613 |
#define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP3E)) |
|
614 |
|
|
615 |
#endif /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) */ |
|
616 |
/** |
|
617 |
* @brief Enable the RTC Tamper interrupt. |
|
618 |
* @param __HANDLE__ specifies the RTC handle. |
|
619 |
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be enabled. |
|
620 |
* This parameter can be any combination of the following values: |
|
621 |
* @arg RTC_IT_TAMP: Tamper interrupt |
|
622 |
* @retval None |
|
623 |
*/ |
|
624 |
#define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAFCR |= (__INTERRUPT__)) |
|
625 |
|
|
626 |
/** |
|
627 |
* @brief Disable the RTC Tamper interrupt. |
|
628 |
* @param __HANDLE__ specifies the RTC handle. |
|
629 |
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be disabled. |
|
630 |
* This parameter can be any combination of the following values: |
|
631 |
* @arg RTC_IT_TAMP: Tamper interrupt |
|
632 |
* @retval None |
|
633 |
*/ |
|
634 |
#define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAFCR &= ~(__INTERRUPT__)) |
|
635 |
|
|
636 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
637 |
/** |
|
638 |
* @brief Check whether the specified RTC Tamper interrupt has occurred or not. |
|
639 |
* @param __HANDLE__ specifies the RTC handle. |
|
640 |
* @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. |
|
641 |
* This parameter can be: |
|
642 |
* @arg RTC_IT_TAMP1: Tamper1 interrupt |
|
643 |
* @arg RTC_IT_TAMP2: Tamper2 interrupt |
|
644 |
* @arg RTC_IT_TAMP3: Tamper3 interrupt |
|
645 |
* @retval None |
|
646 |
*/ |
|
647 |
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
|
648 |
#else |
|
649 |
|
|
650 |
/** |
|
651 |
* @brief Check whether the specified RTC Tamper interrupt has occurred or not. |
|
652 |
* @param __HANDLE__ specifies the RTC handle. |
|
653 |
* @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. |
|
654 |
* This parameter can be: |
|
655 |
* @arg RTC_IT_TAMP1: Tamper1 interrupt |
|
656 |
* @arg RTC_IT_TAMP2: Tamper2 interrupt |
|
657 |
* @retval None |
|
658 |
*/ |
|
659 |
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
|
660 |
|
|
661 |
#endif /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) */ |
|
662 |
|
|
663 |
/** |
|
664 |
* @brief Check whether the specified RTC Tamper interrupt has been enabled or not. |
|
665 |
* @param __HANDLE__ specifies the RTC handle. |
|
666 |
* @param __INTERRUPT__ specifies the RTC Tamper interrupt source to check. |
|
667 |
* This parameter can be: |
|
668 |
* @arg RTC_IT_TAMP: Tamper interrupt |
|
669 |
* @retval None |
|
670 |
*/ |
|
671 |
#define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
|
672 |
|
|
673 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
674 |
/** |
|
675 |
* @brief Get the selected RTC Tamper's flag status. |
|
676 |
* @param __HANDLE__ specifies the RTC handle. |
|
677 |
* @param __FLAG__ specifies the RTC Tamper Flag is pending or not. |
|
678 |
* This parameter can be: |
|
679 |
* @arg RTC_FLAG_TAMP1F |
|
680 |
* @arg RTC_FLAG_TAMP2F |
|
681 |
* @arg RTC_FLAG_TAMP3F |
|
682 |
* @retval None |
|
683 |
*/ |
|
684 |
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
|
685 |
|
|
686 |
|
|
687 |
/** |
|
688 |
* @brief Clear the RTC Tamper's pending flags. |
|
689 |
* @param __HANDLE__ specifies the RTC handle. |
|
690 |
* @param __FLAG__ specifies the RTC Tamper Flag to clear. |
|
691 |
* This parameter can be: |
|
692 |
* @arg RTC_FLAG_TAMP1F |
|
693 |
* @arg RTC_FLAG_TAMP2F |
|
694 |
* @arg RTC_FLAG_TAMP3F |
|
695 |
* @retval None |
|
696 |
*/ |
|
697 |
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
|
698 |
|
|
699 |
#else |
|
700 |
|
|
701 |
/** |
|
702 |
* @brief Get the selected RTC Tamper's flag status. |
|
703 |
* @param __HANDLE__ specifies the RTC handle. |
|
704 |
* @param __FLAG__ specifies the RTC Tamper Flag is pending or not. |
|
705 |
* This parameter can be: |
|
706 |
* @arg RTC_FLAG_TAMP1F |
|
707 |
* @arg RTC_FLAG_TAMP2F |
|
708 |
* @retval None |
|
709 |
*/ |
|
710 |
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
|
711 |
|
|
712 |
|
|
713 |
/** |
|
714 |
* @brief Clear the RTC Tamper's pending flags. |
|
715 |
* @param __HANDLE__ specifies the RTC handle. |
|
716 |
* @param __FLAG__ specifies the RTC Tamper Flag to clear. |
|
717 |
* This parameter can be: |
|
718 |
* @arg RTC_FLAG_TAMP1F |
|
719 |
* @arg RTC_FLAG_TAMP2F |
|
720 |
* @retval None |
|
721 |
*/ |
|
722 |
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
|
723 |
|
|
724 |
#endif /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) */ |
|
725 |
/** |
|
726 |
* @} |
|
727 |
*/ |
|
728 |
|
|
729 |
/* --------------------------TAMPER/TIMESTAMP---------------------------------*/ |
|
730 |
/** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI |
|
731 |
* @{ |
|
732 |
*/ |
|
733 |
|
|
734 |
/* TAMPER TIMESTAMP EXTI */ |
|
735 |
/* --------------------- */ |
|
736 |
/** |
|
737 |
* @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line. |
|
738 |
* @retval None |
|
739 |
*/ |
|
740 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
741 |
|
|
742 |
/** |
|
743 |
* @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line. |
|
744 |
* @retval None |
|
745 |
*/ |
|
746 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
|
747 |
|
|
748 |
/** |
|
749 |
* @brief Enable event on the RTC Tamper and Timestamp associated Exti line. |
|
750 |
* @retval None. |
|
751 |
*/ |
|
752 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
753 |
|
|
754 |
/** |
|
755 |
* @brief Disable event on the RTC Tamper and Timestamp associated Exti line. |
|
756 |
* @retval None. |
|
757 |
*/ |
|
758 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
|
759 |
|
|
760 |
/** |
|
761 |
* @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
|
762 |
* @retval None. |
|
763 |
*/ |
|
764 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
765 |
|
|
766 |
/** |
|
767 |
* @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
|
768 |
* @retval None. |
|
769 |
*/ |
|
770 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
|
771 |
|
|
772 |
/** |
|
773 |
* @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. |
|
774 |
* @retval None. |
|
775 |
*/ |
|
776 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
777 |
|
|
778 |
/** |
|
779 |
* @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. |
|
780 |
* @retval None. |
|
781 |
*/ |
|
782 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
|
783 |
|
|
784 |
/** |
|
785 |
* @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
|
786 |
* @retval None. |
|
787 |
*/ |
|
788 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); |
|
789 |
|
|
790 |
/** |
|
791 |
* @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
|
792 |
* This parameter can be: |
|
793 |
* @retval None. |
|
794 |
*/ |
|
795 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); |
|
796 |
|
|
797 |
/** |
|
798 |
* @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not. |
|
799 |
* @retval Line Status. |
|
800 |
*/ |
|
801 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
802 |
|
|
803 |
/** |
|
804 |
* @brief Clear the RTC Tamper and Timestamp associated Exti line flag. |
|
805 |
* @retval None. |
|
806 |
*/ |
|
807 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
808 |
|
|
809 |
/** |
|
810 |
* @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line |
|
811 |
* @retval None. |
|
812 |
*/ |
|
813 |
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
|
814 |
/** |
|
815 |
* @} |
|
816 |
*/ |
|
817 |
|
|
818 |
/* ------------------------------Calibration----------------------------------*/ |
|
819 |
/** @defgroup RTCEx_Calibration RTC Calibration |
|
820 |
* @{ |
|
821 |
*/ |
|
822 |
|
|
823 |
/** |
|
824 |
* @brief Enable the RTC calibration output. |
|
825 |
* @param __HANDLE__ specifies the RTC handle. |
|
826 |
* @retval None |
|
827 |
*/ |
|
828 |
#define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) |
|
829 |
|
|
830 |
/** |
|
831 |
* @brief Disable the calibration output. |
|
832 |
* @param __HANDLE__ specifies the RTC handle. |
|
833 |
* @retval None |
|
834 |
*/ |
|
835 |
#define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) |
|
836 |
|
|
837 |
/** |
|
838 |
* @brief Enable the clock reference detection. |
|
839 |
* @param __HANDLE__ specifies the RTC handle. |
|
840 |
* @retval None |
|
841 |
*/ |
|
842 |
#define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) |
|
843 |
|
|
844 |
/** |
|
845 |
* @brief Disable the clock reference detection. |
|
846 |
* @param __HANDLE__ specifies the RTC handle. |
|
847 |
* @retval None |
|
848 |
*/ |
|
849 |
#define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) |
|
850 |
|
|
851 |
/** |
|
852 |
* @brief Get the selected RTC shift operation's flag status. |
|
853 |
* @param __HANDLE__ specifies the RTC handle. |
|
854 |
* @param __FLAG__ specifies the RTC shift operation Flag is pending or not. |
|
855 |
* This parameter can be: |
|
856 |
* @arg RTC_FLAG_SHPF |
|
857 |
* @retval None |
|
858 |
*/ |
|
859 |
#define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
|
860 |
/** |
|
861 |
* @} |
|
862 |
*/ |
|
863 |
|
|
864 |
/** |
|
865 |
* @} |
|
866 |
*/ |
|
867 |
|
|
868 |
/* Exported functions --------------------------------------------------------*/ |
|
869 |
/** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions |
|
870 |
* @{ |
|
871 |
*/ |
|
872 |
|
|
873 |
/* RTC TimeStamp and Tamper functions *****************************************/ |
|
874 |
/** @defgroup RTCEx_Exported_Functions_Group1 Extended RTC TimeStamp and Tamper functions |
|
875 |
* @{ |
|
876 |
*/ |
|
877 |
|
|
878 |
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); |
|
879 |
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); |
|
880 |
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc); |
|
881 |
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format); |
|
882 |
|
|
883 |
HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); |
|
884 |
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); |
|
885 |
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); |
|
886 |
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); |
|
887 |
|
|
888 |
void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); |
|
889 |
void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); |
|
890 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
891 |
void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc); |
|
892 |
#endif |
|
893 |
void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); |
|
894 |
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
|
895 |
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
|
896 |
HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
|
897 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
898 |
HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
|
899 |
#endif |
|
900 |
/** |
|
901 |
* @} |
|
902 |
*/ |
|
903 |
|
|
904 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
905 |
/* RTC Wake-up functions ******************************************************/ |
|
906 |
/** @defgroup RTCEx_Exported_Functions_Group2 Extended RTC Wake-up functions |
|
907 |
* @{ |
|
908 |
*/ |
|
909 |
|
|
910 |
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); |
|
911 |
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); |
|
912 |
uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); |
|
913 |
uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); |
|
914 |
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); |
|
915 |
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); |
|
916 |
HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
|
917 |
#endif |
|
918 |
/** |
|
919 |
* @} |
|
920 |
*/ |
|
921 |
|
|
922 |
/* Extended Control functions ************************************************/ |
|
923 |
/** @defgroup RTCEx_Exported_Functions_Group3 Extended Peripheral Control functions |
|
924 |
* @{ |
|
925 |
*/ |
|
926 |
|
|
927 |
#if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB) |
|
928 |
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); |
|
929 |
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); |
|
930 |
#endif /* !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB) */ |
|
931 |
|
|
932 |
HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue); |
|
933 |
HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS); |
|
934 |
HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput); |
|
935 |
HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc); |
|
936 |
HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); |
|
937 |
HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); |
|
938 |
HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); |
|
939 |
HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); |
|
940 |
/** |
|
941 |
* @} |
|
942 |
*/ |
|
943 |
|
|
944 |
/* Extended RTC features functions *******************************************/ |
|
945 |
|
|
946 |
/** |
|
947 |
* @} |
|
948 |
*/ |
|
949 |
|
|
950 |
/* Private types -------------------------------------------------------------*/ |
|
951 |
/* Private variables ---------------------------------------------------------*/ |
|
952 |
/* Private constants ---------------------------------------------------------*/ |
|
953 |
/** @defgroup RTCEx_Private_Constants RTCEx Private Constants |
|
954 |
* @{ |
|
955 |
*/ |
|
956 |
#define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)EXTI_IMR_MR19) /*!< External interrupt line 19 Connected to the RTC Tamper and Time Stamp events */ |
|
957 |
#define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR20) /*!< External interrupt line 20 Connected to the RTC Wakeup event */ |
|
958 |
/** |
|
959 |
* @} |
|
960 |
*/ |
|
961 |
|
|
962 |
/* Private macros ------------------------------------------------------------*/ |
|
963 |
/** @defgroup RTCEx_Private_Macros RTCEx Private Macros |
|
964 |
* @{ |
|
965 |
*/ |
|
966 |
|
|
967 |
/** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters |
|
968 |
* @{ |
|
969 |
*/ |
|
970 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) |
|
971 |
#define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ |
|
972 |
((OUTPUT) == RTC_OUTPUT_ALARMA) || \ |
|
973 |
((OUTPUT) == RTC_OUTPUT_WAKEUP)) |
|
974 |
#else |
|
975 |
#define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ |
|
976 |
((OUTPUT) == RTC_OUTPUT_ALARMA)) |
|
977 |
#endif |
|
978 |
|
|
979 |
#define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER) |
|
980 |
|
|
981 |
#define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ |
|
982 |
((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) |
|
983 |
#if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) |
|
984 |
#define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFD6U) == 0x00U) && ((TAMPER) != (uint32_t)RESET)) |
|
985 |
|
|
986 |
#else |
|
987 |
#define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFF6U) == 0x00U) && ((TAMPER) != (uint32_t)RESET)) |
|
988 |
|
|
989 |
#endif |
|
990 |
|
|
991 |
#define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT)) |
|
992 |
|
|
993 |
|
|
994 |
#define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ |
|
995 |
((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ |
|
996 |
((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ |
|
997 |
((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) |
|
998 |
#define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ |
|
999 |
((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ |
|
1000 |
((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ |
|
1001 |
((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) |
|
1002 |
#define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ |
|
1003 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ |
|
1004 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ |
|
1005 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ |
|
1006 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ |
|
1007 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ |
|
1008 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ |
|
1009 |
((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) |
|
1010 |
#define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ |
|
1011 |
((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ |
|
1012 |
((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ |
|
1013 |
((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) |
|
1014 |
#define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ |
|
1015 |
((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) |
|
1016 |
#define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ |
|
1017 |
((STATE) == RTC_TAMPER_PULLUP_DISABLE)) |
|
1018 |
#define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ |
|
1019 |
((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ |
|
1020 |
((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ |
|
1021 |
((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ |
|
1022 |
((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ |
|
1023 |
((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) |
|
1024 |
|
|
1025 |
#define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFFU) |
|
1026 |
|
|
1027 |
|
|
1028 |
#define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ |
|
1029 |
((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ |
|
1030 |
((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) |
|
1031 |
#define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ |
|
1032 |
((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) |
|
1033 |
|
|
1034 |
|
|
1035 |
#define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FFU) |
|
1036 |
#define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ |
|
1037 |
((SEL) == RTC_SHIFTADD1S_SET)) |
|
1038 |
#define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFFU) |
|
1039 |
#define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ |
|
1040 |
((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) |
|
1041 |
/** |
|
1042 |
* @} |
|
1043 |
*/ |
|
1044 |
|
|
1045 |
/** |
|
1046 |
* @} |
|
1047 |
*/ |
|
1048 |
|
|
1049 |
/** |
|
1050 |
* @} |
|
1051 |
*/ |
|
1052 |
|
|
1053 |
/** |
|
1054 |
* @} |
|
1055 |
*/ |
|
1056 |
|
|
1057 |
#ifdef __cplusplus |
|
1058 |
} |
|
1059 |
#endif |
|
1060 |
|
|
1061 |
#endif /* __STM32F0xx_HAL_RTC_EX_H */ |
|
1062 |
|
|
1063 |
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
|
1064 |
|