Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
29
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Supported Chip:
Summary:
Under SPI single mode, full-duplex write data to and read data from an SPI slave.
The standard SPI protocol simultaneously sends data onto the MOSI data line and receives data
from the MISO line as shown below -
Figure 3.1 SPI full duplex communication
Parameters:
Pointer to the buffer that receives data from the device.
Pointer to the buffer that contains data to be written to the device.
The size of read and write buffer. They must be the same.
Pointer to a variable of type uint16 which receives the number of bytes read
and written to the device.
TRUE to raise the pin of SS at the end of the transaction.
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Error code:
FT4222_DEVICE_NOT_OPENED: The initialization API is not called.
FT4222_INVALID_POINTER: Pointer is a NULL pointer.
FT4222_IS_NOT_SPI_SINGLE_MODE: Device is not in SPI Master Single mode
FT4222_FAILED_TO_WRITE_DEVICE: Write data timeout or failed. FT_SetTimeouts can be called
to extend timeout.
FT4222_FAILED_TO_READ_DEVICE: Failed to read data.
Prerequisite: