Sync usage with man page.
[netbsd-mini2440.git] / sys / dev / i2c / pcf8583reg.h
bloba88a771d6f53f9992514354e2d5ef0628e34c0f9
1 /* $NetBSD: pcf8583reg.h,v 1.1.4.3 2004/09/21 13:27:46 skrll Exp $ */
3 /*
4 * Ben Harris, 2000
6 * This file is in the public domain
7 */
9 /*
10 * Philips PCF8583 RTC registers
13 /* We only have clock mode registers here */
15 #ifndef _PCF8583REG_H
16 #define _PCF8583REG_H
19 * PCF8583 RTC I2C address:
21 * 101 0000
23 #define PCF8583_ADDRMASK 0x7f
24 #define PCF8583_ADDR 0x50
26 #define PCF8583_REG_CSR 0x00
27 #define PCF8583_REG_CENTI 0x01
28 #define PCF8583_REG_SEC 0x02
29 #define PCF8583_REG_MIN 0x03
30 #define PCF8583_REG_HOUR 0x04
31 #define PCF8583_REG_YEARDATE 0x05
32 #define PCF8583_REG_WKDYMON 0x06
33 #define PCF8583_REG_TIMER 0x07
34 #define PCF8583_REG_ALMCTL 0x08
35 #define PCF8583_REG_ALMCENTI 0x09
36 #define PCF8583_REG_ALMSEC 0x0a
37 #define PCF8583_REG_ALMMIN 0x0b
38 #define PCF8583_REG_ALMHOUR 0x0c
39 #define PCF8583_REG_ALMDAY 0x0d
40 #define PCF8583_REG_ALMMON 0x0e
41 #define PCF8583_REG_ALMTIMER 0x0f
43 #define PCF8583_NVRAM_START 0x10
44 #define PCF8583_NVRAM_SIZE 240
46 #define PCF8583_CSR_TIMER 0x01
47 #define PCF8583_CSR_SECTICK 0x01
48 #define PCF8583_CSR_ALARM 0x02
49 #define PCF8583_CSR_MINTICK 0x02
50 #define PCF8583_CSR_ALARMENABLE 0x04
51 #define PCF8583_CSR_MASK 0x08
52 #define PCF8583_CSR_FN_MASK 0x30
53 #define PCF8583_CSR_FN_32768HZ 0x00
54 #define PCF8583_CSR_FN_50HZ 0x10
55 #define PCF8583_CSR_FN_EVENT 0x20
56 #define PCF8583_CSR_FN_TEST 0x30
57 #define PCF8583_CSR_HOLD 0x40
58 #define PCF8583_CSR_STOP 0x80
60 #define PCF8583_HOUR_MASK 0x3f
61 #define PCF8583_HOUR_PM 0x40
62 #define PCF8583_HOUR_12H 0x80
64 #define PCF8583_DATE_MASK 0x3f
65 #define PCF8583_YEAR_MASK 0xc0
66 #define PCF8583_YEAR_SHIFT 6
68 #define PCF8583_MON_MASK 0x1f
69 #define PCF8583_WKDY_MASK 0xe0
70 #define PCF8583_WKDY_SHIFT 5
72 #define PCF8583_ALMCTL_TIMER_MASK 0x07
73 #define PCF8583_ALMCTL_TIMER_OFF 0x00
74 #define PCF8583_ALMCTL_TIMER_CENTI 0x01
75 #define PCF8583_ALMCTL_TIMER_SEC 0x02
76 #define PCF8583_ALMCTL_TIMER_MIN 0x03
77 #define PCF8583_ALMCTL_TIMER_HOUR 0x04
78 #define PCF8583_ALMCTL_TIMER_DAY 0x05
79 #define PCF8583_ALMCTL_TIMER_TEST 0x07
80 #define PCF8583_ALMCTL_TIMERINT 0x08
81 #define PCF8583_ALMCTL_CLKALM_MASK 0x30
82 #define PCF8583_ALMCTL_CLKALM_NONE 0x00
83 #define PCF8583_ALMCTL_CLKALM_DAILY 0x10
84 #define PCF8583_ALMCTL_CLKALM_WKDY 0x20
85 #define PCF8583_ALMCTL_CLKALM_DATED 0x30
86 #define PCF8583_ALMCTL_TIMERALM 0x40
87 #define PCF8583_ALMCTL_ALMINT 0x80
89 #endif /* _PCF8583REG_H */