Erick / Mbed 2 deprecated ICE-F412

Dependencies:   mbed-rtos mbed

Revision:
0:61364762ee0e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ICE-Application/src/Drivers/rtc.h	Tue Jan 24 19:05:33 2017 +0000
@@ -0,0 +1,43 @@
+#ifndef _RTC_H_
+#define _RTC_H_
+
+// -------------------------------------------------------------------------------------------------
+// globals
+
+#define RTC_ADDR 0xD0 // address byte: 0b11010000(R/W) -> DS1339
+
+#define RTC_SIZE_ADDR           1
+#define RTC_SIZE_DATA           7
+#define RTC_SIZE_CONTROL        1
+#define RTC_SIZE_STAUS          1
+
+#define RTC_SECONDS_ADDR        0x0
+#define RTC_MINUTES_ADDR        0x1
+#define RTC_HOURS_ADDR          0x2
+#define RTC_DOW_ADDR            0x3
+#define RTC_MDAY_ADDR           0x4
+#define RTC_MONTH_ADDR          0x5
+#define RTC_YEAR_ADDR           0x6
+
+#define RTC_CONTROL_ADDR        0xE
+#define RTC_STATUS_ADDR         0xF
+#define RTC_TRICKLE_ADDR        0x10
+
+extern int rtc_verbose;
+
+// -------------------------------------------------------------------------------------------------
+// function prototypes
+
+void rtc_init(void);
+void rtc_regs(void);
+
+void rtc_print(void);
+
+void rtc_get_time(int* iyr, int* imo, int* idy, int* ihr, int* imn, int* isc);
+void rtc_set_time(int  iyr, int  imo, int  idy, int  ihr, int  imn, int  isc);
+
+void rtc_set(const char* s);
+
+// -------------------------------------------------------------------------------------------------
+
+#endif // _RTC_H_