STM32L4xx_HAL_Driver  1.14.0
Initialization and de-initialization functions

Functions

ErrorStatus LL_RTC_DeInit (RTC_TypeDef *RTCx)
 De-Initializes the RTC registers to their default reset values. More...
 
ErrorStatus LL_RTC_Init (RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct)
 Initializes the RTC registers according to the specified parameters in RTC_InitStruct. More...
 
void LL_RTC_StructInit (LL_RTC_InitTypeDef *RTC_InitStruct)
 Set each LL_RTC_InitTypeDef field to default value. More...
 
ErrorStatus LL_RTC_TIME_Init (RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct)
 Set the RTC current time. More...
 
void LL_RTC_TIME_StructInit (LL_RTC_TimeTypeDef *RTC_TimeStruct)
 Set each LL_RTC_TimeTypeDef field to default value (Time = 00h:00min:00sec). More...
 
ErrorStatus LL_RTC_DATE_Init (RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_DateTypeDef *RTC_DateStruct)
 Set the RTC current date. More...
 
void LL_RTC_DATE_StructInit (LL_RTC_DateTypeDef *RTC_DateStruct)
 Set each LL_RTC_DateTypeDef field to default value (date = Monday, January 01 xx00) More...
 
ErrorStatus LL_RTC_ALMA_Init (RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct)
 Set the RTC Alarm A. More...
 
ErrorStatus LL_RTC_ALMB_Init (RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct)
 Set the RTC Alarm B. More...
 
void LL_RTC_ALMA_StructInit (LL_RTC_AlarmTypeDef *RTC_AlarmStruct)
 Set each LL_RTC_AlarmTypeDef of ALARMA field to default value (Time = 00h:00mn:00sec / Day = 1st day of the month/Mask = all fields are masked). More...
 
void LL_RTC_ALMB_StructInit (LL_RTC_AlarmTypeDef *RTC_AlarmStruct)
 Set each LL_RTC_AlarmTypeDef of ALARMA field to default value (Time = 00h:00mn:00sec / Day = 1st day of the month/Mask = all fields are masked). More...
 
ErrorStatus LL_RTC_EnterInitMode (RTC_TypeDef *RTCx)
 Enters the RTC Initialization mode. More...
 
ErrorStatus LL_RTC_ExitInitMode (RTC_TypeDef *RTCx)
 Exit the RTC Initialization mode. More...
 
ErrorStatus LL_RTC_WaitForSynchro (RTC_TypeDef *RTCx)
 Waits until the RTC Time and Day registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock. More...
 

Detailed Description

Function Documentation

◆ LL_RTC_ALMA_Init()

ErrorStatus LL_RTC_ALMA_Init ( RTC_TypeDef *  RTCx,
uint32_t  RTC_Format,
LL_RTC_AlarmTypeDef RTC_AlarmStruct 
)

Set the RTC Alarm A.

Note
The Alarm register can only be written when the corresponding Alarm is disabled (Use LL_RTC_ALMA_Disable function).
Parameters
RTCxRTC Instance
RTC_FormatThis parameter can be one of the following values:
  • LL_RTC_FORMAT_BIN
  • LL_RTC_FORMAT_BCD
RTC_AlarmStructpointer to a LL_RTC_AlarmTypeDef structure that contains the alarm configuration parameters.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: ALARMA registers are configured
  • ERROR: ALARMA registers are not configured

Definition at line 454 of file stm32l4xx_ll_rtc.c.

455 {
456  /* Check the parameters */
457  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
458  assert_param(IS_LL_RTC_FORMAT(RTC_Format));
459  assert_param(IS_LL_RTC_ALMA_MASK(RTC_AlarmStruct->AlarmMask));
460  assert_param(IS_LL_RTC_ALMA_DATE_WEEKDAY_SEL(RTC_AlarmStruct->AlarmDateWeekDaySel));
461 
462  if (RTC_Format == LL_RTC_FORMAT_BIN)
463  {
464  if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR)
465  {
466  assert_param(IS_LL_RTC_HOUR12(RTC_AlarmStruct->AlarmTime.Hours));
467  assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat));
468  }
469  else
470  {
471  RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U;
472  assert_param(IS_LL_RTC_HOUR24(RTC_AlarmStruct->AlarmTime.Hours));
473  }
474  assert_param(IS_LL_RTC_MINUTES(RTC_AlarmStruct->AlarmTime.Minutes));
475  assert_param(IS_LL_RTC_SECONDS(RTC_AlarmStruct->AlarmTime.Seconds));
476 
477  if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE)
478  {
479  assert_param(IS_LL_RTC_DAY(RTC_AlarmStruct->AlarmDateWeekDay));
480  }
481  else
482  {
483  assert_param(IS_LL_RTC_WEEKDAY(RTC_AlarmStruct->AlarmDateWeekDay));
484  }
485  }
486  else
487  {
488  if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR)
489  {
490  assert_param(IS_LL_RTC_HOUR12(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours)));
491  assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat));
492  }
493  else
494  {
495  RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U;
496  assert_param(IS_LL_RTC_HOUR24(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours)));
497  }
498 
499  assert_param(IS_LL_RTC_MINUTES(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Minutes)));
500  assert_param(IS_LL_RTC_SECONDS(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Seconds)));
501 
502  if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE)
503  {
504  assert_param(IS_LL_RTC_DAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay)));
505  }
506  else
507  {
508  assert_param(IS_LL_RTC_WEEKDAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay)));
509  }
510  }
511 
512  /* Disable the write protection for RTC registers */
514 
515  /* Select weekday selection */
516  if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE)
517  {
518  /* Set the date for ALARM */
520  if (RTC_Format != LL_RTC_FORMAT_BIN)
521  {
522  LL_RTC_ALMA_SetDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay);
523  }
524  else
525  {
526  LL_RTC_ALMA_SetDay(RTCx, __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmDateWeekDay));
527  }
528  }
529  else
530  {
531  /* Set the week day for ALARM */
533  LL_RTC_ALMA_SetWeekDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay);
534  }
535 
536  /* Configure the Alarm register */
537  if (RTC_Format != LL_RTC_FORMAT_BIN)
538  {
539  LL_RTC_ALMA_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat, RTC_AlarmStruct->AlarmTime.Hours,
540  RTC_AlarmStruct->AlarmTime.Minutes, RTC_AlarmStruct->AlarmTime.Seconds);
541  }
542  else
543  {
544  LL_RTC_ALMA_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat,
545  __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Hours),
546  __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Minutes),
547  __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Seconds));
548  }
549  /* Set ALARM mask */
550  LL_RTC_ALMA_SetMask(RTCx, RTC_AlarmStruct->AlarmMask);
551 
552  /* Enable the write protection for RTC registers */
554 
555  return SUCCESS;
556 }
__STATIC_INLINE void LL_RTC_ALMA_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
Set Alarm A Time (hour, minute and second) in BCD format RTC_ALRMAR PM LL_RTC_ALMA_ConfigTime RTC_A...
__STATIC_INLINE void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef *RTCx)
Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care) RTC_ALRMA...
__STATIC_INLINE void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef *RTCx)
Disable AlarmA Week day selection (DU[3:0] represents the date ) RTC_ALRMAR WDSEL LL_RTC_ALMA_Disabl...
__STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
Enable the write protection for RTC registers. RTC_WPR KEY LL_RTC_EnableWriteProtection.
__STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
Disable the write protection for RTC registers. RTC_WPR KEY LL_RTC_DisableWriteProtection.
__STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx)
Get Hours format (24 hour/day or AM/PM hour format) RTC_CR FMT LL_RTC_GetHourFormat.
LL_RTC_TimeTypeDef AlarmTime
__STATIC_INLINE void LL_RTC_ALMA_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
Specify the Alarm A masks. RTC_ALRMAR MSK4 LL_RTC_ALMA_SetMask RTC_ALRMAR MSK3 LL_RTC_ALMA_SetMask ...
__STATIC_INLINE void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
Set ALARM A Weekday RTC_ALRMAR DU LL_RTC_ALMA_SetWeekDay.
__STATIC_INLINE void LL_RTC_ALMA_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
Set ALARM A Day in BCD format.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ LL_RTC_ALMA_StructInit()

void LL_RTC_ALMA_StructInit ( LL_RTC_AlarmTypeDef RTC_AlarmStruct)

Set each LL_RTC_AlarmTypeDef of ALARMA field to default value (Time = 00h:00mn:00sec / Day = 1st day of the month/Mask = all fields are masked).

Parameters
RTC_AlarmStructpointer to a LL_RTC_AlarmTypeDef structure which will be initialized.
Return values
None

Definition at line 682 of file stm32l4xx_ll_rtc.c.

683 {
684  /* Alarm Time Settings : Time = 00h:00mn:00sec */
685  RTC_AlarmStruct->AlarmTime.TimeFormat = LL_RTC_ALMA_TIME_FORMAT_AM;
686  RTC_AlarmStruct->AlarmTime.Hours = 0U;
687  RTC_AlarmStruct->AlarmTime.Minutes = 0U;
688  RTC_AlarmStruct->AlarmTime.Seconds = 0U;
689 
690  /* Alarm Day Settings : Day = 1st day of the month */
691  RTC_AlarmStruct->AlarmDateWeekDaySel = LL_RTC_ALMA_DATEWEEKDAYSEL_DATE;
692  RTC_AlarmStruct->AlarmDateWeekDay = 1U;
693 
694  /* Alarm Masks Settings : Mask = all fields are not masked */
695  RTC_AlarmStruct->AlarmMask = LL_RTC_ALMA_MASK_NONE;
696 }
LL_RTC_TimeTypeDef AlarmTime

◆ LL_RTC_ALMB_Init()

ErrorStatus LL_RTC_ALMB_Init ( RTC_TypeDef *  RTCx,
uint32_t  RTC_Format,
LL_RTC_AlarmTypeDef RTC_AlarmStruct 
)

Set the RTC Alarm B.

Note
The Alarm register can only be written when the corresponding Alarm is disabled (LL_RTC_ALMB_Disable function).
Parameters
RTCxRTC Instance
RTC_FormatThis parameter can be one of the following values:
  • LL_RTC_FORMAT_BIN
  • LL_RTC_FORMAT_BCD
RTC_AlarmStructpointer to a LL_RTC_AlarmTypeDef structure that contains the alarm configuration parameters.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: ALARMB registers are configured
  • ERROR: ALARMB registers are not configured

Definition at line 572 of file stm32l4xx_ll_rtc.c.

573 {
574  /* Check the parameters */
575  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
576  assert_param(IS_LL_RTC_FORMAT(RTC_Format));
577  assert_param(IS_LL_RTC_ALMB_MASK(RTC_AlarmStruct->AlarmMask));
578  assert_param(IS_LL_RTC_ALMB_DATE_WEEKDAY_SEL(RTC_AlarmStruct->AlarmDateWeekDaySel));
579 
580  if (RTC_Format == LL_RTC_FORMAT_BIN)
581  {
582  if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR)
583  {
584  assert_param(IS_LL_RTC_HOUR12(RTC_AlarmStruct->AlarmTime.Hours));
585  assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat));
586  }
587  else
588  {
589  RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U;
590  assert_param(IS_LL_RTC_HOUR24(RTC_AlarmStruct->AlarmTime.Hours));
591  }
592  assert_param(IS_LL_RTC_MINUTES(RTC_AlarmStruct->AlarmTime.Minutes));
593  assert_param(IS_LL_RTC_SECONDS(RTC_AlarmStruct->AlarmTime.Seconds));
594 
595  if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE)
596  {
597  assert_param(IS_LL_RTC_DAY(RTC_AlarmStruct->AlarmDateWeekDay));
598  }
599  else
600  {
601  assert_param(IS_LL_RTC_WEEKDAY(RTC_AlarmStruct->AlarmDateWeekDay));
602  }
603  }
604  else
605  {
606  if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR)
607  {
608  assert_param(IS_LL_RTC_HOUR12(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours)));
609  assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat));
610  }
611  else
612  {
613  RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U;
614  assert_param(IS_LL_RTC_HOUR24(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours)));
615  }
616 
617  assert_param(IS_LL_RTC_MINUTES(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Minutes)));
618  assert_param(IS_LL_RTC_SECONDS(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Seconds)));
619 
620  if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE)
621  {
622  assert_param(IS_LL_RTC_DAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay)));
623  }
624  else
625  {
626  assert_param(IS_LL_RTC_WEEKDAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay)));
627  }
628  }
629 
630  /* Disable the write protection for RTC registers */
632 
633  /* Select weekday selection */
634  if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE)
635  {
636  /* Set the date for ALARM */
638  if (RTC_Format != LL_RTC_FORMAT_BIN)
639  {
640  LL_RTC_ALMB_SetDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay);
641  }
642  else
643  {
644  LL_RTC_ALMB_SetDay(RTCx, __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmDateWeekDay));
645  }
646  }
647  else
648  {
649  /* Set the week day for ALARM */
651  LL_RTC_ALMB_SetWeekDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay);
652  }
653 
654  /* Configure the Alarm register */
655  if (RTC_Format != LL_RTC_FORMAT_BIN)
656  {
657  LL_RTC_ALMB_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat, RTC_AlarmStruct->AlarmTime.Hours,
658  RTC_AlarmStruct->AlarmTime.Minutes, RTC_AlarmStruct->AlarmTime.Seconds);
659  }
660  else
661  {
662  LL_RTC_ALMB_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat,
663  __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Hours),
664  __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Minutes),
665  __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Seconds));
666  }
667  /* Set ALARM mask */
668  LL_RTC_ALMB_SetMask(RTCx, RTC_AlarmStruct->AlarmMask);
669 
670  /* Enable the write protection for RTC registers */
672 
673  return SUCCESS;
674 }
__STATIC_INLINE void LL_RTC_ALMB_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
Set Alarm B Time (hour, minute and second) in BCD format RTC_ALRMBR PM LL_RTC_ALMB_ConfigTime RTC_A...
__STATIC_INLINE void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef *RTCx)
Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care) RTC_ALRMB...
__STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
Enable the write protection for RTC registers. RTC_WPR KEY LL_RTC_EnableWriteProtection.
__STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
Disable the write protection for RTC registers. RTC_WPR KEY LL_RTC_DisableWriteProtection.
__STATIC_INLINE void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef *RTCx)
Disable AlarmB Week day selection (DU[3:0] represents the date ) RTC_ALRMBR WDSEL LL_RTC_ALMB_Disabl...
__STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx)
Get Hours format (24 hour/day or AM/PM hour format) RTC_CR FMT LL_RTC_GetHourFormat.
LL_RTC_TimeTypeDef AlarmTime
__STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
Set ALARM B Day in BCD format.
__STATIC_INLINE void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay)
Set ALARM B Weekday RTC_ALRMBR DU LL_RTC_ALMB_SetWeekDay.
__STATIC_INLINE void LL_RTC_ALMB_SetMask(RTC_TypeDef *RTCx, uint32_t Mask)
Specify the Alarm B masks. RTC_ALRMBR MSK4 LL_RTC_ALMB_SetMask RTC_ALRMBR MSK3 LL_RTC_ALMB_SetMask ...
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ LL_RTC_ALMB_StructInit()

void LL_RTC_ALMB_StructInit ( LL_RTC_AlarmTypeDef RTC_AlarmStruct)

Set each LL_RTC_AlarmTypeDef of ALARMA field to default value (Time = 00h:00mn:00sec / Day = 1st day of the month/Mask = all fields are masked).

Parameters
RTC_AlarmStructpointer to a LL_RTC_AlarmTypeDef structure which will be initialized.
Return values
None

Definition at line 704 of file stm32l4xx_ll_rtc.c.

705 {
706  /* Alarm Time Settings : Time = 00h:00mn:00sec */
707  RTC_AlarmStruct->AlarmTime.TimeFormat = LL_RTC_ALMB_TIME_FORMAT_AM;
708  RTC_AlarmStruct->AlarmTime.Hours = 0U;
709  RTC_AlarmStruct->AlarmTime.Minutes = 0U;
710  RTC_AlarmStruct->AlarmTime.Seconds = 0U;
711 
712  /* Alarm Day Settings : Day = 1st day of the month */
713  RTC_AlarmStruct->AlarmDateWeekDaySel = LL_RTC_ALMB_DATEWEEKDAYSEL_DATE;
714  RTC_AlarmStruct->AlarmDateWeekDay = 1U;
715 
716  /* Alarm Masks Settings : Mask = all fields are not masked */
717  RTC_AlarmStruct->AlarmMask = LL_RTC_ALMB_MASK_NONE;
718 }
LL_RTC_TimeTypeDef AlarmTime

◆ LL_RTC_DATE_Init()

ErrorStatus LL_RTC_DATE_Init ( RTC_TypeDef *  RTCx,
uint32_t  RTC_Format,
LL_RTC_DateTypeDef RTC_DateStruct 
)

Set the RTC current date.

Parameters
RTCxRTC Instance
RTC_FormatThis parameter can be one of the following values:
  • LL_RTC_FORMAT_BIN
  • LL_RTC_FORMAT_BCD
RTC_DateStructpointer to a RTC_DateTypeDef structure that contains the date configuration information for the RTC.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC Day register is configured
  • ERROR: RTC Day register is not configured

Definition at line 363 of file stm32l4xx_ll_rtc.c.

364 {
365  ErrorStatus status = ERROR;
366 
367  /* Check the parameters */
368  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
369  assert_param(IS_LL_RTC_FORMAT(RTC_Format));
370 
371  if ((RTC_Format == LL_RTC_FORMAT_BIN) && ((RTC_DateStruct->Month & 0x10U) == 0x10U))
372  {
373  RTC_DateStruct->Month = (uint8_t)((RTC_DateStruct->Month & (uint8_t)~(0x10U)) + 0x0AU);
374  }
375 
376  if (RTC_Format == LL_RTC_FORMAT_BIN)
377  {
378  assert_param(IS_LL_RTC_YEAR(RTC_DateStruct->Year));
379  assert_param(IS_LL_RTC_MONTH(RTC_DateStruct->Month));
380  assert_param(IS_LL_RTC_DAY(RTC_DateStruct->Day));
381  }
382  else
383  {
384  assert_param(IS_LL_RTC_YEAR(__LL_RTC_CONVERT_BCD2BIN(RTC_DateStruct->Year)));
385  assert_param(IS_LL_RTC_MONTH(__LL_RTC_CONVERT_BCD2BIN(RTC_DateStruct->Month)));
386  assert_param(IS_LL_RTC_DAY(__LL_RTC_CONVERT_BCD2BIN(RTC_DateStruct->Day)));
387  }
388  assert_param(IS_LL_RTC_WEEKDAY(RTC_DateStruct->WeekDay));
389 
390  /* Disable the write protection for RTC registers */
392 
393  /* Set Initialization mode */
394  if (LL_RTC_EnterInitMode(RTCx) != ERROR)
395  {
396  /* Check the input parameters format */
397  if (RTC_Format != LL_RTC_FORMAT_BIN)
398  {
399  LL_RTC_DATE_Config(RTCx, RTC_DateStruct->WeekDay, RTC_DateStruct->Day, RTC_DateStruct->Month, RTC_DateStruct->Year);
400  }
401  else
402  {
403  LL_RTC_DATE_Config(RTCx, RTC_DateStruct->WeekDay, __LL_RTC_CONVERT_BIN2BCD(RTC_DateStruct->Day),
404  __LL_RTC_CONVERT_BIN2BCD(RTC_DateStruct->Month), __LL_RTC_CONVERT_BIN2BCD(RTC_DateStruct->Year));
405  }
406 
407  /* Exit Initialization mode */
409 
410  /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
411  if (LL_RTC_IsShadowRegBypassEnabled(RTCx) == 0U)
412  {
413  status = LL_RTC_WaitForSynchro(RTCx);
414  }
415  else
416  {
417  status = SUCCESS;
418  }
419  }
420  /* Enable the write protection for RTC registers */
422 
423  return status;
424 }
ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx)
Waits until the RTC Time and Day registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock...
__STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx)
Check if Shadow registers bypass is enabled or not. RTC_CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled.
__STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uint32_t Day, uint32_t Month, uint32_t Year)
Set date (WeekDay, Day, Month and Year) in BCD format RTC_DR WDU LL_RTC_DATE_Config RTC_DR MT LL_RT...
__STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
Disable initialization mode (Free running mode) RTC_ICSR INIT LL_RTC_DisableInitMode.
__STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
Enable the write protection for RTC registers. RTC_WPR KEY LL_RTC_EnableWriteProtection.
__STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
Disable the write protection for RTC registers. RTC_WPR KEY LL_RTC_DisableWriteProtection.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx)
Enters the RTC Initialization mode.

◆ LL_RTC_DATE_StructInit()

void LL_RTC_DATE_StructInit ( LL_RTC_DateTypeDef RTC_DateStruct)

Set each LL_RTC_DateTypeDef field to default value (date = Monday, January 01 xx00)

Parameters
RTC_DateStructpointer to a LL_RTC_DateTypeDef structure which will be initialized.
Return values
None

Definition at line 431 of file stm32l4xx_ll_rtc.c.

432 {
433  /* Monday, January 01 xx00 */
434  RTC_DateStruct->WeekDay = LL_RTC_WEEKDAY_MONDAY;
435  RTC_DateStruct->Day = 1U;
436  RTC_DateStruct->Month = LL_RTC_MONTH_JANUARY;
437  RTC_DateStruct->Year = 0U;
438 }

◆ LL_RTC_DeInit()

ErrorStatus LL_RTC_DeInit ( RTC_TypeDef *  RTCx)

De-Initializes the RTC registers to their default reset values.

Note
This function doesn't reset the RTC Clock source and RTC Backup Data registers.
Parameters
RTCxRTC Instance
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC registers are de-initialized
  • ERROR: RTC registers are not de-initialized

Definition at line 138 of file stm32l4xx_ll_rtc.c.

139 {
140  ErrorStatus status = ERROR;
141 
142  /* Check the parameter */
143  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
144 
145  /* Disable the write protection for RTC registers */
147 
148  /* Set Initialization mode */
149  if (LL_RTC_EnterInitMode(RTCx) != ERROR)
150  {
151  /* Reset TR, DR and CR registers */
152  LL_RTC_WriteReg(RTCx, TR, 0x00000000U);
153 
154  LL_RTC_WriteReg(RTCx, WUTR, RTC_WUTR_WUT);
155  LL_RTC_WriteReg(RTCx, DR, (RTC_DR_WDU_0 | RTC_DR_MU_0 | RTC_DR_DU_0));
156  /* Reset All CR bits except CR[2:0] */
157  LL_RTC_WriteReg(RTCx, CR, (LL_RTC_ReadReg(RTCx, CR) & RTC_CR_WUCKSEL));
158 
159  LL_RTC_WriteReg(RTCx, PRER, (RTC_PRER_PREDIV_A | RTC_SYNCH_PRESC_DEFAULT));
160  LL_RTC_WriteReg(RTCx, ALRMAR, 0x00000000U);
161  LL_RTC_WriteReg(RTCx, ALRMBR, 0x00000000U);
162  LL_RTC_WriteReg(RTCx, SHIFTR, 0x00000000U);
163  LL_RTC_WriteReg(RTCx, CALR, 0x00000000U);
164  LL_RTC_WriteReg(RTCx, ALRMASSR, 0x00000000U);
165  LL_RTC_WriteReg(RTCx, ALRMBSSR, 0x00000000U);
166 
167 #if defined(STM32L412xx) || defined(STM32L422xx)
168 #else /* #if defined(STM32L412xx) || defined(STM32L422xx) */
169  /* Reset ISR register and exit initialization mode */
170  LL_RTC_WriteReg(RTCx, ISR, 0x00000000U);
171 
172  /* Reset Tamper and alternate functions configuration register */
173  LL_RTC_WriteReg(RTCx, TAMPCR, 0x00000000U);
174 
175  /* Reset Option register */
176  LL_RTC_WriteReg(RTCx, OR, 0x00000000U);
177 #endif /* #if defined(STM32L412xx) || defined(STM32L422xx) */
178 
179  /* Wait till the RTC RSF flag is set */
180  status = LL_RTC_WaitForSynchro(RTCx);
181  }
182 
183  /* Enable the write protection for RTC registers */
185 
186  return status;
187 }
ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx)
Waits until the RTC Time and Day registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock...
__STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
Enable the write protection for RTC registers. RTC_WPR KEY LL_RTC_EnableWriteProtection.
__STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
Disable the write protection for RTC registers. RTC_WPR KEY LL_RTC_DisableWriteProtection.
hrtc Instance WUTR
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx)
Enters the RTC Initialization mode.

◆ LL_RTC_EnterInitMode()

ErrorStatus LL_RTC_EnterInitMode ( RTC_TypeDef *  RTCx)

Enters the RTC Initialization mode.

Note
The RTC Initialization mode is write protected, use the LL_RTC_DisableWriteProtection before calling this function.
Parameters
RTCxRTC Instance
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC is in Init mode
  • ERROR: RTC is not in Init mode

Definition at line 729 of file stm32l4xx_ll_rtc.c.

730 {
731  __IO uint32_t timeout = RTC_INITMODE_TIMEOUT;
732  ErrorStatus status = SUCCESS;
733  uint32_t tmp;
734 
735  /* Check the parameter */
736  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
737 
738  /* Check if the Initialization mode is set */
739  if (LL_RTC_IsActiveFlag_INIT(RTCx) == 0U)
740  {
741  /* Set the Initialization mode */
742  LL_RTC_EnableInitMode(RTCx);
743 
744  /* Wait till RTC is in INIT state and if Time out is reached exit */
745  tmp = LL_RTC_IsActiveFlag_INIT(RTCx);
746  while ((timeout != 0U) && (tmp != 1U))
747  {
748  if (LL_SYSTICK_IsActiveCounterFlag() == 1U)
749  {
750  timeout --;
751  }
752  tmp = LL_RTC_IsActiveFlag_INIT(RTCx);
753  if (timeout == 0U)
754  {
755  status = ERROR;
756  }
757  }
758  }
759  return status;
760 }
__STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx)
Enable initialization mode.
__STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx)
Get Initialization flag RTC_ICSR INITF LL_RTC_IsActiveFlag_INIT.
__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void)
This function checks if the Systick counter flag is active or not.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ LL_RTC_ExitInitMode()

ErrorStatus LL_RTC_ExitInitMode ( RTC_TypeDef *  RTCx)

Exit the RTC Initialization mode.

Note
When the initialization sequence is complete, the calendar restarts counting after 4 RTCCLK cycles.
The RTC Initialization mode is write protected, use the LL_RTC_DisableWriteProtection before calling this function.
Parameters
RTCxRTC Instance
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC exited from in Init mode
  • ERROR: Not applicable

Definition at line 773 of file stm32l4xx_ll_rtc.c.

774 {
775  /* Check the parameter */
776  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
777 
778  /* Disable initialization mode */
780 
781  return SUCCESS;
782 }
__STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
Disable initialization mode (Free running mode) RTC_ICSR INIT LL_RTC_DisableInitMode.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ LL_RTC_Init()

ErrorStatus LL_RTC_Init ( RTC_TypeDef *  RTCx,
LL_RTC_InitTypeDef RTC_InitStruct 
)

Initializes the RTC registers according to the specified parameters in RTC_InitStruct.

Parameters
RTCxRTC Instance
RTC_InitStructpointer to a LL_RTC_InitTypeDef structure that contains the configuration information for the RTC peripheral.
Note
The RTC Prescaler register is write protected and can be written in initialization mode only.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC registers are initialized
  • ERROR: RTC registers are not initialized

Definition at line 201 of file stm32l4xx_ll_rtc.c.

202 {
203  ErrorStatus status = ERROR;
204 
205  /* Check the parameters */
206  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
207  assert_param(IS_LL_RTC_HOURFORMAT(RTC_InitStruct->HourFormat));
208  assert_param(IS_LL_RTC_ASYNCH_PREDIV(RTC_InitStruct->AsynchPrescaler));
209  assert_param(IS_LL_RTC_SYNCH_PREDIV(RTC_InitStruct->SynchPrescaler));
210 
211  /* Disable the write protection for RTC registers */
213 
214  /* Set Initialization mode */
215  if (LL_RTC_EnterInitMode(RTCx) != ERROR)
216  {
217  /* Set Hour Format */
218  LL_RTC_SetHourFormat(RTCx, RTC_InitStruct->HourFormat);
219 
220  /* Configure Synchronous and Asynchronous prescaler factor */
221  LL_RTC_SetSynchPrescaler(RTCx, RTC_InitStruct->SynchPrescaler);
222  LL_RTC_SetAsynchPrescaler(RTCx, RTC_InitStruct->AsynchPrescaler);
223 
224  /* Exit Initialization mode */
226 
227  status = SUCCESS;
228  }
229  /* Enable the write protection for RTC registers */
231 
232  return status;
233 }
__STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
Disable initialization mode (Free running mode) RTC_ICSR INIT LL_RTC_DisableInitMode.
__STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
Enable the write protection for RTC registers. RTC_WPR KEY LL_RTC_EnableWriteProtection.
__STATIC_INLINE void LL_RTC_SetHourFormat(RTC_TypeDef *RTCx, uint32_t HourFormat)
Set Hours format (24 hour/day or AM/PM hour format)
__STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler)
Set Asynchronous prescaler factor RTC_PRER PREDIV_A LL_RTC_SetAsynchPrescaler.
__STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
Disable the write protection for RTC registers. RTC_WPR KEY LL_RTC_DisableWriteProtection.
__STATIC_INLINE void LL_RTC_SetSynchPrescaler(RTC_TypeDef *RTCx, uint32_t SynchPrescaler)
Set Synchronous prescaler factor RTC_PRER PREDIV_S LL_RTC_SetSynchPrescaler.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx)
Enters the RTC Initialization mode.

◆ LL_RTC_StructInit()

void LL_RTC_StructInit ( LL_RTC_InitTypeDef RTC_InitStruct)

Set each LL_RTC_InitTypeDef field to default value.

Parameters
RTC_InitStructpointer to a LL_RTC_InitTypeDef structure which will be initialized.
Return values
None

Definition at line 240 of file stm32l4xx_ll_rtc.c.

241 {
242  /* Set RTC_InitStruct fields to default values */
243  RTC_InitStruct->HourFormat = LL_RTC_HOURFORMAT_24HOUR;
244  RTC_InitStruct->AsynchPrescaler = RTC_ASYNCH_PRESC_DEFAULT;
245  RTC_InitStruct->SynchPrescaler = RTC_SYNCH_PRESC_DEFAULT;
246 }

◆ LL_RTC_TIME_Init()

ErrorStatus LL_RTC_TIME_Init ( RTC_TypeDef *  RTCx,
uint32_t  RTC_Format,
LL_RTC_TimeTypeDef RTC_TimeStruct 
)

Set the RTC current time.

Parameters
RTCxRTC Instance
RTC_FormatThis parameter can be one of the following values:
  • LL_RTC_FORMAT_BIN
  • LL_RTC_FORMAT_BCD
RTC_TimeStructpointer to a RTC_TimeTypeDef structure that contains the time configuration information for the RTC.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC Time register is configured
  • ERROR: RTC Time register is not configured

Definition at line 260 of file stm32l4xx_ll_rtc.c.

261 {
262  ErrorStatus status = ERROR;
263 
264  /* Check the parameters */
265  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
266  assert_param(IS_LL_RTC_FORMAT(RTC_Format));
267 
268  if (RTC_Format == LL_RTC_FORMAT_BIN)
269  {
270  if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR)
271  {
272  assert_param(IS_LL_RTC_HOUR12(RTC_TimeStruct->Hours));
273  assert_param(IS_LL_RTC_TIME_FORMAT(RTC_TimeStruct->TimeFormat));
274  }
275  else
276  {
277  RTC_TimeStruct->TimeFormat = 0x00U;
278  assert_param(IS_LL_RTC_HOUR24(RTC_TimeStruct->Hours));
279  }
280  assert_param(IS_LL_RTC_MINUTES(RTC_TimeStruct->Minutes));
281  assert_param(IS_LL_RTC_SECONDS(RTC_TimeStruct->Seconds));
282  }
283  else
284  {
285  if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR)
286  {
287  assert_param(IS_LL_RTC_HOUR12(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Hours)));
288  assert_param(IS_LL_RTC_TIME_FORMAT(RTC_TimeStruct->TimeFormat));
289  }
290  else
291  {
292  RTC_TimeStruct->TimeFormat = 0x00U;
293  assert_param(IS_LL_RTC_HOUR24(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Hours)));
294  }
295  assert_param(IS_LL_RTC_MINUTES(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Minutes)));
296  assert_param(IS_LL_RTC_SECONDS(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Seconds)));
297  }
298 
299  /* Disable the write protection for RTC registers */
301 
302  /* Set Initialization mode */
303  if (LL_RTC_EnterInitMode(RTCx) != ERROR)
304  {
305  /* Check the input parameters format */
306  if (RTC_Format != LL_RTC_FORMAT_BIN)
307  {
308  LL_RTC_TIME_Config(RTCx, RTC_TimeStruct->TimeFormat, RTC_TimeStruct->Hours,
309  RTC_TimeStruct->Minutes, RTC_TimeStruct->Seconds);
310  }
311  else
312  {
313  LL_RTC_TIME_Config(RTCx, RTC_TimeStruct->TimeFormat, __LL_RTC_CONVERT_BIN2BCD(RTC_TimeStruct->Hours),
314  __LL_RTC_CONVERT_BIN2BCD(RTC_TimeStruct->Minutes),
315  __LL_RTC_CONVERT_BIN2BCD(RTC_TimeStruct->Seconds));
316  }
317 
318  /* Exit Initialization mode */
320 
321  /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */
322  if (LL_RTC_IsShadowRegBypassEnabled(RTCx) == 0U)
323  {
324  status = LL_RTC_WaitForSynchro(RTCx);
325  }
326  else
327  {
328  status = SUCCESS;
329  }
330  }
331  /* Enable the write protection for RTC registers */
333 
334  return status;
335 }
ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx)
Waits until the RTC Time and Day registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock...
__STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx)
Check if Shadow registers bypass is enabled or not. RTC_CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled.
__STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx)
Disable initialization mode (Free running mode) RTC_ICSR INIT LL_RTC_DisableInitMode.
__STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
Enable the write protection for RTC registers. RTC_WPR KEY LL_RTC_EnableWriteProtection.
__STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
Disable the write protection for RTC registers. RTC_WPR KEY LL_RTC_DisableWriteProtection.
__STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx)
Get Hours format (24 hour/day or AM/PM hour format) RTC_CR FMT LL_RTC_GetHourFormat.
__STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hours, uint32_t Minutes, uint32_t Seconds)
Set time (hour, minute and second) in BCD format.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx)
Enters the RTC Initialization mode.

◆ LL_RTC_TIME_StructInit()

void LL_RTC_TIME_StructInit ( LL_RTC_TimeTypeDef RTC_TimeStruct)

Set each LL_RTC_TimeTypeDef field to default value (Time = 00h:00min:00sec).

Parameters
RTC_TimeStructpointer to a LL_RTC_TimeTypeDef structure which will be initialized.
Return values
None

Definition at line 342 of file stm32l4xx_ll_rtc.c.

343 {
344  /* Time = 00h:00min:00sec */
345  RTC_TimeStruct->TimeFormat = LL_RTC_TIME_FORMAT_AM_OR_24;
346  RTC_TimeStruct->Hours = 0U;
347  RTC_TimeStruct->Minutes = 0U;
348  RTC_TimeStruct->Seconds = 0U;
349 }

◆ LL_RTC_WaitForSynchro()

ErrorStatus LL_RTC_WaitForSynchro ( RTC_TypeDef *  RTCx)

Waits until the RTC Time and Day registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock.

Note
The RTC Resynchronization mode is write protected, use the LL_RTC_DisableWriteProtection before calling this function.
To read the calendar through the shadow registers after Calendar initialization, calendar update or after wakeup from low power modes the software must first clear the RSF flag. The software must then wait until it is set again before reading the calendar, which means that the calendar registers have been correctly copied into the RTC_TR and RTC_DR shadow registers.
Parameters
RTCxRTC Instance
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC registers are synchronised
  • ERROR: RTC registers are not synchronised

Definition at line 800 of file stm32l4xx_ll_rtc.c.

801 {
802  __IO uint32_t timeout = RTC_SYNCHRO_TIMEOUT;
803  ErrorStatus status = SUCCESS;
804  uint32_t tmp;
805 
806  /* Check the parameter */
807  assert_param(IS_RTC_ALL_INSTANCE(RTCx));
808 
809  /* Clear RSF flag */
810  LL_RTC_ClearFlag_RS(RTCx);
811 
812  /* Wait the registers to be synchronised */
813  tmp = LL_RTC_IsActiveFlag_RS(RTCx);
814  while ((timeout != 0U) && (tmp != 0U))
815  {
816  if (LL_SYSTICK_IsActiveCounterFlag() == 1U)
817  {
818  timeout--;
819  }
820  tmp = LL_RTC_IsActiveFlag_RS(RTCx);
821  if (timeout == 0U)
822  {
823  status = ERROR;
824  }
825  }
826 
827  if (status != ERROR)
828  {
829  timeout = RTC_SYNCHRO_TIMEOUT;
830  tmp = LL_RTC_IsActiveFlag_RS(RTCx);
831  while ((timeout != 0U) && (tmp != 1U))
832  {
833  if (LL_SYSTICK_IsActiveCounterFlag() == 1U)
834  {
835  timeout--;
836  }
837  tmp = LL_RTC_IsActiveFlag_RS(RTCx);
838  if (timeout == 0U)
839  {
840  status = ERROR;
841  }
842  }
843  }
844 
845  return (status);
846 }
__STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx)
Clear Registers synchronization flag RTC_ICSR RSF LL_RTC_ClearFlag_RS.
__STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx)
Get Registers synchronization flag RTC_ICSR RSF LL_RTC_IsActiveFlag_RS.
__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void)
This function checks if the Systick counter flag is active or not.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))