Time and Date configuration functions.
More...
Time and Date configuration functions.
===============================================================================
Time and Date configuration functions
===============================================================================
This section provide functions allowing to program and read the RTC Calendar
(Time and Date).
Fills each RTC_DateStruct member with its default value (Monday, January 01 xx00).
- Parameters
-
RTC_DateStruct,: | pointer to a RTC_DateTypeDef structure which will be initialized. |
- Return values
-
Get the RTC current date.
- Parameters
-
RTC_Format,: | specifies the format of the returned parameters. This parameter can be one of the following values:
- RTC_Format_BIN: Binary data format
- RTC_Format_BCD: BCD data format
|
RTC_DateStruct,: | pointer to a RTC_DateTypeDef structure that will contain the returned current date configuration. |
- Return values
-
Get the RTC current Time.
- Parameters
-
RTC_Format,: | specifies the format of the returned parameters. This parameter can be one of the following values:
- RTC_Format_BIN: Binary data format
- RTC_Format_BCD: BCD data format
|
RTC_TimeStruct,: | pointer to a RTC_TimeTypeDef structure that will contain the returned current time configuration. |
- Return values
-
ErrorStatus RTC_SetDate |
( |
uint32_t |
RTC_Format, |
|
|
RTC_DateTypeDef * |
RTC_DateStruct |
|
) |
| |
Set the RTC current date.
- Parameters
-
RTC_Format,: | specifies the format of the entered parameters. This parameter can be one of the following values:
- RTC_Format_BIN: Binary data format
- RTC_Format_BCD: BCD data format
|
RTC_DateStruct,: | pointer to a RTC_DateTypeDef structure that contains the date configuration information for the RTC. |
- Return values
-
An | ErrorStatus enumeration value:
- SUCCESS: RTC Date register is configured
- ERROR: RTC Date register is not configured
|
ErrorStatus RTC_SetTime |
( |
uint32_t |
RTC_Format, |
|
|
RTC_TimeTypeDef * |
RTC_TimeStruct |
|
) |
| |
Set the RTC current time.
- Parameters
-
RTC_Format,: | specifies the format of the entered parameters. This parameter can be one of the following values:
- RTC_Format_BIN: Binary data format
- RTC_Format_BCD: BCD data format
|
RTC_TimeStruct,: | pointer to a RTC_TimeTypeDef structure that contains the time configuration information for the RTC. |
- Return values
-
An | ErrorStatus enumeration value:
- SUCCESS: RTC Time register is configured
- ERROR: RTC Time register is not configured
|
Fills each RTC_TimeStruct member with its default value (Time = 00h:00min:00sec).
- Parameters
-
RTC_TimeStruct,: | pointer to a RTC_TimeTypeDef structure which will be initialized. |
- Return values
-