STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_rtc.c
Go to the documentation of this file.
1 
139 /* Includes ------------------------------------------------------------------*/
140 #include "stm32f7xx_hal.h"
141 
151 #ifdef HAL_RTC_MODULE_ENABLED
152 
153 /* Private typedef -----------------------------------------------------------*/
154 /* Private define ------------------------------------------------------------*/
155 /* Private macro -------------------------------------------------------------*/
156 /* Private variables ---------------------------------------------------------*/
157 /* Private function prototypes -----------------------------------------------*/
158 /* Private functions ---------------------------------------------------------*/
159 
205 {
206  /* Check the RTC peripheral state */
207  if(hrtc == NULL)
208  {
209  return HAL_ERROR;
210  }
211 
212  /* Check the parameters */
220 
221  if(hrtc->State == HAL_RTC_STATE_RESET)
222  {
223  /* Allocate lock resource and initialize it */
224  hrtc->Lock = HAL_UNLOCKED;
225  /* Initialize RTC MSP */
226  HAL_RTC_MspInit(hrtc);
227  }
228 
229  /* Set RTC state */
230  hrtc->State = HAL_RTC_STATE_BUSY;
231 
232  /* Disable the write protection for RTC registers */
234 
235  /* Set Initialization mode */
236  if(RTC_EnterInitMode(hrtc) != HAL_OK)
237  {
238  /* Enable the write protection for RTC registers */
240 
241  /* Set RTC state */
242  hrtc->State = HAL_RTC_STATE_ERROR;
243 
244  return HAL_ERROR;
245  }
246  else
247  {
248  /* Clear RTC_CR FMT, OSEL and POL Bits */
249  hrtc->Instance->CR &= ((uint32_t)~(RTC_CR_FMT | RTC_CR_OSEL | RTC_CR_POL));
250  /* Set RTC_CR register */
251  hrtc->Instance->CR |= (uint32_t)(hrtc->Init.HourFormat | hrtc->Init.OutPut | hrtc->Init.OutPutPolarity);
252 
253  /* Configure the RTC PRER */
254  hrtc->Instance->PRER = (uint32_t)(hrtc->Init.SynchPrediv);
255  hrtc->Instance->PRER |= (uint32_t)(hrtc->Init.AsynchPrediv << 16);
256 
257  /* Exit Initialization mode */
258  hrtc->Instance->ISR &= (uint32_t)~RTC_ISR_INIT;
259 
260  hrtc->Instance->OR &= (uint32_t)~RTC_OR_ALARMTYPE;
261  hrtc->Instance->OR |= (uint32_t)(hrtc->Init.OutPutType);
262 
263  /* Enable the write protection for RTC registers */
265 
266  /* Set RTC state */
267  hrtc->State = HAL_RTC_STATE_READY;
268 
269  return HAL_OK;
270  }
271 }
272 
281 {
282  uint32_t tickstart = 0;
283 
284  /* Check the parameters */
286 
287  /* Set RTC state */
288  hrtc->State = HAL_RTC_STATE_BUSY;
289 
290  /* Disable the write protection for RTC registers */
292 
293  /* Set Initialization mode */
294  if(RTC_EnterInitMode(hrtc) != HAL_OK)
295  {
296  /* Enable the write protection for RTC registers */
298 
299  /* Set RTC state */
300  hrtc->State = HAL_RTC_STATE_ERROR;
301 
302  return HAL_ERROR;
303  }
304  else
305  {
306  /* Reset TR, DR and CR registers */
307  hrtc->Instance->TR = (uint32_t)0x00000000;
308  hrtc->Instance->DR = (uint32_t)0x00002101;
309  /* Reset All CR bits except CR[2:0] */
310  hrtc->Instance->CR &= (uint32_t)0x00000007;
311 
312  /* Get tick */
313  tickstart = HAL_GetTick();
314 
315  /* Wait till WUTWF flag is set and if Time out is reached exit */
316  while(((hrtc->Instance->ISR) & RTC_ISR_WUTWF) == (uint32_t)RESET)
317  {
318  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
319  {
320  /* Enable the write protection for RTC registers */
322 
323  /* Set RTC state */
325 
326  return HAL_TIMEOUT;
327  }
328  }
329 
330  /* Reset all RTC CR register bits */
331  hrtc->Instance->CR &= (uint32_t)0x00000000;
332  hrtc->Instance->WUTR = (uint32_t)0x0000FFFF;
333  hrtc->Instance->PRER = (uint32_t)0x007F00FF;
334  hrtc->Instance->ALRMAR = (uint32_t)0x00000000;
335  hrtc->Instance->ALRMBR = (uint32_t)0x00000000;
336  hrtc->Instance->SHIFTR = (uint32_t)0x00000000;
337  hrtc->Instance->CALR = (uint32_t)0x00000000;
338  hrtc->Instance->ALRMASSR = (uint32_t)0x00000000;
339  hrtc->Instance->ALRMBSSR = (uint32_t)0x00000000;
340 
341  /* Reset ISR register and exit initialization mode */
342  hrtc->Instance->ISR = (uint32_t)0x00000000;
343 
344  /* Reset Tamper and alternate functions configuration register */
345  hrtc->Instance->TAMPCR = 0x00000000;
346 
347  /* Reset Option register */
348  hrtc->Instance->OR = 0x00000000;
349 
350  /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
351  if((hrtc->Instance->CR & RTC_CR_BYPSHAD) == RESET)
352  {
353  if(HAL_RTC_WaitForSynchro(hrtc) != HAL_OK)
354  {
355  /* Enable the write protection for RTC registers */
357 
358  hrtc->State = HAL_RTC_STATE_ERROR;
359 
360  return HAL_ERROR;
361  }
362  }
363  }
364 
365  /* Enable the write protection for RTC registers */
367 
368  /* De-Initialize RTC MSP */
369  HAL_RTC_MspDeInit(hrtc);
370 
371  hrtc->State = HAL_RTC_STATE_RESET;
372 
373  /* Release Lock */
374  __HAL_UNLOCK(hrtc);
375 
376  return HAL_OK;
377 }
378 
385 __weak void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
386 {
387  /* Prevent unused argument(s) compilation warning */
388  UNUSED(hrtc);
389 
390  /* NOTE : This function Should not be modified, when the callback is needed,
391  the HAL_RTC_MspInit could be implemented in the user file
392  */
393 }
394 
401 __weak void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
402 {
403  /* Prevent unused argument(s) compilation warning */
404  UNUSED(hrtc);
405 
406  /* NOTE : This function Should not be modified, when the callback is needed,
407  the HAL_RTC_MspDeInit could be implemented in the user file
408  */
409 }
410 
441 {
442  uint32_t tmpreg = 0;
443 
444  /* Check the parameters */
445  assert_param(IS_RTC_FORMAT(Format));
448 
449  /* Process Locked */
450  __HAL_LOCK(hrtc);
451 
452  hrtc->State = HAL_RTC_STATE_BUSY;
453 
454  if(Format == RTC_FORMAT_BIN)
455  {
456  if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET)
457  {
460  }
461  else
462  {
463  sTime->TimeFormat = 0x00;
465  }
468 
469  tmpreg = (uint32_t)(((uint32_t)RTC_ByteToBcd2(sTime->Hours) << 16) | \
470  ((uint32_t)RTC_ByteToBcd2(sTime->Minutes) << 8) | \
471  ((uint32_t)RTC_ByteToBcd2(sTime->Seconds)) | \
472  (((uint32_t)sTime->TimeFormat) << 16));
473  }
474  else
475  {
476  if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET)
477  {
478  tmpreg = RTC_Bcd2ToByte(sTime->Hours);
479  assert_param(IS_RTC_HOUR12(tmpreg));
481  }
482  else
483  {
484  sTime->TimeFormat = 0x00;
486  }
489  tmpreg = (((uint32_t)(sTime->Hours) << 16) | \
490  ((uint32_t)(sTime->Minutes) << 8) | \
491  ((uint32_t)sTime->Seconds) | \
492  ((uint32_t)(sTime->TimeFormat) << 16));
493  }
494 
495  /* Disable the write protection for RTC registers */
497 
498  /* Set Initialization mode */
499  if(RTC_EnterInitMode(hrtc) != HAL_OK)
500  {
501  /* Enable the write protection for RTC registers */
503 
504  /* Set RTC state */
505  hrtc->State = HAL_RTC_STATE_ERROR;
506 
507  /* Process Unlocked */
508  __HAL_UNLOCK(hrtc);
509 
510  return HAL_ERROR;
511  }
512  else
513  {
514  /* Set the RTC_TR register */
515  hrtc->Instance->TR = (uint32_t)(tmpreg & RTC_TR_RESERVED_MASK);
516 
517  /* Clear the bits to be configured */
518  hrtc->Instance->CR &= (uint32_t)~RTC_CR_BCK;
519 
520  /* Configure the RTC_CR register */
521  hrtc->Instance->CR |= (uint32_t)(sTime->DayLightSaving | sTime->StoreOperation);
522 
523  /* Exit Initialization mode */
524  hrtc->Instance->ISR &= (uint32_t)~RTC_ISR_INIT;
525 
526  /* If CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
527  if((hrtc->Instance->CR & RTC_CR_BYPSHAD) == RESET)
528  {
529  if(HAL_RTC_WaitForSynchro(hrtc) != HAL_OK)
530  {
531  /* Enable the write protection for RTC registers */
533 
534  hrtc->State = HAL_RTC_STATE_ERROR;
535 
536  /* Process Unlocked */
537  __HAL_UNLOCK(hrtc);
538 
539  return HAL_ERROR;
540  }
541  }
542 
543  /* Enable the write protection for RTC registers */
545 
546  hrtc->State = HAL_RTC_STATE_READY;
547 
548  __HAL_UNLOCK(hrtc);
549 
550  return HAL_OK;
551  }
552 }
553 
576 {
577  uint32_t tmpreg = 0;
578 
579  /* Check the parameters */
580  assert_param(IS_RTC_FORMAT(Format));
581 
582  /* Get subseconds values from the correspondent registers*/
583  sTime->SubSeconds = (uint32_t)(hrtc->Instance->SSR);
584 
585  /* Get SecondFraction structure field from the corresponding register field*/
586  sTime->SecondFraction = (uint32_t)(hrtc->Instance->PRER & RTC_PRER_PREDIV_S);
587 
588  /* Get the TR register */
589  tmpreg = (uint32_t)(hrtc->Instance->TR & RTC_TR_RESERVED_MASK);
590 
591  /* Fill the structure fields with the read parameters */
592  sTime->Hours = (uint8_t)((tmpreg & (RTC_TR_HT | RTC_TR_HU)) >> 16);
593  sTime->Minutes = (uint8_t)((tmpreg & (RTC_TR_MNT | RTC_TR_MNU)) >>8);
594  sTime->Seconds = (uint8_t)(tmpreg & (RTC_TR_ST | RTC_TR_SU));
595  sTime->TimeFormat = (uint8_t)((tmpreg & (RTC_TR_PM)) >> 16);
596 
597  /* Check the input parameters format */
598  if(Format == RTC_FORMAT_BIN)
599  {
600  /* Convert the time structure parameters to Binary format */
601  sTime->Hours = (uint8_t)RTC_Bcd2ToByte(sTime->Hours);
602  sTime->Minutes = (uint8_t)RTC_Bcd2ToByte(sTime->Minutes);
603  sTime->Seconds = (uint8_t)RTC_Bcd2ToByte(sTime->Seconds);
604  }
605 
606  return HAL_OK;
607 }
608 
621 {
622  uint32_t datetmpreg = 0;
623 
624  /* Check the parameters */
625  assert_param(IS_RTC_FORMAT(Format));
626 
627  /* Process Locked */
628  __HAL_LOCK(hrtc);
629 
630  hrtc->State = HAL_RTC_STATE_BUSY;
631 
632  if((Format == RTC_FORMAT_BIN) && ((sDate->Month & 0x10U) == 0x10U))
633  {
634  sDate->Month = (uint8_t)((sDate->Month & (uint8_t)~(0x10U)) + (uint8_t)0x0AU);
635  }
636 
638 
639  if(Format == RTC_FORMAT_BIN)
640  {
641  assert_param(IS_RTC_YEAR(sDate->Year));
643  assert_param(IS_RTC_DATE(sDate->Date));
644 
645  datetmpreg = (((uint32_t)RTC_ByteToBcd2(sDate->Year) << 16) | \
646  ((uint32_t)RTC_ByteToBcd2(sDate->Month) << 8) | \
647  ((uint32_t)RTC_ByteToBcd2(sDate->Date)) | \
648  ((uint32_t)sDate->WeekDay << 13));
649  }
650  else
651  {
653  datetmpreg = RTC_Bcd2ToByte(sDate->Month);
654  assert_param(IS_RTC_MONTH(datetmpreg));
655  datetmpreg = RTC_Bcd2ToByte(sDate->Date);
656  assert_param(IS_RTC_DATE(datetmpreg));
657 
658  datetmpreg = ((((uint32_t)sDate->Year) << 16) | \
659  (((uint32_t)sDate->Month) << 8) | \
660  ((uint32_t)sDate->Date) | \
661  (((uint32_t)sDate->WeekDay) << 13));
662  }
663 
664  /* Disable the write protection for RTC registers */
666 
667  /* Set Initialization mode */
668  if(RTC_EnterInitMode(hrtc) != HAL_OK)
669  {
670  /* Enable the write protection for RTC registers */
672 
673  /* Set RTC state*/
674  hrtc->State = HAL_RTC_STATE_ERROR;
675 
676  /* Process Unlocked */
677  __HAL_UNLOCK(hrtc);
678 
679  return HAL_ERROR;
680  }
681  else
682  {
683  /* Set the RTC_DR register */
684  hrtc->Instance->DR = (uint32_t)(datetmpreg & RTC_DR_RESERVED_MASK);
685 
686  /* Exit Initialization mode */
687  hrtc->Instance->ISR &= (uint32_t)~RTC_ISR_INIT;
688 
689  /* If CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
690  if((hrtc->Instance->CR & RTC_CR_BYPSHAD) == RESET)
691  {
692  if(HAL_RTC_WaitForSynchro(hrtc) != HAL_OK)
693  {
694  /* Enable the write protection for RTC registers */
696 
697  hrtc->State = HAL_RTC_STATE_ERROR;
698 
699  /* Process Unlocked */
700  __HAL_UNLOCK(hrtc);
701 
702  return HAL_ERROR;
703  }
704  }
705 
706  /* Enable the write protection for RTC registers */
708 
709  hrtc->State = HAL_RTC_STATE_READY ;
710 
711  /* Process Unlocked */
712  __HAL_UNLOCK(hrtc);
713 
714  return HAL_OK;
715  }
716 }
717 
733 {
734  uint32_t datetmpreg = 0;
735 
736  /* Check the parameters */
737  assert_param(IS_RTC_FORMAT(Format));
738 
739  /* Get the DR register */
740  datetmpreg = (uint32_t)(hrtc->Instance->DR & RTC_DR_RESERVED_MASK);
741 
742  /* Fill the structure fields with the read parameters */
743  sDate->Year = (uint8_t)((datetmpreg & (RTC_DR_YT | RTC_DR_YU)) >> 16);
744  sDate->Month = (uint8_t)((datetmpreg & (RTC_DR_MT | RTC_DR_MU)) >> 8);
745  sDate->Date = (uint8_t)(datetmpreg & (RTC_DR_DT | RTC_DR_DU));
746  sDate->WeekDay = (uint8_t)((datetmpreg & (RTC_DR_WDU)) >> 13);
747 
748  /* Check the input parameters format */
749  if(Format == RTC_FORMAT_BIN)
750  {
751  /* Convert the date structure parameters to Binary format */
752  sDate->Year = (uint8_t)RTC_Bcd2ToByte(sDate->Year);
753  sDate->Month = (uint8_t)RTC_Bcd2ToByte(sDate->Month);
754  sDate->Date = (uint8_t)RTC_Bcd2ToByte(sDate->Date);
755  }
756  return HAL_OK;
757 }
758 
788 {
789  uint32_t tickstart = 0;
790  uint32_t tmpreg = 0, subsecondtmpreg = 0;
791 
792  /* Check the parameters */
793  assert_param(IS_RTC_FORMAT(Format));
794  assert_param(IS_RTC_ALARM(sAlarm->Alarm));
799 
800  /* Process Locked */
801  __HAL_LOCK(hrtc);
802 
803  hrtc->State = HAL_RTC_STATE_BUSY;
804 
805  if(Format == RTC_FORMAT_BIN)
806  {
807  if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET)
808  {
811  }
812  else
813  {
814  sAlarm->AlarmTime.TimeFormat = 0x00;
816  }
819 
821  {
823  }
824  else
825  {
827  }
828 
829  tmpreg = (((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Hours) << 16) | \
830  ((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Minutes) << 8) | \
831  ((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Seconds)) | \
832  ((uint32_t)(sAlarm->AlarmTime.TimeFormat) << 16) | \
833  ((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmDateWeekDay) << 24) | \
834  ((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
835  ((uint32_t)sAlarm->AlarmMask));
836  }
837  else
838  {
839  if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET)
840  {
841  tmpreg = RTC_Bcd2ToByte(sAlarm->AlarmTime.Hours);
842  assert_param(IS_RTC_HOUR12(tmpreg));
844  }
845  else
846  {
847  sAlarm->AlarmTime.TimeFormat = 0x00;
849  }
850 
853 
855  {
856  tmpreg = RTC_Bcd2ToByte(sAlarm->AlarmDateWeekDay);
858  }
859  else
860  {
861  tmpreg = RTC_Bcd2ToByte(sAlarm->AlarmDateWeekDay);
863  }
864 
865  tmpreg = (((uint32_t)(sAlarm->AlarmTime.Hours) << 16) | \
866  ((uint32_t)(sAlarm->AlarmTime.Minutes) << 8) | \
867  ((uint32_t) sAlarm->AlarmTime.Seconds) | \
868  ((uint32_t)(sAlarm->AlarmTime.TimeFormat) << 16) | \
869  ((uint32_t)(sAlarm->AlarmDateWeekDay) << 24) | \
870  ((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
871  ((uint32_t)sAlarm->AlarmMask));
872  }
873 
874  /* Configure the Alarm A or Alarm B Sub Second registers */
875  subsecondtmpreg = (uint32_t)((uint32_t)(sAlarm->AlarmTime.SubSeconds) | (uint32_t)(sAlarm->AlarmSubSecondMask));
876 
877  /* Disable the write protection for RTC registers */
879 
880  /* Configure the Alarm register */
881  if(sAlarm->Alarm == RTC_ALARM_A)
882  {
883  /* Disable the Alarm A interrupt */
885 
886  /* In case of interrupt mode is used, the interrupt source must disabled */
888 
889  /* Get tick */
890  tickstart = HAL_GetTick();
891 
892  /* Wait till RTC ALRAWF flag is set and if Time out is reached exit */
893  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == RESET)
894  {
895  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
896  {
897  /* Enable the write protection for RTC registers */
899 
900  hrtc->State = HAL_RTC_STATE_TIMEOUT;
901 
902  /* Process Unlocked */
903  __HAL_UNLOCK(hrtc);
904 
905  return HAL_TIMEOUT;
906  }
907  }
908 
909  hrtc->Instance->ALRMAR = (uint32_t)tmpreg;
910  /* Configure the Alarm A Sub Second register */
911  hrtc->Instance->ALRMASSR = subsecondtmpreg;
912  /* Configure the Alarm state: Enable Alarm */
914  }
915  else
916  {
917  /* Disable the Alarm B interrupt */
919 
920  /* In case of interrupt mode is used, the interrupt source must disabled */
922 
923  /* Get tick */
924  tickstart = HAL_GetTick();
925 
926  /* Wait till RTC ALRBWF flag is set and if Time out is reached exit */
927  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == RESET)
928  {
929  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
930  {
931  /* Enable the write protection for RTC registers */
933 
934  hrtc->State = HAL_RTC_STATE_TIMEOUT;
935 
936  /* Process Unlocked */
937  __HAL_UNLOCK(hrtc);
938 
939  return HAL_TIMEOUT;
940  }
941  }
942 
943  hrtc->Instance->ALRMBR = (uint32_t)tmpreg;
944  /* Configure the Alarm B Sub Second register */
945  hrtc->Instance->ALRMBSSR = subsecondtmpreg;
946  /* Configure the Alarm state: Enable Alarm */
948  }
949 
950  /* Enable the write protection for RTC registers */
952 
953  /* Change RTC state */
954  hrtc->State = HAL_RTC_STATE_READY;
955 
956  /* Process Unlocked */
957  __HAL_UNLOCK(hrtc);
958 
959  return HAL_OK;
960 }
961 
977 {
978  uint32_t tickstart = 0;
979  uint32_t tmpreg = 0, subsecondtmpreg = 0;
980 
981  /* Check the parameters */
982  assert_param(IS_RTC_FORMAT(Format));
983  assert_param(IS_RTC_ALARM(sAlarm->Alarm));
988 
989  /* Process Locked */
990  __HAL_LOCK(hrtc);
991 
992  hrtc->State = HAL_RTC_STATE_BUSY;
993 
994  if(Format == RTC_FORMAT_BIN)
995  {
996  if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET)
997  {
1000  }
1001  else
1002  {
1003  sAlarm->AlarmTime.TimeFormat = 0x00;
1005  }
1008 
1010  {
1012  }
1013  else
1014  {
1016  }
1017  tmpreg = (((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Hours) << 16) | \
1018  ((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Minutes) << 8) | \
1019  ((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmTime.Seconds)) | \
1020  ((uint32_t)(sAlarm->AlarmTime.TimeFormat) << 16) | \
1021  ((uint32_t)RTC_ByteToBcd2(sAlarm->AlarmDateWeekDay) << 24) | \
1022  ((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
1023  ((uint32_t)sAlarm->AlarmMask));
1024  }
1025  else
1026  {
1027  if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET)
1028  {
1029  tmpreg = RTC_Bcd2ToByte(sAlarm->AlarmTime.Hours);
1030  assert_param(IS_RTC_HOUR12(tmpreg));
1032  }
1033  else
1034  {
1035  sAlarm->AlarmTime.TimeFormat = 0x00;
1037  }
1038 
1041 
1043  {
1044  tmpreg = RTC_Bcd2ToByte(sAlarm->AlarmDateWeekDay);
1046  }
1047  else
1048  {
1049  tmpreg = RTC_Bcd2ToByte(sAlarm->AlarmDateWeekDay);
1051  }
1052  tmpreg = (((uint32_t)(sAlarm->AlarmTime.Hours) << 16) | \
1053  ((uint32_t)(sAlarm->AlarmTime.Minutes) << 8) | \
1054  ((uint32_t) sAlarm->AlarmTime.Seconds) | \
1055  ((uint32_t)(sAlarm->AlarmTime.TimeFormat) << 16) | \
1056  ((uint32_t)(sAlarm->AlarmDateWeekDay) << 24) | \
1057  ((uint32_t)sAlarm->AlarmDateWeekDaySel) | \
1058  ((uint32_t)sAlarm->AlarmMask));
1059  }
1060  /* Configure the Alarm A or Alarm B Sub Second registers */
1061  subsecondtmpreg = (uint32_t)((uint32_t)(sAlarm->AlarmTime.SubSeconds) | (uint32_t)(sAlarm->AlarmSubSecondMask));
1062 
1063  /* Disable the write protection for RTC registers */
1065 
1066  /* Configure the Alarm register */
1067  if(sAlarm->Alarm == RTC_ALARM_A)
1068  {
1069  /* Disable the Alarm A interrupt */
1071 
1072  /* Clear flag alarm A */
1074 
1075  /* Get tick */
1076  tickstart = HAL_GetTick();
1077 
1078  /* Wait till RTC ALRAWF flag is set and if Time out is reached exit */
1079  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == RESET)
1080  {
1081  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1082  {
1083  /* Enable the write protection for RTC registers */
1085 
1086  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1087 
1088  /* Process Unlocked */
1089  __HAL_UNLOCK(hrtc);
1090 
1091  return HAL_TIMEOUT;
1092  }
1093  }
1094 
1095  hrtc->Instance->ALRMAR = (uint32_t)tmpreg;
1096  /* Configure the Alarm A Sub Second register */
1097  hrtc->Instance->ALRMASSR = subsecondtmpreg;
1098  /* Configure the Alarm state: Enable Alarm */
1100  /* Configure the Alarm interrupt */
1102  }
1103  else
1104  {
1105  /* Disable the Alarm B interrupt */
1107 
1108  /* Clear flag alarm B */
1110 
1111  /* Get tick */
1112  tickstart = HAL_GetTick();
1113 
1114  /* Wait till RTC ALRBWF flag is set and if Time out is reached exit */
1115  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == RESET)
1116  {
1117  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1118  {
1119  /* Enable the write protection for RTC registers */
1121 
1122  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1123 
1124  /* Process Unlocked */
1125  __HAL_UNLOCK(hrtc);
1126 
1127  return HAL_TIMEOUT;
1128  }
1129  }
1130 
1131  hrtc->Instance->ALRMBR = (uint32_t)tmpreg;
1132  /* Configure the Alarm B Sub Second register */
1133  hrtc->Instance->ALRMBSSR = subsecondtmpreg;
1134  /* Configure the Alarm state: Enable Alarm */
1136  /* Configure the Alarm interrupt */
1138  }
1139 
1140  /* RTC Alarm Interrupt Configuration: EXTI configuration */
1142 
1144 
1145  /* Enable the write protection for RTC registers */
1147 
1148  hrtc->State = HAL_RTC_STATE_READY;
1149 
1150  /* Process Unlocked */
1151  __HAL_UNLOCK(hrtc);
1152 
1153  return HAL_OK;
1154 }
1155 
1167 {
1168  uint32_t tickstart = 0;
1169 
1170  /* Check the parameters */
1171  assert_param(IS_RTC_ALARM(Alarm));
1172 
1173  /* Process Locked */
1174  __HAL_LOCK(hrtc);
1175 
1176  hrtc->State = HAL_RTC_STATE_BUSY;
1177 
1178  /* Disable the write protection for RTC registers */
1180 
1181  if(Alarm == RTC_ALARM_A)
1182  {
1183  /* AlarmA */
1185 
1186  /* In case of interrupt mode is used, the interrupt source must disabled */
1188 
1189  /* Get tick */
1190  tickstart = HAL_GetTick();
1191 
1192  /* Wait till RTC ALRxWF flag is set and if Time out is reached exit */
1193  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAWF) == RESET)
1194  {
1195  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1196  {
1197  /* Enable the write protection for RTC registers */
1199 
1200  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1201 
1202  /* Process Unlocked */
1203  __HAL_UNLOCK(hrtc);
1204 
1205  return HAL_TIMEOUT;
1206  }
1207  }
1208  }
1209  else
1210  {
1211  /* AlarmB */
1213 
1214  /* In case of interrupt mode is used, the interrupt source must disabled */
1216 
1217  /* Get tick */
1218  tickstart = HAL_GetTick();
1219 
1220  /* Wait till RTC ALRxWF flag is set and if Time out is reached exit */
1221  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRBWF) == RESET)
1222  {
1223  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1224  {
1225  /* Enable the write protection for RTC registers */
1227 
1228  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1229 
1230  /* Process Unlocked */
1231  __HAL_UNLOCK(hrtc);
1232 
1233  return HAL_TIMEOUT;
1234  }
1235  }
1236  }
1237  /* Enable the write protection for RTC registers */
1239 
1240  hrtc->State = HAL_RTC_STATE_READY;
1241 
1242  /* Process Unlocked */
1243  __HAL_UNLOCK(hrtc);
1244 
1245  return HAL_OK;
1246 }
1247 
1263 HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format)
1264 {
1265  uint32_t tmpreg = 0, subsecondtmpreg = 0;
1266 
1267  /* Check the parameters */
1268  assert_param(IS_RTC_FORMAT(Format));
1269  assert_param(IS_RTC_ALARM(Alarm));
1270 
1271  if(Alarm == RTC_ALARM_A)
1272  {
1273  /* AlarmA */
1274  sAlarm->Alarm = RTC_ALARM_A;
1275 
1276  tmpreg = (uint32_t)(hrtc->Instance->ALRMAR);
1277  subsecondtmpreg = (uint32_t)((hrtc->Instance->ALRMASSR ) & RTC_ALRMASSR_SS);
1278  }
1279  else
1280  {
1281  sAlarm->Alarm = RTC_ALARM_B;
1282 
1283  tmpreg = (uint32_t)(hrtc->Instance->ALRMBR);
1284  subsecondtmpreg = (uint32_t)((hrtc->Instance->ALRMBSSR) & RTC_ALRMBSSR_SS);
1285  }
1286 
1287  /* Fill the structure with the read parameters */
1288  sAlarm->AlarmTime.Hours = (uint32_t)((tmpreg & (RTC_ALRMAR_HT | RTC_ALRMAR_HU)) >> 16);
1289  sAlarm->AlarmTime.Minutes = (uint32_t)((tmpreg & (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU)) >> 8);
1290  sAlarm->AlarmTime.Seconds = (uint32_t)(tmpreg & (RTC_ALRMAR_ST | RTC_ALRMAR_SU));
1291  sAlarm->AlarmTime.TimeFormat = (uint32_t)((tmpreg & RTC_ALRMAR_PM) >> 16);
1292  sAlarm->AlarmTime.SubSeconds = (uint32_t) subsecondtmpreg;
1293  sAlarm->AlarmDateWeekDay = (uint32_t)((tmpreg & (RTC_ALRMAR_DT | RTC_ALRMAR_DU)) >> 24);
1294  sAlarm->AlarmDateWeekDaySel = (uint32_t)(tmpreg & RTC_ALRMAR_WDSEL);
1295  sAlarm->AlarmMask = (uint32_t)(tmpreg & RTC_ALARMMASK_ALL);
1296 
1297  if(Format == RTC_FORMAT_BIN)
1298  {
1299  sAlarm->AlarmTime.Hours = RTC_Bcd2ToByte(sAlarm->AlarmTime.Hours);
1300  sAlarm->AlarmTime.Minutes = RTC_Bcd2ToByte(sAlarm->AlarmTime.Minutes);
1301  sAlarm->AlarmTime.Seconds = RTC_Bcd2ToByte(sAlarm->AlarmTime.Seconds);
1303  }
1304 
1305  return HAL_OK;
1306 }
1307 
1315 {
1317  {
1318  /* Get the status of the Interrupt */
1319  if((uint32_t)(hrtc->Instance->CR & RTC_IT_ALRA) != (uint32_t)RESET)
1320  {
1321  /* AlarmA callback */
1323 
1324  /* Clear the Alarm interrupt pending bit */
1326  }
1327  }
1328 
1330  {
1331  /* Get the status of the Interrupt */
1332  if((uint32_t)(hrtc->Instance->CR & RTC_IT_ALRB) != (uint32_t)RESET)
1333  {
1334  /* AlarmB callback */
1336 
1337  /* Clear the Alarm interrupt pending bit */
1339  }
1340  }
1341 
1342  /* Clear the EXTI's line Flag for RTC Alarm */
1344 
1345  /* Change RTC state */
1346  hrtc->State = HAL_RTC_STATE_READY;
1347 }
1348 
1356 {
1357  /* Prevent unused argument(s) compilation warning */
1358  UNUSED(hrtc);
1359 
1360  /* NOTE : This function Should not be modified, when the callback is needed,
1361  the HAL_RTC_AlarmAEventCallback could be implemented in the user file
1362  */
1363 }
1364 
1373 {
1374  uint32_t tickstart = 0;
1375 
1376  /* Get tick */
1377  tickstart = HAL_GetTick();
1378 
1379  while(__HAL_RTC_ALARM_GET_FLAG(hrtc, RTC_FLAG_ALRAF) == RESET)
1380  {
1381  if(Timeout != HAL_MAX_DELAY)
1382  {
1383  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
1384  {
1385  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1386  return HAL_TIMEOUT;
1387  }
1388  }
1389  }
1390 
1391  /* Clear the Alarm interrupt pending bit */
1393 
1394  /* Change RTC state */
1395  hrtc->State = HAL_RTC_STATE_READY;
1396 
1397  return HAL_OK;
1398 }
1399 
1435 {
1436  uint32_t tickstart = 0;
1437 
1438  /* Clear RSF flag */
1439  hrtc->Instance->ISR &= (uint32_t)RTC_RSF_MASK;
1440 
1441  /* Get tick */
1442  tickstart = HAL_GetTick();
1443 
1444  /* Wait the registers to be synchronised */
1445  while((hrtc->Instance->ISR & RTC_ISR_RSF) == (uint32_t)RESET)
1446  {
1447  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1448  {
1449  return HAL_TIMEOUT;
1450  }
1451  }
1452 
1453  return HAL_OK;
1454 }
1455 
1481 {
1482  return hrtc->State;
1483 }
1484 
1498 {
1499  uint32_t tickstart = 0;
1500 
1501  /* Check if the Initialization mode is set */
1502  if((hrtc->Instance->ISR & RTC_ISR_INITF) == (uint32_t)RESET)
1503  {
1504  /* Set the Initialization mode */
1505  hrtc->Instance->ISR = (uint32_t)RTC_INIT_MASK;
1506 
1507  /* Get tick */
1508  tickstart = HAL_GetTick();
1509 
1510  /* Wait till RTC is in INIT state and if Time out is reached exit */
1511  while((hrtc->Instance->ISR & RTC_ISR_INITF) == (uint32_t)RESET)
1512  {
1513  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1514  {
1515  return HAL_TIMEOUT;
1516  }
1517  }
1518  }
1519 
1520  return HAL_OK;
1521 }
1522 
1523 
1529 uint8_t RTC_ByteToBcd2(uint8_t Value)
1530 {
1531  uint32_t bcdhigh = 0;
1532 
1533  while(Value >= 10)
1534  {
1535  bcdhigh++;
1536  Value -= 10;
1537  }
1538 
1539  return ((uint8_t)(bcdhigh << 4) | Value);
1540 }
1541 
1547 uint8_t RTC_Bcd2ToByte(uint8_t Value)
1548 {
1549  uint32_t tmp = 0;
1550  tmp = ((uint8_t)(Value & (uint8_t)0xF0) >> (uint8_t)0x4) * 10;
1551  return (tmp + (Value & (uint8_t)0x0F));
1552 }
1553 
1558 #endif /* HAL_RTC_MODULE_ENABLED */
1559 
1567 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Alarm&#39;s pending flags.
#define RTC_ALRMBSSR_SS
Definition: stm32f745xx.h:6096
RTC_TypeDef * Instance
#define IS_RTC_HOUR_FORMAT(__FORMAT__)
__IO uint32_t ALRMBR
Definition: stm32f745xx.h:725
#define RTC_ALRMAR_PM
Definition: stm32f745xx.h:5898
#define RTC_TIMEOUT_VALUE
#define IS_RTC_FORMAT(__FORMAT__)
#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__)
Disable the write protection for RTC registers.
#define IS_RTC_ALARM_MASK(__MASK__)
HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef *hrtc)
__IO uint32_t WUTR
Definition: stm32f745xx.h:722
__IO uint32_t SHIFTR
Definition: stm32f745xx.h:728
HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format)
#define RTC_ALRMAR_SU
Definition: stm32f745xx.h:5922
#define RTC_ISR_RSF
Definition: stm32f745xx.h:5872
#define IS_RTC_ALARM_DATE_WEEKDAY_SEL(__SEL__)
HAL_LockTypeDef Lock
#define assert_param(expr)
Include module&#39;s header file.
#define IS_RTC_YEAR(__YEAR__)
#define IS_RTC_DATE(__DATE__)
#define RTC_ALRMAR_ST
Definition: stm32f745xx.h:5918
#define RTC_TR_ST
Definition: stm32f745xx.h:5791
#define __HAL_RTC_ALARMB_DISABLE(__HANDLE__)
Disable the RTC ALARMB peripheral.
#define RTC_ALRMAR_DU
Definition: stm32f745xx.h:5892
#define IS_RTC_MINUTES(__MINUTES__)
#define __HAL_UNLOCK(__HANDLE__)
#define IS_RTC_MONTH(__MONTH__)
#define RTC_IT_ALRA
void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
#define RTC_TR_HU
Definition: stm32f745xx.h:5777
#define RTC_FLAG_ALRAF
__IO uint32_t TAMPCR
Definition: stm32f745xx.h:733
#define RTC_ALRMAR_HT
Definition: stm32f745xx.h:5899
#define RTC_EXTI_LINE_ALARM_EVENT
__IO uint32_t ALRMBSSR
Definition: stm32f745xx.h:735
#define RTC_OR_ALARMTYPE
Definition: stm32f745xx.h:6102
RTC Date structure definition.
#define IS_RTC_ASYNCH_PREDIV(__PREDIV__)
#define IS_RTC_SYNCH_PREDIV(__PREDIV__)
#define __HAL_RTC_ALARMA_ENABLE(__HANDLE__)
Enable the RTC ALARMA peripheral.
#define RTC_ISR_INITF
Definition: stm32f745xx.h:5871
HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc)
__IO uint32_t PRER
Definition: stm32f745xx.h:721
HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
#define RTC_DR_YT
Definition: stm32f745xx.h:5802
#define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG()
Clear the RTC Alarm associated Exti line flag.
#define IS_RTC_ALL_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8873
#define __HAL_RTC_ALARMB_ENABLE(__HANDLE__)
Enable the RTC ALARMB peripheral.
#define RTC_DR_YU
Definition: stm32f745xx.h:5807
__IO uint32_t ALRMAR
Definition: stm32f745xx.h:724
#define RTC_ALRMAR_WDSEL
Definition: stm32f745xx.h:5888
#define IS_RTC_ALARM_SUB_SECOND_MASK(__MASK__)
HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
#define RTC_DR_DU
Definition: stm32f745xx.h:5825
#define RTC_TR_RESERVED_MASK
#define IS_RTC_HOUR24(__HOUR__)
#define __HAL_LOCK(__HANDLE__)
#define IS_RTC_STORE_OPERATION(__OPERATION__)
#define RTC_CR_POL
Definition: stm32f745xx.h:5837
#define RTC_ALARM_A
#define RTC_FLAG_ALRBWF
#define NULL
Definition: usbd_def.h:53
#define HAL_MAX_DELAY
#define RTC_PRER_PREDIV_S
Definition: stm32f745xx.h:5881
void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc)
ALARM A Event Callback in non blocking mode.
RTC_TimeTypeDef AlarmTime
#define RTC_TR_HT
Definition: stm32f745xx.h:5774
RTC Time structure definition.
#define RTC_FORMAT_BIN
This file contains all the functions prototypes for the HAL module driver.
#define RTC_ALRMAR_DT
Definition: stm32f745xx.h:5889
HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef *hrtc)
#define RTC_CR_BCK
Definition: stm32f745xx.h:5839
HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc)
#define RTC_TR_MNU
Definition: stm32f745xx.h:5786
#define RTC_ALRMASSR_SS
Definition: stm32f745xx.h:6088
#define RTC_TR_PM
Definition: stm32f745xx.h:5773
#define IS_RTC_OUTPUT_POL(__POL__)
__IO uint32_t TR
Definition: stm32f745xx.h:717
#define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the RTC Alarm interrupt.
void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc)
#define RTC_ISR_INIT
Definition: stm32f745xx.h:5870
#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(__WEEKDAY__)
#define RTC_DR_MU
Definition: stm32f745xx.h:5817
void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc)
uint32_t AlarmDateWeekDaySel
#define UNUSED(x)
#define RTC_DR_MT
Definition: stm32f745xx.h:5816
__IO uint32_t SSR
Definition: stm32f745xx.h:727
#define RTC_INIT_MASK
__IO uint32_t ISR
Definition: stm32f745xx.h:720
#define __HAL_RTC_ALARMA_DISABLE(__HANDLE__)
Disable the RTC ALARMA peripheral.
#define RTC_FLAG_ALRAWF
#define IS_RTC_ALARM(__ALARM__)
#define IS_RTC_DAYLIGHT_SAVING(__SAVE__)
HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
#define EXTI
Definition: stm32f745xx.h:1301
#define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the RTC Alarm interrupt.
#define IS_RTC_ALARM_SUB_SECOND_VALUE(__VALUE__)
#define IS_RTC_SECONDS(__SECONDS__)
uint8_t RTC_ByteToBcd2(uint8_t Value)
HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
__IO HAL_RTCStateTypeDef State
#define RTC_TR_MNT
Definition: stm32f745xx.h:5782
#define IS_RTC_OUTPUT(__OUTPUT__)
#define RTC_DR_WDU
Definition: stm32f745xx.h:5812
#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(__DATE__)
__IO uint32_t DR
Definition: stm32f745xx.h:718
HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc)
__IO uint32_t ALRMASSR
Definition: stm32f745xx.h:734
#define RTC_CR_BYPSHAD
Definition: stm32f745xx.h:5851
#define RTC_RSF_MASK
void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc)
RTC_InitTypeDef Init
RTC Handle Structure definition.
__IO uint32_t CALR
Definition: stm32f745xx.h:732
#define RTC_ALRMAR_MNT
Definition: stm32f745xx.h:5908
#define RTC_DR_RESERVED_MASK
#define RTC_FLAG_ALRBF
#define IS_RTC_HOURFORMAT12(__PM__)
__IO uint32_t OR
Definition: stm32f745xx.h:736
#define IS_RTC_WEEKDAY(__WEEKDAY__)
#define RTC_TR_SU
Definition: stm32f745xx.h:5795
#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__)
Enable the write protection for RTC registers.
HAL_RTCStateTypeDef
HAL State structures definition.
#define RTC_CR_FMT
Definition: stm32f745xx.h:5850
#define __HAL_RTC_ALARM_EXTI_ENABLE_IT()
Enable interrupt on the RTC Alarm associated Exti line.
HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
HAL_StatusTypeDef
HAL Status structures definition.
#define RTC_ALRMAR_HU
Definition: stm32f745xx.h:5902
uint8_t RTC_Bcd2ToByte(uint8_t Value)
#define RTC_DR_DT
Definition: stm32f745xx.h:5822
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
#define RTC_ALARMDATEWEEKDAYSEL_DATE
#define RTC_ALARM_B
#define RTC_ALARMMASK_ALL
HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm)
#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Alarm&#39;s flag status.
HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
#define RTC_CR_OSEL
Definition: stm32f745xx.h:5834
#define RTC_IT_ALRB
#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__)
Check whether the specified RTC Alarm interrupt has occurred or not.
__IO uint32_t CR
Definition: stm32f745xx.h:719
HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
RTC Alarm structure definition.
#define IS_RTC_HOUR12(__HOUR__)
#define IS_RTC_OUTPUT_TYPE(__TYPE__)
#define RTC_ISR_WUTWF
Definition: stm32f745xx.h:5875
#define RTC_ALRMAR_MNU
Definition: stm32f745xx.h:5912