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

Committer:
togayan
Date:
Sat Mar 01 00:18:23 2014 +0000
Revision:
6:e7073adacdc8
Parent:
4:75ed86b78045
Add indicator LED.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
togayan 1:f8713c387a68 1 #ifndef CLOCK_H
togayan 1:f8713c387a68 2 #define CLOCK_H
togayan 1:f8713c387a68 3
togayan 1:f8713c387a68 4 #include "mbed.h"
togayan 3:061cccf4093a 5 #include <vector>
togayan 1:f8713c387a68 6 #include "I_NotifyUpdate.h"
togayan 1:f8713c387a68 7 #include "I_SetPresentTime.h"
togayan 3:061cccf4093a 8 #include "I_SetMode.h"
togayan 2:6f0158399eff 9 #include "OperationMode.h"
togayan 1:f8713c387a68 10
togayan 1:f8713c387a68 11 namespace Model
togayan 1:f8713c387a68 12 {
togayan 1:f8713c387a68 13 class Clock
togayan 1:f8713c387a68 14 {
togayan 1:f8713c387a68 15 public:
togayan 1:f8713c387a68 16 Clock(I_NotifyUpdate* notifyUpdate, I_SetPresentTime* setPresentTime);
togayan 1:f8713c387a68 17
togayan 3:061cccf4093a 18 void addSetMode(I_SetMode* setMode);
togayan 1:f8713c387a68 19 void initialize();
togayan 1:f8713c387a68 20 void renew();
togayan 2:6f0158399eff 21 struct tm* getDateTime();
togayan 2:6f0158399eff 22 void requestModeChange();
togayan 2:6f0158399eff 23 void requestIncrementValue();
togayan 2:6f0158399eff 24 void requestDecrementValue();
togayan 1:f8713c387a68 25
togayan 1:f8713c387a68 26 private:
togayan 1:f8713c387a68 27 I_NotifyUpdate* m_notifyUpdate;
togayan 1:f8713c387a68 28 I_SetPresentTime* m_setPresentTime;
togayan 2:6f0158399eff 29 struct tm m_dateTime;
togayan 2:6f0158399eff 30 OperationMode m_mode;
togayan 3:061cccf4093a 31 std::vector<I_SetMode*> m_setModes;
togayan 2:6f0158399eff 32
togayan 2:6f0158399eff 33 void notifyMode();
togayan 2:6f0158399eff 34 int getDays();
togayan 2:6f0158399eff 35 void decideDayOfMonth();
togayan 2:6f0158399eff 36 void decideDayOfWeek();
togayan 1:f8713c387a68 37 };
togayan 1:f8713c387a68 38 }
togayan 1:f8713c387a68 39
togayan 1:f8713c387a68 40 #endif // CLOCK_H