libi2cd
1.0.3
Linux kernel I2C character device library
|
Register access functions. More...
Functions | |
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. More... | |
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. More... | |
Register access functions.
These functions simplify interacting with slave devices that require a repeated START condition to separate writing a register address and reading back content. Register addresses are transmitted in host byte order; if a slave device requires different byte ordering, reg
should be converted before being passed as an argument. See endian(3)
for more details.
|
inlinestatic |
Read bytes from an 8-bit slave register.
dev | Pointer to an I2C character device handle. |
addr | I2C slave address. |
reg | I2C slave register. |
buf | Pointer to a buffer to receive bytes. |
len | Number of bytes to read. |
errno
set appropriately.This function is equivalent to calling:
|
inlinestatic |
Read bytes from a 16-bit slave register.
dev | Pointer to an I2C character device handle. |
addr | I2C slave address. |
reg | I2C slave register. |
buf | Pointer to a buffer to receive bytes. |
len | Number of bytes to read. |
errno
set appropriately.This function is equivalent to calling: