4 Created: Dec 1998 by Philip Homburg <philip@cs.vu.nl>
6 Definitions for the CMOS/realtime clock. Based on the datasheet for the
7 Dallas DS12887, compatible with the Motorola MC146818
10 #define RTC_INDEX 0x70 /* Bit 7 = NMI enable (1) / disable (0)
13 #define RTC_IO 0x71 /* Data register,
14 * Note: the operation following a write to
15 * RTC_INDEX should an access (read or write)
19 #define RTC_SEC 0x0 /* Seconds register */
20 #define RTC_SEC_ALRM 0x1 /* Seconds register for alarm */
21 #define RTC_MIN 0x2 /* Minutes register */
22 #define RTC_MIN_ALRM 0x3 /* Minutes register for alarm */
23 #define RTC_HOUR 0x4 /* Hours register */
24 #define RTC_HOUR_ALRM 0x5 /* Hours register for alarm */
25 #define RTC_WDAY 0x6 /* Day of the week, 1..7, Sunday = 1 */
26 #define RTC_MDAY 0x7 /* Day of the month, 1..31 */
27 #define RTC_MONTH 0x8 /* Month, 1..12 */
28 #define RTC_YEAR 0x9 /* Year, 0..99 */
30 #define RTC_A_UIP 0x80 /* Update in progress. When clear,
31 * no update will occur for 244
34 #define RTC_A_DV 0x70 /* Divider bits, valid values are: */
35 #define RTC_A_DV_OK 0x20 /* Normal */
36 #define RTC_A_DV_STOP 0x70 /* Stop, a re-start starts
37 * halfway through a cycle,
38 * i.e. the update occurs after
41 #define RTC_A_RS 0x0F /* Int. freq */
59 #define RTC_A_RS_DEF 6 /* Default freq. */
61 #define RTC_B_SET 0x80 /* Inhibit updates */
62 #define RTC_B_PIE 0x40 /* Enable periodic interrupts */
63 #define RTC_B_AIE 0x20 /* Enable alarm interrupts */
64 #define RTC_B_UIE 0x10 /* Enable update ended interrupts */
65 #define RTC_B_SQWE 0x08 /* Enable square wave output */
66 #define RTC_B_DM_BCD 0x04 /* Data is in BCD (otherwise binary) */
67 #define RTC_B_24 0x02 /* Count hours in 24-hour mode */
68 #define RTC_B_DSE 0x01 /* Automatic (wrong) daylight savings
73 /* Contents of the general purpose CMOS RAM (source IBM reference manual) */
74 #define CMOS_STATUS 0xE
75 #define CS_LOST_POWER 0x80 /* Chip lost power */
76 #define CS_BAD_CHKSUM 0x40 /* Checksum is incorrect */
77 #define CS_BAD_CONFIG 0x20 /* Bad configuration info */
78 #define CS_BAD_MEMSIZE 0x10 /* Wrong memory size of CMOS */
79 #define CS_BAD_HD 0x08 /* Harddisk failed */
80 #define CS_BAD_TIME 0x04 /* CMOS time is invalid */
81 /* bits 0 and 1 are reserved */
84 * $PchId: cmos.h,v 1.1 1998/12/16 09:14:21 philip Exp $