public interface I2CDevice
Modifier and Type | Method and Description |
---|---|
int |
getAddress() |
void |
ioctl(long command,
ByteBuffer data,
IntBuffer offsets)
Runs an ioctl on this device.
|
void |
ioctl(long command,
int value)
Runs an ioctl on this device.
|
int |
read()
This method reads one byte from the i2c device.
|
int |
read(byte[] buffer,
int offset,
int size)
This method reads bytes directly from the i2c device to given buffer at asked offset.
|
int |
read(byte[] writeBuffer,
int writeOffset,
int writeSize,
byte[] readBuffer,
int readOffset,
int readSize)
This method writes and reads bytes to/from the i2c device in a single method call
|
int |
read(int address)
This method reads one byte from the i2c device.
|
int |
read(int address,
byte[] buffer,
int offset,
int size)
This method reads bytes from the i2c device to given buffer at asked offset.
|
void |
write(byte b)
This method writes one byte directly to i2c device.
|
void |
write(byte[] buffer)
This method writes all bytes included in the given buffer directly to the i2c device.
|
void |
write(byte[] buffer,
int offset,
int size)
This method writes several bytes directly to the i2c device from given buffer at given offset.
|
void |
write(int address,
byte b)
This method writes one byte to i2c device.
|
void |
write(int address,
byte[] buffer)
This method writes all bytes included in the given buffer directoy to the register address on the i2c device
|
void |
write(int address,
byte[] buffer,
int offset,
int size)
This method writes several bytes to the i2c device from given buffer at given offset.
|
int getAddress()
void write(byte b) throws IOException
b
- byte to be writtenIOException
- thrown in case byte cannot be written to the i2c device or i2c busvoid write(byte[] buffer, int offset, int size) throws IOException
buffer
- buffer of data to be written to the i2c device in one gooffset
- offset in buffersize
- number of bytes to be writtenIOException
- thrown in case byte cannot be written to the i2c device or i2c busvoid write(byte[] buffer) throws IOException
buffer
- buffer of data to be written to the i2c device in one goIOException
- thrown in case byte cannot be written to the i2c device or i2c busvoid write(int address, byte b) throws IOException
address
- local address in the i2c deviceb
- byte to be writtenIOException
- thrown in case byte cannot be written to the i2c device or i2c busvoid write(int address, byte[] buffer, int offset, int size) throws IOException
address
- local address in the i2c devicebuffer
- buffer of data to be written to the i2c device in one gooffset
- offset in buffersize
- number of bytes to be writtenIOException
- thrown in case byte cannot be written to the i2c device or i2c busvoid write(int address, byte[] buffer) throws IOException
address
- local address in the i2c devicebuffer
- buffer of data to be written to the i2c device in one goIOException
- thrown in case byte cannot be written to the i2c device or i2c busint read() throws IOException
IOException
- thrown in case byte cannot be read from the i2c device or i2c busint read(byte[] buffer, int offset, int size) throws IOException
buffer
- buffer of data to be read from the i2c device in one gooffset
- offset in buffersize
- number of bytes to be readIOException
- thrown in case byte cannot be read from the i2c device or i2c busint read(int address) throws IOException
address
- local address in the i2c deviceIOException
- thrown in case byte cannot be read from the i2c device or i2c busint read(int address, byte[] buffer, int offset, int size) throws IOException
address
- local address in the i2c devicebuffer
- buffer of data to be read from the i2c device in one gooffset
- offset in buffersize
- number of bytes to be readIOException
- thrown in case byte cannot be read from the i2c device or i2c busvoid ioctl(long command, int value) throws IOException
IOException
LinuxFile.ioctl(long, int)
void ioctl(long command, ByteBuffer data, IntBuffer offsets) throws IOException
IOException
LinuxFile.ioctl(long, ByteBuffer, IntBuffer)
int read(byte[] writeBuffer, int writeOffset, int writeSize, byte[] readBuffer, int readOffset, int readSize) throws IOException
writeBuffer
- buffer of data to be written to the i2c device in one gowriteOffset
- offset in write bufferwriteSize
- number of bytes to be written from bufferreadBuffer
- buffer of data to be read from the i2c device in one goreadOffset
- offset in read bufferreadSize
- number of bytes to be readIOException
- thrown in case byte cannot be read from the i2c device or i2c busCopyright © 2012–2019 Pi4J. All rights reserved.