Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
26
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Parameters:
SPI mode could be:
SPI_IO_SINGLE
SPI_IO_DUAL
SPI_IO_QUAD
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_IS_NOT_SPI_MODE: Device does not be configured to SPI Master mode.
FT4222_NOT_SUPPORTED: SPI Master only support single/dual/quad mode, others are not allowed.
Prerequisite:
FT4222_SPIMaster_init
3.3.3 SPI Master Single Read
FT4222_STATUS FT4222_SPIMaster_SingleRead(FT_HANDLE ftHandle, uint8* buffer, uint16
bytesToRead, uint16* sizeOfRead, BOOL isEndTransaction)
Supported Chip:
Summary:
Under SPI single mode, read data from an SPI slave.
Parameters:
Pointer to the buffer that receives the data from the device.
Number of bytes to read from the device.
Pointer to a variable of type uint16 which receives the number of bytes read
from the device.
If TRUE the Slave Select pin will be raised at the end of the read.
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.