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