Constructor and Description |
---|
FT_4222_I2c_Master(FT_4222_Device ft4222Device) |
Modifier and Type | Method and Description |
---|---|
int |
cmdGet(int wValue1,
int wValue2,
byte[] buf,
int datalen) |
int |
cmdSet(int wValue1,
int wValue2) |
int |
cmdSet(int wValue1,
int wValue2,
byte[] buf,
int datalen) |
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.
|
public FT_4222_I2c_Master(FT_4222_Device ft4222Device)
public int cmdSet(int wValue1, int wValue2)
public int cmdSet(int wValue1, int wValue2, byte[] buf, int datalen)
public int cmdGet(int wValue1, int wValue2, byte[] buf, int datalen)
public int init(int kbps)
I2cMaster
init
in interface I2cMaster
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.public int reset()
I2cMaster
public int read(int deviceAddress, byte[] buffer, int sizeToTransfer, int[] sizeTransferred)
I2cMaster
read
in interface I2cMaster
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.public int write(int deviceAddress, byte[] buffer, int sizeToTransfer, int[] sizeTransferred)
I2cMaster
write
in interface I2cMaster
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.