RTC8563

Dependents:   rtc_func Projekt_Wecker_LCD Projekt_Wecker_LCD Projekt_Wecker_LCD

Revision:
1:85010252766c
Parent:
0:9017c5d1bbb2
diff -r 9017c5d1bbb2 -r 85010252766c RTC8563.cpp
--- a/RTC8563.cpp	Thu Apr 16 10:35:00 2015 +0000
+++ b/RTC8563.cpp	Thu Apr 23 09:38:46 2015 +0000
@@ -56,8 +56,24 @@
  
 void RTC8563::rtc_init()
 {
+    rtc_write(CONTROL1, 0x20); //stop
+    rtc_write(CONTROL2, 0x00);
+    rtc_write(HOURS, 0x06);
+    rtc_write(MINUTES, 0x59);
+    rtc_write(SECONDS, 0x00);
+    rtc_write(WEEKDAYS, 0x05);
+    rtc_write(CLOCKOUT_FREQ, 0x00); // 0x83 = TE on & 1Hz
+    rtc_write(TIMER_CINTROL, 0x00);
+    rtc_write(CONTROL1, 0x00); //start
 }
  
 void RTC8563::rtc_alarm()
 {
+    rtc_write(CONTROL1, 0x20); //stop
+    rtc_write(CONTROL2, 0x02); // alarm AF alarm flag bit
+    rtc_write(DAY_ALARM, (0x80) );
+    rtc_write(HOUR_ALARM, (0x97));
+    rtc_write(MINUTE_ALARM, (0x02));
+    rtc_write(WEEKDAY_ALARM, (0x80));
+    rtc_write(CONTROL1, 0x00); //start
 }
\ No newline at end of file