C# Class FTD2XX_NET.FTDI

Class wrapper for FTD2XX.DLL
Exibir arquivo Open project: GNOME/chronojump Class Usage Examples

Private Properties

Property Type Description
ErrorHandler void
FreeLibrary bool
GetProcAddress System.IntPtr
LoadLibrary System.IntPtr

Public Methods

Method Description
Close ( ) : FT_STATUS

Closes the handle to an open FTDI device.

CyclePort ( ) : FT_STATUS

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.

EEReadUserArea ( byte UserAreaDataBuffer, UInt32 &numBytesRead ) : FT_STATUS

Reads data from the user area of the device EEPROM.

EEUserAreaSize ( UInt32 &UASize ) : FT_STATUS

Gets the size of the EEPROM user area.

EEWriteUserArea ( byte UserAreaDataBuffer ) : FT_STATUS

Writes data to the user area of the device EEPROM.

EraseEEPROM ( ) : FT_STATUS

Erases the device EEPROM.

FTDI ( ) : System

Constructor for the FTDI class.

GetCOMPort ( string &ComPortName ) : FT_STATUS

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

GetDescription ( string &Description ) : FT_STATUS

Gets the description of the current device.

GetDeviceID ( UInt32 &DeviceID ) : FT_STATUS

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

GetDeviceList ( FT_DEVICE_INFO_NODE devicelist ) : FT_STATUS

Gets information on all of the FTDI devices available.

GetDeviceType ( FT_DEVICE &DeviceType ) : FT_STATUS

Gets the chip type of the current device.

GetDriverVersion ( UInt32 &DriverVersion ) : FT_STATUS

Gets the current FTDIBUS.SYS driver version number.

GetEventType ( UInt32 &EventType ) : FT_STATUS

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

GetLatency ( byte &Latency ) : FT_STATUS

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

GetLibraryVersion ( UInt32 &LibraryVersion ) : FT_STATUS

Gets the current FTD2XX.DLL driver version number.

GetLineStatus ( byte &LineStatus ) : FT_STATUS

Gets the current line status.

GetModemStatus ( byte &ModemStatus ) : FT_STATUS

Gets the current modem status.

GetNumberOfDevices ( UInt32 &devcount ) : FT_STATUS

Gets the number of FTDI devices available.

GetPinStates ( byte &BitMode ) : FT_STATUS

Gets the instantaneous state of the device IO pins.

GetRxBytesAvailable ( UInt32 &RxQueue ) : FT_STATUS

Gets the number of bytes available in the receive buffer.

GetSerialNumber ( string &SerialNumber ) : FT_STATUS

Gets the serial number of the current device.

GetTxBytesWaiting ( UInt32 &TxQueue ) : FT_STATUS

Gets the number of bytes waiting in the transmit buffer.

InTransferSize ( UInt32 InTransferSize ) : FT_STATUS

Sets the USB IN and OUT transfer sizes.

OpenByDescription ( string description ) : FT_STATUS

Opens the FTDI device with the specified description.

Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.

OpenByIndex ( UInt32 index ) : FT_STATUS

Opens the FTDI device with the specified index.

Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.

OpenByLocation ( UInt32 location ) : FT_STATUS

Opens the FTDI device at the specified physical location.

Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.

OpenBySerialNumber ( string serialnumber ) : FT_STATUS

Opens the FTDI device with the specified serial number.

Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.

Purge ( UInt32 purgemask ) : FT_STATUS

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

Read ( byte dataBuffer, UInt32 numBytesToRead, UInt32 &numBytesRead ) : FT_STATUS

Read data from an open FTDI device.

Read ( string &dataBuffer, UInt32 numBytesToRead, UInt32 &numBytesRead ) : FT_STATUS

Read data from an open FTDI device.

ReadEEPROMLocation ( UInt32 Address, UInt16 &EEValue ) : FT_STATUS

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

ReadFT2232EEPROM ( FT2232_EEPROM_STRUCTURE ee2232 ) : FT_STATUS

Reads the EEPROM contents of an FT2232 device.

ReadFT2232HEEPROM ( FT2232H_EEPROM_STRUCTURE ee2232h ) : FT_STATUS

Reads the EEPROM contents of an FT2232H device.

ReadFT232BEEPROM ( FT232B_EEPROM_STRUCTURE ee232b ) : FT_STATUS

Reads the EEPROM contents of an FT232B or FT245B device.

ReadFT232HEEPROM ( FT232H_EEPROM_STRUCTURE ee232h ) : FT_STATUS

Reads the EEPROM contents of an FT232H device.

ReadFT232REEPROM ( FT232R_EEPROM_STRUCTURE ee232r ) : FT_STATUS

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

ReadFT4232HEEPROM ( FT4232H_EEPROM_STRUCTURE ee4232h ) : FT_STATUS

Reads the EEPROM contents of an FT4232H device.

ReadXSeriesEEPROM ( FT_XSERIES_EEPROM_STRUCTURE eeX ) : FT_STATUS

Reads the EEPROM contents of an X-Series device.

Reload ( UInt16 VendorID, UInt16 ProductID ) : FT_STATUS

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

If the VID and PID parameters are 0, the drivers for USB root hubs will be reloaded, causing all USB devices connected to reload their drivers

Rescan ( ) : FT_STATUS

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.

ResetDevice ( ) : FT_STATUS

Reset an open FTDI device.

ResetPort ( ) : FT_STATUS

Resets the device port.

RestartInTask ( ) : FT_STATUS

Resumes the driver issuing USB in requests.

SetBaudRate ( UInt32 BaudRate ) : FT_STATUS

Sets the current Baud rate.

SetBitMode ( byte Mask, byte BitMode ) : FT_STATUS

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

SetBreak ( bool Enable ) : FT_STATUS

Sets or clears the break state.

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

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

SetDTR ( bool Enable ) : FT_STATUS

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

SetDataCharacteristics ( byte DataBits, byte StopBits, byte Parity ) : FT_STATUS

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

SetDeadmanTimeout ( UInt32 DeadmanTimeout ) : FT_STATUS

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

SetEventNotification ( UInt32 eventmask, EventWaitHandle eventhandle ) : FT_STATUS

Register for event notification.

After setting event notification, the event can be caught by executing the WaitOne() method of the EventWaitHandle. If multiple event types are being monitored, the event that fired can be determined from the GetEventType method.

SetFlowControl ( UInt16 FlowControl, byte Xon, byte Xoff ) : FT_STATUS

Sets the flow control type.

SetLatency ( byte Latency ) : FT_STATUS

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

SetRTS ( bool Enable ) : FT_STATUS

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

SetResetPipeRetryCount ( UInt32 ResetPipeRetryCount ) : FT_STATUS

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

SetTimeouts ( UInt32 ReadTimeout, UInt32 WriteTimeout ) : FT_STATUS

Sets the read and write timeout values.

StopInTask ( ) : FT_STATUS

Stops the driver issuing USB in requests.

Write ( byte dataBuffer, Int32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS

Write data to an open FTDI device.

Write ( byte dataBuffer, UInt32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS

Write data to an open FTDI device.

Write ( string dataBuffer, Int32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS

Write data to an open FTDI device.

Write ( string dataBuffer, UInt32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS

Write data to an open FTDI device.

WriteEEPROMLocation ( UInt32 Address, UInt16 EEValue ) : FT_STATUS

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

WriteFT2232EEPROM ( FT2232_EEPROM_STRUCTURE ee2232 ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

WriteFT2232HEEPROM ( FT2232H_EEPROM_STRUCTURE ee2232h ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

WriteFT232BEEPROM ( FT232B_EEPROM_STRUCTURE ee232b ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

WriteFT232HEEPROM ( FT232H_EEPROM_STRUCTURE ee232h ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

WriteFT232REEPROM ( FT232R_EEPROM_STRUCTURE ee232r ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

WriteFT4232HEEPROM ( FT4232H_EEPROM_STRUCTURE ee4232h ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

WriteXSeriesEEPROM ( FT_XSERIES_EEPROM_STRUCTURE eeX ) : FT_STATUS

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

If the strings are too long, they will be truncated to their maximum permitted lengths

Private Methods

Method Description
ErrorHandler ( FT_STATUS ftStatus, FT_ERROR ftErrorCondition ) : void

Method to check ftStatus and ftErrorCondition values for error conditions and throw exceptions accordingly.

FreeLibrary ( IntPtr hModule ) : bool
GetProcAddress ( IntPtr hModule, string procedureName ) : IntPtr
LoadLibrary ( string dllToLoad ) : IntPtr

Method Details

Close() public method

Closes the handle to an open FTDI device.
public Close ( ) : FT_STATUS
return FT_STATUS

CyclePort() public method

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.
public CyclePort ( ) : FT_STATUS
return FT_STATUS

EEReadUserArea() public method

Reads data from the user area of the device EEPROM.
public EEReadUserArea ( byte UserAreaDataBuffer, UInt32 &numBytesRead ) : FT_STATUS
UserAreaDataBuffer byte An array of bytes which will be populated with the data read from the device EEPROM user area.
numBytesRead System.UInt32 The number of bytes actually read from the EEPROM user area.
return FT_STATUS

EEUserAreaSize() public method

Gets the size of the EEPROM user area.
public EEUserAreaSize ( UInt32 &UASize ) : FT_STATUS
UASize System.UInt32 The EEPROM user area size in bytes.
return FT_STATUS

EEWriteUserArea() public method

Writes data to the user area of the device EEPROM.
public EEWriteUserArea ( byte UserAreaDataBuffer ) : FT_STATUS
UserAreaDataBuffer byte An array of bytes which will be written to the device EEPROM user area.
return FT_STATUS

EraseEEPROM() public method

Erases the device EEPROM.
Thrown when attempting to erase the EEPROM of a device with an internal EEPROM such as an FT232R or FT245R.
public EraseEEPROM ( ) : FT_STATUS
return FT_STATUS

FTDI() public method

Constructor for the FTDI class.
public FTDI ( ) : System
return System

GetCOMPort() public method

Gets the corresponding COM port number for the current device. If no COM port is exposed, an empty string is returned.
public GetCOMPort ( string &ComPortName ) : FT_STATUS
ComPortName string The COM port name corresponding to the current device. If no COM port is installed, an empty string is passed back.
return FT_STATUS

GetDescription() public method

Gets the description of the current device.
public GetDescription ( string &Description ) : FT_STATUS
Description string The description of the current device.
return FT_STATUS

GetDeviceID() public method

Gets the Vendor ID and Product ID of the current device.
public GetDeviceID ( UInt32 &DeviceID ) : FT_STATUS
DeviceID System.UInt32 The device ID (Vendor ID and Product ID) of the current device.
return FT_STATUS

GetDeviceList() public method

Gets information on all of the FTDI devices available.
Thrown when the supplied buffer is not large enough to contain the device info list.
public GetDeviceList ( FT_DEVICE_INFO_NODE devicelist ) : FT_STATUS
devicelist FT_DEVICE_INFO_NODE An array of type FT_DEVICE_INFO_NODE to contain the device information for all available devices.
return FT_STATUS

GetDeviceType() public method

Gets the chip type of the current device.
public GetDeviceType ( FT_DEVICE &DeviceType ) : FT_STATUS
DeviceType FT_DEVICE The FTDI chip type of the current device.
return FT_STATUS

GetDriverVersion() public method

Gets the current FTDIBUS.SYS driver version number.
public GetDriverVersion ( UInt32 &DriverVersion ) : FT_STATUS
DriverVersion System.UInt32 The current driver version number.
return FT_STATUS

GetEventType() public method

Gets the event type after an event has fired. Can be used to distinguish which event has been triggered when waiting on multiple event types.
public GetEventType ( UInt32 &EventType ) : FT_STATUS
EventType System.UInt32 The type of event that has occurred.
return FT_STATUS

GetLatency() public method

Gets the value of the latency timer. Default value is 16ms.
public GetLatency ( byte &Latency ) : FT_STATUS
Latency byte The latency timer value in ms.
return FT_STATUS

GetLibraryVersion() public method

Gets the current FTD2XX.DLL driver version number.
public GetLibraryVersion ( UInt32 &LibraryVersion ) : FT_STATUS
LibraryVersion System.UInt32 The current library version.
return FT_STATUS

GetLineStatus() public method

Gets the current line status.
public GetLineStatus ( byte &LineStatus ) : FT_STATUS
LineStatus byte A bit map representaion of the current line status.
return FT_STATUS

GetModemStatus() public method

Gets the current modem status.
public GetModemStatus ( byte &ModemStatus ) : FT_STATUS
ModemStatus byte A bit map representaion of the current modem status.
return FT_STATUS

GetNumberOfDevices() public method

Gets the number of FTDI devices available.
public GetNumberOfDevices ( UInt32 &devcount ) : FT_STATUS
devcount System.UInt32 The number of FTDI devices available.
return FT_STATUS

GetPinStates() public method

Gets the instantaneous state of the device IO pins.
public GetPinStates ( byte &BitMode ) : FT_STATUS
BitMode byte A bitmap value containing the instantaneous state of the device IO pins
return FT_STATUS

GetRxBytesAvailable() public method

Gets the number of bytes available in the receive buffer.
public GetRxBytesAvailable ( UInt32 &RxQueue ) : FT_STATUS
RxQueue System.UInt32 The number of bytes available to be read.
return FT_STATUS

GetSerialNumber() public method

Gets the serial number of the current device.
public GetSerialNumber ( string &SerialNumber ) : FT_STATUS
SerialNumber string The serial number of the current device.
return FT_STATUS

GetTxBytesWaiting() public method

Gets the number of bytes waiting in the transmit buffer.
public GetTxBytesWaiting ( UInt32 &TxQueue ) : FT_STATUS
TxQueue System.UInt32 The number of bytes waiting to be sent.
return FT_STATUS

InTransferSize() public method

Sets the USB IN and OUT transfer sizes.
public InTransferSize ( UInt32 InTransferSize ) : FT_STATUS
InTransferSize System.UInt32 The USB IN transfer size in bytes.
return FT_STATUS

OpenByDescription() public method

Opens the FTDI device with the specified description.
Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.
public OpenByDescription ( string description ) : FT_STATUS
description string Description of the device to open.
return FT_STATUS

OpenByIndex() public method

Opens the FTDI device with the specified index.
Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.
public OpenByIndex ( UInt32 index ) : FT_STATUS
index System.UInt32 Index of the device to open. /// Note that this cannot be guaranteed to open a specific device.
return FT_STATUS

OpenByLocation() public method

Opens the FTDI device at the specified physical location.
Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.
public OpenByLocation ( UInt32 location ) : FT_STATUS
location System.UInt32 Location of the device to open.
return FT_STATUS

OpenBySerialNumber() public method

Opens the FTDI device with the specified serial number.
Initialises the device to 8 data bits, 1 stop bit, no parity, no flow control and 9600 Baud.
public OpenBySerialNumber ( string serialnumber ) : FT_STATUS
serialnumber string Serial number of the device to open.
return FT_STATUS

Purge() public method

Purge data from the devices transmit and/or receive buffers.
public Purge ( UInt32 purgemask ) : FT_STATUS
purgemask System.UInt32 Specifies which buffer(s) to be purged. Valid values are any combination of the following flags: FT_PURGE_RX, FT_PURGE_TX
return FT_STATUS

Read() public method

Read data from an open FTDI device.
public Read ( byte dataBuffer, UInt32 numBytesToRead, UInt32 &numBytesRead ) : FT_STATUS
dataBuffer byte An array of bytes which will be populated with the data read from the device.
numBytesToRead System.UInt32 The number of bytes requested from the device.
numBytesRead System.UInt32 The number of bytes actually read.
return FT_STATUS

Read() public method

Read data from an open FTDI device.
public Read ( string &dataBuffer, UInt32 numBytesToRead, UInt32 &numBytesRead ) : FT_STATUS
dataBuffer string A string containing the data read
numBytesToRead System.UInt32 The number of bytes requested from the device.
numBytesRead System.UInt32 The number of bytes actually read.
return FT_STATUS

ReadEEPROMLocation() public method

Reads an individual word value from a specified location in the device's EEPROM.
public ReadEEPROMLocation ( UInt32 Address, UInt16 &EEValue ) : FT_STATUS
Address System.UInt32 The EEPROM location to read data from
EEValue System.UInt16 The WORD value read from the EEPROM location specified in the Address paramter
return FT_STATUS

ReadFT2232EEPROM() public method

Reads the EEPROM contents of an FT2232 device.
Thrown when the current device does not match the type required by this method.
public ReadFT2232EEPROM ( FT2232_EEPROM_STRUCTURE ee2232 ) : FT_STATUS
ee2232 FT2232_EEPROM_STRUCTURE An FT2232_EEPROM_STRUCTURE which contains only the relevant information for an FT2232 device.
return FT_STATUS

ReadFT2232HEEPROM() public method

Reads the EEPROM contents of an FT2232H device.
Thrown when the current device does not match the type required by this method.
public ReadFT2232HEEPROM ( FT2232H_EEPROM_STRUCTURE ee2232h ) : FT_STATUS
ee2232h FT2232H_EEPROM_STRUCTURE An FT2232H_EEPROM_STRUCTURE which contains only the relevant information for an FT2232H device.
return FT_STATUS

ReadFT232BEEPROM() public method

Reads the EEPROM contents of an FT232B or FT245B device.
Thrown when the current device does not match the type required by this method.
public ReadFT232BEEPROM ( FT232B_EEPROM_STRUCTURE ee232b ) : FT_STATUS
ee232b FT232B_EEPROM_STRUCTURE An FT232B_EEPROM_STRUCTURE which contains only the relevant information for an FT232B and FT245B device.
return FT_STATUS

ReadFT232HEEPROM() public method

Reads the EEPROM contents of an FT232H device.
Thrown when the current device does not match the type required by this method.
public ReadFT232HEEPROM ( FT232H_EEPROM_STRUCTURE ee232h ) : FT_STATUS
ee232h FT232H_EEPROM_STRUCTURE An FT232H_EEPROM_STRUCTURE which contains only the relevant information for an FT232H device.
return FT_STATUS

ReadFT232REEPROM() public method

Reads the EEPROM contents of an FT232R or FT245R device. Calls FT_EE_Read in FTD2XX DLL
Thrown when the current device does not match the type required by this method.
public ReadFT232REEPROM ( FT232R_EEPROM_STRUCTURE ee232r ) : FT_STATUS
ee232r FT232R_EEPROM_STRUCTURE
return FT_STATUS

ReadFT4232HEEPROM() public method

Reads the EEPROM contents of an FT4232H device.
Thrown when the current device does not match the type required by this method.
public ReadFT4232HEEPROM ( FT4232H_EEPROM_STRUCTURE ee4232h ) : FT_STATUS
ee4232h FT4232H_EEPROM_STRUCTURE An FT4232H_EEPROM_STRUCTURE which contains only the relevant information for an FT4232H device.
return FT_STATUS

ReadXSeriesEEPROM() public method

Reads the EEPROM contents of an X-Series device.
Thrown when the current device does not match the type required by this method.
public ReadXSeriesEEPROM ( FT_XSERIES_EEPROM_STRUCTURE eeX ) : FT_STATUS
eeX FT_XSERIES_EEPROM_STRUCTURE An FT_XSERIES_EEPROM_STRUCTURE which contains only the relevant information for an X-Series device.
return FT_STATUS

Reload() public method

Forces a reload of the driver for devices with a specific VID and PID combination.
If the VID and PID parameters are 0, the drivers for USB root hubs will be reloaded, causing all USB devices connected to reload their drivers
public Reload ( UInt16 VendorID, UInt16 ProductID ) : FT_STATUS
VendorID System.UInt16 Vendor ID of the devices to have the driver reloaded
ProductID System.UInt16 Product ID of the devices to have the driver reloaded
return FT_STATUS

Rescan() public method

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.
public Rescan ( ) : FT_STATUS
return FT_STATUS

ResetDevice() public method

Reset an open FTDI device.
public ResetDevice ( ) : FT_STATUS
return FT_STATUS

ResetPort() public method

Resets the device port.
public ResetPort ( ) : FT_STATUS
return FT_STATUS

RestartInTask() public method

Resumes the driver issuing USB in requests.
public RestartInTask ( ) : FT_STATUS
return FT_STATUS

SetBaudRate() public method

Sets the current Baud rate.
public SetBaudRate ( UInt32 BaudRate ) : FT_STATUS
BaudRate System.UInt32 The desired Baud rate for the device.
return FT_STATUS

SetBitMode() public method

Puts the device in a mode other than the default UART or FIFO mode.
Thrown when the current device does not support the requested bit mode.
public SetBitMode ( byte Mask, byte BitMode ) : FT_STATUS
Mask byte Sets up which bits are inputs and which are 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.
BitMode byte For FT232H devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG, FT_BIT_MODE_MPSSE, FT_BIT_MODE_SYNC_BITBANG, FT_BIT_MODE_CBUS_BITBANG, FT_BIT_MODE_MCU_HOST, FT_BIT_MODE_FAST_SERIAL, FT_BIT_MODE_SYNC_FIFO. /// For FT2232H devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG, FT_BIT_MODE_MPSSE, FT_BIT_MODE_SYNC_BITBANG, FT_BIT_MODE_MCU_HOST, FT_BIT_MODE_FAST_SERIAL, FT_BIT_MODE_SYNC_FIFO. /// For FT4232H devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG, FT_BIT_MODE_MPSSE, FT_BIT_MODE_SYNC_BITBANG. /// For FT232R devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG, FT_BIT_MODE_SYNC_BITBANG, FT_BIT_MODE_CBUS_BITBANG. /// For FT245R devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG, FT_BIT_MODE_SYNC_BITBANG. /// For FT2232 devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG, FT_BIT_MODE_MPSSE, FT_BIT_MODE_SYNC_BITBANG, FT_BIT_MODE_MCU_HOST, FT_BIT_MODE_FAST_SERIAL. /// For FT232B and FT245B devices, valid values are FT_BIT_MODE_RESET, FT_BIT_MODE_ASYNC_BITBANG.
return FT_STATUS

SetBreak() public method

Sets or clears the break state.
public SetBreak ( bool Enable ) : FT_STATUS
Enable bool If true, sets break on. If false, sets break off.
return FT_STATUS

SetCharacters() public method

Sets an event character, an error character and enables or disables them.
public SetCharacters ( byte EventChar, bool EventCharEnable, byte ErrorChar, bool ErrorCharEnable ) : FT_STATUS
EventChar byte A character that will be tigger an IN to the host when this character is received.
EventCharEnable bool Determines if the EventChar is enabled or disabled.
ErrorChar byte A character that will be inserted into the data stream to indicate that an error has occurred.
ErrorCharEnable bool Determines if the ErrorChar is enabled or disabled.
return FT_STATUS

SetDTR() public method

Asserts or de-asserts the Data Terminal Ready (DTR) line.
public SetDTR ( bool Enable ) : FT_STATUS
Enable bool If true, asserts DTR. If false, de-asserts DTR.
return FT_STATUS

SetDataCharacteristics() public method

Sets the data bits, stop bits and parity for the device.
public SetDataCharacteristics ( byte DataBits, byte StopBits, byte Parity ) : FT_STATUS
DataBits byte The number of data bits for UART data. Valid values are FT_DATA_BITS.FT_DATA_7 or FT_DATA_BITS.FT_BITS_8
StopBits byte The number of stop bits for UART data. Valid values are FT_STOP_BITS.FT_STOP_BITS_1 or FT_STOP_BITS.FT_STOP_BITS_2
Parity byte The parity of the UART data. Valid values are FT_PARITY.FT_PARITY_NONE, FT_PARITY.FT_PARITY_ODD, FT_PARITY.FT_PARITY_EVEN, FT_PARITY.FT_PARITY_MARK or FT_PARITY.FT_PARITY_SPACE
return FT_STATUS

SetDeadmanTimeout() public method

Sets the USB deadman timeout value. Default is 5000ms.
public SetDeadmanTimeout ( UInt32 DeadmanTimeout ) : FT_STATUS
DeadmanTimeout System.UInt32 The deadman timeout value in ms. Default is 5000ms.
return FT_STATUS

SetEventNotification() public method

Register for event notification.
After setting event notification, the event can be caught by executing the WaitOne() method of the EventWaitHandle. If multiple event types are being monitored, the event that fired can be determined from the GetEventType method.
public SetEventNotification ( UInt32 eventmask, EventWaitHandle eventhandle ) : FT_STATUS
eventmask System.UInt32 The type of events to signal. Can be any combination of the following: FT_EVENT_RXCHAR, FT_EVENT_MODEM_STATUS, FT_EVENT_LINE_STATUS
eventhandle System.Threading.EventWaitHandle Handle to the event that will receive the notification
return FT_STATUS

SetFlowControl() public method

Sets the flow control type.
public SetFlowControl ( UInt16 FlowControl, byte Xon, byte Xoff ) : FT_STATUS
FlowControl System.UInt16 The type of flow control for the UART. Valid values are FT_FLOW_CONTROL.FT_FLOW_NONE, FT_FLOW_CONTROL.FT_FLOW_RTS_CTS, FT_FLOW_CONTROL.FT_FLOW_DTR_DSR or FT_FLOW_CONTROL.FT_FLOW_XON_XOFF
Xon byte The Xon character for Xon/Xoff flow control. Ignored if not using Xon/XOff flow control.
Xoff byte The Xoff character for Xon/Xoff flow control. Ignored if not using Xon/XOff flow control.
return FT_STATUS

SetLatency() public method

Sets the value of the latency timer. Default value is 16ms.
public SetLatency ( byte Latency ) : FT_STATUS
Latency byte The latency timer value in ms. /// Valid values are 2ms - 255ms for FT232BM, FT245BM and FT2232 devices. /// Valid values are 0ms - 255ms for other devices.
return FT_STATUS

SetRTS() public method

Asserts or de-asserts the Request To Send (RTS) line.
public SetRTS ( bool Enable ) : FT_STATUS
Enable bool If true, asserts RTS. If false, de-asserts RTS
return FT_STATUS

SetResetPipeRetryCount() public method

Gets or sets the reset pipe retry count. Default value is 50.
public SetResetPipeRetryCount ( UInt32 ResetPipeRetryCount ) : FT_STATUS
ResetPipeRetryCount System.UInt32 The reset pipe retry count. /// Electrically noisy environments may benefit from a larger value.
return FT_STATUS

SetTimeouts() public method

Sets the read and write timeout values.
public SetTimeouts ( UInt32 ReadTimeout, UInt32 WriteTimeout ) : FT_STATUS
ReadTimeout System.UInt32 Read timeout value in ms. A value of 0 indicates an infinite timeout.
WriteTimeout System.UInt32 Write timeout value in ms. A value of 0 indicates an infinite timeout.
return FT_STATUS

StopInTask() public method

Stops the driver issuing USB in requests.
public StopInTask ( ) : FT_STATUS
return FT_STATUS

Write() public method

Write data to an open FTDI device.
public Write ( byte dataBuffer, Int32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS
dataBuffer byte An array of bytes which contains the data to be written to the device.
numBytesToWrite System.Int32 The number of bytes to be written to the device.
numBytesWritten System.UInt32 The number of bytes actually written to the device.
return FT_STATUS

Write() public method

Write data to an open FTDI device.
public Write ( byte dataBuffer, UInt32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS
dataBuffer byte An array of bytes which contains the data to be written to the device.
numBytesToWrite System.UInt32 The number of bytes to be written to the device.
numBytesWritten System.UInt32 The number of bytes actually written to the device.
return FT_STATUS

Write() public method

Write data to an open FTDI device.
public Write ( string dataBuffer, Int32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS
dataBuffer string A string which contains the data to be written to the device.
numBytesToWrite System.Int32 The number of bytes to be written to the device.
numBytesWritten System.UInt32 The number of bytes actually written to the device.
return FT_STATUS

Write() public method

Write data to an open FTDI device.
public Write ( string dataBuffer, UInt32 numBytesToWrite, UInt32 &numBytesWritten ) : FT_STATUS
dataBuffer string A string which contains the data to be written to the device.
numBytesToWrite System.UInt32 The number of bytes to be written to the device.
numBytesWritten System.UInt32 The number of bytes actually written to the device.
return FT_STATUS

WriteEEPROMLocation() public method

Writes an individual word value to a specified location in the device's EEPROM.
public WriteEEPROMLocation ( UInt32 Address, UInt16 EEValue ) : FT_STATUS
Address System.UInt32 The EEPROM location to read data from
EEValue System.UInt16 The WORD value to write to the EEPROM location specified by the Address parameter
return FT_STATUS

WriteFT2232EEPROM() public method

Writes the specified values to the EEPROM of an FT2232 device. Calls FT_EE_Program in FTD2XX DLL
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteFT2232EEPROM ( FT2232_EEPROM_STRUCTURE ee2232 ) : FT_STATUS
ee2232 FT2232_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS

WriteFT2232HEEPROM() public method

Writes the specified values to the EEPROM of an FT2232H device. Calls FT_EE_Program in FTD2XX DLL
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteFT2232HEEPROM ( FT2232H_EEPROM_STRUCTURE ee2232h ) : FT_STATUS
ee2232h FT2232H_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS

WriteFT232BEEPROM() public method

Writes the specified values to the EEPROM of an FT232B or FT245B device.
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteFT232BEEPROM ( FT232B_EEPROM_STRUCTURE ee232b ) : FT_STATUS
ee232b FT232B_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS

WriteFT232HEEPROM() public method

Writes the specified values to the EEPROM of an FT232H device. Calls FT_EE_Program in FTD2XX DLL
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteFT232HEEPROM ( FT232H_EEPROM_STRUCTURE ee232h ) : FT_STATUS
ee232h FT232H_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS

WriteFT232REEPROM() public method

Writes the specified values to the EEPROM of an FT232R or FT245R device. Calls FT_EE_Program in FTD2XX DLL
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteFT232REEPROM ( FT232R_EEPROM_STRUCTURE ee232r ) : FT_STATUS
ee232r FT232R_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS

WriteFT4232HEEPROM() public method

Writes the specified values to the EEPROM of an FT4232H device. Calls FT_EE_Program in FTD2XX DLL
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteFT4232HEEPROM ( FT4232H_EEPROM_STRUCTURE ee4232h ) : FT_STATUS
ee4232h FT4232H_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS

WriteXSeriesEEPROM() public method

Writes the specified values to the EEPROM of an X-Series device. Calls FT_EEPROM_Program in FTD2XX DLL
If the strings are too long, they will be truncated to their maximum permitted lengths
Thrown when the current device does not match the type required by this method.
public WriteXSeriesEEPROM ( FT_XSERIES_EEPROM_STRUCTURE eeX ) : FT_STATUS
eeX FT_XSERIES_EEPROM_STRUCTURE The EEPROM settings to be written to the device
return FT_STATUS