-
Notifications
You must be signed in to change notification settings - Fork 0
/
DS1307RTC.h
35 lines (27 loc) · 710 Bytes
/
DS1307RTC.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* DS1307RTC.h - library for DS1307 RTC
* This library is intended to be uses with Arduino Time.h library functions
*/
#ifndef ESP8266
#ifndef DS1307RTC_h
#define DS1307RTC_h
#include "Time.h"
// library interface description
class DS1307RTC
{
// user-accessible "public" interface
public:
DS1307RTC();
static time_t get();
static void set(time_t t);
static void read(tmElements_t &tm);
static void write(tmElements_t &tm);
static uint8_t detect();
private:
static uint8_t dec2bcd(uint8_t num);
static uint8_t bcd2dec(uint8_t num);
static int ctrl_id; // ray: added ctrl_id variable to store chip id
};
extern DS1307RTC RTC;
#endif
#endif