41 #if defined(ARDUINO) && ARDUINO >= 100 50 tmSecond, tmMinute, tmHour, tmWday, tmDay,tmMonth, tmYear, tmNbrFields
64 #define tmYearToCalendar(Y) ((Y) + 1970) // full four digit year 65 #define CalendarYrToTm(Y) ((Y) - 1970) 66 #define tmYearToY2k(Y) ((Y) - 30) // offset is from 2000 67 #define y2kYearToTm(Y) ((Y) + 30) 79 #define RTC_SECONDS 0x00 80 #define RTC_MINUTES 0x01 81 #define RTC_HOURS 0x02 84 #define RTC_MONTH 0x05 86 #define ALM1_SECONDS 0x07 87 #define ALM1_MINUTES 0x08 88 #define ALM1_HOURS 0x09 89 #define ALM1_DAYDATE 0x0A 90 #define ALM2_MINUTES 0x0B 91 #define ALM2_HOURS 0x0C 92 #define ALM2_DAYDATE 0x0D 93 #define RTC_CONTROL 0x0E 94 #define RTC_STATUS 0x0F 95 #define RTC_AGING 0x10 98 #define SRAM_START_ADDR 0x14 //first SRAM address 99 #define SRAM_SIZE 236 //number of bytes of SRAM 131 enum SQWAVE_FREQS_t {SQWAVE_1_HZ, SQWAVE_1024_HZ, SQWAVE_4096_HZ, SQWAVE_8192_HZ, SQWAVE_NONE};
135 ALM1_EVERY_SECOND = 0x0F,
136 ALM1_MATCH_SECONDS = 0x0E,
137 ALM1_MATCH_MINUTES = 0x0C,
138 ALM1_MATCH_HOURS = 0x08,
139 ALM1_MATCH_DATE = 0x00,
140 ALM1_MATCH_DAY = 0x10,
141 ALM2_EVERY_MINUTE = 0x8E,
142 ALM2_MATCH_MINUTES = 0x8C,
143 ALM2_MATCH_HOURS = 0x88,
144 ALM2_MATCH_DATE = 0x80,
145 ALM2_MATCH_DAY = 0x90,
148 #define ALARM_1 1 //constants for calling functions 152 #define DS1307_CH 7 //for DS1307 compatibility, Clock Halt bit in Seconds register 153 #define HR1224 6 //Hours register 12 or 24 hour mode (24 hour mode==0) 154 #define CENTURY 7 //Century bit in Month register 155 #define DYDT 6 //Day/Date flag bit in alarm Day/Date registers 161 static time_t
get(void);
165 byte writeRTC(byte addr, byte *values, byte nBytes);
166 byte writeRTC(byte addr, byte value);
167 byte readRTC(byte addr, byte *values, byte nBytes);
168 byte readRTC(byte addr);
169 void setAlarm(ALARM_TYPES_t alarmType, byte seconds, byte minutes, byte hours, byte daydate);
170 void setAlarm(ALARM_TYPES_t alarmType, byte minutes, byte hours, byte daydate);
171 void alarmInterrupt(byte alarmNumber,
bool alarmEnabled);
172 bool alarm(byte alarmNumber);
173 void squareWave(SQWAVE_FREQS_t freq);
174 bool oscStopped(
bool clearOSF =
true);
175 int temperature(
void);
178 uint8_t dec2bcd(uint8_t n);
179 static uint8_t bcd2dec(uint8_t n);
Definition: DS3232RTC.h:157
Definition: DS3232RTC.h:53