54 I2c(
int bus,
bool raw =
false)
62 throw std::invalid_argument(
"Invalid i2c bus");
70 I2c(
void* i2c_context)
74 throw std::invalid_argument(
"Invalid I2C context");
126 throw std::invalid_argument(
"Unknown error in I2c::readByte()");
139 read(uint8_t* data,
int length)
157 throw std::invalid_argument(
"Unknown error in I2c::readReg()");
175 throw std::invalid_argument(
"Unknown error in I2c::readReg()");
216 write(
const uint8_t* data,
int length)
mraa_i2c_mode_t
Definition: types.h:246
Result
Definition: types.hpp:204
int mraa_i2c_read_byte(mraa_i2c_context dev)
Result writeByte(uint8_t data)
Definition: i2c.hpp:202
mraa_result_t mraa_i2c_frequency(mraa_i2c_context dev, mraa_i2c_mode_t mode)
int mraa_i2c_read(mraa_i2c_context dev, uint8_t *data, int length)
mraa_i2c_context mraa_i2c_init(int bus)
mraa_result_t mraa_i2c_write_byte(mraa_i2c_context dev, const uint8_t data)
mraa_result_t mraa_i2c_write_byte_data(mraa_i2c_context dev, const uint8_t data, const uint8_t command)
uint8_t readReg(uint8_t reg)
Definition: i2c.hpp:153
Result write(const uint8_t *data, int length)
Definition: i2c.hpp:216
int readBytesReg(uint8_t reg, uint8_t *data, int length)
Definition: i2c.hpp:190
I2cMode
Definition: types.hpp:241
mraa_result_t mraa_i2c_write(mraa_i2c_context dev, const uint8_t *data, int length)
uint16_t readWordReg(uint8_t reg)
Definition: i2c.hpp:171
I2c(void *i2c_context)
Definition: i2c.hpp:70
Result writeWordReg(uint8_t reg, uint16_t data)
Definition: i2c.hpp:242
mraa_i2c_context mraa_i2c_init_raw(unsigned int bus)
struct _i2c * mraa_i2c_context
Definition: i2c.h:53
int mraa_i2c_read_word_data(mraa_i2c_context dev, const uint8_t command)
mraa_result_t mraa_i2c_address(mraa_i2c_context dev, uint8_t address)
Result writeReg(uint8_t reg, uint8_t data)
Definition: i2c.hpp:229
Result address(uint8_t address)
Definition: i2c.hpp:110
mraa_result_t mraa_i2c_stop(mraa_i2c_context dev)
int mraa_i2c_read_bytes_data(mraa_i2c_context dev, uint8_t command, uint8_t *data, int length)
Result frequency(I2cMode mode)
Definition: i2c.hpp:97
~I2c()
Definition: i2c.hpp:83
API to Inter-Integrated Circuit.
Definition: i2c.hpp:43
int mraa_i2c_read_byte_data(mraa_i2c_context dev, const uint8_t command)
int read(uint8_t *data, int length)
Definition: i2c.hpp:139
mraa_result_t mraa_i2c_write_word_data(mraa_i2c_context dev, const uint16_t data, const uint8_t command)
uint8_t readByte()
Definition: i2c.hpp:122
I2c(int bus, bool raw=false)
Definition: i2c.hpp:54
Inter-Integrated Circuit.