From cb7bd533cb2b505441ca9a35c9897db358a30b47 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Tue, 20 Mar 2012 23:25:17 +1300 Subject: Add Time library Signed-off-by: Mike Beattie --- DS1307RTC/DS1307RTC.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 DS1307RTC/DS1307RTC.h (limited to 'DS1307RTC/DS1307RTC.h') diff --git a/DS1307RTC/DS1307RTC.h b/DS1307RTC/DS1307RTC.h new file mode 100644 index 0000000..e3a1bc1 --- /dev/null +++ b/DS1307RTC/DS1307RTC.h @@ -0,0 +1,31 @@ +/* + * DS1307RTC.h - library for DS1307 RTC + * This library is intended to be uses with Arduino Time.h library functions + */ + +#ifndef DS1307RTC_h +#define DS1307RTC_h + +#include + +// library interface description +class DS1307RTC +{ + // user-accessible "public" interface + public: + DS1307RTC(); + static time_t get(); + static void set(time_t t); + static void read(tmElements_t &tm); + static void write(tmElements_t &tm); + + private: + static uint8_t dec2bcd(uint8_t num); + static uint8_t bcd2dec(uint8_t num); +}; + +extern DS1307RTC RTC; + +#endif + + -- cgit v1.2.3