source: rtems/c/src/lib/libbsp/arm/stm32f7x/hal/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rtc_ex.h @ c20847a5

5
Last change on this file since c20847a5 was c20847a5, checked in by Isaac Gutekunst <isaac.gutekunst@…>, on 09/16/15 at 13:16:02

Add STM32F7 HAL Files

These files originated as:

+ STC32CubeF7 V1.1.0 from http://www.st.com/web/en/catalog/tools/PF261909

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