Module com.pi4j

Interface I2CRegister

All Superinterfaces:
IODataReader, IODataWriter, Readable

public interface I2CRegister extends IODataWriter, IODataReader
I2C Device Register. This abstraction allows data to be read or written to a specific device register on the I2C bus.
Version:
$Id: $Id
Author:
Robert Savage
  • Method Details

    • getAddress

      int getAddress()

      getAddress.

      Returns:
      This I2C device register address
    • address

      default int address()

      address.

      Returns:
      a int.
    • writeWord

      void writeWord(int word)
      Write a single word value (16-bit) to the I2C device register.
      Parameters:
      word - 16-bit word value to be written
    • readWord

      int readWord()
      Read a single word value (16-bit) to the I2C device register.
      Returns:
      If success, then returns 16-bit word value read from I2C register; else a negative error code.
    • writeReadWord

      int writeReadWord(int word)
      Write a single word value (16-bit) to the I2C device register and immediately reads back a 16-bit word value.
      Parameters:
      word - 16-bit word value to be written
      Returns:
      The 16-bit word value read/returned; or a negative value if error