sdtemp_reg.h revision 1.2 1 1.2 pgoyette /* $NetBSD: sdtemp_reg.h,v 1.2 2009/06/13 19:02:33 pgoyette Exp $ */
2 1.1 pgoyette
3 1.1 pgoyette /*
4 1.1 pgoyette * Copyright (c) 2009 The NetBSD Foundation, Inc.
5 1.1 pgoyette * All rights reserved.
6 1.1 pgoyette *
7 1.1 pgoyette * This code is derived from software contributed to The NetBSD Foundation
8 1.1 pgoyette * by Paul Goyette.
9 1.1 pgoyette *
10 1.1 pgoyette * Redistribution and use in source and binary forms, with or without
11 1.1 pgoyette * modification, are permitted provided that the following conditions
12 1.1 pgoyette * are met:
13 1.1 pgoyette * 1. Redistributions of source code must retain the above copyright
14 1.1 pgoyette * notice, this list of conditions and the following disclaimer.
15 1.1 pgoyette * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 pgoyette * notice, this list of conditions and the following disclaimer in the
17 1.1 pgoyette * documentation and/or other materials provided with the distribution.
18 1.1 pgoyette *
19 1.1 pgoyette * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 pgoyette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 pgoyette * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 pgoyette * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 pgoyette * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 pgoyette * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 pgoyette * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 pgoyette * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 pgoyette * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 pgoyette * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 pgoyette * POSSIBILITY OF SUCH DAMAGE.
30 1.1 pgoyette */
31 1.1 pgoyette
32 1.1 pgoyette #ifndef _DEV_I2C_SDTEMPREG_H
33 1.1 pgoyette #define _DEV_I2C_SDTEMPREG_H
34 1.1 pgoyette
35 1.1 pgoyette /*
36 1.1 pgoyette * Following definitions derived from JEDEC Standard 21-C section 4.7
37 1.1 pgoyette * available at http://www.jedec.org/download/search/4_07R15.pdf
38 1.1 pgoyette */
39 1.1 pgoyette #define SDTEMP_ADDRMASK 0x78
40 1.1 pgoyette #define SDTEMP_ADDR 0x18 /* I2C address 001 1xxx */
41 1.1 pgoyette
42 1.1 pgoyette #define SDTEMP_REG_CAPABILITY 0x00
43 1.1 pgoyette #define SDTEMP_REG_CONFIG 0x01
44 1.1 pgoyette #define SDTEMP_REG_UPPER_LIM 0x02
45 1.1 pgoyette #define SDTEMP_REG_LOWER_LIM 0x03
46 1.1 pgoyette #define SDTEMP_REG_CRIT_LIM 0x04
47 1.1 pgoyette #define SDTEMP_REG_AMBIENT_TEMP 0x05
48 1.1 pgoyette #define SDTEMP_REG_MFG_ID 0x06
49 1.1 pgoyette #define SDTEMP_REG_DEV_REV 0x07
50 1.1 pgoyette #define SDTEMP_REG_RESOLUTION 0x08
51 1.1 pgoyette
52 1.1 pgoyette #define SDTEMP_CAP_HAS_ALARM 0x0001
53 1.1 pgoyette #define SDTEMP_CAP_ACCURACY_1C 0x0002
54 1.1 pgoyette #define SDTEMP_CAP_WIDER_RANGE 0x0004
55 1.1 pgoyette #define SDTEMP_CAP_RESOLUTION 0x0018
56 1.1 pgoyette #define SDTEMP_CAP_RES_SHIFT 3
57 1.1 pgoyette
58 1.1 pgoyette #define SDTEMP_CONFIG_EVENT_MODE 0x0001
59 1.1 pgoyette #define SDTEMP_CONFIG_EVENT_POL_AH 0x0002
60 1.1 pgoyette #define SDTEMP_CONFIG_EVENT_CRIT_ONLY 0x0004
61 1.1 pgoyette #define SDTEMP_CONFIG_EVENT_ENABLED 0x0008
62 1.1 pgoyette #define SDTEMP_CONFIG_EVENT_STATUS 0x0010
63 1.1 pgoyette #define SDTEMP_CONFIG_INT_CLEAR 0x0020
64 1.1 pgoyette #define SDTEMP_CONFIG_WINDOW_LOCKED 0x0040
65 1.1 pgoyette #define SDTEMP_CONFIG_CRITICAL_LOCKED 0x0080
66 1.1 pgoyette #define SDTEMP_CONFIG_SHUTDOWN_MODE 0x0100
67 1.1 pgoyette #define SDTEMP_CONFIG_HYSTERESIS 0x0600
68 1.1 pgoyette
69 1.1 pgoyette #define SDTEMP_HYSTERESIS_NONE 0x0000
70 1.1 pgoyette #define SDTEMP_HYSTERESIS_15 0x0200
71 1.1 pgoyette #define SDTEMP_HYSTERESIS_30 0x0400
72 1.1 pgoyette #define SDTEMP_HYSTERESIS_60 0x0600
73 1.1 pgoyette
74 1.1 pgoyette /*
75 1.2 pgoyette * Temperature is a 13-bit value in the range of -256 <= x < +256 degrees.
76 1.1 pgoyette * Maximum resolution is 0.0625C (1/16th degree, 4 bits), but some devices
77 1.1 pgoyette * may have only 0.2500C or 0.1250C (1 or 2 bits), and some devices may not
78 1.1 pgoyette * be able to represent negative values (not that we'd expect them, anyway).
79 1.1 pgoyette */
80 1.1 pgoyette #define SDTEMP_TEMP_MASK 0x0FFF
81 1.1 pgoyette #define SDTEMP_TEMP_NEGATIVE 0x1000
82 1.1 pgoyette #define SDTEMP_TEMP_SIGN_EXT 0xF000
83 1.1 pgoyette
84 1.1 pgoyette /*
85 1.2 pgoyette * Status bits set in SDTEMP_REG_AMBIENT_TEMP only
86 1.1 pgoyette */
87 1.1 pgoyette #define SDTEMP_ABOVE_CRIT 0x8000
88 1.1 pgoyette #define SDTEMP_ABOVE_UPPER 0x4000
89 1.1 pgoyette #define SDTEMP_BELOW_LOWER 0x2000
90 1.1 pgoyette
91 1.1 pgoyette /*
92 1.1 pgoyette * Devices known to conform to JEDEC JC42.4
93 1.1 pgoyette */
94 1.1 pgoyette #define MAXIM_MANUFACTURER_ID 0x004D
95 1.1 pgoyette #define MAX_6604_DEVICE_ID 0x3E
96 1.1 pgoyette
97 1.1 pgoyette #define MCP_MANUFACTURER_ID 0x0054
98 1.1 pgoyette #define MCP_9805_DEVICE_ID 0x00
99 1.1 pgoyette #define MCP_98242_DEVICE_ID 0x20
100 1.1 pgoyette
101 1.1 pgoyette /* According to datasheets, SE97 and SE98 have same ID */
102 1.1 pgoyette
103 1.1 pgoyette #define NXP_MANUFACTURER_ID 0x1131
104 1.1 pgoyette #define NXP_SE97_DEVICE_ID 0xA1
105 1.1 pgoyette
106 1.1 pgoyette #define ADT_MANUFACTURER_ID 0x11D4
107 1.1 pgoyette #define ADT_7408_DEVICE_ID 0x80
108 1.1 pgoyette
109 1.1 pgoyette #define STTS_MANUFACTURER_ID 0x104A
110 1.1 pgoyette #define STTS_424E02_DEVICE_ID 0x00
111 1.1 pgoyette
112 1.1 pgoyette /* According to datasheets, both the CAT6095 and CAT34TS02 have the same ID */
113 1.1 pgoyette
114 1.1 pgoyette #define CAT_MANUFACTURER_ID 0x1B09
115 1.1 pgoyette #define CAT_34TS02_DEVICE_ID 0x08
116 1.1 pgoyette
117 1.1 pgoyette #endif /* _DEV_I2C_SDTEMPREG_H */
118