modified to work with juston I2CX library for Nordic BLE, see http://developer.mbed.org/questions/5107/Arch-BLE-I2C-working/#answer5383 esp. the answer by Joris Aerts
Dependents: Seed_Barometer_Sensor_custom_I2C_lib
Fork of BMP085 by
Revision 3:61eea911ad24, committed 2014-11-04
- Comitter:
- grassel
- Date:
- Tue Nov 04 19:20:17 2014 +0000
- Parent:
- 2:5e2b1f3c0a6a
- Commit message:
- patched to work with custom I2CX i2c library, see http://developer.mbed.org/questions/5107/Arch-BLE-I2C-working/#answer5383 esp. the answer by Joris Aerts
Changed in this revision
BMP085.cpp | Show annotated file Show diff for this revision Revisions of this file |
BMP085.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/BMP085.cpp Fri Jul 11 00:54:26 2014 +0000 +++ b/BMP085.cpp Tue Nov 04 19:20:17 2014 +0000 @@ -22,16 +22,16 @@ * @param p_scl port of I2C SCL * @param p_oss parameter of OSS */ -BMP085::BMP085 (PinName p_sda, PinName p_scl, BMP085_oss p_oss) : i2c(p_sda, p_scl) { - init(p_oss); -} +//BMP085::BMP085 (PinName p_sda, PinName p_scl, BMP085_oss p_oss) : i2c(p_sda, p_scl) { +// init(p_oss); +//} /** * @brief Initializes interface (public I2C) * @param p_i2c instance of I2C class * @param p_oss parameter of OSS */ -BMP085::BMP085 (I2C& p_i2c, BMP085_oss p_oss) : i2c(p_i2c) { +BMP085::BMP085 (I2CX& p_i2c, BMP085_oss p_oss) : i2c(p_i2c) { init(p_oss); }
--- a/BMP085.h Fri Jul 11 00:54:26 2014 +0000 +++ b/BMP085.h Tue Nov 04 19:20:17 2014 +0000 @@ -14,6 +14,7 @@ #define BMP085_H #include "mbed.h" +#include "I2CX.h" /** * @brief over sampling setting @@ -30,8 +31,8 @@ */ class BMP085 { public: - BMP085(PinName p_sda, PinName p_scl, BMP085_oss p_oss = BMP085_oss1); - BMP085(I2C& p_i2c, BMP085_oss p_oss = BMP085_oss1); + // BMP085(PinName p_sda, PinName p_scl, BMP085_oss p_oss = BMP085_oss1); + BMP085(I2CX& p_i2c, BMP085_oss p_oss = BMP085_oss1); float get_temperature(); float get_pressure(); @@ -43,7 +44,7 @@ unsigned long twi_readlong (int, int); void twi_writechar (int, int, int); - I2C i2c; + I2CX i2c; float temperature; float pressure;