Constructor and Description |
---|
FT_4222_Spi_Master(FT_4222_Device pDevice) |
Modifier and Type | Method and Description |
---|---|
int |
init(int ioLine,
int clock,
int cpol,
int cpha,
byte ssoMap)
Initialize FT4222H as an SPI master.
|
int |
multiReadWrite(byte[] readBuffer,
byte[] writeBuffer,
int singleWriteBytes,
int multiWriteBytes,
int multiReadBytes,
int[] sizeOfRead)
Under SPI dual or quad mode, write data to and read data from an SPI slave.
|
int |
reset()
Reset the SPI master or slave device.
|
int |
setDrivingStrength(int clkStrength,
int ioStrength,
int ssoStregth)
For the FT4222H SPI master, set the driving strength of clk, io, and sso pins.
|
int |
setLines(int spiMode)
Switch FT4222H SPI master to single, dual, or quad lines.
|
int |
singleRead(byte[] readBuffer,
int sizeToTransfer,
int[] sizeOfRead,
boolean isEndTransaction)
Under SPI single mode, read data from an SPI slave.
|
int |
singleReadWrite(byte[] readBuffer,
byte[] writeBuffer,
int sizeToTransfer,
int[] sizeTransferred,
boolean isEndTransaction)
Under SPI single mode, full-duplex write data to and read data from an SPI slave.
|
int |
singleWrite(byte[] writeBuffer,
int sizeToTransfer,
int[] sizeTransferred,
boolean isEndTransaction)
Under SPI single mode, write data to an SPI slave.
|
public FT_4222_Spi_Master(FT_4222_Device pDevice)
public int init(int ioLine, int clock, int cpol, int cpha, byte ssoMap)
SpiMaster
public int setLines(int spiMode)
SpiMaster
public int singleWrite(byte[] writeBuffer, int sizeToTransfer, int[] sizeTransferred, boolean isEndTransaction)
SpiMaster
singleWrite
in interface SpiMaster
writeBuffer
- buffer that contains the data to be written to the device.sizeToTransfer
- The size of read and write buffer. They must be the same.sizeTransferred
- Pointer to a variable of type uint16 which receives the number of bytes read and written to the device.isEndTransaction
- TRUE to raise the pin of SS at the end of the transactionpublic int singleRead(byte[] readBuffer, int sizeToTransfer, int[] sizeOfRead, boolean isEndTransaction)
SpiMaster
singleRead
in interface SpiMaster
readBuffer
- buffer that receives the data from the devicesizeToTransfer
- The size of read and write buffer. They must be the same.isEndTransaction
- TRUE to raise the pin of SS at the end of the transactionpublic int singleReadWrite(byte[] readBuffer, byte[] writeBuffer, int sizeToTransfer, int[] sizeTransferred, boolean isEndTransaction)
SpiMaster
singleReadWrite
in interface SpiMaster
readBuffer
- buffer that receives the data from the devicewriteBuffer
- buffer that contains the data to be written to the device.sizeToTransfer
- The size of read and write buffer. They must be the same.sizeTransferred
- Pointer to a variable of type uint16 which receives the number of bytes read and written to the device.isEndTransaction
- TRUE to raise the pin of SS at the end of the transactionpublic int multiReadWrite(byte[] readBuffer, byte[] writeBuffer, int singleWriteBytes, int multiWriteBytes, int multiReadBytes, int[] sizeOfRead)
SpiMaster
multiReadWrite
in interface SpiMaster
readBuffer
- buffer that receives the data from the device.writeBuffer
- buffer that contains the data to be written to the device. .singleWriteBytes
- number of bytes in writeBuffer will be written as single-line.multiWriteBytes
- number of bytes in writeBuffer will be written as multi-line.multiReadBytes
- number of bytes to read as multi-line.sizeOfRead
- number of bytes read from the device.public int reset()
SpiMaster
public int setDrivingStrength(int clkStrength, int ioStrength, int ssoStregth)
clkStrength
- The driving strength of the clk pinioStrength
- The driving strength of the io pinssoStregth
- The driving strength of the sso pin