1.8.17.2 1.25.17.8 1.26.15.8 1.27.17.8 1.28.20.8 1.34.16.8 1.35.11.8 1.36.14.8 1.41.17.8 1.42.15.8 RTC_TimeSet Function
C
bool RTC_TimeSet( struct tm *time )
Summary
Sets the Time for the RTC peripheral.
Description
This function updates the time for RTC peripheral as configured by the user.
Precondition
None.
Parameters
Param | Description |
---|---|
time | Pointer to struct tm |
Returns
True if Valid Time and/or Date is configured, False otherwise.
Example
struct tm dateTime; //Hour dateTime.tm_hour = 12; //second dateTime.tm_sec = 0; //Minute dateTime.tm_min = 34; //Month dateTime.tm_mon = 11; //Year dateTime.tm_year = 2017; //day of the month dateTime.tm_mday = 14; //day of the week dateTime.tm_wday = 1; RTC_TimeSet( &dateTime );
Remarks
The structure can be deleted once the API returns to free up the memory