The tcDspRtcM41T81 class is a real-time clock class used to keep track of time in increments of seconds, minutes, hours, days and years. The M41T81 also has support for hundredths of a second resolution. This class provides functions for converting time formats, as well as getting and setting the current time.
This is a simple example of tcDspRtcM41T81 creation and usage:
{ // Assume an I2C object has already been created // (See DspI2C.h for details). // Create a tcDspRtc object tcDspRtcM41T81 clock1(myI2C, I2C_address, 2005); // Set the time to May 10, 2005 4:30 PM (16:30 in 24-hour time) clock1.set_time(2005, 5, 10, 16, 30, 0); // Store the current time in a tsCLTime structure unsigned short hundredths; tsCLTime current_time = clock1.get_time(&hundredths); ... }