STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_rtc_ex.c
Go to the documentation of this file.
1 
100 /* Includes ------------------------------------------------------------------*/
101 #include "stm32f7xx_hal.h"
102 
112 #ifdef HAL_RTC_MODULE_ENABLED
113 
114 /* Private typedef -----------------------------------------------------------*/
115 /* Private define ------------------------------------------------------------*/
116 /* Private macro -------------------------------------------------------------*/
117 /* Private variables ---------------------------------------------------------*/
118 /* Private function prototypes -----------------------------------------------*/
119 /* Private functions ---------------------------------------------------------*/
120 
159 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
160 {
161  uint32_t tmpreg = 0;
162 
163  /* Check the parameters */
164  assert_param(IS_TIMESTAMP_EDGE(TimeStampEdge));
165  assert_param(IS_RTC_TIMESTAMP_PIN(RTC_TimeStampPin));
166 
167  /* Process Locked */
168  __HAL_LOCK(hrtc);
169 
170  hrtc->State = HAL_RTC_STATE_BUSY;
171 
172  /* Get the RTC_CR register and clear the bits to be configured */
173  tmpreg = (uint32_t)(hrtc->Instance->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
174 
175  tmpreg|= TimeStampEdge;
176 
177  /* Disable the write protection for RTC registers */
179 
180  hrtc->Instance->OR &= (uint32_t)~RTC_OR_TSINSEL;
181  hrtc->Instance->OR |= (uint32_t)(RTC_TimeStampPin);
182 
183  /* Configure the Time Stamp TSEDGE and Enable bits */
184  hrtc->Instance->CR = (uint32_t)tmpreg;
185 
187 
188  /* Enable the write protection for RTC registers */
190 
191  /* Change RTC state */
192  hrtc->State = HAL_RTC_STATE_READY;
193 
194  /* Process Unlocked */
195  __HAL_UNLOCK(hrtc);
196 
197  return HAL_OK;
198 }
199 
219 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
220 {
221  uint32_t tmpreg = 0;
222 
223  /* Check the parameters */
224  assert_param(IS_TIMESTAMP_EDGE(TimeStampEdge));
225  assert_param(IS_RTC_TIMESTAMP_PIN(RTC_TimeStampPin));
226 
227  /* Process Locked */
228  __HAL_LOCK(hrtc);
229 
230  hrtc->State = HAL_RTC_STATE_BUSY;
231 
232  /* Get the RTC_CR register and clear the bits to be configured */
233  tmpreg = (uint32_t)(hrtc->Instance->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
234 
235  tmpreg |= TimeStampEdge;
236 
237  /* Disable the write protection for RTC registers */
239 
240  /* Configure the Time Stamp TSEDGE and Enable bits */
241  hrtc->Instance->CR = (uint32_t)tmpreg;
242 
243  hrtc->Instance->OR &= (uint32_t)~RTC_OR_TSINSEL;
244  hrtc->Instance->OR |= (uint32_t)(RTC_TimeStampPin);
245 
247 
248  /* Enable IT timestamp */
250 
251  /* RTC timestamp Interrupt Configuration: EXTI configuration */
253 
255 
256  /* Enable the write protection for RTC registers */
258 
259  hrtc->State = HAL_RTC_STATE_READY;
260 
261  /* Process Unlocked */
262  __HAL_UNLOCK(hrtc);
263 
264  return HAL_OK;
265 }
266 
274 {
275  uint32_t tmpreg = 0;
276 
277  /* Process Locked */
278  __HAL_LOCK(hrtc);
279 
280  hrtc->State = HAL_RTC_STATE_BUSY;
281 
282  /* Disable the write protection for RTC registers */
284 
285  /* In case of interrupt mode is used, the interrupt source must disabled */
287 
288  /* Get the RTC_CR register and clear the bits to be configured */
289  tmpreg = (uint32_t)(hrtc->Instance->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
290 
291  /* Configure the Time Stamp TSEDGE and Enable bits */
292  hrtc->Instance->CR = (uint32_t)tmpreg;
293 
294  /* Enable the write protection for RTC registers */
296 
297  hrtc->State = HAL_RTC_STATE_READY;
298 
299  /* Process Unlocked */
300  __HAL_UNLOCK(hrtc);
301 
302  return HAL_OK;
303 }
304 
313 {
314  /* Process Locked */
315  __HAL_LOCK(hrtc);
316 
317  hrtc->State = HAL_RTC_STATE_BUSY;
318 
319  /* Disable the write protection for RTC registers */
321 
322  /* Configure the internal Time Stamp Enable bits */
324 
325  /* Enable the write protection for RTC registers */
327 
328  /* Change RTC state */
329  hrtc->State = HAL_RTC_STATE_READY;
330 
331  /* Process Unlocked */
332  __HAL_UNLOCK(hrtc);
333 
334  return HAL_OK;
335 }
336 
344 {
345  /* Process Locked */
346  __HAL_LOCK(hrtc);
347 
348  hrtc->State = HAL_RTC_STATE_BUSY;
349 
350  /* Disable the write protection for RTC registers */
352 
353  /* Configure the internal Time Stamp Enable bits */
355 
356  /* Enable the write protection for RTC registers */
358 
359  hrtc->State = HAL_RTC_STATE_READY;
360 
361  /* Process Unlocked */
362  __HAL_UNLOCK(hrtc);
363 
364  return HAL_OK;
365 }
366 
379 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef* sTimeStamp, RTC_DateTypeDef* sTimeStampDate, uint32_t Format)
380 {
381  uint32_t tmptime = 0, tmpdate = 0;
382 
383  /* Check the parameters */
384  assert_param(IS_RTC_FORMAT(Format));
385 
386  /* Get the TimeStamp time and date registers values */
387  tmptime = (uint32_t)(hrtc->Instance->TSTR & RTC_TR_RESERVED_MASK);
388  tmpdate = (uint32_t)(hrtc->Instance->TSDR & RTC_DR_RESERVED_MASK);
389 
390  /* Fill the Time structure fields with the read parameters */
391  sTimeStamp->Hours = (uint8_t)((tmptime & (RTC_TR_HT | RTC_TR_HU)) >> 16);
392  sTimeStamp->Minutes = (uint8_t)((tmptime & (RTC_TR_MNT | RTC_TR_MNU)) >> 8);
393  sTimeStamp->Seconds = (uint8_t)(tmptime & (RTC_TR_ST | RTC_TR_SU));
394  sTimeStamp->TimeFormat = (uint8_t)((tmptime & (RTC_TR_PM)) >> 16);
395  sTimeStamp->SubSeconds = (uint32_t) hrtc->Instance->TSSSR;
396 
397  /* Fill the Date structure fields with the read parameters */
398  sTimeStampDate->Year = 0;
399  sTimeStampDate->Month = (uint8_t)((tmpdate & (RTC_DR_MT | RTC_DR_MU)) >> 8);
400  sTimeStampDate->Date = (uint8_t)(tmpdate & (RTC_DR_DT | RTC_DR_DU));
401  sTimeStampDate->WeekDay = (uint8_t)((tmpdate & (RTC_DR_WDU)) >> 13);
402 
403  /* Check the input parameters format */
404  if(Format == RTC_FORMAT_BIN)
405  {
406  /* Convert the TimeStamp structure parameters to Binary format */
407  sTimeStamp->Hours = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Hours);
408  sTimeStamp->Minutes = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Minutes);
409  sTimeStamp->Seconds = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Seconds);
410 
411  /* Convert the DateTimeStamp structure parameters to Binary format */
412  sTimeStampDate->Month = (uint8_t)RTC_Bcd2ToByte(sTimeStampDate->Month);
413  sTimeStampDate->Date = (uint8_t)RTC_Bcd2ToByte(sTimeStampDate->Date);
414  sTimeStampDate->WeekDay = (uint8_t)RTC_Bcd2ToByte(sTimeStampDate->WeekDay);
415  }
416 
417  /* Clear the TIMESTAMP Flag */
419 
420  return HAL_OK;
421 }
422 
432 {
433  uint32_t tmpreg = 0;
434 
435  /* Check the parameters */
436  assert_param(IS_RTC_TAMPER(sTamper->Tamper));
445 
446  /* Process Locked */
447  __HAL_LOCK(hrtc);
448 
449  hrtc->State = HAL_RTC_STATE_BUSY;
450 
451  if(sTamper->Trigger != RTC_TAMPERTRIGGER_RISINGEDGE)
452  {
453  sTamper->Trigger = (uint32_t)(sTamper->Tamper << 1);
454  }
455 
457  {
458  sTamper->NoErase = 0;
459  if((sTamper->Tamper & RTC_TAMPER_1) != 0)
460  {
461  sTamper->NoErase |= RTC_TAMPCR_TAMP1NOERASE;
462  }
463  if((sTamper->Tamper & RTC_TAMPER_2) != 0)
464  {
465  sTamper->NoErase |= RTC_TAMPCR_TAMP2NOERASE;
466  }
467  if((sTamper->Tamper & RTC_TAMPER_3) != 0)
468  {
469  sTamper->NoErase |= RTC_TAMPCR_TAMP3NOERASE;
470  }
471  }
472 
473  if(sTamper->MaskFlag != RTC_TAMPERMASK_FLAG_DISABLE)
474  {
475  sTamper->MaskFlag = 0;
476  if((sTamper->Tamper & RTC_TAMPER_1) != 0)
477  {
478  sTamper->MaskFlag |= RTC_TAMPCR_TAMP1MF;
479  }
480  if((sTamper->Tamper & RTC_TAMPER_2) != 0)
481  {
482  sTamper->MaskFlag |= RTC_TAMPCR_TAMP2MF;
483  }
484  if((sTamper->Tamper & RTC_TAMPER_3) != 0)
485  {
486  sTamper->MaskFlag |= RTC_TAMPCR_TAMP3MF;
487  }
488  }
489 
490  tmpreg = ((uint32_t)sTamper->Tamper | (uint32_t)sTamper->Trigger | (uint32_t)sTamper->NoErase |\
491  (uint32_t)sTamper->MaskFlag | (uint32_t)sTamper->Filter | (uint32_t)sTamper->SamplingFrequency |\
492  (uint32_t)sTamper->PrechargeDuration | (uint32_t)sTamper->TamperPullUp | sTamper->TimeStampOnTamperDetection);
493 
494  hrtc->Instance->TAMPCR &= (uint32_t)~((uint32_t)sTamper->Tamper | (uint32_t)(sTamper->Tamper << 1) | (uint32_t)RTC_TAMPCR_TAMPTS |\
495  (uint32_t)RTC_TAMPCR_TAMPFREQ | (uint32_t)RTC_TAMPCR_TAMPFLT | (uint32_t)RTC_TAMPCR_TAMPPRCH |\
496  (uint32_t)RTC_TAMPCR_TAMPPUDIS | (uint32_t)RTC_TAMPCR_TAMPIE | (uint32_t)RTC_TAMPCR_TAMP1IE |\
497  (uint32_t)RTC_TAMPCR_TAMP2IE | (uint32_t)RTC_TAMPCR_TAMP3IE | (uint32_t)RTC_TAMPCR_TAMP1NOERASE |\
498  (uint32_t)RTC_TAMPCR_TAMP2NOERASE | (uint32_t)RTC_TAMPCR_TAMP3NOERASE | (uint32_t)RTC_TAMPCR_TAMP1MF |\
499  (uint32_t)RTC_TAMPCR_TAMP2MF | (uint32_t)RTC_TAMPCR_TAMP3MF);
500 
501  hrtc->Instance->TAMPCR |= tmpreg;
502 
503  hrtc->State = HAL_RTC_STATE_READY;
504 
505  /* Process Unlocked */
506  __HAL_UNLOCK(hrtc);
507 
508  return HAL_OK;
509 }
510 
520 {
521  uint32_t tmpreg = 0;
522 
523  /* Check the parameters */
524  assert_param(IS_RTC_TAMPER(sTamper->Tamper));
534 
535  /* Process Locked */
536  __HAL_LOCK(hrtc);
537 
538  hrtc->State = HAL_RTC_STATE_BUSY;
539 
540  /* Configure the tamper trigger */
541  if(sTamper->Trigger != RTC_TAMPERTRIGGER_RISINGEDGE)
542  {
543  sTamper->Trigger = (uint32_t)(sTamper->Tamper << 1);
544  }
545 
547  {
548  sTamper->NoErase = 0;
549  if((sTamper->Tamper & RTC_TAMPER_1) != 0)
550  {
551  sTamper->NoErase |= RTC_TAMPCR_TAMP1NOERASE;
552  }
553  if((sTamper->Tamper & RTC_TAMPER_2) != 0)
554  {
555  sTamper->NoErase |= RTC_TAMPCR_TAMP2NOERASE;
556  }
557  if((sTamper->Tamper & RTC_TAMPER_3) != 0)
558  {
559  sTamper->NoErase |= RTC_TAMPCR_TAMP3NOERASE;
560  }
561  }
562 
563  if(sTamper->MaskFlag != RTC_TAMPERMASK_FLAG_DISABLE)
564  {
565  sTamper->MaskFlag = 0;
566  if((sTamper->Tamper & RTC_TAMPER_1) != 0)
567  {
568  sTamper->MaskFlag |= RTC_TAMPCR_TAMP1MF;
569  }
570  if((sTamper->Tamper & RTC_TAMPER_2) != 0)
571  {
572  sTamper->MaskFlag |= RTC_TAMPCR_TAMP2MF;
573  }
574  if((sTamper->Tamper & RTC_TAMPER_3) != 0)
575  {
576  sTamper->MaskFlag |= RTC_TAMPCR_TAMP3MF;
577  }
578  }
579 
580  tmpreg = ((uint32_t)sTamper->Tamper | (uint32_t)sTamper->Interrupt | (uint32_t)sTamper->Trigger | (uint32_t)sTamper->NoErase |\
581  (uint32_t)sTamper->MaskFlag | (uint32_t)sTamper->Filter | (uint32_t)sTamper->SamplingFrequency |\
582  (uint32_t)sTamper->PrechargeDuration | (uint32_t)sTamper->TamperPullUp | sTamper->TimeStampOnTamperDetection);
583 
584  hrtc->Instance->TAMPCR &= (uint32_t)~((uint32_t)sTamper->Tamper | (uint32_t)(sTamper->Tamper << 1) | (uint32_t)RTC_TAMPCR_TAMPTS |\
585  (uint32_t)RTC_TAMPCR_TAMPFREQ | (uint32_t)RTC_TAMPCR_TAMPFLT | (uint32_t)RTC_TAMPCR_TAMPPRCH |\
586  (uint32_t)RTC_TAMPCR_TAMPPUDIS | (uint32_t)RTC_TAMPCR_TAMPIE | (uint32_t)RTC_TAMPCR_TAMP1IE |\
587  (uint32_t)RTC_TAMPCR_TAMP2IE | (uint32_t)RTC_TAMPCR_TAMP3IE | (uint32_t)RTC_TAMPCR_TAMP1NOERASE |\
588  (uint32_t)RTC_TAMPCR_TAMP2NOERASE | (uint32_t)RTC_TAMPCR_TAMP3NOERASE | (uint32_t)RTC_TAMPCR_TAMP1MF |\
589  (uint32_t)RTC_TAMPCR_TAMP2MF | (uint32_t)RTC_TAMPCR_TAMP3MF);
590 
591  hrtc->Instance->TAMPCR |= tmpreg;
592 
593  /* RTC Tamper Interrupt Configuration: EXTI configuration */
595 
597 
598  hrtc->State = HAL_RTC_STATE_READY;
599 
600  /* Process Unlocked */
601  __HAL_UNLOCK(hrtc);
602 
603  return HAL_OK;
604 }
605 
615 {
616  assert_param(IS_RTC_TAMPER(Tamper));
617 
618  /* Process Locked */
619  __HAL_LOCK(hrtc);
620 
621  hrtc->State = HAL_RTC_STATE_BUSY;
622 
623 /* Disable the selected Tamper pin */
624  hrtc->Instance->TAMPCR &= (uint32_t)~Tamper;
625 
626  if ((Tamper & RTC_TAMPER_1) != 0)
627  {
628  /* Disable the Tamper1 interrupt */
629  hrtc->Instance->TAMPCR &= (uint32_t)~(RTC_IT_TAMP | RTC_IT_TAMP1);
630  }
631  if ((Tamper & RTC_TAMPER_2) != 0)
632  {
633  /* Disable the Tamper2 interrupt */
634  hrtc->Instance->TAMPCR &= (uint32_t)~(RTC_IT_TAMP | RTC_IT_TAMP2);
635  }
636  if ((Tamper & RTC_TAMPER_3) != 0)
637  {
638  /* Disable the Tamper2 interrupt */
639  hrtc->Instance->TAMPCR &= (uint32_t)~(RTC_IT_TAMP | RTC_IT_TAMP3);
640  }
641 
642  hrtc->State = HAL_RTC_STATE_READY;
643 
644  /* Process Unlocked */
645  __HAL_UNLOCK(hrtc);
646 
647  return HAL_OK;
648 }
649 
657 {
659  {
660  /* Get the status of the Interrupt */
661  if((uint32_t)(hrtc->Instance->CR & RTC_IT_TS) != (uint32_t)RESET)
662  {
663  /* TIMESTAMP callback */
665 
666  /* Clear the TIMESTAMP interrupt pending bit */
668  }
669  }
670 
671  /* Get the status of the Interrupt */
673  {
674  /* Get the TAMPER Interrupt enable bit and pending bit */
675  if((((hrtc->Instance->TAMPCR & RTC_TAMPCR_TAMPIE)) != (uint32_t)RESET) || \
676  (((hrtc->Instance->TAMPCR & RTC_TAMPCR_TAMP1IE)) != (uint32_t)RESET))
677  {
678  /* Tamper callback */
680 
681  /* Clear the Tamper interrupt pending bit */
683  }
684  }
685 
686  /* Get the status of the Interrupt */
688  {
689  /* Get the TAMPER Interrupt enable bit and pending bit */
690  if((((hrtc->Instance->TAMPCR & RTC_TAMPCR_TAMPIE)) != (uint32_t)RESET) || \
691  (((hrtc->Instance->TAMPCR & RTC_TAMPCR_TAMP2IE)) != (uint32_t)RESET))
692  {
693  /* Tamper callback */
695 
696  /* Clear the Tamper interrupt pending bit */
698  }
699  }
700 
701  /* Get the status of the Interrupt */
703  {
704  /* Get the TAMPER Interrupt enable bit and pending bit */
705  if((((hrtc->Instance->TAMPCR & RTC_TAMPCR_TAMPIE)) != (uint32_t)RESET) || \
706  (((hrtc->Instance->TAMPCR & RTC_TAMPCR_TAMP3IE)) != (uint32_t)RESET))
707  {
708  /* Tamper callback */
710 
711  /* Clear the Tamper interrupt pending bit */
713  }
714  }
715 
716  /* Clear the EXTI's Flag for RTC TimeStamp and Tamper */
718 
719  /* Change RTC state */
720  hrtc->State = HAL_RTC_STATE_READY;
721 }
722 
730 {
731  /* Prevent unused argument(s) compilation warning */
732  UNUSED(hrtc);
733 
734  /* NOTE : This function Should not be modified, when the callback is needed,
735  the HAL_RTC_TimeStampEventCallback could be implemented in the user file
736  */
737 }
738 
746 {
747  /* Prevent unused argument(s) compilation warning */
748  UNUSED(hrtc);
749 
750  /* NOTE : This function Should not be modified, when the callback is needed,
751  the HAL_RTC_Tamper1EventCallback could be implemented in the user file
752  */
753 }
754 
762 {
763  /* Prevent unused argument(s) compilation warning */
764  UNUSED(hrtc);
765 
766  /* NOTE : This function Should not be modified, when the callback is needed,
767  the HAL_RTC_Tamper2EventCallback could be implemented in the user file
768  */
769 }
770 
777 {
778  /* Prevent unused argument(s) compilation warning */
779  UNUSED(hrtc);
780 
781  /* NOTE : This function Should not be modified, when the callback is needed,
782  the HAL_RTCEx_Tamper3EventCallback could be implemented in the user file
783  */
784 }
785 
794 {
795  uint32_t tickstart = 0;
796 
797  /* Get tick */
798  tickstart = HAL_GetTick();
799 
801  {
802  if(Timeout != HAL_MAX_DELAY)
803  {
804  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
805  {
807  return HAL_TIMEOUT;
808  }
809  }
810  }
811 
813  {
814  /* Clear the TIMESTAMP OverRun Flag */
816 
817  /* Change TIMESTAMP state */
818  hrtc->State = HAL_RTC_STATE_ERROR;
819 
820  return HAL_ERROR;
821  }
822 
823  /* Change RTC state */
824  hrtc->State = HAL_RTC_STATE_READY;
825 
826  return HAL_OK;
827 }
828 
837 {
838  uint32_t tickstart = 0;
839 
840  /* Get tick */
841  tickstart = HAL_GetTick();
842 
843  /* Get the status of the Interrupt */
845  {
846  if(Timeout != HAL_MAX_DELAY)
847  {
848  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
849  {
851  return HAL_TIMEOUT;
852  }
853  }
854  }
855 
856  /* Clear the Tamper Flag */
858 
859  /* Change RTC state */
860  hrtc->State = HAL_RTC_STATE_READY;
861 
862  return HAL_OK;
863 }
864 
873 {
874  uint32_t tickstart = 0;
875 
876  /* Get tick */
877  tickstart = HAL_GetTick();
878 
879  /* Get the status of the Interrupt */
881  {
882  if(Timeout != HAL_MAX_DELAY)
883  {
884  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
885  {
887  return HAL_TIMEOUT;
888  }
889  }
890  }
891 
892  /* Clear the Tamper Flag */
894 
895  /* Change RTC state */
896  hrtc->State = HAL_RTC_STATE_READY;
897 
898  return HAL_OK;
899 }
900 
908 {
909  uint32_t tickstart = HAL_GetTick();
910 
911  /* Get the status of the Interrupt */
913  {
914  if(Timeout != HAL_MAX_DELAY)
915  {
916  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
917  {
919  return HAL_TIMEOUT;
920  }
921  }
922  }
923 
924  /* Clear the Tamper Flag */
926 
927  /* Change RTC state */
928  hrtc->State = HAL_RTC_STATE_READY;
929 
930  return HAL_OK;
931 }
932 
959 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
960 {
961  uint32_t tickstart = 0;
962 
963  /* Check the parameters */
964  assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock));
965  assert_param(IS_RTC_WAKEUP_COUNTER(WakeUpCounter));
966 
967  /* Process Locked */
968  __HAL_LOCK(hrtc);
969 
970  hrtc->State = HAL_RTC_STATE_BUSY;
971 
972  /* Disable the write protection for RTC registers */
974 
976 
977  /* Get tick */
978  tickstart = HAL_GetTick();
979 
980  /*Check RTC WUTWF flag is reset only when wake up timer enabled*/
981  if((hrtc->Instance->CR & RTC_CR_WUTE) != RESET)
982  {
983  /* Wait till RTC WUTWF flag is set and if Time out is reached exit */
985  {
986  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
987  {
988  /* Enable the write protection for RTC registers */
990 
991  hrtc->State = HAL_RTC_STATE_TIMEOUT;
992 
993  /* Process Unlocked */
994  __HAL_UNLOCK(hrtc);
995 
996  return HAL_TIMEOUT;
997  }
998  }
999  }
1000 
1001  /* Clear the Wakeup Timer clock source bits in CR register */
1002  hrtc->Instance->CR &= (uint32_t)~RTC_CR_WUCKSEL;
1003 
1004  /* Configure the clock source */
1005  hrtc->Instance->CR |= (uint32_t)WakeUpClock;
1006 
1007  /* Configure the Wakeup Timer counter */
1008  hrtc->Instance->WUTR = (uint32_t)WakeUpCounter;
1009 
1010  /* Enable the Wakeup Timer */
1012 
1013  /* Enable the write protection for RTC registers */
1015 
1016  hrtc->State = HAL_RTC_STATE_READY;
1017 
1018  /* Process Unlocked */
1019  __HAL_UNLOCK(hrtc);
1020 
1021  return HAL_OK;
1022 }
1023 
1032 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
1033 {
1034  uint32_t tickstart = 0;
1035 
1036  /* Check the parameters */
1037  assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock));
1038  assert_param(IS_RTC_WAKEUP_COUNTER(WakeUpCounter));
1039 
1040  /* Process Locked */
1041  __HAL_LOCK(hrtc);
1042 
1043  hrtc->State = HAL_RTC_STATE_BUSY;
1044 
1045  /* Disable the write protection for RTC registers */
1047 
1049 
1050  /* Get tick */
1051  tickstart = HAL_GetTick();
1052 
1053  /*Check RTC WUTWF flag is reset only when wake up timer enabled*/
1054  if((hrtc->Instance->CR & RTC_CR_WUTE) != RESET)
1055  {
1056  /* Wait till RTC WUTWF flag is set and if Time out is reached exit */
1058  {
1059  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1060  {
1061  /* Enable the write protection for RTC registers */
1063 
1064  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1065 
1066  /* Process Unlocked */
1067  __HAL_UNLOCK(hrtc);
1068 
1069  return HAL_TIMEOUT;
1070  }
1071  }
1072  }
1073 
1074  /* Configure the Wakeup Timer counter */
1075  hrtc->Instance->WUTR = (uint32_t)WakeUpCounter;
1076 
1077  /* Clear the Wakeup Timer clock source bits in CR register */
1078  hrtc->Instance->CR &= (uint32_t)~RTC_CR_WUCKSEL;
1079 
1080  /* Configure the clock source */
1081  hrtc->Instance->CR |= (uint32_t)WakeUpClock;
1082 
1083  /* RTC WakeUpTimer Interrupt Configuration: EXTI configuration */
1085 
1087 
1088  /* Configure the Interrupt in the RTC_CR register */
1090 
1091  /* Enable the Wakeup Timer */
1093 
1094  /* Enable the write protection for RTC registers */
1096 
1097  hrtc->State = HAL_RTC_STATE_READY;
1098 
1099  /* Process Unlocked */
1100  __HAL_UNLOCK(hrtc);
1101 
1102  return HAL_OK;
1103 }
1104 
1112 {
1113  uint32_t tickstart = 0;
1114 
1115  /* Process Locked */
1116  __HAL_LOCK(hrtc);
1117 
1118  hrtc->State = HAL_RTC_STATE_BUSY;
1119 
1120  /* Disable the write protection for RTC registers */
1122 
1123  /* Disable the Wakeup Timer */
1125 
1126  /* In case of interrupt mode is used, the interrupt source must disabled */
1128 
1129  /* Get tick */
1130  tickstart = HAL_GetTick();
1131 
1132  /* Wait till RTC WUTWF flag is set and if Time out is reached exit */
1134  {
1135  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1136  {
1137  /* Enable the write protection for RTC registers */
1139 
1140  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1141 
1142  /* Process Unlocked */
1143  __HAL_UNLOCK(hrtc);
1144 
1145  return HAL_TIMEOUT;
1146  }
1147  }
1148 
1149  /* Enable the write protection for RTC registers */
1151 
1152  hrtc->State = HAL_RTC_STATE_READY;
1153 
1154  /* Process Unlocked */
1155  __HAL_UNLOCK(hrtc);
1156 
1157  return HAL_OK;
1158 }
1159 
1167 {
1168  /* Get the counter value */
1169  return ((uint32_t)(hrtc->Instance->WUTR & RTC_WUTR_WUT));
1170 }
1171 
1179 {
1181  {
1182  /* Get the status of the Interrupt */
1183  if((uint32_t)(hrtc->Instance->CR & RTC_IT_WUT) != (uint32_t)RESET)
1184  {
1185  /* WAKEUPTIMER callback */
1187 
1188  /* Clear the WAKEUPTIMER interrupt pending bit */
1190  }
1191  }
1192 
1193  /* Clear the EXTI's line Flag for RTC WakeUpTimer */
1195 
1196  /* Change RTC state */
1197  hrtc->State = HAL_RTC_STATE_READY;
1198 }
1199 
1207 {
1208  /* Prevent unused argument(s) compilation warning */
1209  UNUSED(hrtc);
1210 
1211  /* NOTE : This function Should not be modified, when the callback is needed,
1212  the HAL_RTC_WakeUpTimerEventCallback could be implemented in the user file
1213  */
1214 }
1215 
1224 {
1225  uint32_t tickstart = 0;
1226 
1227  /* Get tick */
1228  tickstart = HAL_GetTick();
1229 
1231  {
1232  if(Timeout != HAL_MAX_DELAY)
1233  {
1234  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
1235  {
1236  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1237 
1238  return HAL_TIMEOUT;
1239  }
1240  }
1241  }
1242 
1243  /* Clear the WAKEUPTIMER Flag */
1245 
1246  /* Change RTC state */
1247  hrtc->State = HAL_RTC_STATE_READY;
1248 
1249  return HAL_OK;
1250 }
1251 
1293 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
1294 {
1295  uint32_t tmp = 0;
1296 
1297  /* Check the parameters */
1298  assert_param(IS_RTC_BKP(BackupRegister));
1299 
1300  tmp = (uint32_t)&(hrtc->Instance->BKP0R);
1301  tmp += (BackupRegister * 4);
1302 
1303  /* Write the specified register */
1304  *(__IO uint32_t *)tmp = (uint32_t)Data;
1305 }
1306 
1316 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
1317 {
1318  uint32_t tmp = 0;
1319 
1320  /* Check the parameters */
1321  assert_param(IS_RTC_BKP(BackupRegister));
1322 
1323  tmp = (uint32_t)&(hrtc->Instance->BKP0R);
1324  tmp += (BackupRegister * 4);
1325 
1326  /* Read the specified register */
1327  return (*(__IO uint32_t *)tmp);
1328 }
1329 
1350 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef* hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue)
1351 {
1352  uint32_t tickstart = 0;
1353 
1354  /* Check the parameters */
1355  assert_param(IS_RTC_SMOOTH_CALIB_PERIOD(SmoothCalibPeriod));
1356  assert_param(IS_RTC_SMOOTH_CALIB_PLUS(SmoothCalibPlusPulses));
1357  assert_param(IS_RTC_SMOOTH_CALIB_MINUS(SmouthCalibMinusPulsesValue));
1358 
1359  /* Process Locked */
1360  __HAL_LOCK(hrtc);
1361 
1362  hrtc->State = HAL_RTC_STATE_BUSY;
1363 
1364  /* Disable the write protection for RTC registers */
1366 
1367  /* check if a calibration is pending*/
1368  if((hrtc->Instance->ISR & RTC_ISR_RECALPF) != RESET)
1369  {
1370  /* Get tick */
1371  tickstart = HAL_GetTick();
1372 
1373  /* check if a calibration is pending*/
1374  while((hrtc->Instance->ISR & RTC_ISR_RECALPF) != RESET)
1375  {
1376  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1377  {
1378  /* Enable the write protection for RTC registers */
1380 
1381  /* Change RTC state */
1382  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1383 
1384  /* Process Unlocked */
1385  __HAL_UNLOCK(hrtc);
1386 
1387  return HAL_TIMEOUT;
1388  }
1389  }
1390  }
1391 
1392  /* Configure the Smooth calibration settings */
1393  hrtc->Instance->CALR = (uint32_t)((uint32_t)SmoothCalibPeriod | (uint32_t)SmoothCalibPlusPulses | (uint32_t)SmouthCalibMinusPulsesValue);
1394 
1395  /* Enable the write protection for RTC registers */
1397 
1398  /* Change RTC state */
1399  hrtc->State = HAL_RTC_STATE_READY;
1400 
1401  /* Process Unlocked */
1402  __HAL_UNLOCK(hrtc);
1403 
1404  return HAL_OK;
1405 }
1406 
1420 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef* hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
1421 {
1422  uint32_t tickstart = 0;
1423 
1424  /* Check the parameters */
1425  assert_param(IS_RTC_SHIFT_ADD1S(ShiftAdd1S));
1426  assert_param(IS_RTC_SHIFT_SUBFS(ShiftSubFS));
1427 
1428  /* Process Locked */
1429  __HAL_LOCK(hrtc);
1430 
1431  hrtc->State = HAL_RTC_STATE_BUSY;
1432 
1433  /* Disable the write protection for RTC registers */
1435 
1436  /* Get tick */
1437  tickstart = HAL_GetTick();
1438 
1439  /* Wait until the shift is completed*/
1440  while((hrtc->Instance->ISR & RTC_ISR_SHPF) != RESET)
1441  {
1442  if((HAL_GetTick() - tickstart ) > RTC_TIMEOUT_VALUE)
1443  {
1444  /* Enable the write protection for RTC registers */
1446 
1447  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1448 
1449  /* Process Unlocked */
1450  __HAL_UNLOCK(hrtc);
1451 
1452  return HAL_TIMEOUT;
1453  }
1454  }
1455 
1456  /* Check if the reference clock detection is disabled */
1457  if((hrtc->Instance->CR & RTC_CR_REFCKON) == RESET)
1458  {
1459  /* Configure the Shift settings */
1460  hrtc->Instance->SHIFTR = (uint32_t)(uint32_t)(ShiftSubFS) | (uint32_t)(ShiftAdd1S);
1461 
1462  /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
1463  if((hrtc->Instance->CR & RTC_CR_BYPSHAD) == RESET)
1464  {
1465  if(HAL_RTC_WaitForSynchro(hrtc) != HAL_OK)
1466  {
1467  /* Enable the write protection for RTC registers */
1469 
1470  hrtc->State = HAL_RTC_STATE_ERROR;
1471 
1472  /* Process Unlocked */
1473  __HAL_UNLOCK(hrtc);
1474 
1475  return HAL_ERROR;
1476  }
1477  }
1478  }
1479  else
1480  {
1481  /* Enable the write protection for RTC registers */
1483 
1484  /* Change RTC state */
1485  hrtc->State = HAL_RTC_STATE_ERROR;
1486 
1487  /* Process Unlocked */
1488  __HAL_UNLOCK(hrtc);
1489 
1490  return HAL_ERROR;
1491  }
1492 
1493  /* Enable the write protection for RTC registers */
1495 
1496  /* Change RTC state */
1497  hrtc->State = HAL_RTC_STATE_READY;
1498 
1499  /* Process Unlocked */
1500  __HAL_UNLOCK(hrtc);
1501 
1502  return HAL_OK;
1503 }
1504 
1516 {
1517  /* Check the parameters */
1518  assert_param(IS_RTC_CALIB_OUTPUT(CalibOutput));
1519 
1520  /* Process Locked */
1521  __HAL_LOCK(hrtc);
1522 
1523  hrtc->State = HAL_RTC_STATE_BUSY;
1524 
1525  /* Disable the write protection for RTC registers */
1527 
1528  /* Clear flags before config */
1529  hrtc->Instance->CR &= (uint32_t)~RTC_CR_COSEL;
1530 
1531  /* Configure the RTC_CR register */
1532  hrtc->Instance->CR |= (uint32_t)CalibOutput;
1533 
1535 
1536  /* Enable the write protection for RTC registers */
1538 
1539  /* Change RTC state */
1540  hrtc->State = HAL_RTC_STATE_READY;
1541 
1542  /* Process Unlocked */
1543  __HAL_UNLOCK(hrtc);
1544 
1545  return HAL_OK;
1546 }
1547 
1555 {
1556  /* Process Locked */
1557  __HAL_LOCK(hrtc);
1558 
1559  hrtc->State = HAL_RTC_STATE_BUSY;
1560 
1561  /* Disable the write protection for RTC registers */
1563 
1565 
1566  /* Enable the write protection for RTC registers */
1568 
1569  /* Change RTC state */
1570  hrtc->State = HAL_RTC_STATE_READY;
1571 
1572  /* Process Unlocked */
1573  __HAL_UNLOCK(hrtc);
1574 
1575  return HAL_OK;
1576 }
1577 
1585 {
1586  /* Process Locked */
1587  __HAL_LOCK(hrtc);
1588 
1589  hrtc->State = HAL_RTC_STATE_BUSY;
1590 
1591  /* Disable the write protection for RTC registers */
1593 
1594  /* Set Initialization mode */
1595  if(RTC_EnterInitMode(hrtc) != HAL_OK)
1596  {
1597  /* Enable the write protection for RTC registers */
1599 
1600  /* Set RTC state*/
1601  hrtc->State = HAL_RTC_STATE_ERROR;
1602 
1603  /* Process Unlocked */
1604  __HAL_UNLOCK(hrtc);
1605 
1606  return HAL_ERROR;
1607  }
1608  else
1609  {
1611 
1612  /* Exit Initialization mode */
1613  hrtc->Instance->ISR &= (uint32_t)~RTC_ISR_INIT;
1614  }
1615 
1616  /* Enable the write protection for RTC registers */
1618 
1619  /* Change RTC state */
1620  hrtc->State = HAL_RTC_STATE_READY;
1621 
1622  /* Process Unlocked */
1623  __HAL_UNLOCK(hrtc);
1624 
1625  return HAL_OK;
1626 }
1627 
1635 {
1636  /* Process Locked */
1637  __HAL_LOCK(hrtc);
1638 
1639  hrtc->State = HAL_RTC_STATE_BUSY;
1640 
1641  /* Disable the write protection for RTC registers */
1643 
1644  /* Set Initialization mode */
1645  if(RTC_EnterInitMode(hrtc) != HAL_OK)
1646  {
1647  /* Enable the write protection for RTC registers */
1649 
1650  /* Set RTC state*/
1651  hrtc->State = HAL_RTC_STATE_ERROR;
1652 
1653  /* Process Unlocked */
1654  __HAL_UNLOCK(hrtc);
1655 
1656  return HAL_ERROR;
1657  }
1658  else
1659  {
1661 
1662  /* Exit Initialization mode */
1663  hrtc->Instance->ISR &= (uint32_t)~RTC_ISR_INIT;
1664  }
1665 
1666  /* Enable the write protection for RTC registers */
1668 
1669  /* Change RTC state */
1670  hrtc->State = HAL_RTC_STATE_READY;
1671 
1672  /* Process Unlocked */
1673  __HAL_UNLOCK(hrtc);
1674 
1675  return HAL_OK;
1676 }
1677 
1687 {
1688  /* Process Locked */
1689  __HAL_LOCK(hrtc);
1690 
1691  hrtc->State = HAL_RTC_STATE_BUSY;
1692 
1693  /* Disable the write protection for RTC registers */
1695 
1696  /* Set the BYPSHAD bit */
1697  hrtc->Instance->CR |= (uint8_t)RTC_CR_BYPSHAD;
1698 
1699  /* Enable the write protection for RTC registers */
1701 
1702  /* Change RTC state */
1703  hrtc->State = HAL_RTC_STATE_READY;
1704 
1705  /* Process Unlocked */
1706  __HAL_UNLOCK(hrtc);
1707 
1708  return HAL_OK;
1709 }
1710 
1720 {
1721  /* Process Locked */
1722  __HAL_LOCK(hrtc);
1723 
1724  hrtc->State = HAL_RTC_STATE_BUSY;
1725 
1726  /* Disable the write protection for RTC registers */
1728 
1729  /* Reset the BYPSHAD bit */
1730  hrtc->Instance->CR &= (uint8_t)~RTC_CR_BYPSHAD;
1731 
1732  /* Enable the write protection for RTC registers */
1734 
1735  /* Change RTC state */
1736  hrtc->State = HAL_RTC_STATE_READY;
1737 
1738  /* Process Unlocked */
1739  __HAL_UNLOCK(hrtc);
1740 
1741  return HAL_OK;
1742 }
1743 
1770 {
1771  /* Prevent unused argument(s) compilation warning */
1772  UNUSED(hrtc);
1773 
1774  /* NOTE : This function Should not be modified, when the callback is needed,
1775  the HAL_RTC_AlarmBEventCallback could be implemented in the user file
1776  */
1777 }
1778 
1787 {
1788  uint32_t tickstart = 0;
1789 
1790  /* Get tick */
1791  tickstart = HAL_GetTick();
1792 
1794  {
1795  if(Timeout != HAL_MAX_DELAY)
1796  {
1797  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
1798  {
1799  hrtc->State = HAL_RTC_STATE_TIMEOUT;
1800  return HAL_TIMEOUT;
1801  }
1802  }
1803  }
1804 
1805  /* Clear the Alarm Flag */
1807 
1808  /* Change RTC state */
1809  hrtc->State = HAL_RTC_STATE_READY;
1810 
1811  return HAL_OK;
1812 }
1813 
1822 #endif /* HAL_RTC_MODULE_ENABLED */
1823 
1831 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Alarm&#39;s pending flags.
RTC_TypeDef * Instance
#define RTC_TAMPCR_TAMP3MF
Definition: stm32f745xx.h:6048
#define RTC_TAMPER_1
#define RTC_IT_TAMP
#define RTC_TIMEOUT_VALUE
#define IS_RTC_FORMAT(__FORMAT__)
#define __HAL_RTC_INTERNAL_TIMESTAMP_DISABLE(__HANDLE__)
Disable the RTC internal TimeStamp peripheral.
#define RTC_IT_TAMP2
#define IS_RTC_SHIFT_ADD1S(__SEL__)
#define RTC_TAMPCR_TAMP2NOERASE
Definition: stm32f745xx.h:6052
#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__)
Disable the write protection for RTC registers.
#define RTC_IT_TAMP1
#define IS_RTC_TIMESTAMP_PIN(__PIN__)
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
#define RTC_FLAG_TSF
#define RTC_IT_WUT
HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef *hrtc)
__IO uint32_t WUTR
Definition: stm32f745xx.h:722
#define RTC_TAMPCR_TAMP3IE
Definition: stm32f745xx.h:6050
__IO uint32_t SHIFTR
Definition: stm32f745xx.h:728
#define RTC_TAMPER_3
#define IS_RTC_TAMPER_ERASE_MODE(__MODE__)
#define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__)
Enable the RTC TimeStamp peripheral.
#define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__)
Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
RTC Tamper structure definition.
#define assert_param(expr)
Include module&#39;s header file.
#define IS_RTC_WAKEUP_COUNTER(__COUNTER__)
void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc)
#define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Wake Up timer&#39;s pending flags.
HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc)
#define RTC_TR_ST
Definition: stm32f745xx.h:5791
#define IS_RTC_SMOOTH_CALIB_PLUS(__PLUS__)
#define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__)
Disable the clock reference detection.
Definition: stm32f7xx.h:155
#define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(__DETECTION__)
HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
#define RTC_TAMPER_2
#define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the RTC WakeUpTimer interrupt.
#define RTC_FLAG_TSOVF
#define __HAL_UNLOCK(__HANDLE__)
#define RTC_TAMPCR_TAMP1IE
Definition: stm32f745xx.h:6056
void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
#define RTC_TR_HU
Definition: stm32f745xx.h:5777
HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc)
__IO uint32_t TAMPCR
Definition: stm32f745xx.h:733
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Tamper&#39;s flag status.
#define RTC_TAMPCR_TAMPFREQ
Definition: stm32f745xx.h:6064
#define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__)
Disable the RTC WakeUp Timer peripheral.
#define IS_RTC_BKP(__BKP__)
RTC Date structure definition.
#define RTC_ISR_SHPF
Definition: stm32f745xx.h:5874
#define RTC_FLAG_WUTWF
#define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC WakeUpTimer&#39;s flag status.
#define IS_RTC_TAMPER_MASKFLAG_STATE(__STATE__)
#define RTC_IT_TS
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
#define RTC_CR_TSE
Definition: stm32f745xx.h:5846
#define IS_RTC_TAMPER_INTERRUPT(__INTERRUPT__)
#define RTC_FLAG_TAMP2F
#define RTC_TAMPCR_TAMP2MF
Definition: stm32f745xx.h:6051
#define IS_RTC_WAKEUP_CLOCK(__CLOCK__)
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc)
#define RTC_CR_REFCKON
Definition: stm32f745xx.h:5852
#define RTC_FLAG_TAMP3F
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Tamper&#39;s pending flags.
#define RTC_DR_DU
Definition: stm32f745xx.h:5825
#define RTC_TR_RESERVED_MASK
#define IS_RTC_TAMPER_PRECHARGE_DURATION(__DURATION__)
HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG()
Clear the RTC Tamper and Timestamp associated Exti line flag.
uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
#define __HAL_LOCK(__HANDLE__)
HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue)
__IO uint32_t TSSSR
Definition: stm32f745xx.h:731
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
#define HAL_MAX_DELAY
__IO uint32_t TSDR
Definition: stm32f745xx.h:730
#define RTC_TAMPERTRIGGER_RISINGEDGE
HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc)
#define RTC_TR_HT
Definition: stm32f745xx.h:5774
#define __IO
Definition: core_cm0.h:213
#define IS_RTC_SMOOTH_CALIB_MINUS(__VALUE__)
RTC Time structure definition.
#define RTC_ISR_RECALPF
Definition: stm32f745xx.h:5861
#define RTC_OR_TSINSEL
Definition: stm32f745xx.h:6099
#define RTC_FORMAT_BIN
This file contains all the functions prototypes for the HAL module driver.
HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef *hrtc)
#define RTC_TAMPCR_TAMP3NOERASE
Definition: stm32f745xx.h:6049
#define RTC_TAMPCR_TAMP1MF
Definition: stm32f745xx.h:6054
#define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the RTC TimeStamp interrupt.
#define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG()
Clear the RTC WakeUp Timer associated Exti line flag.
#define RTC_TAMPCR_TAMPFLT
Definition: stm32f745xx.h:6061
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
Wake Up Timer Event Callback in non blocking mode.
#define RTC_TR_MNU
Definition: stm32f745xx.h:5786
void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc)
#define RTC_FLAG_TAMP1F
HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc)
#define RTC_TR_PM
Definition: stm32f745xx.h:5773
#define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__)
Disable the calibration output.
__IO uint32_t BKP0R
Definition: stm32f745xx.h:737
#define RTC_WUTR_WUT
Definition: stm32f745xx.h:5884
#define RTC_CR_TSEDGE
Definition: stm32f745xx.h:5853
uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc)
#define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the RTC WakeUpTimer interrupt.
#define RTC_TAMPCR_TAMPTS
Definition: stm32f745xx.h:6068
#define IS_RTC_TAMPER_FILTER(__FILTER__)
#define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__)
Enable the RTC WakeUp Timer peripheral.
#define RTC_ISR_INIT
Definition: stm32f745xx.h:5870
#define IS_RTC_TAMPER_TRIGGER(__TRIGGER__)
#define IS_RTC_SMOOTH_CALIB_PERIOD(__PERIOD__)
#define IS_TIMESTAMP_EDGE(__EDGE__)
#define RTC_DR_MU
Definition: stm32f745xx.h:5817
HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
__IO uint32_t TSTR
Definition: stm32f745xx.h:729
#define RTC_EXTI_LINE_WAKEUPTIMER_EVENT
#define RTC_TAMPCR_TAMP2IE
Definition: stm32f745xx.h:6053
#define UNUSED(x)
#define RTC_DR_MT
Definition: stm32f745xx.h:5816
HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
__IO uint32_t ISR
Definition: stm32f745xx.h:720
#define RTC_TAMPER_ERASE_BACKUP_ENABLE
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
#define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__)
Enable the clock reference detection.
#define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT()
Enable interrupt on the RTC WakeUp Timer associated Exti line.
#define EXTI
Definition: stm32f745xx.h:1301
#define RTC_TAMPERMASK_FLAG_DISABLE
HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput)
#define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__)
Check whether the specified RTC TimeStamp interrupt has occurred or not.
void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
HAL_StatusTypeDef HAL_RTCEx_DeactivateInternalTimeStamp(RTC_HandleTypeDef *hrtc)
#define __HAL_RTC_INTERNAL_TIMESTAMP_ENABLE(__HANDLE__)
Enable the RTC internal TimeStamp peripheral.
#define RTC_TAMPCR_TAMP1NOERASE
Definition: stm32f745xx.h:6055
__IO HAL_RTCStateTypeDef State
#define RTC_TR_MNT
Definition: stm32f745xx.h:5782
#define RTC_TAMPCR_TAMPIE
Definition: stm32f745xx.h:6073
#define RTC_DR_WDU
Definition: stm32f745xx.h:5812
#define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__)
Enable the RTC calibration output.
HAL_StatusTypeDef HAL_RTCEx_SetInternalTimeStamp(RTC_HandleTypeDef *hrtc)
#define IS_RTC_TAMPER(__TAMPER__)
#define RTC_CR_BYPSHAD
Definition: stm32f745xx.h:5851
#define RTC_CR_WUCKSEL
Definition: stm32f745xx.h:5854
uint32_t TimeStampOnTamperDetection
RTC Handle Structure definition.
__IO uint32_t CALR
Definition: stm32f745xx.h:732
#define IS_RTC_CALIB_OUTPUT(__OUTPUT__)
#define IS_RTC_SHIFT_SUBFS(__FS__)
void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc)
#define RTC_DR_RESERVED_MASK
#define RTC_FLAG_ALRBF
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
__IO uint32_t OR
Definition: stm32f745xx.h:736
#define RTC_TR_SU
Definition: stm32f745xx.h:5795
#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__)
Enable the write protection for RTC registers.
#define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC TimeStamp&#39;s flag status.
#define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the RTC Time Stamp&#39;s pending flags.
#define RTC_IT_TAMP3
#define IS_RTC_TAMPER_PULLUP_STATE(__STATE__)
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
#define RTC_CR_COSEL
Definition: stm32f745xx.h:5838
#define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the RTC TimeStamp interrupt.
#define RTC_CR_WUTE
Definition: stm32f745xx.h:5847
#define RTC_FLAG_WUTF
HAL_StatusTypeDef
HAL Status structures definition.
uint8_t RTC_Bcd2ToByte(uint8_t Value)
#define RTC_DR_DT
Definition: stm32f745xx.h:5822
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
#define RTC_TAMPCR_TAMPPRCH
Definition: stm32f745xx.h:6058
#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__)
Get the selected RTC Alarm&#39;s flag status.
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT()
Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
__IO uint32_t CR
Definition: stm32f745xx.h:719
#define IS_RTC_TAMPER_SAMPLING_FREQ(__FREQ__)
HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc)
#define RTC_TAMPCR_TAMPPUDIS
Definition: stm32f745xx.h:6057