diff options
author | Mike Beattie <mike@ethernal.org> | 2012-03-20 23:25:17 +1300 |
---|---|---|
committer | Mike Beattie <mike@ethernal.org> | 2012-03-20 23:25:17 +1300 |
commit | cb7bd533cb2b505441ca9a35c9897db358a30b47 (patch) | |
tree | fd20d304a519730798433e9835ce3e8e12f703fc /DS1307RTC/DS1307RTC.h |
Add Time library
Signed-off-by: Mike Beattie <mike@ethernal.org>
Diffstat (limited to 'DS1307RTC/DS1307RTC.h')
-rw-r--r-- | DS1307RTC/DS1307RTC.h | 31 |
1 files changed, 31 insertions, 0 deletions
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 <Time.h>
+
+// 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
+
+
|