com.ftdi.j2xx.ft4222

## Class FT_4222_Device

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

-     public class FT_4222_Device
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FT_4222_Device(FT_Device ftDev)` Constructor for FT4222 device class

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `chipReset()` Chip reset
    `boolean` | `cleanRxData()` Clear inner read buffer
    `int` | `getClock(byte[] clk)` Get the current system clock rate.
    `Gpio` | `getGpioDevice()` Get GPIO interface
    `I2cMaster` | `getI2cMasterDevice()` Get I2c mater interface
    `I2cSlave` | `getI2cSlaveDevice()` Get I2c slave interface
    `SpiMaster` | `getSpiMasterDevice()` Get Spi mater interface
    `SpiSlave` | `getSpiSlaveDevice()` Get Spi slave interface
    `char` | `GetVersion()`
    `int` | `init()` Init FT_4222_Device class and sync the chip status internally
    `boolean` | `isFT4222Device()` Check if the device is FT4222 device
    `int` | `setClock(byte clk)` Set the system clock rate.
    `int` | `setInterruptEnable(boolean bValue)` Set interrupt and remote wake up enable
    `int` | `setInterruptTrigger(int triggerType)` Set interrupt trigger type
    `int` | `setSuspendOut(boolean bValue)` Set suspend out enable

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

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

- - ### Constructor Detail

    - #### FT_4222_Device

          public FT_4222_Device(FT_Device ftDev)

      Constructor for FT4222 device class
      Parameters:
        `ftDev` - a generic FT device interface

  - ### Method Detail

    - #### init

          public int init()

      Init FT_4222_Device class and sync the chip status internally
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### setClock

          public int setClock(byte clk)

      Set the system clock rate. The FT4222H supports 4 clock rates: 80MHz, 60MHz, 48MHz, or 24MHz. By default, the FT4222H runs at 60MHz clock rate.
      Parameters:
        `clk` - FT4222 system clock rate
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### getClock

          public int getClock(byte[] clk)

      Get the current system clock rate.
      Parameters:
        `clk` - FT4222 system clock rate
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### cleanRxData

          public boolean cleanRxData()

      Clear inner read buffer
      Returns:
        true if data exists in the read buffer, otherwise return false.

    - #### isFT4222Device

          public boolean isFT4222Device()

      Check if the device is FT4222 device
      Returns:
        Return true iff the device is a FT4222 device; otherwise return false.

    - #### getI2cMasterDevice

          public I2cMaster getI2cMasterDevice()

      Get I2c mater interface
      Returns:
        Return a I2C mater interface; return null, if it is not a FT4222 device.

    - #### getI2cSlaveDevice

          public I2cSlave getI2cSlaveDevice()

      Get I2c slave interface
      Returns:
        Return a I2C slave interface; return null, if it is not a FT4222 device.

    - #### getSpiMasterDevice

          public SpiMaster getSpiMasterDevice()

      Get Spi mater interface
      Returns:
        Return a SPI master interface; return null, if it is not a FT4222 device.

    - #### getSpiSlaveDevice

          public SpiSlave getSpiSlaveDevice()

      Get Spi slave interface
      Returns:
        Return a SPI slave interface; return null, if it is not a FT4222 device.

    - #### getGpioDevice

          public Gpio getGpioDevice()

      Get GPIO interface
      Returns:
        Return a GPIO interface; return null, if it is not a FT4222 device.

    - #### setSuspendOut

          public int setSuspendOut(boolean bValue)

      Set suspend out enable
      Parameters:
        `bValue` - true for enable and false for disable
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### setInterruptEnable

          public int setInterruptEnable(boolean bValue)

      Set interrupt and remote wake up enable
      Parameters:
        `bValue` - true for enable and false for disable
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### setInterruptTrigger

          public int setInterruptTrigger(int triggerType)

      Set interrupt trigger type
      Parameters:
        `triggerType` - GPIO_Tigger.GPIO_TRIGGER_RISING, GPIO_Tigger.GPIO_TRIGGER_FALLING, GPIO_Tigger.GPIO_TRIGGER_LEVEL_HIGH or GPIO_Tigger.GPIO_TRIGGER_LEVEL_LOW
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### chipReset

          public int chipReset()

      Chip reset
      Returns:
        FT4222_OK if successful, otherwise the return value is an FT error code.

    - #### GetVersion

          public char GetVersion()

About FTDI | FTDI Licence Terms