m41t81reg.h revision 1.4 1 1.4 christos /* $NetBSD: m41t81reg.h,v 1.4 2005/12/11 12:23:56 christos Exp $ */
2 1.1 simonb
3 1.1 simonb /*
4 1.1 simonb * Copyright 2002 Wasabi Systems, Inc.
5 1.1 simonb * All rights reserved.
6 1.1 simonb *
7 1.1 simonb * Written by Simon Burge for Wasabi Systems, Inc.
8 1.1 simonb *
9 1.1 simonb * Redistribution and use in source and binary forms, with or without
10 1.1 simonb * modification, are permitted provided that the following conditions
11 1.1 simonb * are met:
12 1.1 simonb * 1. Redistributions of source code must retain the above copyright
13 1.1 simonb * notice, this list of conditions and the following disclaimer.
14 1.1 simonb * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 simonb * notice, this list of conditions and the following disclaimer in the
16 1.1 simonb * documentation and/or other materials provided with the distribution.
17 1.1 simonb * 3. All advertising materials mentioning features or use of this software
18 1.1 simonb * must display the following acknowledgement:
19 1.1 simonb * This product includes software developed for the NetBSD Project by
20 1.1 simonb * Wasabi Systems, Inc.
21 1.1 simonb * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 1.1 simonb * or promote products derived from this software without specific prior
23 1.1 simonb * written permission.
24 1.1 simonb *
25 1.1 simonb * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 1.1 simonb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1 simonb * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1 simonb * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 1.1 simonb * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1 simonb * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1 simonb * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1 simonb * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1 simonb * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1 simonb * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1 simonb * POSSIBILITY OF SUCH DAMAGE.
36 1.1 simonb */
37 1.1 simonb
38 1.1 simonb #ifndef _DEV_SMBUS_M41T81REG_H_
39 1.1 simonb #define _DEV_SMBUS_M41T81REG_H_
40 1.1 simonb
41 1.1 simonb /* The M41T81 appears at a fixed addresses on the SMBus */
42 1.1 simonb #define M41T81_SLAVEADDR 0x68
43 1.1 simonb
44 1.1 simonb #define M41T81_PARTSEC 0x00 /* Partial seconds (0.01s resolution) - BCD */
45 1.1 simonb #define M41T81_SEC 0x01 /* Seconds - BCD */
46 1.1 simonb #define M41T81_SEC_ST 0x80 /* Stop Bit */
47 1.1 simonb #define M41T81_MIN 0x02 /* Minutes - BCD */
48 1.1 simonb #define M41T81_HOUR 0x03 /* Century/Hours - BCD */
49 1.1 simonb #define M41T81_HOUR_MASK 0x3f /* Mask for hours */
50 1.1 simonb #define M41T81_HOUR_CB 0x40 /* Century Bit */
51 1.1 simonb #define M41T81_HOUR_CEB 0x80 /* Century Enable Bit */
52 1.1 simonb #define M41T81_DAY 0x04 /* Day of Week */
53 1.1 simonb #define M41T81_DATE 0x05 /* Date: Day of Month - BCD */
54 1.1 simonb #define M41T81_MON 0x06 /* Month - BCD */
55 1.1 simonb #define M41T81_YEAR 0x07 /* Year - BCD */
56 1.1 simonb #define M41T81_CTL 0x08 /* Control */
57 1.1 simonb #define M41T81_CTL_CAL 0x1f /* Calibration mask */
58 1.1 simonb #define M41T81_CTL_S 0x20 /* Sign Bit */
59 1.2 simonb #define M41T81_CTL_FT 0x40 /* Frequency Test Bit */
60 1.2 simonb #define M41T81_CTL_OUT 0x80 /* Output Level */
61 1.1 simonb #define M41T81_WDOG 0x09 /* Watchdog */
62 1.1 simonb #define M41T81_WDOG_RB 0x03 /* Watchdog Resolution */
63 1.1 simonb #define M41T81_WDOG_RB_1_16 0x00 /* 1/16th second */
64 1.1 simonb #define M41T81_WDOG_RB_1_4 0x01 /* 1/4th second */
65 1.1 simonb #define M41T81_WDOG_RB_1 0x02 /* 1 second */
66 1.1 simonb #define M41T81_WDOG_RB_4 0x03 /* 4 seconds */
67 1.1 simonb #define M41T81_WDOG_BMB_SHIFT 2 /* Watchdog Multiplier */
68 1.1 simonb #define M41T81_WDOG_BMB_MASK 0x7c
69 1.1 simonb #define M41T81_ALM_MON 0x0a /* Alarm Month - BCD */
70 1.1 simonb #define M41T81_ALM_MON_ABE 0x20 /* Alarm in Battery Back-up Mode Enable Bit */
71 1.1 simonb #define M41T81_ALM_MON_SQWE 0x40 /* Square Wave Enable */
72 1.2 simonb #define M41T81_ALM_MON_AFE 0x80 /* Alarm Flag Enable Flag */
73 1.1 simonb #define M41T81_ALM_DATE 0x0b /* Alarm Date - BCD */
74 1.1 simonb #define M41T81_ALM_DATE_RPT5 0x40 /* Alarm Repeat Mode Bit 5 */
75 1.1 simonb #define M41T81_ALM_DATE_RPT4 0x80 /* Alarm Repeat Mode Bit 4 */
76 1.1 simonb #define M41T81_ALM_HOUR 0x0c /* Alarm Hour - BCD */
77 1.1 simonb #define M41T81_ALM_HOUR_HT 0x40 /* Half Update Bit */
78 1.1 simonb #define M41T81_ALM_HOUR_RPT3 0x80 /* Alarm Repeat Mode Bit 3 */
79 1.1 simonb #define M41T81_ALM_MIN 0x0d /* Alarm Minutes - BCD */
80 1.3 simonb #define M41T81_ALM_MIN_RPT2 0x80 /* Alarm Repeat Mode Bit 2 */
81 1.1 simonb #define M41T81_ALM_SEC 0x0e /* Alarm Seconds - BCD */
82 1.3 simonb #define M41T81_ALM_SEC_RPT1 0x80 /* Alarm Repeat Mode Bit 1 */
83 1.1 simonb #define M41T81_FLAGS 0x0f
84 1.1 simonb #define M41T81_SQW 0x13 /* Square Wave Frequency */
85 1.1 simonb #define M41T81_SQW_RS_SHIFT 4 /* SQW Frequency */
86 1.1 simonb #define M41T81_SQW_RS_MASK 0x0f /* For a non-zero value 'v',
87 1.1 simonb the square wave frequency
88 1.1 simonb is 2^(16-v) Hz */
89 1.1 simonb
90 1.1 simonb #endif /* _DEV_SMBUS_M41T81REG_H_ */
91