ds1687reg.h revision 1.1 1 1.1 chris /* $NetBSD: ds1687reg.h,v 1.1 2002/02/10 12:26:01 chris Exp $ */
2 1.1 chris
3 1.1 chris /*
4 1.1 chris * Copyright (c) 1998 Mark Brinicombe.
5 1.1 chris * Copyright (c) 1998 Causality Limited.
6 1.1 chris * All rights reserved.
7 1.1 chris *
8 1.1 chris * Written by Mark Brinicombe, Causality Limited
9 1.1 chris *
10 1.1 chris * Redistribution and use in source and binary forms, with or without
11 1.1 chris * modification, are permitted provided that the following conditions
12 1.1 chris * are met:
13 1.1 chris * 1. Redistributions of source code must retain the above copyright
14 1.1 chris * notice, this list of conditions and the following disclaimer.
15 1.1 chris * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 chris * notice, this list of conditions and the following disclaimer in the
17 1.1 chris * documentation and/or other materials provided with the distribution.
18 1.1 chris * 3. All advertising materials mentioning features or use of this software
19 1.1 chris * must display the following acknowledgement:
20 1.1 chris * This product includes software developed by Mark Brinicombe
21 1.1 chris * for the NetBSD Project.
22 1.1 chris * 4. The name of the company nor the name of the author may be used to
23 1.1 chris * endorse or promote products derived from this software without specific
24 1.1 chris * prior written permission.
25 1.1 chris *
26 1.1 chris * THIS SOFTWARE IS PROVIDED BY CAUASLITY LIMITED ``AS IS'' AND ANY EXPRESS
27 1.1 chris * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28 1.1 chris * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29 1.1 chris * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED OR CONTRIBUTORS BE LIABLE
30 1.1 chris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 1.1 chris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 1.1 chris * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 1.1 chris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 1.1 chris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 1.1 chris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 1.1 chris * SUCH DAMAGE.
37 1.1 chris */
38 1.1 chris
39 1.1 chris #define RTC_ADDR 0x72
40 1.1 chris #define RTC_ADDR_REG 0x00
41 1.1 chris #define RTC_DATA_REG 0x01
42 1.1 chris
43 1.1 chris #define RTC_SECONDS 0x00
44 1.1 chris #define RTC_SECONDS_ALARM 0x01
45 1.1 chris #define RTC_MINUTES 0x02
46 1.1 chris #define RTC_MINUTES_ALARM 0x03
47 1.1 chris #define RTC_HOURS 0x04
48 1.1 chris #define RTC_HOURS_ALARM 0x05
49 1.1 chris #define RTC_DAYOFWEEK 0x06
50 1.1 chris #define RTC_DAYOFMONTH 0x07
51 1.1 chris #define RTC_MONTH 0x08
52 1.1 chris #define RTC_YEAR 0x09
53 1.1 chris
54 1.1 chris #define RTC_REG_A 0x0a
55 1.1 chris #define RTC_REG_A_UIP 0x80 /* Update In Progress */
56 1.1 chris #define RTC_REG_A_DV2 0x40 /* Countdown CHain */
57 1.1 chris #define RTC_REG_A_DV1 0x20 /* Oscillator Enable */
58 1.1 chris #define RTC_REG_A_DV0 0x10 /* Bank Select */
59 1.1 chris #define RTC_REG_A_BANK_MASK RTC_REG_A_DV0
60 1.1 chris #define RTC_REG_A_BANK1 RTC_REG_A_DV0
61 1.1 chris #define RTC_REG_A_BANK0 0x00
62 1.1 chris #define RTC_REG_A_RS_MASK 0x0f /* Rate select mask */
63 1.1 chris #define RTC_REG_A_RS_NONE 0x00
64 1.1 chris #define RTC_REG_A_RS_256HZ_1 0x01
65 1.1 chris #define RTC_REG_A_RS_128HZ_1 0x02
66 1.1 chris #define RTC_REG_A_RS_8192HZ 0x03
67 1.1 chris #define RTC_REG_A_RS_4096HZ 0x04
68 1.1 chris #define RTC_REG_A_RS_2048HZ 0x05
69 1.1 chris #define RTC_REG_A_RS_1024HZ 0x06
70 1.1 chris #define RTC_REG_A_RS_512HZ 0x07
71 1.1 chris #define RTC_REG_A_RS_256HZ 0x08
72 1.1 chris #define RTC_REG_A_RS_128HZ 0x09
73 1.1 chris #define RTC_REG_A_RS_64HZ 0x0A
74 1.1 chris #define RTC_REG_A_RS_32HZ 0x0B
75 1.1 chris #define RTC_REG_A_RS_16HZ 0x0C
76 1.1 chris #define RTC_REG_A_RS_8HZ 0x0D
77 1.1 chris #define RTC_REG_A_RS_4HZ 0x0E
78 1.1 chris #define RTC_REG_A_RS_2HZ 0x0F
79 1.1 chris
80 1.1 chris #define RTC_REG_B 0x0b
81 1.1 chris #define RTC_REG_B_SET 0x80 /* Inhibit update */
82 1.1 chris #define RTC_REG_B_PIE 0x40 /* Periodic Interrupt Enable */
83 1.1 chris #define RTC_REG_B_AIE 0x20 /* Alarm Interrupt Enable */
84 1.1 chris #define RTC_REG_B_UIE 0x10 /* Updated Ended Interrupt Enable */
85 1.1 chris #define RTC_REG_B_SQWE 0x08 /* Square Wave Enable */
86 1.1 chris #define RTC_REG_B_DM 0x04 /* Data Mode */
87 1.1 chris #define RTC_REG_B_BINARY RTC_REG_B_DM
88 1.1 chris #define RTC_REG_B_BCD 0
89 1.1 chris #define RTC_REG_B_24_12 0x02 /* Hour format */
90 1.1 chris #define RTC_REG_B_24_HOUR RTC_REG_B_24_12
91 1.1 chris #define RTC_REG_B_12_HOUR 0
92 1.1 chris #define RTC_REG_B_DSE 0x01 /* Daylight Savings Enable */
93 1.1 chris
94 1.1 chris #define RTC_REG_C 0x0c
95 1.1 chris #define RTC_REG_C_IRQF 0x80 /* Interrupt Request Flag */
96 1.1 chris #define RTC_REG_C_PF 0x40 /* Periodic Interrupt Flag */
97 1.1 chris #define RTC_REG_C_AF 0x20 /* Alarm Interrupt Flag */
98 1.1 chris #define RTC_REG_C_UF 0x10 /* Update Ended Flags */
99 1.1 chris
100 1.1 chris #define RTC_REG_D 0x0d
101 1.1 chris #define RTC_REG_D_VRT 0x80 /* Valid RAM and Time */
102 1.1 chris
103 1.1 chris #define RTC_PC_RAM_START 0x0e
104 1.1 chris #define RTC_PC_RAM_SIZE 50
105 1.1 chris
106 1.1 chris #define RTC_BANK0_RAM_START 0x40
107 1.1 chris #define RTC_BANK0_RAM_SIZE 0x40
108 1.1 chris
109 1.1 chris #define RTC_MODEL 0x40
110 1.1 chris #define RTC_SERIAL_1 0x41
111 1.1 chris #define RTC_SERIAL_2 0x42
112 1.1 chris #define RTC_SERIAL_3 0x43
113 1.1 chris #define RTC_SERIAL_4 0x44
114 1.1 chris #define RTC_SERIAL_5 0x45
115 1.1 chris #define RTC_SERIAL_6 0x46
116 1.1 chris #define RTC_CRC 0x47
117 1.1 chris #define RTC_CENTURY 0x48
118 1.1 chris #define RTC_DATE_ALARM 0x49
119 1.1 chris #define RTC_REG_4A 0x4a
120 1.1 chris #define RTC_REG_4A_VRT2 0x80
121 1.1 chris #define RTC_REG_4A_INCR 0x40
122 1.1 chris #define RTC_REG_4A_PAB 0x08
123 1.1 chris #define RTC_REG_4A_RF 0x04
124 1.1 chris #define RTC_REG_4B 0x4b
125 1.1 chris #define RTC_EXT_RAM_ADDRESS 0x50
126 1.1 chris #define RTC_EXT_RAM_DATA 0x53
127 1.1 chris #define RTC_EXT_RAM_START 0x00
128 1.1 chris #define RTC_EXT_RAM_SIZE 0x80
129