RTC8564.h

Committer:
misodengaku
Date:
2012-06-20
Revision:
0:ed1f619f1794

File content as of revision 0:ed1f619f1794:

#define RTC8564NB_ADR 0xA2

#define CONTROL1 0x00
#define CONTROL2 0x01
#define SECONDS 0x02
#define MINUTES 0x03
#define HOURS 0x04
#define DAYS 0x05
#define WEEKDAYS 0x06
#define MONTHS 0x07
#define YEARS 0x08
#define MINUTE_ALARM 0x09
#define HOUR_ALARM 0x0A
#define DAY_ALARM 0x0B
#define WEEKDAY_ALARM 0x0C
#define CLOCKOUT_FREQ 0x0D
#define TIMER_CONTROL 0x0E
#define TIMER 0x0F
#define _READ 0x01
#include "mbed.h"

class RTC8564{
public:
    RTC8564(PinName sda = p9, PinName scl = p10) : i2c(sda, scl) {
    }
    void write(char address, char value);
    char read(char address);
    void time_just();
    void setdaytime(char y[3], char m[3], char d[3], char h[3], char min[3], char s[3], char week_val[2]);
private:
    I2C i2c;
};