write_read_raw()#

I2CInterface.write_read_raw(
address: int,
payload: bytes,
length: int,
endianness: Literal['little', 'big'],
) → int[source]#

Write-then-read without an intermediate I2C STOP (uses repeated START); decode as integer.

Typical use: write a register address, then read its contents.

Parameters:
  • address – 7-bit I2C device address.

  • payload – Bytes to write (typically the register address).

  • length – Number of bytes to read back.

  • endianness – Byte order for the integer decode.