-
- 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
address()
address.int
getAddress()
getAddress.int
readWord()
Read a single word value (16-bit) to the I2C device register.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.void
writeWord(int word)
Write a single word value (16-bit) to the I2C device register.-
Methods inherited from interface com.pi4j.io.IODataReader
getInputStream, in, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readByte, readByteBuffer, readByteBuffer, readCharArray, readCharArray, readCharArray, readCharArray, readCharBuffer, readCharBuffer, readCharBuffer, readCharBuffer, readNBytes, readNBytes, readString, readString, readString, readString
-
Methods inherited from interface com.pi4j.io.IODataWriter
getOutputStream, out, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write
-
-
-
-
Method Detail
-
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
-
-