64 #include "rnr/rnrconfig.h" 74 #define I2C_ADDR_NONE ((i2c_addr_t)(-1)) 170 uint_t write_len, byte_t *read_buf, uint_t read_len);
i2c_addr_t addr
address of the currently selected attached I2C device
int i2c_write(i2c_t *i2c, i2c_addr_t addr, const byte_t *buf, uint_t len)
Write to an I2C device.
int fd
opened file descriptor of the I2C bus device
ushort_t i2c_addr_t
I2C Device Address Type.
void i2c_close(i2c_t *i2c)
Closes an I2C Bus.
int i2c_scan(i2c_t *i2c, int(*callback)(i2c_t *i2c, i2c_addr_t addr, void *context), void *context)
Scans the given I2C Bus to find all connected devices.
struct i2c_struct i2c_t
I2C Bus Handle Type.
int i2c_transfer(i2c_t *i2c, i2c_addr_t addr, const byte_t *write_buf, uint_t write_len, byte_t *read_buf, uint_t read_len)
Perform a transfer with an I2C device.
I2C character device interface.
int i2c_open(i2c_t *i2c, const char *device)
Open the host I2C Bus device.
int i2c_read(i2c_t *i2c, i2c_addr_t addr, byte_t *buf, uint_t len)
Read from an I2C device.
int i2c_exists(i2c_t *i2c, i2c_addr_t addr)
Test the existance of a device at the given address on the given I2C Bus.