Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
70
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
GPIO_TRIGGER_LEVEL_LOW |
GPIO_TRIGGER_RISING |
GPIO_TRIGGER_FALLING));
while(1)
{
if(FT4222_GPIO_GetTriggerStatus(ftHandle, GPIO_PORT0, &queueSize) == FT4222_OK)
{
if(queueSize>0)
{
uint16 sizeofRead;
std::vector<GPIO_Trigger> tmpBuf;
tmpBuf.resize(queueSize);
if(FT4222_GPIO_ReadTriggerQueue(ftHandle, GPIO_PORT0, &tmpBuf[0], queueSize,
&sizeofRead) == FT4222_OK)
{
// tmpBuf store all trigger status of gpio0
}
}
}
}
// monitor gpio trigger status
FT4222_UnInitialize(ftHandle);
FT_Close(ftHandle);
3.8.7 GPIO Set WaveForm Mode
FT4222_STATUS FT4222_GPIO_SetWaveFormMode(FT_HANDLE ftHandle, BOOL enable)
Supported Chip:
Summary:
Enable or disable WaveForm Mode. When WaveForm mode is enabled, the device will record all
GPIO status periodically. The peeking time depends on the system clock. The default setting of
WaveForm mode is disabled.
Parameters:
TRUE to configure GPIO WaveForm mode
FALSE to switch back to GPIO normal mode. In normal mode, it only records the
changing status on GPIO pins.
Return Value:
FT4222_OK if successful, otherwise the return value is a FT error
Error code:
FT4222_DEVICE_NOT_OPENED: The initialization API is not called.
FT4222_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
Prerequisite:
FT4222_GPIO_Init