This is a library for managing the mbed real time clock, including functions for setting and getting the rtc in text format, getting and setting the timezone offset, and getting and setting the calibration register, both directly, and by using an adjustment API to automatically set the calibration value.

Dependents:   LAB4WEEK1 Motor

Revision:
6:a517fee06e2e
Parent:
5:fbbdf57675c3
--- a/TimeUtilities.h	Sun Oct 30 23:42:43 2011 +0000
+++ b/TimeUtilities.h	Wed Nov 02 01:32:07 2011 +0000
@@ -19,6 +19,8 @@
 ///
 /// @note
 /// History
+/// v1.04 20111101
+/// \li Minor change to the APIs to reduce some of the complexity
 /// v1.03 20111030
 /// \li Adding an API to adjust time and calibration based on how far it is
 ///     off "now", based on when it was set.
@@ -95,16 +97,6 @@
     ///
     time_t GetTimeValue();
     
-    /// GetTimeValueWhenSet gets the time in time_t seconds when the clock was last set
-    ///
-    /// This value represents the time_t time when the clock was set.
-    /// This value is not preserved through power cycles, or resets, in which
-    /// case it will return 0.
-    ///
-    /// @returns time in time_t format when the clock was last set
-    ///
-    time_t GetTimeValueWhenSet();
-    
     /// GetTimeString gets the formatted time applying the internal time-zone offset of hours and minutes
     ///
     /// It places the formatted string into the buffer in the format of
@@ -145,6 +137,16 @@
     ///
     void GetTimeString(char * buffer, time_t tValue, int hOffset, int mOffset);
 
+    /// GetTimeLastSet will extract the time_t when last set from RTC ram
+    ///
+    /// When the clock is correctly set, the time value will have been stored
+    /// which permits later adjustments to the calibration based on 
+    /// elapsed time and knowing when it was set. This function retrieves it.
+    ///
+    /// @returns time_t value when the time was last set
+    ///
+    time_t GetTimeLastSet();
+
     /// SetTimeOffset will set the hour and minute timezone offset
     ///
     /// @param offsetHour is the timezone offset in hours
@@ -244,26 +246,17 @@
     ///
     void GetTimeOffsetStore();
     
-    /// SetTimeLastSetStore will store the time_t when last set in RTC ram
+    /// SetTimeLastSet will store the time_t when last set in RTC ram
     ///
     /// When the clock is correctly set, the time value will be stored
     /// which permits later adjustments to the calibration based on 
     /// elapsed time and knowing when it was set.
     ///
+    /// @param t is the time_t value that should be saved
     /// @returns nothing
     ///
-    void SetTimeLastSetStore();
+    void SetTimeLastSet(time_t);
     
-    /// GetTimeLastSetStore will extract the time_t when last set from RTC ram
-    ///
-    /// When the clock is correctly set, the time value will have been stored
-    /// which permits later adjustments to the calibration based on 
-    /// elapsed time and knowing when it was set. This function retrieves it.
-    ///
-    /// @returns nothing
-    ///
-    void GetTimeLastSetStore();
-
 };
 
 #endif