Skip to content

FTDI ​

Class wrapper for FTD2XX.DLL

Kind: Class

Namespace: FTD2XX_NET

Public Constructors

FTDI()

Constructor for the FTDI class.

FTDI(string path)

Constructor for the FTDI class.

Public Member Functions

FT_STATUS

GetNumberOfDevices(uint ref devcount)

Gets the number of FTDI devices available.

FT_STATUS

GetDeviceList(FT_DEVICE_INFO_NODE[] devicelist)

Gets information on all of the FTDI devices available.

FT_STATUS

OpenByIndex(uint index)

Opens the FTDI device with the specified index.

FT_STATUS

OpenBySerialNumber(string serialnumber)

Opens the FTDI device with the specified serial number.

FT_STATUS

OpenByDescription(string description)

Opens the FTDI device with the specified description.

FT_STATUS

OpenByLocation(uint location)

Opens the FTDI device at the specified physical location.

FT_STATUS

Close()

Closes the handle to an open FTDI device.

FT_STATUS

Read(byte[] dataBuffer, uint numBytesToRead, uint out numBytesRead)

Read data from an open FTDI device.

FT_STATUS

Read(string out dataBuffer, uint numBytesToRead, uint out numBytesRead)

Read data from an open FTDI device.

FT_STATUS

Write(byte[] dataBuffer, int numBytesToWrite, uint out numBytesWritten)

Write data to an open FTDI device.

FT_STATUS

Write(byte[] dataBuffer, uint numBytesToWrite, uint out numBytesWritten)

Write data to an open FTDI device.

FT_STATUS

Write(string dataBuffer, int numBytesToWrite, uint out numBytesWritten)

Write data to an open FTDI device.

FT_STATUS

Write(string dataBuffer, uint numBytesToWrite, uint out numBytesWritten)

Write data to an open FTDI device.

FT_STATUS

ResetDevice()

Reset an open FTDI device.

FT_STATUS

Purge(uint purgemask)

Purge data from the devices transmit and/or receive buffers.

FT_STATUS

SetEventNotification(uint eventmask, EventWaitHandle eventhandle)

Register for event notification.

FT_STATUS

StopInTask()

Stops the driver issuing USB in requests.

FT_STATUS

RestartInTask()

Resumes the driver issuing USB in requests.

FT_STATUS

ResetPort()

Resets the device port.

FT_STATUS

CyclePort()

Causes the device to be re-enumerated on the USB bus. This is equivalent to unplugging and replugging the device. Also calls FT_Close if FT_CyclePort is successful, so no need to call this separately in the application.

FT_STATUS

Rescan()

Causes the system to check for USB hardware changes. This is equivalent to clicking on the "Scan for hardware changes" button in the Device Manager.

FT_STATUS

Reload(ushort VendorID, ushort ProductID)

Forces a reload of the driver for devices with a specific VID and PID combination.

FT_STATUS

SetBitMode(byte Mask, byte BitMode)

Puts the device in a mode other than the default UART or FIFO mode.

FT_STATUS

GetPinStates(byte ref BitMode)

Gets the instantaneous state of the device IO pins.

FT_STATUS

ReadEEPROMLocation(uint Address, ushort ref EEValue)

Reads an individual word value from a specified location in the device's EEPROM.

FT_STATUS

WriteEEPROMLocation(uint Address, ushort EEValue)

Writes an individual word value to a specified location in the device's EEPROM.

FT_STATUS

EraseEEPROM()

Erases the device EEPROM.

FT_STATUS

ReadFT232BEEPROM(FT232B_EEPROM_STRUCTURE ee232b)

Reads the EEPROM contents of an FT232B or FT245B device.

FT_STATUS

ReadFT2232EEPROM(FT2232_EEPROM_STRUCTURE ee2232)

Reads the EEPROM contents of an FT2232 device.

FT_STATUS

ReadFT232REEPROM(FT232R_EEPROM_STRUCTURE ee232r)

Reads the EEPROM contents of an FT232R or FT245R device. Calls FT_EE_Read in FTD2XX DLL

FT_STATUS

ReadFT2232HEEPROM(FT2232H_EEPROM_STRUCTURE ee2232h)

Reads the EEPROM contents of an FT2232H device.

FT_STATUS

ReadFT4232HEEPROM(FT4232H_EEPROM_STRUCTURE ee4232h)

Reads the EEPROM contents of an FT4232H device.

FT_STATUS

ReadFT232HEEPROM(FT232H_EEPROM_STRUCTURE ee232h)

Reads the EEPROM contents of an FT232H device.

FT_STATUS

ReadXSeriesEEPROM(FT_XSERIES_EEPROM_STRUCTURE eeX)

Reads the EEPROM contents of an X-Series device.

FT_STATUS

WriteFT232BEEPROM(FT232B_EEPROM_STRUCTURE ee232b)

Writes the specified values to the EEPROM of an FT232B or FT245B device.

FT_STATUS

WriteFT2232EEPROM(FT2232_EEPROM_STRUCTURE ee2232)

Writes the specified values to the EEPROM of an FT2232 device. Calls FT_EE_Program in FTD2XX DLL

FT_STATUS

WriteFT232REEPROM(FT232R_EEPROM_STRUCTURE ee232r)

Writes the specified values to the EEPROM of an FT232R or FT245R device. Calls FT_EE_Program in FTD2XX DLL

FT_STATUS

WriteFT2232HEEPROM(FT2232H_EEPROM_STRUCTURE ee2232h)

Writes the specified values to the EEPROM of an FT2232H device. Calls FT_EE_Program in FTD2XX DLL

FT_STATUS

WriteFT4232HEEPROM(FT4232H_EEPROM_STRUCTURE ee4232h)

Writes the specified values to the EEPROM of an FT4232H device. Calls FT_EE_Program in FTD2XX DLL

FT_STATUS

WriteFT232HEEPROM(FT232H_EEPROM_STRUCTURE ee232h)

Writes the specified values to the EEPROM of an FT232H device. Calls FT_EE_Program in FTD2XX DLL

FT_STATUS

WriteXSeriesEEPROM(FT_XSERIES_EEPROM_STRUCTURE eeX)

Writes the specified values to the EEPROM of an X-Series device. Calls FT_EEPROM_Program in FTD2XX DLL

FT_STATUS

EEReadUserArea(byte[] UserAreaDataBuffer, uint out numBytesRead)

Reads data from the user area of the device EEPROM.

FT_STATUS

EEWriteUserArea(byte[] UserAreaDataBuffer)

Writes data to the user area of the device EEPROM.

FT_STATUS

GetDeviceType(FT_DEVICE ref DeviceType)

Gets the chip type of the current device.

FT_STATUS

GetDeviceID(uint ref DeviceID)

Gets the Vendor ID and Product ID of the current device.

FT_STATUS

GetDescription(string out Description)

Gets the description of the current device.

FT_STATUS

GetSerialNumber(string out SerialNumber)

Gets the serial number of the current device.

FT_STATUS

GetRxBytesAvailable(uint ref RxQueue)

Gets the number of bytes available in the receive buffer.

FT_STATUS

GetTxBytesWaiting(uint ref TxQueue)

Gets the number of bytes waiting in the transmit buffer.

FT_STATUS

GetEventType(uint ref EventType)

Gets the event type after an event has fired. Can be used to distinguish which event has been called when waiting on multiple event types.

FT_STATUS

GetModemStatus(byte ref ModemStatus)

Gets the current modem status.

FT_STATUS

GetLineStatus(byte ref LineStatus)

Gets the current line status.

FT_STATUS

SetBaudRate(uint BaudRate)

Sets the current Baud rate.

FT_STATUS

SetDataCharacteristics(byte DataBits, byte StopBits, byte Parity)

Sets the data bits, stop bits and parity for the device.

FT_STATUS

SetFlowControl(ushort FlowControl, byte Xon, byte Xoff)

Sets the flow control type.

FT_STATUS

SetRTS(bool Enable)

Asserts or de-asserts the Request To Send (RTS) line.

FT_STATUS

SetDTR(bool Enable)

Asserts or de-asserts the Data Terminal Ready (DTR) line.

FT_STATUS

SetTimeouts(uint ReadTimeout, uint WriteTimeout)

Sets the read and write timeout values.

FT_STATUS

SetBreak(bool Enable)

Sets or clears the break state.

FT_STATUS

SetResetPipeRetryCount(uint ResetPipeRetryCount)

Gets or sets the reset pipe retry count. Default value is 50.

FT_STATUS

GetDriverVersion(uint ref DriverVersion)

Gets the current FTDIBUS.SYS driver version number.

FT_STATUS

GetLibraryVersion(uint ref LibraryVersion)

Gets the current FTD2XX.DLL driver version number.

FT_STATUS

SetDeadmanTimeout(uint DeadmanTimeout)

Sets the USB deadman timeout value. Default is 5000ms.

FT_STATUS

SetLatency(byte Latency)

Sets the value of the latency timer. Default value is 16ms.

FT_STATUS

GetLatency(byte ref Latency)

Gets the value of the latency timer. Default value is 16ms.

FT_STATUS

InTransferSize(uint InTransferSize)

Sets the USB IN and OUT transfer sizes.

FT_STATUS

SetCharacters(byte EventChar, bool EventCharEnable, byte ErrorChar, bool ErrorCharEnable)

Sets an event character, an error character and enables or disables them.

FT_STATUS

EEUserAreaSize(uint ref UASize)

Gets the size of the EEPROM user area.

FT_STATUS

GetCOMPort(string out ComPortName)

Gets the corresponding COM port number for the current device. If no COM port is exposed, an empty string is returned.

FT_STATUS

VendorCmdGet(ushort request, byte[] buf, ushort len)

Get data from the FT4222 using the vendor command interface.

FT_STATUS

VendorCmdSet(ushort request, byte[] buf, ushort len)

Set data from the FT4222 using the vendor command interface.

Properties

bool

IsOpen

[get, ]

Gets the open status of the device.