Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
67
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Supported Chip:
Summary:
Set software trigger conditions on the specified GPIO pin.
This function allows developers to monitor value changes of the GPIO pins. Values that satisfy the
trigger condition will be stored in a queue. For example, if GPIO_TRIGGER_RISING is set on GPIO0,
and GPIO0 then changes value from 0 to 1, the event GPIO_TRIGGER_RISING will be recorded
into the queue. Developers can query the queue status by FT4222_GPIO_GetTriggerStatus, and
FT4222_GPIO_ReadTriggerQueue.
This function can only set gpio trigger conditions. For interrupt trigger conditions, please refer to
FT4222_SetInterruptTrigger.
Parameters:
One of the following GPIO port:
GPIO_PORT0
GPIO_PORT1
GPIO_PORT2
GPIO_PORT3
Combination of the following trigger conditions:
GPIO_TRIGGER_RISING
GPIO_TRIGGER_FALLING
GPIO_TRIGGER_LEVEL_HIGH
GPIO_TRIGGER_LEVEL_LOW
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_GPIO_NOT_SUPPORTED_IN_THIS_MODE: GPIO function is not supported in mode 2 and
mode 3
FT4222_GPIO_INPUT_NOT_SUPPORTED: Direction on this port is not reading direction.
Prerequisite:
FT4222_GPIO_Init
Example:
Please refer the example in FT4222_GPIO_ReadTriggerQueue
3.8.5 GPIO Get Trigger Status
FT4222_STATUS FT4222_GPIO_GetTriggerStatus(FT_HANDLE ftHandle, GPIO_Port portNum,
uint16* pQueueSize)