libi2cd
1.0.3
Linux kernel I2C character device library
|
24 #include <linux/i2c.h>
175 int i2cd_read(
struct i2cd *dev, uint16_t addr,
void *buf,
size_t len);
188 int i2cd_write(
struct i2cd *dev, uint16_t addr,
const void *buf,
size_t len);
205 const void *write_buf,
size_t write_len,
206 void *read_buf,
size_t read_len);
240 uint8_t reg,
void *buf,
size_t len)
263 uint16_t reg,
void *buf,
size_t len)
int i2cd_write_read(struct i2cd *dev, uint16_t addr, const void *write_buf, size_t write_len, void *read_buf, size_t read_len)
Write and read bytes from a slave device using a repeated START condition.
int i2cd_write(struct i2cd *dev, uint16_t addr, const void *buf, size_t len)
Write bytes to a slave device.
struct i2cd * i2cd_open_by_number(unsigned int num)
Open the I2C character device specified by num.
static int i2cd_register_read(struct i2cd *dev, uint16_t addr, uint8_t reg, void *buf, size_t len)
Read bytes from an 8-bit slave register.
Definition: i2cd.h:239
struct i2cd * i2cd_open_by_name(const char *name)
Open the I2C character device specified by name.
void i2cd_close(struct i2cd *dev)
Close an I2C character device handle and free associated memory.
int i2cd_read(struct i2cd *dev, uint16_t addr, void *buf, size_t len)
Read bytes from a slave device.
int i2cd_set_timeout(struct i2cd *dev, unsigned long timeout)
Set the timeout in units of 10ms.
static int i2cd_register_read16(struct i2cd *dev, uint16_t addr, uint16_t reg, void *buf, size_t len)
Read bytes from a 16-bit slave register.
Definition: i2cd.h:262
int i2cd_transfer(struct i2cd *dev, struct i2c_msg msgs[], size_t nmsgs)
Transfer one or more low-level messages terminated with a single STOP condition.
int i2cd_get_functionality(struct i2cd *dev, unsigned long *funcs)
Get the adapter functionality mask.
const char * i2cd_get_path(struct i2cd *dev)
Get the path used to open the I2C character device handle.
int i2cd_set_retries(struct i2cd *dev, unsigned long retries)
Set the number of times a slave address should be polled when not acknowledging.
struct i2cd * i2cd_open(const char *path)
Open the I2C character device specified by path.
Handle to an I2C character device.