root / hw / tmp105.h @ 5e22c276
History | View | Annotate | Download (1.6 kB)
1 | 2915efbf | Alex Horn | /*
|
---|---|---|---|
2 | 2915efbf | Alex Horn | * Texas Instruments TMP105 Temperature Sensor
|
3 | 2915efbf | Alex Horn | *
|
4 | 2915efbf | Alex Horn | * Browse the data sheet:
|
5 | 2915efbf | Alex Horn | *
|
6 | 2915efbf | Alex Horn | * http://www.ti.com/lit/gpn/tmp105
|
7 | 2915efbf | Alex Horn | *
|
8 | 2915efbf | Alex Horn | * Copyright (C) 2012 Alex Horn <alex.horn@cs.ox.ac.uk>
|
9 | 2915efbf | Alex Horn | * Copyright (C) 2008-2012 Andrzej Zaborowski <balrogg@gmail.com>
|
10 | 2915efbf | Alex Horn | *
|
11 | 2915efbf | Alex Horn | * This work is licensed under the terms of the GNU GPL, version 2 or
|
12 | 2915efbf | Alex Horn | * later. See the COPYING file in the top-level directory.
|
13 | 2915efbf | Alex Horn | */
|
14 | 2915efbf | Alex Horn | #ifndef QEMU_TMP105_H
|
15 | 2915efbf | Alex Horn | #define QEMU_TMP105_H
|
16 | 2915efbf | Alex Horn | |
17 | 2915efbf | Alex Horn | #include "i2c.h" |
18 | 2915efbf | Alex Horn | |
19 | 2915efbf | Alex Horn | /**
|
20 | 2915efbf | Alex Horn | * TMP105Reg:
|
21 | 2915efbf | Alex Horn | * @TMP105_REG_TEMPERATURE: Temperature register
|
22 | 2915efbf | Alex Horn | * @TMP105_REG_CONFIG: Configuration register
|
23 | 2915efbf | Alex Horn | * @TMP105_REG_T_LOW: Low temperature register (also known as T_hyst)
|
24 | 2915efbf | Alex Horn | * @TMP105_REG_T_HIGH: High temperature register (also known as T_OS)
|
25 | 2915efbf | Alex Horn | *
|
26 | 2915efbf | Alex Horn | * The following temperature sensors are
|
27 | 2915efbf | Alex Horn | * compatible with the TMP105 registers:
|
28 | 2915efbf | Alex Horn | * - adt75
|
29 | 2915efbf | Alex Horn | * - ds1775
|
30 | 2915efbf | Alex Horn | * - ds75
|
31 | 2915efbf | Alex Horn | * - lm75
|
32 | 2915efbf | Alex Horn | * - lm75a
|
33 | 2915efbf | Alex Horn | * - max6625
|
34 | 2915efbf | Alex Horn | * - max6626
|
35 | 2915efbf | Alex Horn | * - mcp980x
|
36 | 2915efbf | Alex Horn | * - stds75
|
37 | 2915efbf | Alex Horn | * - tcn75
|
38 | 2915efbf | Alex Horn | * - tmp100
|
39 | 2915efbf | Alex Horn | * - tmp101
|
40 | 2915efbf | Alex Horn | * - tmp105
|
41 | 2915efbf | Alex Horn | * - tmp175
|
42 | 2915efbf | Alex Horn | * - tmp275
|
43 | 2915efbf | Alex Horn | * - tmp75
|
44 | 2915efbf | Alex Horn | **/
|
45 | 2915efbf | Alex Horn | typedef enum TMP105Reg { |
46 | 2915efbf | Alex Horn | TMP105_REG_TEMPERATURE = 0,
|
47 | 2915efbf | Alex Horn | TMP105_REG_CONFIG, |
48 | 2915efbf | Alex Horn | TMP105_REG_T_LOW, |
49 | 2915efbf | Alex Horn | TMP105_REG_T_HIGH, |
50 | 2915efbf | Alex Horn | } TMP105Reg; |
51 | 2915efbf | Alex Horn | |
52 | 2915efbf | Alex Horn | /**
|
53 | 2915efbf | Alex Horn | * tmp105_set:
|
54 | 2915efbf | Alex Horn | * @i2c: dispatcher to TMP105 hardware model
|
55 | 2915efbf | Alex Horn | * @temp: temperature with 0.001 centigrades units in the range -40 C to +125 C
|
56 | 2915efbf | Alex Horn | *
|
57 | 2915efbf | Alex Horn | * Sets the temperature of the TMP105 hardware model.
|
58 | 2915efbf | Alex Horn | *
|
59 | 2915efbf | Alex Horn | * Bits 5 and 6 (value 32 and 64) in the register indexed by TMP105_REG_CONFIG
|
60 | 2915efbf | Alex Horn | * determine the precision of the temperature. See Table 8 in the data sheet.
|
61 | 2915efbf | Alex Horn | *
|
62 | 2915efbf | Alex Horn | * @see_also: I2C_SLAVE macro
|
63 | 2915efbf | Alex Horn | * @see_also: http://www.ti.com/lit/gpn/tmp105
|
64 | 2915efbf | Alex Horn | */
|
65 | 2915efbf | Alex Horn | void tmp105_set(I2CSlave *i2c, int temp); |
66 | 2915efbf | Alex Horn | |
67 | 2915efbf | Alex Horn | #endif |