A helper class for I2C
I2CHelper.cpp
- Committer:
- ethanharstad
- Date:
- 2014-06-07
- Revision:
- 0:e0f604f504c4
- Child:
- 1:e1b13a0c1987
File content as of revision 0:e0f604f504c4:
#include "I2CHelper.h" /* Constructors */ I2CHelper::I2CHelper() : i2c_(I2C_SDA, I2C_SCL) {} I2CHelper::I2CHelper(PinName sda, PinName scl) : i2c_(sda, scl) {} /* Read Functions */ bool I2CHelper::readBit(const uint8_t devAddr, const uint8_t regAddr, const uint8_t bit, uint8_t *data) { } bool I2CHelper::readBits(const uint8_t devAddr, const uint8_t regAddr, const uint8_t startBit, const uint8_t length, uint8_t *data) { } bool I2CHelper::readByte(const uint8_t devAddr, const uint8_t regAddr, uint8_t *data) { return readBytes(devAddr, regAddr, data, 1); } bool I2CHelper::readBytes(const uint8_t devAddr, const uint8_t regAddr, uint8_t *data, const uint8_t length) { } /* Write Functions */ bool I2CHelper::writeBit(const uint8_t devAddr, const uint8_t regAddr, const uint8_t bit, const uint8_t data) { } bool I2CHelper::writeBits(const uint8_t devAddr, const uint8_t regAddr, const uint8_t startBit, const uint8_t length, const uint8_t data) { } bool I2CHelper::writeByte(const uint8_t devAddr, const uint8_t regAddr, const uint8_t data) { return writeBytes(devAddr, regAddr, &data, 1); } bool I2CHelper::writeBytes(const uint8_t devAddr, const uint8_t regAddr, const uint8_t *data, const uint8_t length) { }