Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
Time
[RTC Exported Functions]
Functions | |
| __STATIC_INLINE void | LL_RTC_TIME_SetFormat (RTC_TypeDef *RTCx, uint32_t Format) |
| Set time format (AM/24-hour or PM notation) | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_GetFormat (RTC_TypeDef *RTCx) |
| Get time format (AM or PM notation) | |
| __STATIC_INLINE void | LL_RTC_TIME_SetHour (RTC_TypeDef *RTCx, uint32_t Hour) |
| Set Hour in BCD format. | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_GetHour (RTC_TypeDef *RTCx) |
| Get Hour in BCD format. | |
| __STATIC_INLINE void | LL_RTC_TIME_SetMinute (RTC_TypeDef *RTCx, uint32_t Minute) |
| Set Minute in BCD format. | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_GetMinute (RTC_TypeDef *RTCx) |
| Get Minute in BCD format. | |
| __STATIC_INLINE void | LL_RTC_TIME_SetSecond (RTC_TypeDef *RTCx, uint32_t Second) |
| Set Second in BCD format. | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_GetSecond (RTC_TypeDef *RTCx) |
| Get Second in BCD format. | |
| __STATIC_INLINE void | LL_RTC_TIME_Config (RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hour, uint32_t Minute, uint32_t Second) |
| Set time (hour, minute and second) in BCD format. | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_Get (RTC_TypeDef *RTCx) |
| Get time (hour, minute and second) in BCD format. | |
| __STATIC_INLINE void | LL_RTC_TIME_EnableDayLightStore (RTC_TypeDef *RTCx) |
| Memorize whether the daylight saving time change has been performed. | |
| __STATIC_INLINE void | LL_RTC_TIME_DisableDayLightStore (RTC_TypeDef *RTCx) |
| Disable memorization whether the daylight saving time change has been performed. | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_IsDayLightStoreEnabled (RTC_TypeDef *RTCx) |
| Check if RTC Day Light Saving stored operation has been enabled or not CR BCK LL_RTC_TIME_IsDayLightStoreEnabled. | |
| __STATIC_INLINE void | LL_RTC_TIME_DecHour (RTC_TypeDef *RTCx) |
| Subtract 1 hour (winter time change) | |
| __STATIC_INLINE void | LL_RTC_TIME_IncHour (RTC_TypeDef *RTCx) |
| Add 1 hour (summer time change) | |
| __STATIC_INLINE uint32_t | LL_RTC_TIME_GetSubSecond (RTC_TypeDef *RTCx) |
| Get Sub second value in the synchronous prescaler counter. | |
| __STATIC_INLINE void | LL_RTC_TIME_Synchronize (RTC_TypeDef *RTCx, uint32_t ShiftSecond, uint32_t Fraction) |
| Synchronize to a remote clock with a high degree of precision. | |
Function Documentation
| __STATIC_INLINE void LL_RTC_TIME_Config | ( | RTC_TypeDef * | RTCx, |
| uint32_t | Format12_24, | ||
| uint32_t | Hour, | ||
| uint32_t | Minute, | ||
| uint32_t | Second | ||
| ) |
Set time (hour, minute and second) in BCD format.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before.
- It can be written in initialization mode only (LL_RTC_EnableInitMode function)
-
Format and Hour should follow the same format TR PM LL_RTC_TIME_Config
TR HT LL_RTC_TIME_Config
TR HU LL_RTC_TIME_Config
TR MNT LL_RTC_TIME_Config
TR MNU LL_RTC_TIME_Config
TR ST LL_RTC_TIME_Config
TR SU LL_RTC_TIME_Config
- Parameters:
-
RTCx RTC Instance Format12_24 This parameter can be one of the following values: - LL_RTC_TIME_FORMAT_AM_OR_24
- LL_RTC_TIME_FORMAT_PM
Hour 0x01. . .0x12 or 0x00. . .0x23 Minute 0x00. . .0x59 Second 0x00. . .0x59
- Return values:
-
None
Definition at line 1120 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_DecHour | ( | RTC_TypeDef * | RTCx ) |
Subtract 1 hour (winter time change)
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before. CR SUB1H LL_RTC_TIME_DecHour
- Parameters:
-
RTCx RTC Instance
- Return values:
-
None
Definition at line 1195 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_DisableDayLightStore | ( | RTC_TypeDef * | RTCx ) |
Disable memorization whether the daylight saving time change has been performed.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before. CR BCK LL_RTC_TIME_DisableDayLightStore
- Parameters:
-
RTCx RTC Instance
- Return values:
-
None
Definition at line 1172 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_EnableDayLightStore | ( | RTC_TypeDef * | RTCx ) |
Memorize whether the daylight saving time change has been performed.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before. CR BCK LL_RTC_TIME_EnableDayLightStore
- Parameters:
-
RTCx RTC Instance
- Return values:
-
None
Definition at line 1160 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_Get | ( | RTC_TypeDef * | RTCx ) |
Get time (hour, minute and second) in BCD format.
- Note:
- if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set before reading this bit
- Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
-
helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND are available to get independently each parameter. TR HT LL_RTC_TIME_Get
TR HU LL_RTC_TIME_Get
TR MNT LL_RTC_TIME_Get
TR MNU LL_RTC_TIME_Get
TR ST LL_RTC_TIME_Get
TR SU LL_RTC_TIME_Get
- Parameters:
-
RTCx RTC Instance
- Return values:
-
Combination of hours, minutes and seconds (Format: 0x00HHMMSS).
Definition at line 1148 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_GetFormat | ( | RTC_TypeDef * | RTCx ) |
Get time format (AM or PM notation)
- Note:
- if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set before reading this bit
- Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). TR PM LL_RTC_TIME_GetFormat
- Parameters:
-
RTCx RTC Instance
- Return values:
-
Returned value can be one of the following values: - LL_RTC_TIME_FORMAT_AM_OR_24
- LL_RTC_TIME_FORMAT_PM
Definition at line 980 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_GetHour | ( | RTC_TypeDef * | RTCx ) |
Get Hour in BCD format.
- Note:
- if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set before reading this bit
- Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
-
helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to Binary format TR HT LL_RTC_TIME_GetHour
TR HU LL_RTC_TIME_GetHour
- Parameters:
-
RTCx RTC Instance
- Return values:
-
0x01. . .0x12 or 0x00. . .0x23
Definition at line 1015 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_GetMinute | ( | RTC_TypeDef * | RTCx ) |
Get Minute in BCD format.
- Note:
- if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set before reading this bit
- Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
-
helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD to Binary format TR MNT LL_RTC_TIME_GetMinute
TR MNU LL_RTC_TIME_GetMinute
- Parameters:
-
RTCx RTC Instance
- Return values:
-
0x00. . .0x59
Definition at line 1053 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_GetSecond | ( | RTC_TypeDef * | RTCx ) |
Get Second in BCD format.
- Note:
- if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set before reading this bit
- Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)).
-
helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Second from BCD to Binary format TR ST LL_RTC_TIME_GetSecond
TR SU LL_RTC_TIME_GetSecond
- Parameters:
-
RTCx RTC Instance
- Return values:
-
0x00. . .0x59
Definition at line 1091 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_GetSubSecond | ( | RTC_TypeDef * | RTCx ) |
Get Sub second value in the synchronous prescaler counter.
- Note:
- You can use both SubSeconds value and SecondFraction (PREDIV_S through LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar SubSeconds value in second fraction ratio with time unit following generic formula: ==> Second fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit This conversion can be performed only if no shift operation is pending (ie. SHFP=0) when PREDIV_S >= SS. SSR SS LL_RTC_TIME_GetSubSecond
- Parameters:
-
RTCx RTC Instance
- Return values:
-
Sub second value (number between 0 and 65535)
Definition at line 1225 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_IncHour | ( | RTC_TypeDef * | RTCx ) |
Add 1 hour (summer time change)
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before. CR ADD1H LL_RTC_TIME_IncHour
- Parameters:
-
RTCx RTC Instance
- Return values:
-
None
Definition at line 1207 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE uint32_t LL_RTC_TIME_IsDayLightStoreEnabled | ( | RTC_TypeDef * | RTCx ) |
Check if RTC Day Light Saving stored operation has been enabled or not CR BCK LL_RTC_TIME_IsDayLightStoreEnabled.
- Parameters:
-
RTCx RTC Instance
- Return values:
-
State of bit (1 or 0).
Definition at line 1183 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_SetFormat | ( | RTC_TypeDef * | RTCx, |
| uint32_t | Format | ||
| ) |
Set time format (AM/24-hour or PM notation)
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before.
- It can be written in initialization mode only (LL_RTC_EnableInitMode function) TR PM LL_RTC_TIME_SetFormat
- Parameters:
-
RTCx RTC Instance Format This parameter can be one of the following values: - LL_RTC_TIME_FORMAT_AM_OR_24
- LL_RTC_TIME_FORMAT_PM
- Return values:
-
None
Definition at line 963 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_SetHour | ( | RTC_TypeDef * | RTCx, |
| uint32_t | Hour | ||
| ) |
Set Hour in BCD format.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before.
- It can be written in initialization mode only (LL_RTC_EnableInitMode function)
-
helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format TR HT LL_RTC_TIME_SetHour
TR HU LL_RTC_TIME_SetHour
- Parameters:
-
RTCx RTC Instance Hour 0x01. . .0x12 or 0x00. . .0x23
- Return values:
-
None
Definition at line 996 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_SetMinute | ( | RTC_TypeDef * | RTCx, |
| uint32_t | Minute | ||
| ) |
Set Minute in BCD format.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before.
- It can be written in initialization mode only (LL_RTC_EnableInitMode function)
-
helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minute from binary to BCD format TR MNT LL_RTC_TIME_SetMinute
TR MNU LL_RTC_TIME_SetMinute
- Parameters:
-
RTCx RTC Instance Minute 0x00. . .0x59
- Return values:
-
None
Definition at line 1034 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_SetSecond | ( | RTC_TypeDef * | RTCx, |
| uint32_t | Second | ||
| ) |
Set Second in BCD format.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before.
- It can be written in initialization mode only (LL_RTC_EnableInitMode function)
-
helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Second from binary to BCD format TR ST LL_RTC_TIME_SetSecond
TR SU LL_RTC_TIME_SetSecond
- Parameters:
-
RTCx RTC Instance Second 0x00. . .0x59
- Return values:
-
None
Definition at line 1072 of file stm32l4xx_ll_rtc.h.
| __STATIC_INLINE void LL_RTC_TIME_Synchronize | ( | RTC_TypeDef * | RTCx, |
| uint32_t | ShiftSecond, | ||
| uint32_t | Fraction | ||
| ) |
Synchronize to a remote clock with a high degree of precision.
This operation effectively subtracts from (delays) or advance the clock of a fraction of a second.
- Note:
- Bit is write-protected. LL_RTC_DisableWriteProtection function should be called before.
-
When REFCKON is set, firmware must not write to Shift control register. SHIFTR ADD1S LL_RTC_TIME_Synchronize
SHIFTR SUBFS LL_RTC_TIME_Synchronize
- Parameters:
-
RTCx RTC Instance ShiftSecond This parameter can be one of the following values: - LL_RTC_SHIFT_SECOND_DELAY
- LL_RTC_SHIFT_SECOND_ADVANCE
Fraction Number of Second Fractions (any value from 0 to 0x7FFF)
- Return values:
-
None
Definition at line 1244 of file stm32l4xx_ll_rtc.h.
Generated on Tue Jul 12 2022 11:35:24 by
1.7.2
