STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Time and Date configuration functions

Time and Date configuration functions. More...

Functions

ErrorStatus RTC_SetTime (uint32_t RTC_Format, RTC_TimeTypeDef *RTC_TimeStruct)
 Set the RTC current time. More...
 
void RTC_TimeStructInit (RTC_TimeTypeDef *RTC_TimeStruct)
 Fills each RTC_TimeStruct member with its default value (Time = 00h:00min:00sec). More...
 
void RTC_GetTime (uint32_t RTC_Format, RTC_TimeTypeDef *RTC_TimeStruct)
 Get the RTC current Time. More...
 
uint32_t RTC_GetSubSecond (void)
 Gets the RTC current Calendar Subseconds value. More...
 
ErrorStatus RTC_SetDate (uint32_t RTC_Format, RTC_DateTypeDef *RTC_DateStruct)
 Set the RTC current date. More...
 
void RTC_DateStructInit (RTC_DateTypeDef *RTC_DateStruct)
 Fills each RTC_DateStruct member with its default value (Monday, January 01 xx00). More...
 
void RTC_GetDate (uint32_t RTC_Format, RTC_DateTypeDef *RTC_DateStruct)
 Get the RTC current date. More...
 

Detailed Description

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).

Function Documentation

void RTC_DateStructInit ( RTC_DateTypeDef RTC_DateStruct)

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
None
void RTC_GetDate ( uint32_t  RTC_Format,
RTC_DateTypeDef RTC_DateStruct 
)

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
None
uint32_t RTC_GetSubSecond ( void  )

Gets the RTC current Calendar Subseconds value.

Note
This function freeze the Time and Date registers after reading the SSR register.
Parameters
None
Return values
RTCcurrent Calendar Subseconds value.
void RTC_GetTime ( uint32_t  RTC_Format,
RTC_TimeTypeDef RTC_TimeStruct 
)

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
None
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
AnErrorStatus 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
AnErrorStatus enumeration value:
  • SUCCESS: RTC Time register is configured
  • ERROR: RTC Time register is not configured
void RTC_TimeStructInit ( RTC_TimeTypeDef RTC_TimeStruct)

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
None