Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
63
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Summary:
This function only takes effect when Clock Stretch is disabled. When data is requested by an I
2
C
master and the device is not ready to respond, the device will respond a default value. Default
value is 0xFF. This function can be used to set the response word
Parameters:
The response word when the device is not ready to send data to master.
Return Value:
FT4222_OK if successful, otherwise the return value is a FT error code.
Error code:
FT4222_DEVICE_NOT_OPENED: The initialization API is not called.
FT4222_IS_NOT_I2C_MODE: The device is not in i2c slave mode
Prerequisite:
FT4222_I2CSlave_Init
3.8 GPIO Functions
The FT4222H contains 4 GPIO. When the USB GPIO interface is supported, chip mode 0 and mode
1, LibFT4222 helps application developers to control GPIO directly. However, each GPIO pin is
multiplexed with interrupt/suspend out/SPI slave select/I2C functions as listed below:
gpio0 / ss1o / scl
gpio1 / ss2o / sda
gpio2 / ss3o / suspend out
gpio3 / wakeup/intr
The number of GPIO pins available depends on the mode of the chip. For example, if the FT4222H
is initialized as an I
2
C device, as shown above, the pins of gpio0 and gpio1 will be switched to scl
and sda, and cannot be used as GPIO. If suspend out and remote wakeup are enabled gpio2 and
gpio3 cannot be used as GPIO.
The FT4222H supports GPIO on the second USB interface in mode 0 or on the fourth interface in
mode 2 (Please refer table 2.1 for chip mode and interface).
3.8.1 GPIO Init
FT4222_STATUS FT4222_GPIO_Init(FT_HANDLE ftHandle, GPIO_Dir gpioDir[4])
Supported Chip:
Summary:
Initialize the GPIO interface of the FT4222H.
Please note the GPIO interface is available on the 2
nd
USB interface in mode 0 or on the 4
th
USB
interface in mode 1.