Package com.ftdi

Interface FTD2XX

All Superinterfaces:
com.sun.jna.Library

public interface FTD2XX extends com.sun.jna.Library
Author:
Peter Kocsis invalid input: '<'p. kocsis. 2. 7182 at gmail.com>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
    static class 
     
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from interface com.sun.jna.Library

    com.sun.jna.Library.Handler
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final FTD2XX
     

    Fields inherited from interface com.sun.jna.Library

    OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    FT_Close(com.sun.jna.Pointer ftHandle)
    Close an open device.
    int
    FT_ClrDtr(com.sun.jna.Pointer ftHandle)
    This function clears the Data Terminal Ready (DTR) control signal.
    int
    FT_ClrRts(com.sun.jna.Pointer ftHandle)
    This function clears the Request To Send (RTS) control signal.
    int
    FT_CreateDeviceInfoList(com.sun.jna.ptr.IntByReference lpdwNumDevs)
    This function builds a device information list and returns the number of D2XX devices connected to the system.
    int
    FT_CyclePort(com.sun.jna.Pointer ftHandle)
    Send a cycle command to the USB port.
    int
    FT_EE_Program(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData)
    Program the EEPROM.
    int
    FT_EE_ProgramEx(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData, String Manufacturer, String ManufacturerId, String Description, String SerialNumber)
    Program the EEPROM and pass strings separately.
    int
    FT_EE_Read(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData)
    Read the contents of the EEPROM.
    int
    FT_EE_ReadEx(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData, String Manufacturer, String ManufacturerId, String Description, String SerialNumber)
    Read the contents of the EEPROM and pass strings separately.
    int
    FT_EE_UARead(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer pucData, int dwDataLen, com.sun.jna.ptr.IntByReference lpdwBytesRead)
    Read the contents of the EEPROM user area.
    int
    FT_EE_UASize(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwSize)
    Get the available size of the EEPROM user area.
    int
    FT_EE_UAWrite(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer pucData, int dwDataLen)
    Write data into the EEPROM user area.
    int
    FT_EEPROM_Program(com.sun.jna.Pointer ftHandle, com.sun.jna.Structure eepromData, int eepromDataSize, com.sun.jna.Pointer Manufacturer, com.sun.jna.Pointer ManufacturerId, com.sun.jna.Pointer Description, com.sun.jna.Pointer SerialNumber)
    Write the contents of the EEPROM and pass strings separately.
    int
    FT_EEPROM_Read(com.sun.jna.Pointer ftHandle, com.sun.jna.Structure eepromData, int eepromDataSize, com.sun.jna.Pointer Manufacturer, com.sun.jna.Pointer ManufacturerId, com.sun.jna.Pointer Description, com.sun.jna.Pointer SerialNumber)
    Read the contents of the EEPROM and pass strings separately.
    int
    FT_EraseEE(com.sun.jna.Pointer ftHandle)
    Erases the device EEPROM.
    int
    FT_GetBitMode(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.ByteByReference pucMode)
    Gets the instantaneous value of the data bus.
    int
    FT_GetComPortNumber(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lplComPortNumber)
    Retrieves the COM port associated with a device.
    int
    FT_GetDeviceInfo(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference pftType, com.sun.jna.ptr.IntByReference lpdwID, com.sun.jna.Pointer pcSerialNumber, com.sun.jna.Pointer pcDescription, com.sun.jna.Pointer pvDummy)
    Get device information for an open device.
    int
    FT_GetDeviceInfoDetail(int dwIndex, com.sun.jna.ptr.IntByReference lpdwFlags, com.sun.jna.ptr.IntByReference lpdwType, com.sun.jna.ptr.IntByReference lpdwID, com.sun.jna.ptr.IntByReference lpdwLocId, com.sun.jna.Pointer pcSerialNumber, com.sun.jna.Pointer pcDescription, com.sun.jna.ptr.PointerByReference ftHandle)
    This function returns an entry from the device information list.
    int
    FT_GetDeviceInfoList(FTD2XX.FT_DEVICE_LIST_INFO_NODE[] pDest, com.sun.jna.ptr.IntByReference lpdwNumDevs)
    This function returns an entry from the device information list.
    int
    FT_GetDriverVersion(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwDriverVersion)
    This function returns the D2XX driver version number.
    int
    FT_GetLatencyTimer(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.ByteByReference pucTimer)
    Get the current value of the latency timer.
    int
    FT_GetLibraryVersion(com.sun.jna.ptr.IntByReference lpdwDLLVersion)
    This function returns D2XX DLL version number.
    int
    FT_GetModemStatus(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwModemStatus)
    Gets the modem status and line status from the device.
    int
    FT_GetQueueStatus(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwAmountInRxQueue)
    Gets the number of bytes in the receive queue.
    int
    FT_GetStatus(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwAmountInRxQueue, com.sun.jna.ptr.IntByReference lpdwAmountInTxQueue, com.sun.jna.ptr.IntByReference lpdwEventStatus)
    Gets the device status including number of characters in the receive queue, number of characters in the transmit queue, and the current event status.
    int
    FT_GetVIDPID(com.sun.jna.ptr.IntByReference pdwVID, com.sun.jna.ptr.IntByReference pdwPID)
    A command to retrieve the current VID and PID combination from within the internal device list table.
    int
    FT_ListDevices(com.sun.jna.Pointer pvArg1, com.sun.jna.Pointer pvArg2, int dwFlags)
    Gets information concerning the devices currently connected.
    int
    FT_Open(int iDevice, com.sun.jna.ptr.PointerByReference ftHandle)
    Open the device and return a handle which will be used for subsequent accesses.
    int
    FT_OpenEx(com.sun.jna.Pointer pvArg1, int dwFlags, com.sun.jna.ptr.PointerByReference ftHandle)
    Open the specified device and return a handle that will be used for subsequent accesses.
    int
    FT_Purge(com.sun.jna.Pointer ftHandle, int dwMask)
    This function purges receive and transmit buffers in the device.
    int
    FT_Read(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer lpBuffer, int dwBytesToRead, com.sun.jna.ptr.IntByReference lpdwBytesReturned)
    Read data from the device.
    int
    FT_ReadEE(com.sun.jna.Pointer ftHandle, int dwWordOffset, com.sun.jna.ptr.ShortByReference lpwValue)
    Read a value from an EEPROM location.
    int
    FT_Reload(short wVID, short wPID)
    This function forces a reload of the driver for devices with a specific VID and PID combination.
    int
    This function can be of use when trying to recover devices programatically.
    int
    FT_ResetDevice(com.sun.jna.Pointer ftHandle)
    This function sends a reset command to the device.
    int
    FT_ResetPort(com.sun.jna.Pointer ftHandle)
    Send a reset command to the port.
    int
    FT_RestartInTask(com.sun.jna.Pointer ftHandle)
    Restart the driver's IN task.
    int
    FT_SetBaudRate(com.sun.jna.Pointer ftHandle, int dwBaudRate)
    This function sets the baud rate for the device.
    int
    FT_SetBitMode(com.sun.jna.Pointer ftHandle, byte ucMask, byte ucMode)
    Enables different chip modes.
    int
    FT_SetBreakOff(com.sun.jna.Pointer ftHandle)
    Resets the BREAK condition for the device.
    int
    FT_SetBreakOn(com.sun.jna.Pointer ftHandle)
    Sets the BREAK condition for the device.
    int
    FT_SetChars(com.sun.jna.Pointer ftHandle, byte uEventCh, byte uEventChEn, byte uErrorCh, byte uErrorChEn)
    This function sets the special characters for the device.
    int
    FT_SetDataCharacteristics(com.sun.jna.Pointer ftHandle, byte uWordLength, byte uStopBits, byte uParity)
    This function sets the data characteristics for the device.
    int
    FT_SetDeadmanTimeout(com.sun.jna.Pointer ftHandle, int dwDeadmanTimeout)
    This function allows the maximum time in milliseconds that a USB request can remain outstanding to be set.
    int
    FT_SetDivisor(com.sun.jna.Pointer ftHandle, short usDivisor)
    This function sets the baud rate for the device.
    int
    FT_SetDtr(com.sun.jna.Pointer ftHandle)
    This function sets the Data Terminal Ready (DTR) control signal.
    int
    FT_SetEventNotification(com.sun.jna.Pointer ftHandle, int dwEventMask, com.sun.jna.Pointer pvArg)
    Sets conditions for event notification.
    int
    FT_SetFlowControl(com.sun.jna.Pointer ftHandle, short usFlowControl, byte uXon, byte uXoff)
    This function sets the flow control for the device.
    int
    FT_SetLatencyTimer(com.sun.jna.Pointer ftHandle, byte ucTimer)
    Set the latency timer value.
    int
    FT_SetResetPipeRetryCount(com.sun.jna.Pointer ftHandle, int dwCount)
    Set the ResetPipeRetryCount value.
    int
    FT_SetRts(com.sun.jna.Pointer ftHandle)
    This function sets the Request To Send (RTS) control signal.
    int
    FT_SetTimeouts(com.sun.jna.Pointer ftHandle, int dwReadTimeout, int dwWriteTimeout)
    This function sets the read and write timeouts for the device.
    int
    FT_SetUSBParameters(com.sun.jna.Pointer ftHandle, int dwInTransferSize, int dwOutTransferSize)
    Set the USB request transfer size.
    int
    FT_SetVIDPID(int dwVID, int dwPID)
    A command to include a custom VID and PID combination within the internal device list table.
    int
    FT_StopInTask(com.sun.jna.Pointer ftHandle)
    Stops the driver's IN task.
    int
    FT_Write(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer lpBuffer, int dwBytesToWrite, com.sun.jna.ptr.IntByReference lpdwBytesWritten)
    Write data to the device.
    int
    FT_WriteEE(com.sun.jna.Pointer ftHandle, int dwWordOffset, short wValue)
    Write a value to an EEPROM location.
  • Field Details

  • Method Details

    • FT_SetVIDPID

      int FT_SetVIDPID(int dwVID, int dwPID)
      A command to include a custom VID and PID combination within the internal device list table. This will allow the driver to load for the specified VID and PID combination.
      Parameters:
      dwVID - Device Vendor ID (VID)
      dwPID - Device Product ID (PID)
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetVIDPID

      int FT_GetVIDPID(com.sun.jna.ptr.IntByReference pdwVID, com.sun.jna.ptr.IntByReference pdwPID)
      A command to retrieve the current VID and PID combination from within the internal device list table.
      Parameters:
      pdwVID - Pointer to DWORD(int) that will contain the internal VID
      pdwPID - Pointer to DWORD(int) that will contain the internal PID
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_CreateDeviceInfoList

      int FT_CreateDeviceInfoList(com.sun.jna.ptr.IntByReference lpdwNumDevs)
      This function builds a device information list and returns the number of D2XX devices connected to the system. The list contains information about both unopen and open devices.
      Parameters:
      lpdwNumDevs - Pointer to unsigned long(long) to store the number of devices connected.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetDeviceInfoList

      int FT_GetDeviceInfoList(FTD2XX.FT_DEVICE_LIST_INFO_NODE[] pDest, com.sun.jna.ptr.IntByReference lpdwNumDevs)
      This function returns an entry from the device information list.
      Parameters:
      pDest - Pointer to an array of FT_DEVICE_LIST_INFO_NODE structures.
      lpdwNumDevs - Pointer to the number of elements in the array
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetDeviceInfoDetail

      int FT_GetDeviceInfoDetail(int dwIndex, com.sun.jna.ptr.IntByReference lpdwFlags, com.sun.jna.ptr.IntByReference lpdwType, com.sun.jna.ptr.IntByReference lpdwID, com.sun.jna.ptr.IntByReference lpdwLocId, com.sun.jna.Pointer pcSerialNumber, com.sun.jna.Pointer pcDescription, com.sun.jna.ptr.PointerByReference ftHandle)
      This function returns an entry from the device information list.
      Parameters:
      dwIndex - Index of the entry in the device info list.
      lpdwFlags - Pointer to unsigned long to store the flag value.
      lpdwType - Pointer to unsigned long to store device type.
      lpdwID - Pointer to unsigned long to store device ID.
      lpdwLocId - Pointer to unsigned long to store the device location ID.
      pcSerialNumber - Pointer to buffer to store device serial number as a nullterminated string.
      pcDescription - Pointer to buffer to store device description as a null-terminated string.
      ftHandle - Pointer to a variable of type FT_HANDLE where the handle will be stored.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_ListDevices

      int FT_ListDevices(com.sun.jna.Pointer pvArg1, com.sun.jna.Pointer pvArg2, int dwFlags)
      Gets information concerning the devices currently connected. This function can return information such as the number of devices connected, the device serial number and device description strings, and the location IDs of connected devices.
      Parameters:
      pvArg1 - Meaning depends on dwFlags
      pvArg2 - Meaning depends on dwFlags
      dwFlags - Determines format of returned information.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Open

      int FT_Open(int iDevice, com.sun.jna.ptr.PointerByReference ftHandle)
      Open the device and return a handle which will be used for subsequent accesses.
      Parameters:
      iDevice - Index of the device to open. Indices are 0 based.
      ftHandle - Pointer to a variable of type FT_HANDLE where the handle will be stored. This handle must be used to access the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_OpenEx

      int FT_OpenEx(com.sun.jna.Pointer pvArg1, int dwFlags, com.sun.jna.ptr.PointerByReference ftHandle)
      Open the specified device and return a handle that will be used for subsequent accesses. The device can be specified by its serial number, device description or location. This function can also be used to open multiple devices simultaneously. Multiple devices can be specified by serial number, device description or location ID (location information derived from the physical location of a device on USB). Location IDs for specific USB ports can be obtained using the utility USBView and are given in hexadecimal format. Location IDs for devices connected to a system can be obtained by calling FT_GetDeviceInfoList or FT_ListDevices with the appropriate flags.
      Parameters:
      pvArg1 - Pointer to an argument whose type depends on the value of dwFlags. It is normally be interpreted as a pointer to a null terminated string.
      dwFlags - FT_OPEN_BY_SERIAL_NUMBER, FT_OPEN_BY_DESCRIPTION or FT_OPEN_BY_LOCATION.
      ftHandle - Pointer to a variable of type FT_HANDLE where the handle will be stored. This handle must be used to access the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Close

      int FT_Close(com.sun.jna.Pointer ftHandle)
      Close an open device.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Read

      int FT_Read(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer lpBuffer, int dwBytesToRead, com.sun.jna.ptr.IntByReference lpdwBytesReturned)
      Read data from the device.
      Parameters:
      ftHandle - Handle of the device.
      lpBuffer - Pointer to the buffer that receives the data from the device.
      dwBytesToRead - Number of bytes to be read from the device.
      lpdwBytesReturned - Pointer to a variable of type DWORD which receives the number of bytes read from the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Write

      int FT_Write(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer lpBuffer, int dwBytesToWrite, com.sun.jna.ptr.IntByReference lpdwBytesWritten)
      Write data to the device.
      Parameters:
      ftHandle - Handle of the device.
      lpBuffer - Pointer to the buffer that contains the data to be written to the device.
      dwBytesToWrite - Number of bytes to write to the device.
      lpdwBytesWritten - Pointer to a variable of type DWORD which receives the number of bytes written to the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetBaudRate

      int FT_SetBaudRate(com.sun.jna.Pointer ftHandle, int dwBaudRate)
      This function sets the baud rate for the device.
      Parameters:
      ftHandle - Handle of the device.
      dwBaudRate - Baud rate.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetDivisor

      int FT_SetDivisor(com.sun.jna.Pointer ftHandle, short usDivisor)
      This function sets the baud rate for the device. It is used to set non-standard baud rates. This function is no longer required as FT_SetBaudRate will now automatically calculate the required divisor for a requested baud rate.
      Parameters:
      ftHandle - Handle of the device.
      usDivisor - Divisor.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetDataCharacteristics

      int FT_SetDataCharacteristics(com.sun.jna.Pointer ftHandle, byte uWordLength, byte uStopBits, byte uParity)
      This function sets the data characteristics for the device.
      Parameters:
      ftHandle - Handle of the device.
      uWordLength - Number of bits per word - must be FT_BITS_8 or FT_BITS_7.
      uStopBits - Number of stop bits - must be FT_STOP_BITS_1 or FT_STOP_BITS_2.
      uParity - Parity - must be FT_PARITY_NONE, FT_PARITY_ODD, FT_PARITY_EVEN, FT_PARITY_MARK or FT_PARITY SPACE.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetTimeouts

      int FT_SetTimeouts(com.sun.jna.Pointer ftHandle, int dwReadTimeout, int dwWriteTimeout)
      This function sets the read and write timeouts for the device.
      Parameters:
      ftHandle - Handle of the device.
      dwReadTimeout - Read timeout in milliseconds.
      dwWriteTimeout - Write timeout in milliseconds.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetFlowControl

      int FT_SetFlowControl(com.sun.jna.Pointer ftHandle, short usFlowControl, byte uXon, byte uXoff)
      This function sets the flow control for the device.
      Parameters:
      ftHandle - Handle of the device.
      usFlowControl - Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, FT_FLOW_DTR_DSR or FT_FLOW_XON_XOFF.
      uXon - Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF.
      uXoff - Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetDtr

      int FT_SetDtr(com.sun.jna.Pointer ftHandle)
      This function sets the Data Terminal Ready (DTR) control signal.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_ClrDtr

      int FT_ClrDtr(com.sun.jna.Pointer ftHandle)
      This function clears the Data Terminal Ready (DTR) control signal.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetRts

      int FT_SetRts(com.sun.jna.Pointer ftHandle)
      This function sets the Request To Send (RTS) control signal.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_ClrRts

      int FT_ClrRts(com.sun.jna.Pointer ftHandle)
      This function clears the Request To Send (RTS) control signal.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetModemStatus

      int FT_GetModemStatus(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwModemStatus)
      Gets the modem status and line status from the device.
      Parameters:
      ftHandle - Handle of the device.
      lpdwModemStatus - Pointer to a variable of type DWORD which receives the modem status and line status from the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetQueueStatus

      int FT_GetQueueStatus(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwAmountInRxQueue)
      Gets the number of bytes in the receive queue.
      Parameters:
      ftHandle - Handle of the device.
      lpdwAmountInRxQueue - Pointer to a variable of type DWORD which receives the number of bytes in the receive queue.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetDeviceInfo

      int FT_GetDeviceInfo(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference pftType, com.sun.jna.ptr.IntByReference lpdwID, com.sun.jna.Pointer pcSerialNumber, com.sun.jna.Pointer pcDescription, com.sun.jna.Pointer pvDummy)
      Get device information for an open device.
      Parameters:
      ftHandle - Handle of the device.
      pftType - Pointer to unsigned long to store device type.
      lpdwID - Pointer to unsigned long to store device ID.
      pcSerialNumber - Pointer to buffer to store device serial number as a null-terminated string.
      pcDescription - Pointer to buffer to store device description as a null-terminated string.
      pvDummy - Reserved for future use - should be set to NULL.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetDriverVersion

      int FT_GetDriverVersion(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwDriverVersion)
      This function returns the D2XX driver version number.
      Parameters:
      ftHandle - Handle of the device.
      lpdwDriverVersion - Pointer to the driver version number.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetLibraryVersion

      int FT_GetLibraryVersion(com.sun.jna.ptr.IntByReference lpdwDLLVersion)
      This function returns D2XX DLL version number.
      Parameters:
      lpdwDLLVersion - Pointer to the DLL version number.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetComPortNumber

      int FT_GetComPortNumber(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lplComPortNumber)
      Retrieves the COM port associated with a device.
      Parameters:
      ftHandle - Handle of the device.
      lplComPortNumber - Pointer to a variable of type LONG which receives the COM port number associated with the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetStatus

      int FT_GetStatus(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwAmountInRxQueue, com.sun.jna.ptr.IntByReference lpdwAmountInTxQueue, com.sun.jna.ptr.IntByReference lpdwEventStatus)
      Gets the device status including number of characters in the receive queue, number of characters in the transmit queue, and the current event status.
      Parameters:
      ftHandle - Handle of the device.
      lpdwAmountInRxQueue - Pointer to a variable of type DWORD which receives the number of characters in the receive queue.
      lpdwAmountInTxQueue - Pointer to a variable of type DWORD which receives the number of characters in the transmit queue.
      lpdwEventStatus - Pointer to a variable of type DWORD which receives the current state of the event status.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetEventNotification

      int FT_SetEventNotification(com.sun.jna.Pointer ftHandle, int dwEventMask, com.sun.jna.Pointer pvArg)
      Sets conditions for event notification.
      Parameters:
      ftHandle - Handle of the device.
      dwEventMask - Conditions that cause the event to be set.
      pvArg - Interpreted as the handle of an event.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetChars

      int FT_SetChars(com.sun.jna.Pointer ftHandle, byte uEventCh, byte uEventChEn, byte uErrorCh, byte uErrorChEn)
      This function sets the special characters for the device.
      Parameters:
      ftHandle - Handle of the device.
      uEventCh - Event character.
      uEventChEn - 0 if event character disabled, non-zero otherwise.
      uErrorCh - Error character.
      uErrorChEn - 0 if error character disabled, non-zero otherwise.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetBreakOn

      int FT_SetBreakOn(com.sun.jna.Pointer ftHandle)
      Sets the BREAK condition for the device.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetBreakOff

      int FT_SetBreakOff(com.sun.jna.Pointer ftHandle)
      Resets the BREAK condition for the device.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Purge

      int FT_Purge(com.sun.jna.Pointer ftHandle, int dwMask)
      This function purges receive and transmit buffers in the device.
      Parameters:
      ftHandle - Handle of the device.
      dwMask - Combination of FT_PURGE_RX and FT_PURGE_TX.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_ResetDevice

      int FT_ResetDevice(com.sun.jna.Pointer ftHandle)
      This function sends a reset command to the device.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_ResetPort

      int FT_ResetPort(com.sun.jna.Pointer ftHandle)
      Send a reset command to the port.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_CyclePort

      int FT_CyclePort(com.sun.jna.Pointer ftHandle)
      Send a cycle command to the USB port.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Rescan

      int FT_Rescan()
      This function can be of use when trying to recover devices programatically.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_Reload

      int FT_Reload(short wVID, short wPID)
      This function forces a reload of the driver for devices with a specific VID and PID combination.
      Parameters:
      wVID - Vendor ID of the devices to reload the driver for.
      wPID - Product ID of the devices to reload the driver for.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetResetPipeRetryCount

      int FT_SetResetPipeRetryCount(com.sun.jna.Pointer ftHandle, int dwCount)
      Set the ResetPipeRetryCount value.
      Parameters:
      ftHandle - Handle of the device.
      dwCount - Unsigned long containing required ResetPipeRetryCount.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_StopInTask

      int FT_StopInTask(com.sun.jna.Pointer ftHandle)
      Stops the driver's IN task.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_RestartInTask

      int FT_RestartInTask(com.sun.jna.Pointer ftHandle)
      Restart the driver's IN task.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetDeadmanTimeout

      int FT_SetDeadmanTimeout(com.sun.jna.Pointer ftHandle, int dwDeadmanTimeout)
      This function allows the maximum time in milliseconds that a USB request can remain outstanding to be set.
      Parameters:
      ftHandle - Handle of the device.
      dwDeadmanTimeout - Deadman timeout value in milliseconds. Default value is 5000.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_ReadEE

      int FT_ReadEE(com.sun.jna.Pointer ftHandle, int dwWordOffset, com.sun.jna.ptr.ShortByReference lpwValue)
      Read a value from an EEPROM location.
      Parameters:
      ftHandle - Handle of the device.
      dwWordOffset - EEPROM location to read from.
      lpwValue - Pointer to the WORD value read from the EEPROM.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_WriteEE

      int FT_WriteEE(com.sun.jna.Pointer ftHandle, int dwWordOffset, short wValue)
      Write a value to an EEPROM location.
      Parameters:
      ftHandle - Handle of the device.
      dwWordOffset - EEPROM location to read from.
      wValue - The WORD value write to the EEPROM.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EraseEE

      int FT_EraseEE(com.sun.jna.Pointer ftHandle)
      Erases the device EEPROM.
      Parameters:
      ftHandle - Handle of the device.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_Read

      int FT_EE_Read(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData)
      Read the contents of the EEPROM.
      Parameters:
      ftHandle - Handle of the device.
      pData - Pointer to structure of type FT_PROGRAM_DATA.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_ReadEx

      int FT_EE_ReadEx(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData, String Manufacturer, String ManufacturerId, String Description, String SerialNumber)
      Read the contents of the EEPROM and pass strings separately.
      Parameters:
      ftHandle - Handle of the device.
      pData - Pointer to structure of type FT_PROGRAM_DATA.
      Manufacturer - Pointer to a null-terminated string containing the manufacturer name.
      ManufacturerId - Pointer to a null-terminated string containing the manufacturer ID.
      Description - Pointer to a null-terminated string containing the device description.
      SerialNumber - Pointer to a null-terminated string containing the device serial number.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EEPROM_Read

      int FT_EEPROM_Read(com.sun.jna.Pointer ftHandle, com.sun.jna.Structure eepromData, int eepromDataSize, com.sun.jna.Pointer Manufacturer, com.sun.jna.Pointer ManufacturerId, com.sun.jna.Pointer Description, com.sun.jna.Pointer SerialNumber)
      Read the contents of the EEPROM and pass strings separately.
      Parameters:
      ftHandle - Handle of the device.
      eepromData - Pointer to a buffer that contains the data to be read.
      eepromDataSize - Size of the eepromData buffer that contains storage for the data to be read.
      Manufacturer - Pointer to a null-terminated string containing the manufacturer name.
      ManufacturerId - Pointer to a null-terminated string containing the manufacturer ID.
      Description - Pointer to a null-terminated string containing the device description.
      SerialNumber - Pointer to a null-terminated string containing the device serial number.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EEPROM_Program

      int FT_EEPROM_Program(com.sun.jna.Pointer ftHandle, com.sun.jna.Structure eepromData, int eepromDataSize, com.sun.jna.Pointer Manufacturer, com.sun.jna.Pointer ManufacturerId, com.sun.jna.Pointer Description, com.sun.jna.Pointer SerialNumber)
      Write the contents of the EEPROM and pass strings separately.
      Parameters:
      ftHandle - Handle of the device.
      eepromData - Pointer to a buffer that contains the data to be read.
      eepromDataSize - Size of the eepromData buffer that contains storage for the data to be read.
      Manufacturer - Pointer to a null-terminated string containing the manufacturer name.
      ManufacturerId - Pointer to a null-terminated string containing the manufacturer ID.
      Description - Pointer to a null-terminated string containing the device description.
      SerialNumber - Pointer to a null-terminated string containing the device serial number.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_Program

      int FT_EE_Program(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData)
      Program the EEPROM.
      Parameters:
      ftHandle - Handle of the device.
      pData - Pointer to structure of type FT_PROGRAM_DATA.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_ProgramEx

      int FT_EE_ProgramEx(com.sun.jna.Pointer ftHandle, FTD2XX.FT_PROGRAM_DATA.ByReference pData, String Manufacturer, String ManufacturerId, String Description, String SerialNumber)
      Program the EEPROM and pass strings separately.
      Parameters:
      ftHandle - Handle of the device.
      pData - Pointer to structure of type FT_PROGRAM_DATA.
      Manufacturer - Pointer to a null-terminated string containing the manufacturer name.
      ManufacturerId - Pointer to a null-terminated string containing the manufacturer ID.
      Description - Pointer to a null-terminated string containing the device description.
      SerialNumber - Pointer to a null-terminated string containing the device serial number.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_UASize

      int FT_EE_UASize(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.IntByReference lpdwSize)
      Get the available size of the EEPROM user area.
      Parameters:
      ftHandle - Handle of the device.
      lpdwSize - Pointer to a DWORD that receives the available size, in bytes, of the EEPROM user area.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_UARead

      int FT_EE_UARead(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer pucData, int dwDataLen, com.sun.jna.ptr.IntByReference lpdwBytesRead)
      Read the contents of the EEPROM user area.
      Parameters:
      ftHandle - Handle of the device.
      pucData - Pointer to a buffer that contains storage for data to be read.
      dwDataLen - Size, in bytes, of buffer that contains storage for the data to be read.
      lpdwBytesRead - Pointer to a DWORD that receives the number of bytes read.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_EE_UAWrite

      int FT_EE_UAWrite(com.sun.jna.Pointer ftHandle, com.sun.jna.Pointer pucData, int dwDataLen)
      Write data into the EEPROM user area.
      Parameters:
      ftHandle - Handle of the device.
      pucData - Pointer to a buffer that contains the data to be written.
      dwDataLen - Size, in bytes, of buffer that contains storage for the data to be read.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetLatencyTimer

      int FT_SetLatencyTimer(com.sun.jna.Pointer ftHandle, byte ucTimer)
      Set the latency timer value.
      Parameters:
      ftHandle - Handle of the device.
      ucTimer - Required value, in milliseconds, of latency timer. Valid range is 2 – 255.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetLatencyTimer

      int FT_GetLatencyTimer(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.ByteByReference pucTimer)
      Get the current value of the latency timer.
      Parameters:
      ftHandle - Handle of the device.
      pucTimer - Pointer to unsigned char to store latency timer value.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetBitMode

      int FT_SetBitMode(com.sun.jna.Pointer ftHandle, byte ucMask, byte ucMode)
      Enables different chip modes.
      Parameters:
      ftHandle - Handle of the device.
      ucMask - Required value for bit mode mask. This sets up which bits are inputs and outputs. A bit value of 0 sets the corresponding pin to an input, a bit value of 1 sets the corresponding pin to an output. In the case of CBUS Bit Bang, the upper nibble of this value controls which pins are inputs and outputs, while the lower nibble controls which of the outputs are high and low.
      ucMode - Mode value. Can be one of the following: 0x0 = Reset 0x1 = Asynchronous Bit Bang 0x2 = MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) 0x4 = Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) 0x8 = MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) 0x10 = Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) 0x20 = CBUS Bit Bang Mode (FT232R and FT232H devices only) 0x40 = Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only)
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_GetBitMode

      int FT_GetBitMode(com.sun.jna.Pointer ftHandle, com.sun.jna.ptr.ByteByReference pucMode)
      Gets the instantaneous value of the data bus.
      Parameters:
      ftHandle - Handle of the device.
      pucMode - Pointer to unsigned char to store the instantaneous data bus value.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.
    • FT_SetUSBParameters

      int FT_SetUSBParameters(com.sun.jna.Pointer ftHandle, int dwInTransferSize, int dwOutTransferSize)
      Set the USB request transfer size.
      Parameters:
      ftHandle - Handle of the device.
      dwInTransferSize - Transfer size for USB IN request.
      dwOutTransferSize - Transfer size for USB OUT request.
      Returns:
      FT_STATUS: FT_OK if successful, otherwise the return value is an FT error code.