stm32f4xx_hal_rtc_ex.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __STM32F4xx_HAL_RTC_EX_H
22 #define __STM32F4xx_HAL_RTC_EX_H
23 
24 #ifdef __cplusplus
25  extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f4xx_hal_def.h"
30 
39 /* Exported types ------------------------------------------------------------*/
47 typedef struct
48 {
49  uint32_t Tamper;
52  uint32_t PinSelection;
55  uint32_t Trigger;
58  uint32_t Filter;
61  uint32_t SamplingFrequency;
64  uint32_t PrechargeDuration;
67  uint32_t TamperPullUp;
77 /* Exported constants --------------------------------------------------------*/
85 #define RTC_BKP_DR0 0x00000000U
86 #define RTC_BKP_DR1 0x00000001U
87 #define RTC_BKP_DR2 0x00000002U
88 #define RTC_BKP_DR3 0x00000003U
89 #define RTC_BKP_DR4 0x00000004U
90 #define RTC_BKP_DR5 0x00000005U
91 #define RTC_BKP_DR6 0x00000006U
92 #define RTC_BKP_DR7 0x00000007U
93 #define RTC_BKP_DR8 0x00000008U
94 #define RTC_BKP_DR9 0x00000009U
95 #define RTC_BKP_DR10 0x0000000AU
96 #define RTC_BKP_DR11 0x0000000BU
97 #define RTC_BKP_DR12 0x0000000CU
98 #define RTC_BKP_DR13 0x0000000DU
99 #define RTC_BKP_DR14 0x0000000EU
100 #define RTC_BKP_DR15 0x0000000FU
101 #define RTC_BKP_DR16 0x00000010U
102 #define RTC_BKP_DR17 0x00000011U
103 #define RTC_BKP_DR18 0x00000012U
104 #define RTC_BKP_DR19 0x00000013U
105 
112 #define RTC_TIMESTAMPEDGE_RISING 0x00000000U
113 #define RTC_TIMESTAMPEDGE_FALLING 0x00000008U
114 
121 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
122 
123 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
124 #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
125 #endif
126 
134 #define RTC_TAMPERPIN_DEFAULT 0x00000000U
135 
136 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
137 #define RTC_TAMPERPIN_POS1 0x00010000U
138 #endif
139 
146 #define RTC_TIMESTAMPPIN_DEFAULT 0x00000000U
147 
148 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
149 #define RTC_TIMESTAMPPIN_POS1 0x00020000U
150 #endif
151 
158 #define RTC_TAMPERTRIGGER_RISINGEDGE 0x00000000U
159 #define RTC_TAMPERTRIGGER_FALLINGEDGE 0x00000002U
160 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
161 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
162 
169 #define RTC_TAMPERFILTER_DISABLE 0x00000000U
171 #define RTC_TAMPERFILTER_2SAMPLE 0x00000800U
173 #define RTC_TAMPERFILTER_4SAMPLE 0x00001000U
175 #define RTC_TAMPERFILTER_8SAMPLE 0x00001800U
184 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 0x00000000U
186 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 0x00000100U
188 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 0x00000200U
190 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 0x00000300U
192 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 0x00000400U
194 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 0x00000500U
196 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 0x00000600U
198 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 0x00000700U
207 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK 0x00000000U
209 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK 0x00002000U
211 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK 0x00004000U
213 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK 0x00006000U
222 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS)
223 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE 0x00000000U
231 #define RTC_TAMPER_PULLUP_ENABLE 0x00000000U
232 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS)
240 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 0x00000000U
241 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 0x00000001U
242 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 0x00000002U
243 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 0x00000003U
244 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS 0x00000004U
245 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS 0x00000006U
246 
253 #define RTC_CALIBSIGN_POSITIVE 0x00000000U
254 #define RTC_CALIBSIGN_NEGATIVE 0x00000080U
255 
262 #define RTC_SMOOTHCALIB_PERIOD_32SEC 0x00000000U
264 #define RTC_SMOOTHCALIB_PERIOD_16SEC 0x00002000U
266 #define RTC_SMOOTHCALIB_PERIOD_8SEC 0x00004000U
275 #define RTC_SMOOTHCALIB_PLUSPULSES_SET 0x00008000U
278 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET 0x00000000U
287 #define RTC_SHIFTADD1S_RESET 0x00000000U
288 #define RTC_SHIFTADD1S_SET 0x80000000U
289 
297 #define RTC_CALIBOUTPUT_512HZ 0x00000000U
298 #define RTC_CALIBOUTPUT_1HZ 0x00080000U
299 
307 /* Exported macro ------------------------------------------------------------*/
312 /* ---------------------------------WAKEUPTIMER---------------------------------*/
322 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
323 
329 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
330 
339 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
340 
349 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
350 
359 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
360 
369 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
370 
380 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
381 
390 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
391 
396 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
397 
402 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
403 
408 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
409 
414 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
415 
420 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
421 
426 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
427 
432 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
433 
438 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
439 
444 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();\
445  __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();\
446  } while(0U)
447 
453 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();\
454  __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();\
455  } while(0U)
456 
461 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
462 
467 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
468 
473 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
474 
479 /* ---------------------------------TIMESTAMP---------------------------------*/
489 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
490 
496 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
497 
506 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
507 
516 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
517 
526 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
527 
536 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
537 
547 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
548 
557 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
558 
563 /* ---------------------------------TAMPER------------------------------------*/
573 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E))
574 
580 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E))
581 
582 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
583 
588 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E))
589 
595 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E))
596 #endif
597 
607 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
608 
617 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
618 
628 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
629 
639 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
640 
644 /* --------------------------TAMPER/TIMESTAMP---------------------------------*/
653 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
654 
659 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
660 
665 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
666 
671 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
672 
677 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
678 
683 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
684 
689 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
690 
695 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
696 
701 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();\
702  __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); \
703  } while(0U)
704 
710 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();\
711  __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE();\
712  } while(0U)
713 
718 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
719 
724 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
725 
730 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
731 
735 /* ------------------------------Calibration----------------------------------*/
745 #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
746 
752 #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
753 
759 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
760 
766 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
767 
773 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
774 
780 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
781 
790 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
791 
799 /* Exported functions --------------------------------------------------------*/
807 /* RTC TimeStamp and Tamper functions *****************************************/
808 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
809 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
811 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
812 
817 
831 /* RTC Wake-up functions ******************************************************/
832 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
833 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
846 /* Extension Control functions ************************************************/
847 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
848 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
849 
850 HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
852 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
853 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
867 /* Extension RTC features functions *******************************************/
878 /* Private types -------------------------------------------------------------*/
879 /* Private variables ---------------------------------------------------------*/
880 /* Private constants ---------------------------------------------------------*/
884 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)EXTI_IMR_MR21)
885 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR22)
890 /* Private macros ------------------------------------------------------------*/
891 
898 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
899  ((BKP) == RTC_BKP_DR1) || \
900  ((BKP) == RTC_BKP_DR2) || \
901  ((BKP) == RTC_BKP_DR3) || \
902  ((BKP) == RTC_BKP_DR4) || \
903  ((BKP) == RTC_BKP_DR5) || \
904  ((BKP) == RTC_BKP_DR6) || \
905  ((BKP) == RTC_BKP_DR7) || \
906  ((BKP) == RTC_BKP_DR8) || \
907  ((BKP) == RTC_BKP_DR9) || \
908  ((BKP) == RTC_BKP_DR10) || \
909  ((BKP) == RTC_BKP_DR11) || \
910  ((BKP) == RTC_BKP_DR12) || \
911  ((BKP) == RTC_BKP_DR13) || \
912  ((BKP) == RTC_BKP_DR14) || \
913  ((BKP) == RTC_BKP_DR15) || \
914  ((BKP) == RTC_BKP_DR16) || \
915  ((BKP) == RTC_BKP_DR17) || \
916  ((BKP) == RTC_BKP_DR18) || \
917  ((BKP) == RTC_BKP_DR19))
918 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
919  ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
920 
921 #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
922 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E ))) == 0x00U) && ((TAMPER) != (uint32_t)RESET))
923 #else
924 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E | RTC_TAFCR_TAMP2E))) == 0x00U) && ((TAMPER) != (uint32_t)RESET))
925 #endif
926 
927 #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
928 #define IS_RTC_TAMPER_PIN(PIN) ((PIN) == RTC_TAMPERPIN_DEFAULT)
929 #else
930 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_DEFAULT) || \
931  ((PIN) == RTC_TAMPERPIN_POS1))
932 #endif
933 
934 #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
935 #define IS_RTC_TIMESTAMP_PIN(PIN) ((PIN) == RTC_TIMESTAMPPIN_DEFAULT)
936 #else
937 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT) || \
938  ((PIN) == RTC_TIMESTAMPPIN_POS1))
939 #endif
940 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
941  ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
942  ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
943  ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
944 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
945  ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
946  ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
947  ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
948 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
949  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
950  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
951  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
952  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
953  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
954  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
955  ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
956 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
957  ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
958  ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
959  ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
960 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
961  ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
962 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
963  ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
964 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
965  ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
966  ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
967  ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
968  ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
969  ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
970 
971 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFFU)
972 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
973  ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
974 
975 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20U)
976 
977 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
978  ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
979  ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
980 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
981  ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
982 
983 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FFU)
984 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
985  ((SEL) == RTC_SHIFTADD1S_SET))
986 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFFU)
987 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
988  ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
989 
1005 #ifdef __cplusplus
1006 }
1007 #endif
1008 
1009 #endif /* __STM32F4xx_HAL_RTC_EX_H */
1010 
1011 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
HAL_RTCEx_EnableBypassShadow
HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
HAL_RTCEx_SetTimeStamp
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
HAL_RTCEx_SetCoarseCalib
HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value)
RTC_TamperTypeDef::PinSelection
uint32_t PinSelection
Definition: stm32f4xx_hal_rtc_ex.h:52
RTC_HandleTypeDef
RTC Handle Structure definition.
Definition: stm32f4xx_hal_rtc.h:165
HAL_RTCEx_DeactivateCoarseCalib
HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_SetRefClock
HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_DeactivateCalibrationOutPut
HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_SetSmoothCalib
HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue)
HAL_RTCEx_DeactivateWakeUpTimer
uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_SetSynchroShift
HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
HAL_RTCEx_Tamper2EventCallback
void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_BKUPRead
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
HAL_RTCEx_Tamper1EventCallback
void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_DeactivateTamper
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
HAL_RTCEx_SetTamper_IT
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
RTC_TamperTypeDef::Filter
uint32_t Filter
Definition: stm32f4xx_hal_rtc_ex.h:58
HAL_RTCEx_DisableBypassShadow
HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc)
RTC_TimeTypeDef
RTC Time structure definition.
Definition: stm32f4xx_hal_rtc.h:83
RTC_TamperTypeDef::TimeStampOnTamperDetection
uint32_t TimeStampOnTamperDetection
Definition: stm32f4xx_hal_rtc_ex.h:70
HAL_RTCEx_TimeStampEventCallback
void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc)
RTC_TamperTypeDef
RTC Tamper structure definition
Definition: stm32f4xx_hal_rtc_ex.h:47
stm32f4xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_RTCEx_DeactivateRefClock
HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc)
RTC_TamperTypeDef::PrechargeDuration
uint32_t PrechargeDuration
Definition: stm32f4xx_hal_rtc_ex.h:64
HAL_RTCEx_PollForAlarmBEvent
HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_RTCEx_GetWakeUpTimer
uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_SetWakeUpTimer
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
HAL_RTCEx_AlarmBEventCallback
void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
RTC_TamperTypeDef::TamperPullUp
uint32_t TamperPullUp
Definition: stm32f4xx_hal_rtc_ex.h:67
HAL_RTCEx_SetCalibrationOutPut
HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput)
RTC_TamperTypeDef::Trigger
uint32_t Trigger
Definition: stm32f4xx_hal_rtc_ex.h:55
HAL_RTCEx_BKUPWrite
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
RTC_TamperTypeDef::Tamper
uint32_t Tamper
Definition: stm32f4xx_hal_rtc_ex.h:49
HAL_RTCEx_SetWakeUpTimer_IT
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
HAL_RTCEx_PollForTimeStampEvent
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
RTC_TamperTypeDef::SamplingFrequency
uint32_t SamplingFrequency
Definition: stm32f4xx_hal_rtc_ex.h:61
HAL_RTCEx_DeactivateTimeStamp
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_SetTamper
HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
RTC_DateTypeDef
RTC Date structure definition.
Definition: stm32f4xx_hal_rtc.h:119
HAL_RTCEx_GetTimeStamp
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
HAL_RTCEx_TamperTimeStampIRQHandler
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_WakeUpTimerEventCallback
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_PollForWakeUpTimerEvent
HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_RTCEx_PollForTamper1Event
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_RTCEx_PollForTamper2Event
HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_RTCEx_WakeUpTimerIRQHandler
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
HAL_RTCEx_SetTimeStamp_IT
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:52