public interface I2cMaster
Modifier and Type | Method and Description |
---|---|
int |
init(int kbps)
Initialize the FT4222H as an I2C master with the requested I2C speed.
|
int |
read(int deviceAddress,
byte[] buffer,
int sizeToTransfer,
int[] sizeTransferred)
Read data from the I2C master device.
|
int |
reset()
Reset the I2C master device.
|
int |
write(int deviceAddress,
byte[] buffer,
int sizeToTransfer,
int[] sizeTransferred)
Write data to the I2C master device.
|
int init(int kbps)
kbps
- The speed of I2C transmission. It ranges from 60K bps to 3400K bps. By specified speed,
the initial function helps to setup bus speed with the corresponding mode.int reset()
int read(int deviceAddress, byte[] buffer, int sizeToTransfer, int[] sizeTransferred)
deviceAddress
- Address of the target I2C slave.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(int deviceAddress, byte[] buffer, int sizeToTransfer, int[] sizeTransferred)
deviceAddress
- Address of the target I2C slave.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.