EasyManua.ls Logo

FTDI LibFT4222 - Figure 3.1 SPI Full Duplex Communication

Default Icon
78 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
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:
ftHandle
Handle of the device.
readBuffer
Pointer to the buffer that receives data from the device.
writeBuffer
Pointer to the buffer that contains 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 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:

Table of Contents