blob: 4e8aaad87fef82140f416b6ccb956b710e3ca3bb [file] [log] [blame]
wdenkc6097192002-11-03 00:24:07 +00001/*
2 * (C) Copyright 2001
3 * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24/*
25 * Digital Thermometers and Thermostats.
26 */
27#ifndef _DTT_H_
28#define _DTT_H_
29
wdenk6dd652f2003-06-19 23:40:20 +000030#if defined(CONFIG_DTT_LM75) || \
31 defined(CONFIG_DTT_DS1621) || \
John Otkend4024bb2007-07-26 17:49:11 +020032 defined(CONFIG_DTT_DS1775) || \
Heiko Schocher6dedf3d2006-12-21 16:14:48 +010033 defined(CONFIG_DTT_LM81) || \
Larry Johnson9e2c3472007-12-27 09:52:17 -050034 defined(CONFIG_DTT_ADM1021) || \
35 defined(CONFIG_DTT_LM73)
wdenk6dd652f2003-06-19 23:40:20 +000036
wdenkc6097192002-11-03 00:24:07 +000037#define CONFIG_DTT /* We have a DTT */
38
wdenk6dd652f2003-06-19 23:40:20 +000039#ifndef CONFIG_DTT_ADM1021
wdenkc6097192002-11-03 00:24:07 +000040#define DTT_COMMERCIAL_MAX_TEMP 70 /* 0 - +70 C */
41#define DTT_INDUSTRIAL_MAX_TEMP 85 /* -40 - +85 C */
42#define DTT_AUTOMOTIVE_MAX_TEMP 105 /* -40 - +105 C */
43#ifndef CFG_DTT_MAX_TEMP
44#define CFG_DTT_MAX_TEMP DTT_COMMERCIAL_MAX_TEMP
45#endif
46#ifndef CFG_DTT_HYSTERESIS
47#define CFG_DTT_HYSTERESIS 5 /* 5 C */
48#endif
wdenk6dd652f2003-06-19 23:40:20 +000049#endif /* CONFIG_DTT_ADM1021 */
wdenkc6097192002-11-03 00:24:07 +000050
51extern int dtt_init (void);
52extern int dtt_read(int sensor, int reg);
53extern int dtt_write(int sensor, int reg, int val);
54extern int dtt_get_temp(int sensor);
55#endif
56
57#if defined(CONFIG_DTT_LM75)
58#define DTT_READ_TEMP 0x0
59#define DTT_CONFIG 0x1
60#define DTT_TEMP_HYST 0x2
61#define DTT_TEMP_SET 0x3
62#endif
63
Heiko Schocher6dedf3d2006-12-21 16:14:48 +010064#if defined(CONFIG_DTT_LM81)
65#define DTT_READ_TEMP 0x27
66#define DTT_CONFIG_TEMP 0x4b
67#define DTT_TEMP_MAX 0x39
68#define DTT_TEMP_HYST 0x3a
69#define DTT_CONFIG 0x40
70#endif
71
wdenkc6097192002-11-03 00:24:07 +000072#if defined(CONFIG_DTT_DS1621)
73#define DTT_READ_TEMP 0xAA
74#define DTT_READ_COUNTER 0xA8
75#define DTT_READ_SLOPE 0xA9
76#define DTT_WRITE_START_CONV 0xEE
77#define DTT_WRITE_STOP_CONV 0x22
78#define DTT_TEMP_HIGH 0xA1
79#define DTT_TEMP_LOW 0xA2
80#define DTT_CONFIG 0xAC
81#endif
82
John Otkend4024bb2007-07-26 17:49:11 +020083#if defined(CONFIG_DTT_DS1775)
84#define DTT_READ_TEMP 0x0
85#define DTT_CONFIG 0x1
86#define DTT_TEMP_HYST 0x2
87#define DTT_TEMP_OS 0x3
88#endif
89
wdenk6dd652f2003-06-19 23:40:20 +000090#if defined(CONFIG_DTT_ADM1021)
91#define DTT_READ_LOC_VALUE 0x00
92#define DTT_READ_REM_VALUE 0x01
93#define DTT_READ_STATUS 0x02
94#define DTT_READ_CONFIG 0x03
95#define DTT_READ_CONVRATE 0x04
96#define DTT_READ_LOC_HIGHLIM 0x05
97#define DTT_READ_LOC_LOWLIM 0x06
98#define DTT_READ_REM_HIGHLIM 0x07
99#define DTT_READ_REM_LOWLIM 0x08
100#define DTT_READ_DEVID 0xfe
101
102#define DTT_WRITE_CONFIG 0x09
103#define DTT_WRITE_CONVRATE 0x0a
104#define DTT_WRITE_LOC_HIGHLIM 0x0b
105#define DTT_WRITE_LOC_LOWLIM 0x0c
106#define DTT_WRITE_REM_HIGHLIM 0x0d
107#define DTT_WRITE_REM_LOWLIM 0x0e
108#define DTT_WRITE_ONESHOT 0x0f
109
110#define DTT_STATUS_BUSY 0x80 /* 1=ADC Converting */
111#define DTT_STATUS_LHIGH 0x40 /* 1=Local High Temp Limit Tripped */
112#define DTT_STATUS_LLOW 0x20 /* 1=Local Low Temp Limit Tripped */
113#define DTT_STATUS_RHIGH 0x10 /* 1=Remote High Temp Limit Tripped */
114#define DTT_STATUS_RLOW 0x08 /* 1=Remote Low Temp Limit Tripped */
115#define DTT_STATUS_OPEN 0x04 /* 1=Remote Sensor Open-Circuit */
116
117#define DTT_CONFIG_ALERT_MASKED 0x80 /* 0=ALERT Enabled, 1=ALERT Masked */
118#define DTT_CONFIG_STANDBY 0x40 /* 0=Run, 1=Standby */
119
120#define DTT_ADM1021_DEVID 0x41
121#endif
122
Larry Johnson9e2c3472007-12-27 09:52:17 -0500123#if defined(CONFIG_DTT_LM73)
124#define DTT_READ_TEMP 0x0
125#define DTT_CONFIG 0x1
126#define DTT_TEMP_HIGH 0x2
127#define DTT_TEMP_LOW 0x3
128#define DTT_CONTROL 0x4
129#define DTT_ID 0x7
130#endif
131
wdenkc6097192002-11-03 00:24:07 +0000132#endif /* _DTT_H_ */