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

Model/Clock.h

Committer:
togayan
Date:
2014-02-17
Revision:
2:6f0158399eff
Parent:
1:f8713c387a68
Child:
3:061cccf4093a

File content as of revision 2:6f0158399eff:

#ifndef CLOCK_H
#define CLOCK_H

#include "mbed.h"
#include "I_NotifyUpdate.h"
#include "I_SetPresentTime.h"
#include "DateTime.h"
#include "OperationMode.h"

namespace Model
{
class Clock
{
public:
    Clock(I_NotifyUpdate* notifyUpdate, I_SetPresentTime* setPresentTime);

    void initialize();
    void renew();
    struct tm* getDateTime();
    void informHalfSec();
    void requestModeChange();
    void requestIncrementValue();
    void requestDecrementValue();

private:
    I_NotifyUpdate* m_notifyUpdate;
    I_SetPresentTime* m_setPresentTime;
    struct tm m_dateTime;
    OperationMode m_mode;
    
    void notifyMode();
    int getDays();
    void decideDayOfMonth();
    void decideDayOfWeek();
};
}

#endif // CLOCK_H