public interface I2cSlave
Modifier and Type | Method and Description |
---|---|
int |
getAddress(int[] addr)
Get the address of the I2C slave device.
|
int |
init()
Initialize the device as an I2C slave.
|
int |
read(byte[] buffer,
int sizeToTransfer,
int[] sizeTransferred)
Read data from the buffer of I2C slave device.
|
int |
reset()
Reset the I2C slave device.
|
int |
setAddress(int addr)
Set the address of the I2C slave device.
|
int |
write(byte[] buffer,
int sizeToTransfer,
int[] sizeTransferred)
Write data to the I2C slave device.
|
int init()
int reset()
int getAddress(int[] addr)
addr
- The address of the I2C slave device.int setAddress(int addr)
addr
- The 7-bit address of the I2C slave device.int read(byte[] buffer, int sizeToTransfer, int[] sizeTransferred)
buffer
- Buffer array that receives the data from the device.sizeToTransfer
- Number of bytes to read from the device.sizeTransferred
- The actual number of bytes read from the device.int write(byte[] buffer, int sizeToTransfer, int[] sizeTransferred)
buffer
- Buffer array that contains the data to be written to the devicesizeToTransfer
- Number of bytes to write to the device.sizeTransferred
- The actual number of bytes written to the device.