Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
43
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Rule 2: SPI slave device receives USB maximum bulk size in specific time. The device returns full
packet data.
Rule 3: The option only takes effect when FT4222_SPISlave_RxQuickResponse is on.
When this option turns on, the device return the rx data when the transfer gap of two
bytes is larger than 1000 MCU clock. Take an example ,the default MCU frequency is
80 MHZ. 1000MCU clock is equal to 12.5ns*1000 = 12.5us
There is a constraint. The size of rx data is not the multiple of 16 bytes or data can
not be returned so fast.
Rule1 and Rule 2 are mandatory. Rule 3 is optional. If Rule 3 option turns on, the priority of rule 3
is highest.
Two things needs to notice, do not enable FT4222_SPISlave_RxQuickResponse while the
transaction rate below 2 Mbps or it may cause some RX data lost. The gap between two
transactions should larger than 2 ms or it may cause some RX data lost.
Parameters:
TRUE to enable Rule3 to speed up the response time of RX data.
FALSE to disable Rule3.
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_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
FT4222_IS_NOT_SPI_MODE: The device is not in spi slave mode.
Prerequisite:
FT4222_SPISlave_InitEx or FT4222_SPISlave_Init
3.5 SPI General Functions
3.5.1 SPI Reset Transaction
FT4222_STATUS FT4222_SPI_ResetTransaction(FT_HANDLE ftHandle, uint8 spiIdx)
Supported Chip:
Summary:
Reset the SPI transaction.It would purge receive and transmit buffers in the device and reset the
transaction state. D2XX has similar function(FT_PURGE) but strongly recommend to use
FT4222_SPI_ResetTransaction.