EasyManua.ls Logo

FTDI LibFT4222 - GPIO Read

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
64
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Parameters:
ftHandle
Handle of the device.
gpioDir
An array defines the directions of 4 GPIO pins. The GPIO direction will be:
GPIO_OUTPUT
GPIO_INPUT
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Error code:
FT4222_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
FT4222_GPIO_NOT_SUPPORTED_IN_THIS_MODE: GPIO function is not supported in mode 2 and
mode 3
Example:
Please refer to the example in FT4222_GPIO_Read.
3.8.2 GPIO Read
FT4222_STATUS FT4222_GPIO_Read(FT_HANDLE ftHandle, GPIO_Port portNum, BOOL* pValue)
Supported Chip:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
Summary:
Read the status of a specified GPIO pin or interrupt register.
Parameters:
ftHandle
Handle of the device.
portNum
One of the following GPIO ports:
GPIO_PORT0
GPIO_PORT1
GPIO_PORT2
GPIO_PORT3
pValue
Pointer to a variable of type BOOL which receives the value of the GPIO pin.
For GPIO :
TRUE means voltage level is high now
FALSE mean voltage level is low now
For Interrupt:
TRUE means trigger condition is invoked
FALSE means trigger condition is not invoked
Interrupt status is cleared after calling this function.
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.

Table of Contents