FT_4222_Gpio

com.ftdi.j2xx.ft4222

## Class FT_4222_Gpio

- java.lang.Object
- - com.ftdi.j2xx.ft4222.FT_4222_Gpio

- All Implemented Interfaces:
    Gpio

      public class FT_4222_Gpio
      extends java.lang.Object
      implements Gpio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FT_4222_Gpio(FT_4222_Device ft4222Device)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `init(int[] gpio)` Initialize the GPIO interface of the FT4222H.
    `int` | `read(int portNum, boolean[] bValue)` Read the value from the specified GPIO pin.
    `int` | `write(int portNum, boolean bValue)` Write value to the specified GPIO pin.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FT_4222_Gpio

          public FT_4222_Gpio(FT_4222_Device ft4222Device)

  - ### Method Detail

    - #### init

          public int init(int[] gpio)

      Initialize the GPIO interface of the FT4222H. Please note the GPIO interface is available on the 2nd USB interface in mode 0 or on the 4th USB interface in mode 1.
      Specified by:
        `init` in interface `Gpio`
      Parameters:
        `gpio` - An array defines the directions of 4 GPIO pins. The GPIO direction will be: GPIO_OUTPUT GPIO_INPUT
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### read

          public int read(int portNum,
                 boolean[] bValue)

      Read the value from the specified GPIO pin.
      Specified by:
        `read` in interface `Gpio`
      Parameters:
        `portNum` - One of the following GPIO ports: GPIO_PORT0 GPIO_PORT1 GPIO_PORT2 GPIO_PORT3
        `bValue` - A variable of typeBOOL which receives the value of the GPIO pin.
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### write

          public int write(int portNum,
                  boolean bValue)

      Write value to the specified GPIO pin.
      Specified by:
        `write` in interface `Gpio`
      Parameters:
        `portNum` - One of the following GPIO ports: GPIO_PORT0 GPIO_PORT1 GPIO_PORT2 GPIO_PORT3
        `bValue` - The output value.
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

About FTDI | FTDI Licence Terms