]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/tests/peripherals/TMP102/TMP102.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / libraries / tests / peripherals / TMP102 / TMP102.h
1 #ifndef TMP102_H
2 #define TMP102_H
3
4 #include "mbed.h"
5
6 //!Library for the TI TMP102 temperature sensor.
7 /*!
8 The TMP102 is an I2C digital temperature sensor in a small SOT563 package, with a 0.0625C resolution and 0.5C accuracy.
9 */
10 class TMP102
11 {
12 public:
13 //!Creates an instance of the class.
14 /*!
15 Connect module at I2C address addr using I2C port pins sda and scl.
16 TMP102
17 \param addr <table><tr><th>A0 pin connection</th><th>Address</th></tr><tr><td>GND</td><td>0x90</td></tr><tr><td>V+</td><td>0x92</td></tr><tr><td>SDA</td><td>0x94</td></tr><tr><td>SCL</td><td>0x96</td></tr></table>
18 */
19 TMP102(PinName sda, PinName scl, int addr);
20
21 /*!
22 Destroys instance.
23 */
24 ~TMP102();
25
26 //!Reads the current temperature.
27 /*!
28 Reads the temperature register of the TMP102 and converts it to a useable value.
29 */
30 float read();
31
32 I2C m_i2c;
33
34 private:
35 int m_addr;
36
37 };
38
39 #endif
Imprint / Impressum