Go to the documentation of this file.
21 #ifndef __STM32F4xx_HAL_RTC_EX_H
22 #define __STM32F4xx_HAL_RTC_EX_H
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
112 #define RTC_TIMESTAMPEDGE_RISING 0x00000000U
113 #define RTC_TIMESTAMPEDGE_FALLING 0x00000008U
121 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
123 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
124 #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
134 #define RTC_TAMPERPIN_DEFAULT 0x00000000U
136 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
137 #define RTC_TAMPERPIN_POS1 0x00010000U
146 #define RTC_TIMESTAMPPIN_DEFAULT 0x00000000U
148 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
149 #define RTC_TIMESTAMPPIN_POS1 0x00020000U
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
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
253 #define RTC_CALIBSIGN_POSITIVE 0x00000000U
254 #define RTC_CALIBSIGN_NEGATIVE 0x00000080U
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
297 #define RTC_CALIBOUTPUT_512HZ 0x00000000U
298 #define RTC_CALIBOUTPUT_1HZ 0x00080000U
322 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
329 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
339 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
349 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
359 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
369 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
380 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
390 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
396 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
402 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
408 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
414 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
420 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
426 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
432 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
438 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
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();\
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();\
461 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
467 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
473 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
489 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
496 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
506 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
516 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
526 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
536 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
547 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
557 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
573 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E))
580 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E))
582 #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx)
588 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E))
595 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E))
607 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
617 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
628 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
639 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
653 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
659 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
665 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
671 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
677 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
683 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
689 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
695 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
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(); \
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();\
718 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
724 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
730 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
745 #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
752 #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
759 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
766 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
773 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
780 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
790 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
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)
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))
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))
924 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E | RTC_TAFCR_TAMP2E))) == 0x00U) && ((TAMPER) != (uint32_t)RESET))
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)
930 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_DEFAULT) || \
931 ((PIN) == RTC_TAMPERPIN_POS1))
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)
937 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT) || \
938 ((PIN) == RTC_TIMESTAMPPIN_POS1))
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))
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))
975 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20U)
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))
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))
HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef
HAL Status structures definition
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value)
RTC Handle Structure definition.
HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue)
uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc)
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc)
RTC Time structure definition.
uint32_t TimeStampOnTamperDetection
void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc)
RTC Tamper structure definition
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc)
uint32_t PrechargeDuration
HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput)
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
uint32_t SamplingFrequency
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
RTC Date structure definition.
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)