Simple RTC class based on DS1307. Emphasis on simple. Allows you to run at 100k or 400k Hz (for newer DS1307 capable devices). MapTime() allows you to set the time() service to the same as the RTC. Uses struct tm throughout so you can use traditional time functions for manipulation.
Diff: RTclock.h
- Revision:
- 7:3621025e7949
- Parent:
- 6:984fd3ba519a
- Child:
- 9:3a0ba8364ef2
diff -r 984fd3ba519a -r 3621025e7949 RTclock.h --- a/RTclock.h Sat Aug 09 17:05:44 2014 +0000 +++ b/RTclock.h Sun Aug 10 12:34:32 2014 +0000 @@ -27,31 +27,30 @@ ); virtual ~RTclock(); - bool IsTwelveHour(); // true if set to a 12hr clock (adjust tm.tm_hour as appropraite) - virtual bool MapTime(); // Maps RTC chip to C time.h time system - virtual bool GetTime(tm & out_sTM); // Get a TM structure directly - static const char * GetWeekday(int in_nWeekDay); - virtual bool SetSquareWaveOutput + bool isTwelveHour(); // true if set to a 12hr clock (adjust tm.tm_hour as appropraite) + virtual bool mapTime(); // Maps RTC chip to C time.h time system + virtual bool getTime(tm & out_sTM); // Get a TM structure directly + virtual bool setSquareWaveOutput ( bool in_bEnable, ESquareWaveRates in_nRateSelect ); - virtual bool SetTime // Set time time using a TM structure (always starts) + virtual bool setTime // Set time time using a TM structure (always starts) ( const tm & in_sTM, bool in_bTwelveHour ); protected: - static int BcdToDecimal(int in_nBCD); - static int DecimalToBcd(int in_nDecimal); + static int bcdToDecimal(int in_nBCD); + static int decimalToBcd(int in_nDecimal); virtual bool read ( int in_nAddress, char * out_pBuffer, int in_nLength ); - virtual bool SetRunning(bool in_nEnable); + virtual bool setRunning(bool in_nEnable); virtual bool write ( int in_nAddress,