xref: /netbsd-src/sys/dev/i2c/pcf8563reg.h (revision 198c829970b96328c892657ff80e6906953f728b)
1 /*	$NetBSD: pcf8563reg.h,v 1.2 2015/01/11 18:56:54 jmcneill Exp $	*/
2 
3 /*
4  * Jonathan Kollasch, 2011
5  *
6  * This file is in the public domain.
7  */
8 
9 /*
10  * NXP (Philips) PCF8563 RTC registers
11  */
12 
13 /* We only have clock mode registers here */
14 
15 #ifndef _PCF8563REG_H_
16 #define _PCF8563REG_H_
17 
18 /*
19  * PCF8563 RTC I2C address:
20  *
21  *	101 0001
22  */
23 #define PCF8563_ADDR		0x51
24 
25 #define PCF8563_R_CS1		0x00
26 #define PCF8563_R_CS2		0x01
27 #define PCF8563_R_SECOND	0x02
28 #define PCF8563_R_MINUTE	0x03
29 #define PCF8563_R_HOUR		0x04
30 #define PCF8563_R_DAY		0x05
31 #define PCF8563_R_WEEKDAY	0x06
32 #define PCF8563_R_MONTH		0x07
33 #define PCF8563_R_YEAR		0x08
34 #define PCF8563_R_MINUTE_ALARM	0x09
35 #define PCF8563_R_HOUR_ALARM	0x0a
36 #define PCF8563_R_DAY_ALARM	0x0b
37 #define PCF8563_R_WEEKDAY_ALARM	0x0c
38 #define PCF8563_R_CLKOUT_CNTRL	0x0d
39 #define PCF8563_R_TIMER_CNTRL	0x0e
40 #define PCF8563_R_TIMER		0x0f
41 
42 #define PCF8563_NREGS		0x10
43 
44 #define PCF8563_M_SECOND	0x7f
45 #define PCF8563_M_VL		0x80
46 #define PCF8563_M_MINUTE	0x7f
47 #define PCF8563_M_HOUR		0x3f
48 #define PCF8563_M_DAY		0x3f
49 #define PCF8563_M_WEEKDAY	0x07
50 #define PCF8563_M_MONTH		0x1f
51 #define PCF8563_M_CENTURY	0x80
52 #define PCF8563_M_YEAR		0xff
53 
54 #endif	/* _PCF8563REG_H_ */
55