51 I2c(
int bus,
bool raw=
false) {
59 throw std::invalid_argument(
"Invalid i2c bus");
111 int read(uint8_t *data,
int length) {
mraa_i2c_mode_t
Definition: types.h:180
mraa_result_t writeWordReg(uint8_t reg, uint16_t data)
Definition: i2c.hpp:175
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)
uint8_t mraa_i2c_read_byte_data(mraa_i2c_context dev, const uint8_t command)
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)
uint16_t mraa_i2c_read_word_data(mraa_i2c_context dev, const uint8_t command)
uint8_t readReg(uint8_t reg)
Definition: i2c.hpp:121
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:131
mraa_i2c_context mraa_i2c_init_raw(unsigned int bus)
struct _i2c * mraa_i2c_context
Definition: i2c.h:53
mraa_result_t mraa_i2c_address(mraa_i2c_context dev, uint8_t address)
mraa_result_t mraa_i2c_stop(mraa_i2c_context dev)
mraa_result_t frequency(mraa_i2c_mode_t mode)
Definition: i2c.hpp:80
mraa_result_t writeReg(uint8_t reg, uint8_t data)
Definition: i2c.hpp:164
mraa_result_t write(const uint8_t *data, int length)
Definition: i2c.hpp:153
uint8_t mraa_i2c_read_byte(mraa_i2c_context dev)
mraa_result_t
Definition: types.h:145
~I2c()
Definition: i2c.hpp:68
API to Inter-Integrated Circuit.
Definition: i2c.hpp:41
mraa_result_t address(uint8_t address)
Definition: i2c.hpp:91
int read(uint8_t *data, int length)
Definition: i2c.hpp:111
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:100
I2c(int bus, bool raw=false)
Definition: i2c.hpp:51
mraa_result_t writeByte(uint8_t data)
Definition: i2c.hpp:141
Inter-Integrated Circuit.