An improved version of mbed's I2C class.
Dependents: acd52832_Humidity_Temp_Example BB acnSensa_LIS aconnoCellularGnss ... more
Diff: aconno_i2c.h
- Revision:
- 2:3c0eab894a4b
- Parent:
- 1:5ae1807e3902
- Child:
- 4:db46d6bb60f0
--- a/aconno_i2c.h Fri Sep 22 16:48:28 2017 +0000 +++ b/aconno_i2c.h Tue Sep 26 12:03:09 2017 +0000 @@ -12,9 +12,9 @@ #include "mbed.h" -class aconno_i2c: public I2C{ +class aconno_i2c{ public: - aconno_i2c(PinName data, PinName clock, char address); + aconno_i2c(I2C *i2c, char address); uint8_t writeToReg(char regAddress, char *data, int len); uint8_t readFromReg(char regAddress, char *dataBuffer, int len); uint8_t sendCommand(char *command, uint8_t len, char *response, uint8_t responseLen); @@ -22,6 +22,7 @@ uint8_t readBus(char *dataBuffer, int len); private: uint8_t i2cAddress; + I2C *i2c; }; #endif // ACONNO_I2C_H \ No newline at end of file