Clock with Real-Time Clock (RTC-8564) and I2C LCD module(SB1062B).

Dependencies:   DebouncedEdgeIn I2cLCD_cursor Rtc8564 mbed beep

/media/uploads/togayan/imgp0004s.jpg /media/uploads/togayan/lcdclock_circuit_rev4.png

Revision:
2:6f0158399eff
Parent:
1:f8713c387a68
Child:
3:061cccf4093a
--- a/ViewModel/ClockViewModel.h	Fri Feb 14 09:24:03 2014 +0000
+++ b/ViewModel/ClockViewModel.h	Mon Feb 17 08:13:21 2014 +0000
@@ -6,33 +6,33 @@
 #include "I2cLCD/I2cLCD.h"
 #include "Model/I_NotifyUpdate.h"
 #include "Model/DateTime.h"
-#include "EventMechanism/I_EventHandler.h"
 
 namespace ViewModel
 {
 class ClockViewModel : public Model::I_NotifyUpdate
 {
 public:
-    ClockViewModel(I2cLCD& i2clcd, PinName set, PinName select, EventMechanism::I_EventHandler* evHandler, DigitalOut& led);
+    ClockViewModel(I2cLCD& i2clcd, PinName set, PinName increment, PinName decrement);
     void setClock(Model::Clock* clock);
     void initialize();
 
     virtual void dateTimeUpdated();
+    virtual void mode(Model::OperationMode mode);
 
 private:
-    void setButtonPressed();
-    void setButtonPressedAsync();
-    void selectButtonPressed();
-    void selectButtonPressedAsync();
-
-
     I2cLCD& m_i2clcd;
     InterruptIn m_set;
-    InterruptIn m_select;
-    EventMechanism::I_EventHandler* m_evHandler;
+    InterruptIn m_increment;
+    InterruptIn m_decrement;
     Model::Clock* m_clock;
-    Model::DateTime* m_dateTime;
-    DigitalOut& m_led;
+    struct tm* m_dateTime;
+    Model::OperationMode m_mode;
+    static const char* WEEKDAYS[];
+    
+    void setButtonOn();
+    void incrementButtonOn();
+    void decrementButtonOn();
+    void setCurSor();
 };
 }