TMP102 with I2C object constructor

Fork of TMP102 by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
JLarkin
Date:
Tue Mar 01 23:09:11 2016 +0000
Parent:
3:694792b93731
Commit message:
Constructor now takes an I2C object rather than SDA and SCL pins

Changed in this revision

TMP102.cpp Show annotated file Show diff for this revision Revisions of this file
TMP102.h Show annotated file Show diff for this revision Revisions of this file
--- a/TMP102.cpp	Thu Mar 07 10:44:42 2013 +0000
+++ b/TMP102.cpp	Tue Mar 01 23:09:11 2016 +0000
@@ -25,7 +25,7 @@
 
 #define TEMP_REG_ADDR 0x00
 
-TMP102::TMP102(PinName sda, PinName scl, int addr) : m_i2c(sda, scl), m_addr(addr)
+TMP102::TMP102(I2C i2c, int addr) : m_i2c(i2c), m_addr(addr)
 {
 
 }
--- a/TMP102.h	Thu Mar 07 10:44:42 2013 +0000
+++ b/TMP102.h	Tue Mar 01 23:09:11 2016 +0000
@@ -39,7 +39,7 @@
   TMP102
   \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>  
   */
-  TMP102(PinName sda, PinName scl, int addr);
+  TMP102(I2C i2c, int addr);
   
   /*!
   Destroys instance.