miso dengaku / RTC8564
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RTC8564.h Source File

RTC8564.h

00001 #define RTC8564NB_ADR 0xA2
00002 
00003 #define CONTROL1 0x00
00004 #define CONTROL2 0x01
00005 #define SECONDS 0x02
00006 #define MINUTES 0x03
00007 #define HOURS 0x04
00008 #define DAYS 0x05
00009 #define WEEKDAYS 0x06
00010 #define MONTHS 0x07
00011 #define YEARS 0x08
00012 #define MINUTE_ALARM 0x09
00013 #define HOUR_ALARM 0x0A
00014 #define DAY_ALARM 0x0B
00015 #define WEEKDAY_ALARM 0x0C
00016 #define CLOCKOUT_FREQ 0x0D
00017 #define TIMER_CONTROL 0x0E
00018 #define TIMER 0x0F
00019 #define _READ 0x01
00020 #include "mbed.h"
00021 
00022 class RTC8564{
00023 public:
00024     RTC8564(PinName sda = p9, PinName scl = p10) : i2c(sda, scl) {
00025     }
00026     void write(char address, char value);
00027     char read(char address);
00028     void time_just();
00029     void setdaytime(char y[3], char m[3], char d[3], char h[3], char min[3], char s[3], char week_val[2]);
00030 private:
00031     I2C i2c;
00032 };