Driver for ADXL345
Fork of ADXL345_I2C by
Revision 3:a453a5e561c2, committed 2015-12-19
- Comitter:
- sillevl
- Date:
- Sat Dec 19 10:40:48 2015 +0000
- Parent:
- 2:f2d04afa9603
- Commit message:
- add constructor that accepts I2C object
Changed in this revision
ADXL345_I2C.cpp | Show annotated file Show diff for this revision Revisions of this file |
ADXL345_I2C.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/ADXL345_I2C.cpp Sat Dec 19 09:17:19 2015 +0000 +++ b/ADXL345_I2C.cpp Sat Dec 19 10:40:48 2015 +0000 @@ -47,6 +47,11 @@ } +ADXL345_I2C::ADXL345_I2C(I2C &i2c) : i2c_(i2c) +{ + +} + char ADXL345_I2C::getDevId(void) { return oneByteRead(ADXL345_DEVID_REG);
--- a/ADXL345_I2C.h Sat Dec 19 09:17:19 2015 +0000 +++ b/ADXL345_I2C.h Sat Dec 19 10:40:48 2015 +0000 @@ -115,6 +115,8 @@ * @param cs mbed pin to use for not chip select line of I2C interface. */ ADXL345_I2C(PinName sda, PinName scl); + + ADXL345_I2C(I2C &i2c); /** * Read the device ID register on the device.