Kernel description
UM1743
28/111
DocID026161 Rev 4
3.11
Clock and date
The clock and date are managed by the RTC HAL driver, the RTC module initializes the
LSE source clock and provides a set of methods to retrieve date and clock in addition to
backup save and restore ones.
shows the different APIs offered by the RTC module:
The following code shows an example of how to retrieve the system data:
The kernel uses the RTC for modules settings saving and getting the time and date,
displayed in the status bar of the main desktop. Time and date could be changed through
the system module, as shown in
and in
.
Table 3. APIs from the RTC module
Function
Description
k_calendarBkuplinit
Initialize RTC peripheral (clock and backup registers)
k_BkupSaveParameter
Save a 32bits word into backup registers
k_BkupRestoreParameter
Retrieve a saved 32bits word from backup registers
k_SetTime
Change system time through the RTC_TimeTypeDef
k_GetTime
Get system time into the RTC_TimeTypeDef structure
k_SetDate
Change system date through the RTC_DateTypeDef
k_GetDate
Get system date into the RTC_DateTypeDef structure