STM32F4xx HAL Driver master
STM32CubeF4 HAL / LL Drivers API Reference
Loading...
Searching...
No Matches
stm32f4xx_hal_rtc_ex.c
Go to the documentation of this file.
1
124
125/* Includes ------------------------------------------------------------------*/
126#include "stm32f4xx_hal.h"
127
131
136
137#ifdef HAL_RTC_MODULE_ENABLED
138
139/* Private typedef -----------------------------------------------------------*/
140/* Private define ------------------------------------------------------------*/
141/* Private macro -------------------------------------------------------------*/
142/* Private variables ---------------------------------------------------------*/
143/* Private function prototypes -----------------------------------------------*/
144/* Exported functions --------------------------------------------------------*/
145
149
163
186HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
187{
188 uint32_t tmpreg = 0U;
189
190 /* Check the parameters */
191 assert_param(IS_TIMESTAMP_EDGE(RTC_TimeStampEdge));
192 assert_param(IS_RTC_TIMESTAMP_PIN(RTC_TimeStampPin));
193
194 /* Process Locked */
195 __HAL_LOCK(hrtc);
196
197 /* Change RTC state to BUSY */
199
200 hrtc->Instance->TAFCR &= (uint32_t)~RTC_TAFCR_TSINSEL;
201 hrtc->Instance->TAFCR |= (uint32_t)(RTC_TimeStampPin);
202
203 /* Get the RTC_CR register and clear the bits to be configured */
204 tmpreg = (uint32_t)(hrtc->Instance->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
205
206 /* Configure the Timestamp TSEDGE bit */
207 tmpreg |= RTC_TimeStampEdge;
208
209 /* Disable the write protection for RTC registers */
211
212 /* Copy the desired configuration into the CR register */
213 hrtc->Instance->CR = (uint32_t)tmpreg;
214
215 /* Clear RTC Timestamp flag */
217
218 /* Clear RTC Timestamp overrun Flag */
220
221 /* Enable the Timestamp saving */
223
224 /* Enable the write protection for RTC registers */
226
227 /* Change RTC state back to READY */
229
230 /* Process Unlocked */
231 __HAL_UNLOCK(hrtc);
232
233 return HAL_OK;
234}
235
258HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
259{
260 uint32_t tmpreg = 0U;
261
262 /* Check the parameters */
263 assert_param(IS_TIMESTAMP_EDGE(RTC_TimeStampEdge));
264 assert_param(IS_RTC_TIMESTAMP_PIN(RTC_TimeStampPin));
265
266 /* Process Locked */
267 __HAL_LOCK(hrtc);
268
269 /* Change RTC state to BUSY */
271
272 hrtc->Instance->TAFCR &= (uint32_t)~RTC_TAFCR_TSINSEL;
273 hrtc->Instance->TAFCR |= (uint32_t)(RTC_TimeStampPin);
274
275 /* Get the RTC_CR register and clear the bits to be configured */
276 tmpreg = (uint32_t)(hrtc->Instance->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
277
278 /* Configure the Timestamp TSEDGE bit */
279 tmpreg |= RTC_TimeStampEdge;
280
281 /* Disable the write protection for RTC registers */
283
284 /* Copy the desired configuration into the CR register */
285 hrtc->Instance->CR = (uint32_t)tmpreg;
286
287 /* Clear RTC Timestamp flag */
289
290 /* Clear RTC Timestamp overrun Flag */
292
293 /* Enable the Timestamp saving */
295
296 /* Enable IT Timestamp */
298
299 /* Enable the write protection for RTC registers */
301
302 /* Enable and configure the EXTI line associated to the RTC Timestamp and Tamper interrupts */
305
306 /* Change RTC state back to READY */
308
309 /* Process Unlocked */
310 __HAL_UNLOCK(hrtc);
311
312 return HAL_OK;
313}
314
322{
323 uint32_t tmpreg = 0U;
324
325 /* Process Locked */
326 __HAL_LOCK(hrtc);
327
329
330 /* Disable the write protection for RTC registers */
332
333 /* In case interrupt mode is used, the interrupt source must disabled */
335
336 /* Get the RTC_CR register and clear the bits to be configured */
337 tmpreg = (uint32_t)(hrtc->Instance->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
338
339 /* Configure the Timestamp TSEDGE and Enable bits */
340 hrtc->Instance->CR = (uint32_t)tmpreg;
341
342 /* Enable the write protection for RTC registers */
344
346
347 /* Process Unlocked */
348 __HAL_UNLOCK(hrtc);
349
350 return HAL_OK;
351}
352
365HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
366{
367 uint32_t tmptime = 0U;
368 uint32_t tmpdate = 0U;
369
370 /* Check the parameters */
372
373 /* Get the Timestamp time and date registers values */
374 tmptime = (uint32_t)(hrtc->Instance->TSTR & RTC_TR_RESERVED_MASK);
375 tmpdate = (uint32_t)(hrtc->Instance->TSDR & RTC_DR_RESERVED_MASK);
376
377 /* Fill the Time structure fields with the read parameters */
378 sTimeStamp->Hours = (uint8_t)((tmptime & (RTC_TSTR_HT | RTC_TSTR_HU)) >> RTC_TSTR_HU_Pos);
379 sTimeStamp->Minutes = (uint8_t)((tmptime & (RTC_TSTR_MNT | RTC_TSTR_MNU)) >> RTC_TSTR_MNU_Pos);
380 sTimeStamp->Seconds = (uint8_t)((tmptime & (RTC_TSTR_ST | RTC_TSTR_SU)) >> RTC_TSTR_SU_Pos);
381 sTimeStamp->TimeFormat = (uint8_t)((tmptime & (RTC_TSTR_PM)) >> RTC_TSTR_PM_Pos);
382 sTimeStamp->SubSeconds = (uint32_t) hrtc->Instance->TSSSR;
383
384 /* Fill the Date structure fields with the read parameters */
385 sTimeStampDate->Year = 0U;
386 sTimeStampDate->Month = (uint8_t)((tmpdate & (RTC_TSDR_MT | RTC_TSDR_MU)) >> RTC_TSDR_MU_Pos);
387 sTimeStampDate->Date = (uint8_t)((tmpdate & (RTC_TSDR_DT | RTC_TSDR_DU)) >> RTC_TSDR_DU_Pos);
388 sTimeStampDate->WeekDay = (uint8_t)((tmpdate & (RTC_TSDR_WDU)) >> RTC_TSDR_WDU_Pos);
389
390 /* Check the input parameters format */
391 if (Format == RTC_FORMAT_BIN)
392 {
393 /* Convert the Timestamp structure parameters to Binary format */
394 sTimeStamp->Hours = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Hours);
395 sTimeStamp->Minutes = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Minutes);
396 sTimeStamp->Seconds = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Seconds);
397
398 /* Convert the DateTimeStamp structure parameters to Binary format */
399 sTimeStampDate->Month = (uint8_t)RTC_Bcd2ToByte(sTimeStampDate->Month);
400 sTimeStampDate->Date = (uint8_t)RTC_Bcd2ToByte(sTimeStampDate->Date);
401 sTimeStampDate->WeekDay = (uint8_t)RTC_Bcd2ToByte(sTimeStampDate->WeekDay);
402 }
403
404 /* Clear the Timestamp Flag */
406
407 return HAL_OK;
408}
409
419{
420 uint32_t tmpreg = 0U;
421
422 /* Check the parameters */
432
433 /* Process Locked */
434 __HAL_LOCK(hrtc);
435
437
438 /* Copy control register into temporary variable */
439 tmpreg = hrtc->Instance->TAFCR;
440
441 /* Enable selected tamper */
442 tmpreg |= (sTamper->Tamper);
443
444 /* Configure the tamper trigger bit (this bit is just on the right of the
445 tamper enable bit, hence the one-time right shift before updating it) */
447 {
448 /* Set the tamper trigger bit (case of falling edge or high level) */
449 tmpreg |= (uint32_t)(sTamper->Tamper << 1U);
450 }
451 else
452 {
453 /* Clear the tamper trigger bit (case of rising edge or low level) */
454 tmpreg &= (uint32_t)~(sTamper->Tamper << 1U);
455 }
456
457 /* Clear remaining fields before setting them */
458 tmpreg &= ~(RTC_TAMPERFILTER_MASK | \
462 RTC_TAFCR_TAMP1INSEL | \
464
465 /* Set remaining parameters of desired configuration into temporary variable */
466 tmpreg |= ((uint32_t)sTamper->Filter | \
467 (uint32_t)sTamper->SamplingFrequency | \
468 (uint32_t)sTamper->PrechargeDuration | \
469 (uint32_t)sTamper->TamperPullUp | \
470 (uint32_t)sTamper->PinSelection | \
471 (uint32_t)sTamper->TimeStampOnTamperDetection);
472
473 /* Disable tamper global interrupt in case it is enabled */
474 tmpreg &= (uint32_t)~RTC_TAFCR_TAMPIE;
475
476 /* Copy desired configuration into configuration register */
477 hrtc->Instance->TAFCR = tmpreg;
478
480
481 /* Process Unlocked */
482 __HAL_UNLOCK(hrtc);
483
484 return HAL_OK;
485}
486
496{
497 uint32_t tmpreg = 0U;
498
499 /* Check the parameters */
509
510 /* Process Locked */
511 __HAL_LOCK(hrtc);
512
514
515 /* Copy control register into temporary variable */
516 tmpreg = hrtc->Instance->TAFCR;
517
518 /* Enable selected tamper */
519 tmpreg |= (sTamper->Tamper);
520
521 /* Configure the tamper trigger bit (this bit is just on the right of the
522 tamper enable bit, hence the one-time right shift before updating it) */
524 {
525 /* Set the tamper trigger bit (case of falling edge or high level) */
526 tmpreg |= (uint32_t)(sTamper->Tamper << 1U);
527 }
528 else
529 {
530 /* Clear the tamper trigger bit (case of rising edge or low level) */
531 tmpreg &= (uint32_t)~(sTamper->Tamper << 1U);
532 }
533
534 /* Clear remaining fields before setting them */
535 tmpreg &= ~(RTC_TAMPERFILTER_MASK | \
539 RTC_TAFCR_TAMP1INSEL | \
541
542 /* Set remaining parameters of desired configuration into temporary variable */
543 tmpreg |= ((uint32_t)sTamper->Filter | \
544 (uint32_t)sTamper->SamplingFrequency | \
545 (uint32_t)sTamper->PrechargeDuration | \
546 (uint32_t)sTamper->TamperPullUp | \
547 (uint32_t)sTamper->PinSelection | \
548 (uint32_t)sTamper->TimeStampOnTamperDetection);
549
550 /* Enable global tamper interrupt */
551 tmpreg |= (uint32_t)RTC_TAFCR_TAMPIE;
552
553 /* Copy desired configuration into configuration register */
554 hrtc->Instance->TAFCR = tmpreg;
555
556 /* Enable and configure the EXTI line associated to the RTC Timestamp and Tamper interrupts */
559
561
562 /* Process Unlocked */
563 __HAL_UNLOCK(hrtc);
564
565 return HAL_OK;
566}
567
582{
584
585 /* Process Locked */
586 __HAL_LOCK(hrtc);
587
589
590 /* Disable the selected Tamper pin */
591 hrtc->Instance->TAFCR &= (uint32_t)~Tamper;
592
594
595 /* Process Unlocked */
596 __HAL_UNLOCK(hrtc);
597
598 return HAL_OK;
599}
600
608{
609 /* Clear the EXTI flag associated to the RTC Timestamp and Tamper interrupts */
611
612 /* Get the Timestamp interrupt source enable status */
614 {
615 /* Get the pending status of the Timestamp Interrupt */
617 {
618 /* Timestamp callback */
619#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
620 hrtc->TimeStampEventCallback(hrtc);
621#else
623#endif /* USE_HAL_RTC_REGISTER_CALLBACKS */
624
625 /* Clear the Timestamp interrupt pending bit after returning from callback
626 as RTC_TSTR and RTC_TSDR registers are cleared when TSF bit is reset */
628 }
629 }
630
631 /* Get the Tamper 1 interrupt source enable status */
633 {
634 /* Get the pending status of the Tamper 1 Interrupt */
636 {
637 /* Clear the Tamper interrupt pending bit */
639
640 /* Tamper callback */
641#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
642 hrtc->Tamper1EventCallback(hrtc);
643#else
645#endif /* USE_HAL_RTC_REGISTER_CALLBACKS */
646 }
647 }
648
649#if defined(RTC_TAMPER2_SUPPORT)
650 /* Get the Tamper 2 interrupt source enable status */
652 {
653 /* Get the pending status of the Tamper 2 Interrupt */
654 if (__HAL_RTC_TAMPER_GET_FLAG(hrtc, RTC_FLAG_TAMP2F) != 0U)
655 {
656 /* Clear the Tamper interrupt pending bit */
657 __HAL_RTC_TAMPER_CLEAR_FLAG(hrtc, RTC_FLAG_TAMP2F);
658
659 /* Tamper callback */
660#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
661 hrtc->Tamper2EventCallback(hrtc);
662#else
663 HAL_RTCEx_Tamper2EventCallback(hrtc);
664#endif /* USE_HAL_RTC_REGISTER_CALLBACKS */
665 }
666 }
667#endif /* RTC_TAMPER2_SUPPORT */
668
669 /* Change RTC state */
671}
672
680{
681 /* Prevent unused argument(s) compilation warning */
682 UNUSED(hrtc);
683
684 /* NOTE: This function should not be modified, when the callback is needed,
685 the HAL_RTCEx_TimeStampEventCallback could be implemented in the user file
686 */
687}
688
696{
697 /* Prevent unused argument(s) compilation warning */
698 UNUSED(hrtc);
699
700 /* NOTE: This function should not be modified, when the callback is needed,
701 the HAL_RTCEx_Tamper1EventCallback could be implemented in the user file
702 */
703}
704
705#if defined(RTC_TAMPER2_SUPPORT)
712__weak void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc)
713{
714 /* Prevent unused argument(s) compilation warning */
715 UNUSED(hrtc);
716
717 /* NOTE: This function should not be modified, when the callback is needed,
718 the HAL_RTCEx_Tamper2EventCallback could be implemented in the user file
719 */
720}
721#endif /* RTC_TAMPER2_SUPPORT */
722
731{
732 uint32_t tickstart = 0U;
733
734 /* Get tick */
735 tickstart = HAL_GetTick();
736
737 while (__HAL_RTC_TIMESTAMP_GET_FLAG(hrtc, RTC_FLAG_TSF) == 0U)
738 {
739 if (Timeout != HAL_MAX_DELAY)
740 {
741 if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
742 {
744 return HAL_TIMEOUT;
745 }
746 }
747
749 {
750 /* Clear the Timestamp Overrun Flag */
752
753 /* Change Timestamp state */
755
756 return HAL_ERROR;
757 }
758 }
759
760 /* Change RTC state */
762
763 return HAL_OK;
764}
765
774{
775 uint32_t tickstart = 0U;
776
777 /* Get tick */
778 tickstart = HAL_GetTick();
779
780 /* Get the status of the Interrupt */
781 while (__HAL_RTC_TAMPER_GET_FLAG(hrtc, RTC_FLAG_TAMP1F) == 0U)
782 {
783 if (Timeout != HAL_MAX_DELAY)
784 {
785 if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
786 {
788 return HAL_TIMEOUT;
789 }
790 }
791 }
792
793 /* Clear the Tamper Flag */
795
796 /* Change RTC state */
798
799 return HAL_OK;
800}
801
802#if defined(RTC_TAMPER2_SUPPORT)
810HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
811{
812 uint32_t tickstart = 0U;
813
814 /* Get tick */
815 tickstart = HAL_GetTick();
816
817 /* Get the status of the Interrupt */
818 while (__HAL_RTC_TAMPER_GET_FLAG(hrtc, RTC_FLAG_TAMP2F) == 0U)
819 {
820 if (Timeout != HAL_MAX_DELAY)
821 {
822 if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
823 {
825 return HAL_TIMEOUT;
826 }
827 }
828 }
829
830 /* Clear the Tamper Flag */
831 __HAL_RTC_TAMPER_CLEAR_FLAG(hrtc, RTC_FLAG_TAMP2F);
832
833 /* Change RTC state */
835
836 return HAL_OK;
837}
838#endif /* RTC_TAMPER2_SUPPORT */
839
843
857
866HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
867{
868 uint32_t tickstart = 0U;
869
870 /* Check the parameters */
871 assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock));
872 assert_param(IS_RTC_WAKEUP_COUNTER(WakeUpCounter));
873
874 /* Process Locked */
875 __HAL_LOCK(hrtc);
876
878
879 /* Disable the write protection for RTC registers */
881
882 /* Check RTC WUTWF flag is reset only when wakeup timer enabled*/
883 if ((hrtc->Instance->CR & RTC_CR_WUTE) != 0U)
884 {
885 tickstart = HAL_GetTick();
886
887 /* Wait till RTC WUTWF flag is reset and if timeout is reached exit */
889 {
890 if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
891 {
892 /* Enable the write protection for RTC registers */
894
896
897 /* Process Unlocked */
898 __HAL_UNLOCK(hrtc);
899
900 return HAL_TIMEOUT;
901 }
902 }
903 }
904
905 /* Disable the Wakeup timer */
907
908 /* Clear the Wakeup flag */
910
911 /* Get tick */
912 tickstart = HAL_GetTick();
913
914 /* Wait till RTC WUTWF flag is set and if timeout is reached exit */
916 {
917 if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
918 {
919 /* Enable the write protection for RTC registers */
921
923
924 /* Process Unlocked */
925 __HAL_UNLOCK(hrtc);
926
927 return HAL_TIMEOUT;
928 }
929 }
930
931 /* Clear the Wakeup Timer clock source bits in CR register */
932 hrtc->Instance->CR &= (uint32_t)~RTC_CR_WUCKSEL;
933
934 /* Configure the clock source */
935 hrtc->Instance->CR |= (uint32_t)WakeUpClock;
936
937 /* Configure the Wakeup Timer counter */
938 hrtc->Instance->WUTR = (uint32_t)WakeUpCounter;
939
940 /* Enable the Wakeup Timer */
942
943 /* Enable the write protection for RTC registers */
945
947
948 /* Process Unlocked */
949 __HAL_UNLOCK(hrtc);
950
951 return HAL_OK;
952}
953
962HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
963{
964 __IO uint32_t count = RTC_TIMEOUT_VALUE * (SystemCoreClock / 32U / 1000U);
965
966 /* Check the parameters */
967 assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock));
968 assert_param(IS_RTC_WAKEUP_COUNTER(WakeUpCounter));
969
970 /* Process Locked */
971 __HAL_LOCK(hrtc);
972
974
975 /* Disable the write protection for RTC registers */
977
978 /* Check RTC WUTWF flag is reset only when wakeup timer enabled */
979 if ((hrtc->Instance->CR & RTC_CR_WUTE) != 0U)
980 {
981 /* Wait till RTC WUTWF flag is reset and if timeout is reached exit */
982 do
983 {
984 count = count - 1U;
985 if (count == 0U)
986 {
987 /* Enable the write protection for RTC registers */
989
991
992 /* Process Unlocked */
993 __HAL_UNLOCK(hrtc);
994
995 return HAL_TIMEOUT;
996 }
997 } while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(hrtc, RTC_FLAG_WUTWF) != 0U);
998 }
999
1000 /* Disable the Wakeup timer */
1002
1003 /* Clear the Wakeup flag */
1005
1006 /* Reload the counter */
1007 count = RTC_TIMEOUT_VALUE * (SystemCoreClock / 32U / 1000U);
1008
1009 /* Wait till RTC WUTWF flag is set and if timeout is reached exit */
1010 do
1011 {
1012 count = count - 1U;
1013 if (count == 0U)
1014 {
1015 /* Enable the write protection for RTC registers */
1017
1019
1020 /* Process Unlocked */
1021 __HAL_UNLOCK(hrtc);
1022
1023 return HAL_TIMEOUT;
1024 }
1025 } while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(hrtc, RTC_FLAG_WUTWF) == 0U);
1026
1027 /* Clear the Wakeup Timer clock source bits in CR register */
1028 hrtc->Instance->CR &= (uint32_t)~RTC_CR_WUCKSEL;
1029
1030 /* Configure the clock source */
1031 hrtc->Instance->CR |= (uint32_t)WakeUpClock;
1032
1033 /* Configure the Wakeup Timer counter */
1034 hrtc->Instance->WUTR = (uint32_t)WakeUpCounter;
1035
1036 /* Enable and configure the EXTI line associated to the RTC Wakeup Timer interrupt */
1039
1040 /* Configure the interrupt in the RTC_CR register */
1042
1043 /* Enable the Wakeup Timer */
1045
1046 /* Enable the write protection for RTC registers */
1048
1049 hrtc->State = HAL_RTC_STATE_READY;
1050
1051 /* Process Unlocked */
1052 __HAL_UNLOCK(hrtc);
1053
1054 return HAL_OK;
1055}
1056
1064{
1065 uint32_t tickstart = 0U;
1066
1067 /* Process Locked */
1068 __HAL_LOCK(hrtc);
1069
1070 hrtc->State = HAL_RTC_STATE_BUSY;
1071
1072 /* Disable the write protection for RTC registers */
1074
1075 /* Disable the Wakeup Timer */
1077
1078 /* In case interrupt mode is used, the interrupt source must disabled */
1080
1081 /* Get tick */
1082 tickstart = HAL_GetTick();
1083
1084 /* Wait till RTC WUTWF flag is set and if timeout is reached exit */
1086 {
1087 if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
1088 {
1089 /* Enable the write protection for RTC registers */
1091
1093
1094 /* Process Unlocked */
1095 __HAL_UNLOCK(hrtc);
1096
1097 return HAL_TIMEOUT;
1098 }
1099 }
1100
1101 /* Enable the write protection for RTC registers */
1103
1104 hrtc->State = HAL_RTC_STATE_READY;
1105
1106 /* Process Unlocked */
1107 __HAL_UNLOCK(hrtc);
1108
1109 return HAL_OK;
1110}
1111
1119{
1120 /* Get the counter value */
1121 return ((uint32_t)(hrtc->Instance->WUTR & RTC_WUTR_WUT));
1122}
1123
1136{
1137 /* Clear the EXTI flag associated to the RTC Wakeup Timer interrupt */
1139
1140 /* Get the pending status of the Wakeup timer Interrupt */
1142 {
1143 /* Clear the Wakeup timer interrupt pending bit */
1145
1146 /* Wakeup timer callback */
1147#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
1148 hrtc->WakeUpTimerEventCallback(hrtc);
1149#else
1151#endif /* USE_HAL_RTC_REGISTER_CALLBACKS */
1152 }
1153
1154 /* Change RTC state */
1155 hrtc->State = HAL_RTC_STATE_READY;
1156}
1157
1165{
1166 /* Prevent unused argument(s) compilation warning */
1167 UNUSED(hrtc);
1168
1169 /* NOTE: This function should not be modified, when the callback is needed,
1170 the HAL_RTCEx_WakeUpTimerEventCallback could be implemented in the user file
1171 */
1172}
1173
1182{
1183 uint32_t tickstart = 0U;
1184
1185 /* Get tick */
1186 tickstart = HAL_GetTick();
1187
1189 {
1190 if (Timeout != HAL_MAX_DELAY)
1191 {
1192 if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
1193 {
1195 return HAL_TIMEOUT;
1196 }
1197 }
1198 }
1199
1200 /* Clear the Wakeup timer Flag */
1202
1203 /* Change RTC state */
1204 hrtc->State = HAL_RTC_STATE_READY;
1205
1206 return HAL_OK;
1207}
1208
1212
1238
1249void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
1250{
1251 uint32_t tmp = 0U;
1252
1253 /* Check the parameters */
1254 assert_param(IS_RTC_BKP(BackupRegister));
1255
1256 tmp = (uint32_t) &(hrtc->Instance->BKP0R);
1257 tmp += (BackupRegister * 4U);
1258
1259 /* Write the specified register */
1260 *(__IO uint32_t *)tmp = (uint32_t)Data;
1261}
1262
1272uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
1273{
1274 uint32_t tmp = 0U;
1275
1276 /* Check the parameters */
1277 assert_param(IS_RTC_BKP(BackupRegister));
1278
1279 tmp = (uint32_t) &(hrtc->Instance->BKP0R);
1280 tmp += (BackupRegister * 4U);
1281
1282 /* Read the specified register */
1283 return (*(__IO uint32_t *)tmp);
1284}
1285
1303HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value)
1304{
1305 HAL_StatusTypeDef status;
1306
1307 /* Check the parameters */
1308 assert_param(IS_RTC_CALIB_SIGN(CalibSign));
1310
1311 /* Process Locked */
1312 __HAL_LOCK(hrtc);
1313
1314 hrtc->State = HAL_RTC_STATE_BUSY;
1315
1316 /* Disable the write protection for RTC registers */
1318
1319 /* Enter Initialization mode */
1320 status = RTC_EnterInitMode(hrtc);
1321
1322 if (status == HAL_OK)
1323 {
1324 /* Enable the Coarse Calibration */
1326
1327 /* Set the coarse calibration value */
1328 hrtc->Instance->CALIBR = (uint32_t)(CalibSign | Value);
1329
1330 /* Exit Initialization mode */
1331 status = RTC_ExitInitMode(hrtc);
1332 }
1333
1334 if (status == HAL_OK)
1335 {
1336 hrtc->State = HAL_RTC_STATE_READY;
1337 }
1338
1339 /* Enable the write protection for RTC registers */
1341
1342 /* Process Unlocked */
1343 __HAL_UNLOCK(hrtc);
1344
1345 return status;
1346}
1347
1355{
1356 HAL_StatusTypeDef status;
1357
1358 /* Process Locked */
1359 __HAL_LOCK(hrtc);
1360
1361 hrtc->State = HAL_RTC_STATE_BUSY;
1362
1363 /* Disable the write protection for RTC registers */
1365
1366 /* Enter Initialization mode */
1367 status = RTC_EnterInitMode(hrtc);
1368
1369 if (status == HAL_OK)
1370 {
1371 /* Disable the Coarse Calibration */
1373
1374 /* Exit Initialization mode */
1375 status = RTC_ExitInitMode(hrtc);
1376 }
1377
1378 if (status == HAL_OK)
1379 {
1380 hrtc->State = HAL_RTC_STATE_READY;
1381 }
1382
1383 /* Enable the write protection for RTC registers */
1385
1386 /* Process Unlocked */
1387 __HAL_UNLOCK(hrtc);
1388
1389 return status;
1390}
1391
1412HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue)
1413{
1414 uint32_t tickstart = 0U;
1415
1416 /* Check the parameters */
1417 assert_param(IS_RTC_SMOOTH_CALIB_PERIOD(SmoothCalibPeriod));
1418 assert_param(IS_RTC_SMOOTH_CALIB_PLUS(SmoothCalibPlusPulses));
1419 assert_param(IS_RTC_SMOOTH_CALIB_MINUS(SmoothCalibMinusPulsesValue));
1420
1421 /* Process Locked */
1422 __HAL_LOCK(hrtc);
1423
1424 hrtc->State = HAL_RTC_STATE_BUSY;
1425
1426 /* Disable the write protection for RTC registers */
1428
1429 /* check if a calibration is pending*/
1430 if ((hrtc->Instance->ISR & RTC_ISR_RECALPF) != 0U)
1431 {
1432 /* Get tick */
1433 tickstart = HAL_GetTick();
1434
1435 /* check if a calibration is pending*/
1436 while ((hrtc->Instance->ISR & RTC_ISR_RECALPF) != 0U)
1437 {
1438 if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
1439 {
1440 /* Enable the write protection for RTC registers */
1442
1443 /* Change RTC state */
1445
1446 /* Process Unlocked */
1447 __HAL_UNLOCK(hrtc);
1448
1449 return HAL_TIMEOUT;
1450 }
1451 }
1452 }
1453
1454 /* Configure the Smooth calibration settings */
1455 hrtc->Instance->CALR = (uint32_t)((uint32_t)SmoothCalibPeriod | \
1456 (uint32_t)SmoothCalibPlusPulses | \
1457 (uint32_t)SmoothCalibMinusPulsesValue);
1458
1459 /* Enable the write protection for RTC registers */
1461
1462 /* Change RTC state */
1463 hrtc->State = HAL_RTC_STATE_READY;
1464
1465 /* Process Unlocked */
1466 __HAL_UNLOCK(hrtc);
1467
1468 return HAL_OK;
1469}
1470
1484HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
1485{
1486 uint32_t tickstart = 0U;
1487
1488 /* Check the parameters */
1489 assert_param(IS_RTC_SHIFT_ADD1S(ShiftAdd1S));
1490 assert_param(IS_RTC_SHIFT_SUBFS(ShiftSubFS));
1491
1492 /* Process Locked */
1493 __HAL_LOCK(hrtc);
1494
1495 hrtc->State = HAL_RTC_STATE_BUSY;
1496
1497 /* Disable the write protection for RTC registers */
1499
1500 /* Get tick */
1501 tickstart = HAL_GetTick();
1502
1503 /* Wait until the shift is completed */
1504 while ((hrtc->Instance->ISR & RTC_ISR_SHPF) != 0U)
1505 {
1506 if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
1507 {
1508 /* Enable the write protection for RTC registers */
1510
1512
1513 /* Process Unlocked */
1514 __HAL_UNLOCK(hrtc);
1515
1516 return HAL_TIMEOUT;
1517 }
1518 }
1519
1520 /* Check if the reference clock detection is disabled */
1521 if ((hrtc->Instance->CR & RTC_CR_REFCKON) == 0U)
1522 {
1523 /* Configure the Shift settings */
1524 hrtc->Instance->SHIFTR = (uint32_t)(uint32_t)(ShiftSubFS) | (uint32_t)(ShiftAdd1S);
1525
1526 /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
1527 if ((hrtc->Instance->CR & RTC_CR_BYPSHAD) == 0U)
1528 {
1529 if (HAL_RTC_WaitForSynchro(hrtc) != HAL_OK)
1530 {
1531 /* Enable the write protection for RTC registers */
1533
1534 hrtc->State = HAL_RTC_STATE_ERROR;
1535
1536 /* Process Unlocked */
1537 __HAL_UNLOCK(hrtc);
1538
1539 return HAL_ERROR;
1540 }
1541 }
1542 }
1543 else
1544 {
1545 /* Enable the write protection for RTC registers */
1547
1548 /* Change RTC state */
1549 hrtc->State = HAL_RTC_STATE_ERROR;
1550
1551 /* Process Unlocked */
1552 __HAL_UNLOCK(hrtc);
1553
1554 return HAL_ERROR;
1555 }
1556
1557 /* Enable the write protection for RTC registers */
1559
1560 /* Change RTC state */
1561 hrtc->State = HAL_RTC_STATE_READY;
1562
1563 /* Process Unlocked */
1564 __HAL_UNLOCK(hrtc);
1565
1566 return HAL_OK;
1567}
1568
1580{
1581 /* Check the parameters */
1582 assert_param(IS_RTC_CALIB_OUTPUT(CalibOutput));
1583
1584 /* Process Locked */
1585 __HAL_LOCK(hrtc);
1586
1587 hrtc->State = HAL_RTC_STATE_BUSY;
1588
1589 /* Disable the write protection for RTC registers */
1591
1592 /* Clear flags before config */
1593 hrtc->Instance->CR &= (uint32_t)~RTC_CR_COSEL;
1594
1595 /* Configure the RTC_CR register */
1596 hrtc->Instance->CR |= (uint32_t)CalibOutput;
1597
1599
1600 /* Enable the write protection for RTC registers */
1602
1603 /* Change RTC state */
1604 hrtc->State = HAL_RTC_STATE_READY;
1605
1606 /* Process Unlocked */
1607 __HAL_UNLOCK(hrtc);
1608
1609 return HAL_OK;
1610}
1611
1619{
1620 /* Process Locked */
1621 __HAL_LOCK(hrtc);
1622
1623 hrtc->State = HAL_RTC_STATE_BUSY;
1624
1625 /* Disable the write protection for RTC registers */
1627
1629
1630 /* Enable the write protection for RTC registers */
1632
1633 /* Change RTC state */
1634 hrtc->State = HAL_RTC_STATE_READY;
1635
1636 /* Process Unlocked */
1637 __HAL_UNLOCK(hrtc);
1638
1639 return HAL_OK;
1640}
1641
1649{
1650 HAL_StatusTypeDef status;
1651
1652 /* Process Locked */
1653 __HAL_LOCK(hrtc);
1654
1655 hrtc->State = HAL_RTC_STATE_BUSY;
1656
1657 /* Disable the write protection for RTC registers */
1659
1660 /* Enter Initialization mode */
1661 status = RTC_EnterInitMode(hrtc);
1662
1663 if (status == HAL_OK)
1664 {
1665 /* Enable the reference clock detection */
1667
1668 /* Exit Initialization mode */
1669 status = RTC_ExitInitMode(hrtc);
1670 }
1671
1672 if (status == HAL_OK)
1673 {
1674 hrtc->State = HAL_RTC_STATE_READY;
1675 }
1676
1677 /* Enable the write protection for RTC registers */
1679
1680 /* Process Unlocked */
1681 __HAL_UNLOCK(hrtc);
1682
1683 return status;
1684}
1685
1693{
1694 HAL_StatusTypeDef status;
1695
1696 /* Process Locked */
1697 __HAL_LOCK(hrtc);
1698
1699 hrtc->State = HAL_RTC_STATE_BUSY;
1700
1701 /* Disable the write protection for RTC registers */
1703
1704 /* Enter Initialization mode */
1705 status = RTC_EnterInitMode(hrtc);
1706
1707 if (status == HAL_OK)
1708 {
1709 /* Disable the reference clock detection */
1711
1712 /* Exit Initialization mode */
1713 status = RTC_ExitInitMode(hrtc);
1714 }
1715
1716 if (status == HAL_OK)
1717 {
1718 hrtc->State = HAL_RTC_STATE_READY;
1719 }
1720
1721 /* Enable the write protection for RTC registers */
1723
1724 /* Process Unlocked */
1725 __HAL_UNLOCK(hrtc);
1726
1727 return status;
1728}
1729
1739{
1740 /* Process Locked */
1741 __HAL_LOCK(hrtc);
1742
1743 hrtc->State = HAL_RTC_STATE_BUSY;
1744
1745 /* Disable the write protection for RTC registers */
1747
1748 /* Set the BYPSHAD bit */
1749 hrtc->Instance->CR |= (uint32_t)RTC_CR_BYPSHAD;
1750
1751 /* Enable the write protection for RTC registers */
1753
1754 /* Change RTC state */
1755 hrtc->State = HAL_RTC_STATE_READY;
1756
1757 /* Process Unlocked */
1758 __HAL_UNLOCK(hrtc);
1759
1760 return HAL_OK;
1761}
1762
1772{
1773 /* Process Locked */
1774 __HAL_LOCK(hrtc);
1775
1776 hrtc->State = HAL_RTC_STATE_BUSY;
1777
1778 /* Disable the write protection for RTC registers */
1780
1781 /* Reset the BYPSHAD bit */
1782 hrtc->Instance->CR &= (uint32_t)~RTC_CR_BYPSHAD;
1783
1784 /* Enable the write protection for RTC registers */
1786
1787 /* Change RTC state */
1788 hrtc->State = HAL_RTC_STATE_READY;
1789
1790 /* Process Unlocked */
1791 __HAL_UNLOCK(hrtc);
1792
1793 return HAL_OK;
1794}
1795
1799
1814
1822{
1823 /* Prevent unused argument(s) compilation warning */
1824 UNUSED(hrtc);
1825
1826 /* NOTE: This function should not be modified, when the callback is needed,
1827 the HAL_RTCEx_AlarmBEventCallback could be implemented in the user file
1828 */
1829}
1830
1839{
1840 uint32_t tickstart = 0U;
1841
1842 /* Get tick */
1843 tickstart = HAL_GetTick();
1844
1845 /* Wait till RTC ALRBF flag is set and if timeout is reached exit */
1846 while (__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBF) == 0U)
1847 {
1848 if (Timeout != HAL_MAX_DELAY)
1849 {
1850 if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
1851 {
1853 return HAL_TIMEOUT;
1854 }
1855 }
1856 }
1857
1858 /* Clear the Alarm flag */
1860
1861 /* Change RTC state */
1862 hrtc->State = HAL_RTC_STATE_READY;
1863
1864 return HAL_OK;
1865}
1866
1870
1874
1875#endif /* HAL_RTC_MODULE_ENABLED */
1879
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
#define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__)
Enable the RTC calibration output.
#define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__)
Enable the clock reference detection.
#define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__)
Disable the clock reference detection.
#define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__)
Disable the Coarse calibration process.
#define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__)
Enable the Coarse calibration process.
#define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__)
Disable the calibration output.
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc)
void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
Wake Up Timer Event Callback in non blocking mode.
uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value)
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue)
HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc)
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput)
void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
#define IS_RTC_SMOOTH_CALIB_MINUS(VALUE)
#define IS_RTC_SHIFT_ADD1S(SEL)
#define IS_RTC_TAMPER_TRIGGER(TRIGGER)
#define IS_TIMESTAMP_EDGE(EDGE)
#define IS_RTC_TIMESTAMP_PIN(PIN)
#define IS_RTC_WAKEUP_COUNTER(COUNTER)
#define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD)
#define IS_RTC_BKP(BKP)
#define IS_RTC_SHIFT_SUBFS(FS)
#define IS_RTC_TAMPER(TAMPER)
#define IS_RTC_CALIB_SIGN(SIGN)
#define IS_RTC_TAMPER_FILTER(FILTER)
#define IS_RTC_TAMPER_PULLUP_STATE(STATE)
#define IS_RTC_WAKEUP_CLOCK(CLOCK)
#define IS_RTC_SMOOTH_CALIB_PLUS(PLUS)
#define IS_RTC_TAMPER_FILTER_CONFIG_CORRECT(FILTER, TRIGGER)
#define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION)
#define IS_RTC_CALIB_OUTPUT(OUTPUT)
#define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ)
#define IS_RTC_CALIB_VALUE(VALUE)
#define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION)
#define IS_RTC_TAMPER_PIN(PIN)
#define RTC_TAMPERFILTER_MASK
#define RTC_IT_TAMP
#define RTC_TAMPERPRECHARGEDURATION_MASK
#define RTC_TAMPER_PULLUP_MASK
#define RTC_TAMPERSAMPLINGFREQ_RTCCLK_MASK
#define RTC_TIMESTAMPONTAMPERDETECTION_MASK
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE()
Enable rising edge trigger on the RTC Tamper and Timestamp associated EXTI line.
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT()
Enable interrupt on the RTC Tamper and Timestamp associated EXTI line.
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG()
Clear the RTC Tamper and Timestamp associated EXTI line flag.
#define RTC_TAMPERTRIGGER_FALLINGEDGE
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Tamper's pending flags.
#define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
Check whether the specified RTC Tamper interrupt has been enabled or not.
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Tamper's flag status.
#define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the RTC Timestamp interrupt.
#define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
Check whether the specified RTC Timestamp interrupt has been enabled or not.
#define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Timestamp's flag status.
#define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the RTC Timestamp interrupt.
#define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Timestamp's pending flags.
#define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__)
Enable the RTC Timestamp peripheral.
#define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__)
Disable the RTC Wakeup Timer peripheral.
#define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Wakeup Timer's flag status.
#define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG()
Clear the RTC Wakeup Timer associated EXTI line flag.
#define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the RTC Wakeup Timer interrupt.
#define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__)
Enable the RTC WakeUp Timer peripheral.
#define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the RTC Wakeup Timer interrupt.
#define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Wakeup timer's pending flags.
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE()
Enable rising edge trigger on the RTC Wakeup Timer associated EXTI line.
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT()
Enable interrupt on the RTC Wakeup Timer associated EXTI line.
HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef *hrtc)
#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Alarm's pending flags.
#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__)
Enable the write protection for RTC registers.
#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Alarm's flag status.
#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__)
Disable the write protection for RTC registers.
@ HAL_RTC_STATE_TIMEOUT
@ HAL_RTC_STATE_ERROR
@ HAL_RTC_STATE_READY
@ HAL_RTC_STATE_BUSY
#define RTC_FLAG_WUTWF
#define RTC_FLAG_TAMP1F
#define RTC_FLAG_TSOVF
#define RTC_FLAG_TSF
#define RTC_FLAG_ALRBF
#define RTC_FLAG_WUTF
#define IS_RTC_FORMAT(FORMAT)
#define RTC_FORMAT_BIN
#define RTC_IT_TS
#define RTC_IT_WUT
#define RTC_DR_RESERVED_MASK
#define RTC_TIMEOUT_VALUE
#define RTC_TR_RESERVED_MASK
HAL_StatusTypeDef RTC_ExitInitMode(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef *hrtc)
uint8_t RTC_Bcd2ToByte(uint8_t number)
#define assert_param(expr)
This file contains all the functions prototypes for the HAL module driver.
HAL_StatusTypeDef
HAL Status structures definition.
@ HAL_TIMEOUT
@ HAL_ERROR
@ HAL_OK
#define __HAL_UNLOCK(__HANDLE__)
#define HAL_MAX_DELAY
#define __HAL_LOCK(__HANDLE__)
RTC Date structure definition.
RTC Handle Structure definition.
volatile HAL_RTCStateTypeDef State
RTC Tamper structure definition.
RTC Time structure definition.