diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/i2c.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h index bb7f28000d..b749d04b08 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -265,6 +265,35 @@ int i2c_read8(int port, int slave_addr, int offset, int *data); int i2c_write8(int port, int slave_addr, int offset, int data); /** + * Read one or two bytes data from the slave at 8-bit slave address + * * <slaveaddr>, at 16-bit <offset> in the slave's address space. + */ +int i2c_read_offset16(int port, int slave_addr, uint16_t offset, + int *data, int len); + +/** + * Write one or two bytes data to the slave at 8-bit slave address + * <slaveaddr>, at 16-bit <offset> in the slave's address space. + */ +int i2c_write_offset16(int port, int slave_addr, uint16_t offset, + int data, int len); + +/** + * Read <len> bytes block data from the slave at 8-bit slave address + * * <slaveaddr>, at 16-bit <offset> in the slave's address space. + */ +int i2c_read_offset16_block(int port, int slave_addr, uint16_t offset, + uint8_t *data, int len); + +/** + * Write <len> bytes block data to the slave at 8-bit slave address + * <slaveaddr>, at 16-bit <offset> in the slave's address space. + */ +int i2c_write_offset16_block(int port, int slave_addr, uint16_t offset, + const uint8_t *data, int len); + + +/** * @return non-zero if i2c bus is busy */ int i2c_is_busy(int port); |