Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.

Access to the real time clock. More...

Classes

class  RtcClass
 

Functions

 RtcClass::RtcClass ()
 Instantiate real time clock object. More...
 
uint64_t RtcClass::getRtcNanoseconds ()
 Get nanoseconds from RTC. More...
 
uint32_t RtcClass::getRtcSeconds ()
 Get seconds from RTC. More...
 
bool RtcClass::setRtcNanoseconds (uint64_t nanoseconds)
 Set RTC nanoseconds. More...
 
bool RtcClass::setRtcSeconds (uint32_t seconds)
 Set RTC. More...
 

Variables

uint64_t RtcData::time
 Quantity of nanoseconds since epoch. More...
 
uint32_t RtcData::magic
 Magic ID used to identify that RTC has been initialised. More...
 
uint32_t RtcData::cycles
 Quantity of RTC cycles since last update. More...
 
RtcClass RTC
 Global instance of real time clock object. More...
 

Detailed Description

Access to the real time clock.

Real time clock class.

Note
Provides ability to set and read the ESP8266 RTC.

Function Documentation

uint64_t RtcClass::getRtcNanoseconds ( )

Get nanoseconds from RTC.

Return values
uint64_tQuantity of nanoseconds since last RTC reset or set
uint32_t RtcClass::getRtcSeconds ( )

Get seconds from RTC.

Return values
uint32_tQuantity of seconds since epoch
Note
Also updates RTC NVRAM
RtcClass::RtcClass ( )

Instantiate real time clock object.

bool RtcClass::setRtcNanoseconds ( uint64_t  nanoseconds)

Set RTC nanoseconds.

Parameters
nanosecondsValue to set RTC to
Return values
boolTrue on success
bool RtcClass::setRtcSeconds ( uint32_t  seconds)

Set RTC.

Parameters
secondsQuantity of seconds since epoch
Return values
boolTrue on success
Note
Updates RTC NVRAM

Variable Documentation

uint32_t RtcData::cycles

Quantity of RTC cycles since last update.

uint32_t RtcData::magic

Magic ID used to identify that RTC has been initialised.

RtcClass RTC

Global instance of real time clock object.

Note
Use RTC.function to access real time clock functions
Example:
1 RTC.setRtcSeconds(1454225610); //set time to 07:33:30 2016-31-01
uint64_t RtcData::time

Quantity of nanoseconds since epoch.