eLua reference manual - STR9 rtc module
Overview
This module contains functions for accesing the particular features of the RTC - Real Time Clock - subsystem of the STR9 family of CPUs. This internal subsystem offers functions to keep track of a real time clock calendar, as well as some other features like alarms and auxiliar functions. Reference manual, available from ST at this address.
Functions
str9.rtc.settime( time )
Sets the Real Time Clock time to a specific time of the day.
Arguments: time - a string in the format 'hh:mm:ss' or a Lua table with 'hour', 'min' and 'sec' string fields.
Returns: nothing.
str9.rtc.gettime( format )
Gets the time kept by the Real Time Clock.
Arguments: format - the string '*s' to return the time as a string 'hh:mm:ss' or '*t' to return as a Lua table with string fields 'hour', 'min' and 'sec'.
Returns: a string or a Lua table, according to the format argument.
str9.rtc.setdate( date )
Sets the Real Time Clock date to a specific date.
Arguments: date - a string in the format 'dd/mm/yyyy' or a Lua table with 'day', 'month' and 'year' string fields.
Returns: nothing.
str9.rtc.getdate( format )
Gets the date kept by the Real Time Clock.
Arguments: format - the string '*s' to return the date as a string 'dd/mm/yyyy' or '*t' to return as a Lua table with string fields 'day', 'month' and 'year'.
Returns: a string or a Lua table, according to the format argument.