1,6 → 1,6 |
/*++ |
|
Copyright (c) 2001-2011 Future Technology Devices International Limited |
Copyright © 2001-2011 Future Technology Devices International Limited |
|
THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED "AS IS" |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
32,7 → 32,7 |
|
Environment: |
|
user mode |
kernel & user mode |
|
|
--*/ |
41,10 → 41,9 |
#ifndef FTD2XX_H |
#define FTD2XX_H |
|
#ifndef _WINDOWS |
#include <pthread.h> |
#define WINAPI |
#endif |
#ifdef _WIN32 |
// Compiling on Windows |
#include <windows.h> |
|
// The following ifdef block is the standard way of creating macros |
// which make exporting from a DLL simpler. All files within this DLL |
56,24 → 55,21 |
|
#ifdef FTD2XX_EXPORTS |
#define FTD2XX_API __declspec(dllexport) |
#elif defined(FTD2XX_STATIC) |
// Avoid decorations when linking statically to D2XX. |
#define FTD2XX_API |
#else |
#define FTD2XX_API __declspec(dllimport) |
#endif |
|
#ifndef _WINDOWS |
#else // _WIN32 |
// Compiling on non-Windows platform. |
#include "WinTypes.h" |
|
#ifdef FTD2XX_API |
#undef FTD2XX_API |
// No decorations needed. |
#define FTD2XX_API |
#endif |
#endif |
typedef struct _EVENT_HANDLE{ |
pthread_cond_t eCondVar; |
pthread_mutex_t eMutex; |
int iVar; |
} EVENT_HANDLE; |
|
#endif // _WIN32 |
|
typedef PVOID FT_HANDLE; |
typedef ULONG FT_STATUS; |
|
88,7 → 84,7 |
FT_IO_ERROR, |
FT_INSUFFICIENT_RESOURCES, |
FT_INVALID_PARAMETER, |
FT_INVALID_BAUD_RATE, //7 |
FT_INVALID_BAUD_RATE, |
|
FT_DEVICE_NOT_OPENED_FOR_ERASE, |
FT_DEVICE_NOT_OPENED_FOR_WRITE, |
100,7 → 96,8 |
FT_EEPROM_NOT_PROGRAMMED, |
FT_INVALID_ARGS, |
FT_NOT_SUPPORTED, |
FT_OTHER_ERROR |
FT_OTHER_ERROR, |
FT_DEVICE_LIST_NOT_READY, |
}; |
|
|
114,6 → 111,10 |
#define FT_OPEN_BY_DESCRIPTION 2 |
#define FT_OPEN_BY_LOCATION 4 |
|
#define FT_OPEN_MASK (FT_OPEN_BY_SERIAL_NUMBER | \ |
FT_OPEN_BY_DESCRIPTION | \ |
FT_OPEN_BY_LOCATION) |
|
// |
// FT_ListDevices Flags (used in conjunction with FT_OpenEx Flags |
// |
214,7 → 215,12 |
FT_DEVICE_232R, |
FT_DEVICE_2232H, |
FT_DEVICE_4232H, |
FT_DEVICE_232H |
FT_DEVICE_232H, |
FT_DEVICE_X_SERIES, |
FT_DEVICE_4222H_0, |
FT_DEVICE_4222H_1_2, |
FT_DEVICE_4222H_3, |
FT_DEVICE_4222_PROG, |
}; |
|
// |
230,7 → 236,6 |
#define FT_BITMODE_CBUS_BITBANG 0x20 |
#define FT_BITMODE_SYNC_FIFO 0x40 |
|
|
// |
// FT232R CBUS Options EEPROM values |
// |
267,11 → 272,45 |
#define FT_232H_CBUS_CLK15 0x0B // 15MHz clock |
#define FT_232H_CBUS_CLK7_5 0x0C // 7.5MHz clock |
|
// |
// FT X Series CBUS Options EEPROM values |
// |
|
#define FT_X_SERIES_CBUS_TRISTATE 0x00 // Tristate |
#define FT_X_SERIES_CBUS_TXLED 0x01 // Tx LED |
#define FT_X_SERIES_CBUS_RXLED 0x02 // Rx LED |
#define FT_X_SERIES_CBUS_TXRXLED 0x03 // Tx and Rx LED |
#define FT_X_SERIES_CBUS_PWREN 0x04 // Power Enable |
#define FT_X_SERIES_CBUS_SLEEP 0x05 // Sleep |
#define FT_X_SERIES_CBUS_DRIVE_0 0x06 // Drive pin to logic 0 |
#define FT_X_SERIES_CBUS_DRIVE_1 0x07 // Drive pin to logic 1 |
#define FT_X_SERIES_CBUS_IOMODE 0x08 // IO Mode for CBUS bit-bang |
#define FT_X_SERIES_CBUS_TXDEN 0x09 // Tx Data Enable |
#define FT_X_SERIES_CBUS_CLK24 0x0A // 24MHz clock |
#define FT_X_SERIES_CBUS_CLK12 0x0B // 12MHz clock |
#define FT_X_SERIES_CBUS_CLK6 0x0C // 6MHz clock |
#define FT_X_SERIES_CBUS_BCD_CHARGER 0x0D // Battery charger detected |
#define FT_X_SERIES_CBUS_BCD_CHARGER_N 0x0E // Battery charger detected inverted |
#define FT_X_SERIES_CBUS_I2C_TXE 0x0F // I2C Tx empty |
#define FT_X_SERIES_CBUS_I2C_RXF 0x10 // I2C Rx full |
#define FT_X_SERIES_CBUS_VBUS_SENSE 0x11 // Detect VBUS |
#define FT_X_SERIES_CBUS_BITBANG_WR 0x12 // Bit-bang write strobe |
#define FT_X_SERIES_CBUS_BITBANG_RD 0x13 // Bit-bang read strobe |
#define FT_X_SERIES_CBUS_TIMESTAMP 0x14 // Toggle output when a USB SOF token is received |
#define FT_X_SERIES_CBUS_KEEP_AWAKE 0x15 // |
|
|
// Driver types |
#define FT_DRIVER_TYPE_D2XX 0 |
#define FT_DRIVER_TYPE_VCP 1 |
|
|
|
#ifdef __cplusplus |
extern "C" { |
#endif |
|
|
FTD2XX_API |
FT_STATUS WINAPI FT_Open( |
int deviceNumber, |
293,18 → 332,6 |
); |
|
FTD2XX_API |
FT_STATUS FT_SetVIDPID( |
DWORD dwVID, |
DWORD dwPID |
); |
|
FTD2XX_API |
FT_STATUS FT_GetVIDPID( |
DWORD * pdwVID, |
DWORD * pdwPID |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_Close( |
FT_HANDLE ftHandle |
); |
313,7 → 340,7 |
FT_STATUS WINAPI FT_Read( |
FT_HANDLE ftHandle, |
LPVOID lpBuffer, |
DWORD nBufferSize, |
DWORD dwBytesToRead, |
LPDWORD lpBytesReturned |
); |
|
321,7 → 348,7 |
FT_STATUS WINAPI FT_Write( |
FT_HANDLE ftHandle, |
LPVOID lpBuffer, |
DWORD nBufferSize, |
DWORD dwBytesToWrite, |
LPDWORD lpBytesWritten |
); |
|
425,12 → 452,6 |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_GetQueueStatusEx( |
FT_HANDLE ftHandle, |
DWORD *dwRxBytes |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_SetEventNotification( |
FT_HANDLE ftHandle, |
DWORD Mask, |
493,7 → 514,8 |
); |
|
// |
// structure to hold program data for FT_Program function |
// structure to hold program data for FT_EE_Program, FT_EE_ProgramEx, FT_EE_Read |
// and FT_EE_ReadEx functions |
// |
typedef struct ft_program_data { |
|
501,11 → 523,12 |
DWORD Signature2; // Header - must be 0xffffffff |
DWORD Version; // Header - FT_PROGRAM_DATA version |
// 0 = original |
// 1 = FT2232C extensions |
// 1 = FT2232 extensions |
// 2 = FT232R extensions |
// 3 = FT2232H extensions |
// 4 = FT4232H extensions |
// 5 = FT232H extensions |
|
WORD VendorId; // 0x0403 |
WORD ProductId; // 0x6001 |
char *Manufacturer; // "FTDI" |
569,7 → 592,7 |
UCHAR Cbus2; // Cbus Mux control |
UCHAR Cbus3; // Cbus Mux control |
UCHAR Cbus4; // Cbus Mux control |
UCHAR RIsD2XX; // non-zero if using D2XX drivers |
UCHAR RIsD2XX; // non-zero if using D2XX driver |
// |
// Rev 7 (FT2232H) Extensions |
// |
601,17 → 624,17 |
// |
UCHAR PullDownEnable8; // non-zero if pull down enabled |
UCHAR SerNumEnable8; // non-zero if serial number to be used |
UCHAR ASlowSlew; // non-zero if AL pins have slow slew |
UCHAR ASchmittInput; // non-zero if AL pins are Schmitt input |
UCHAR ASlowSlew; // non-zero if A pins have slow slew |
UCHAR ASchmittInput; // non-zero if A pins are Schmitt input |
UCHAR ADriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR BSlowSlew; // non-zero if AH pins have slow slew |
UCHAR BSchmittInput; // non-zero if AH pins are Schmitt input |
UCHAR BSlowSlew; // non-zero if B pins have slow slew |
UCHAR BSchmittInput; // non-zero if B pins are Schmitt input |
UCHAR BDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR CSlowSlew; // non-zero if BL pins have slow slew |
UCHAR CSchmittInput; // non-zero if BL pins are Schmitt input |
UCHAR CSlowSlew; // non-zero if C pins have slow slew |
UCHAR CSchmittInput; // non-zero if C pins are Schmitt input |
UCHAR CDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR DSlowSlew; // non-zero if BH pins have slow slew |
UCHAR DSchmittInput; // non-zero if BH pins are Schmitt input |
UCHAR DSlowSlew; // non-zero if D pins have slow slew |
UCHAR DSchmittInput; // non-zero if D pins are Schmitt input |
UCHAR DDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR ARIIsTXDEN; // non-zero if port A uses RI as RS485 TXDEN |
UCHAR BRIIsTXDEN; // non-zero if port B uses RI as RS485 TXDEN |
654,7 → 677,6 |
|
} FT_PROGRAM_DATA, *PFT_PROGRAM_DATA; |
|
|
FTD2XX_API |
FT_STATUS WINAPI FT_EE_Program( |
FT_HANDLE ftHandle, |
664,7 → 686,7 |
FTD2XX_API |
FT_STATUS WINAPI FT_EE_ProgramEx( |
FT_HANDLE ftHandle, |
PFT_PROGRAM_DATA lpData, |
PFT_PROGRAM_DATA pData, |
char *Manufacturer, |
char *ManufacturerId, |
char *Description, |
680,7 → 702,7 |
FTD2XX_API |
FT_STATUS WINAPI FT_EE_ReadEx( |
FT_HANDLE ftHandle, |
PFT_PROGRAM_DATA lpData, |
PFT_PROGRAM_DATA pData, |
char *Manufacturer, |
char *ManufacturerId, |
char *Description, |
708,7 → 730,246 |
LPDWORD lpdwBytesRead |
); |
|
|
typedef struct ft_eeprom_header { |
FT_DEVICE deviceType; // FTxxxx device type to be programmed |
// Device descriptor options |
WORD VendorId; // 0x0403 |
WORD ProductId; // 0x6001 |
UCHAR SerNumEnable; // non-zero if serial number to be used |
// Config descriptor options |
WORD MaxPower; // 0 < MaxPower <= 500 |
UCHAR SelfPowered; // 0 = bus powered, 1 = self powered |
UCHAR RemoteWakeup; // 0 = not capable, 1 = capable |
// Hardware options |
UCHAR PullDownEnable; // non-zero if pull down in suspend enabled |
} FT_EEPROM_HEADER, *PFT_EEPROM_HEADER; |
|
|
// FT232B EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_232b { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
} FT_EEPROM_232B, *PFT_EEPROM_232B; |
|
|
// FT2232 EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_2232 { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
// Drive options |
UCHAR AIsHighCurrent; // non-zero if interface is high current |
UCHAR BIsHighCurrent; // non-zero if interface is high current |
// Hardware options |
UCHAR AIsFifo; // non-zero if interface is 245 FIFO |
UCHAR AIsFifoTar; // non-zero if interface is 245 FIFO CPU target |
UCHAR AIsFastSer; // non-zero if interface is Fast serial |
UCHAR BIsFifo; // non-zero if interface is 245 FIFO |
UCHAR BIsFifoTar; // non-zero if interface is 245 FIFO CPU target |
UCHAR BIsFastSer; // non-zero if interface is Fast serial |
// Driver option |
UCHAR ADriverType; // |
UCHAR BDriverType; // |
} FT_EEPROM_2232, *PFT_EEPROM_2232; |
|
|
// FT232R EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_232r { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
// Drive options |
UCHAR IsHighCurrent; // non-zero if interface is high current |
// Hardware options |
UCHAR UseExtOsc; // Use External Oscillator |
UCHAR InvertTXD; // non-zero if invert TXD |
UCHAR InvertRXD; // non-zero if invert RXD |
UCHAR InvertRTS; // non-zero if invert RTS |
UCHAR InvertCTS; // non-zero if invert CTS |
UCHAR InvertDTR; // non-zero if invert DTR |
UCHAR InvertDSR; // non-zero if invert DSR |
UCHAR InvertDCD; // non-zero if invert DCD |
UCHAR InvertRI; // non-zero if invert RI |
UCHAR Cbus0; // Cbus Mux control |
UCHAR Cbus1; // Cbus Mux control |
UCHAR Cbus2; // Cbus Mux control |
UCHAR Cbus3; // Cbus Mux control |
UCHAR Cbus4; // Cbus Mux control |
// Driver option |
UCHAR DriverType; // |
} FT_EEPROM_232R, *PFT_EEPROM_232R; |
|
|
// FT2232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_2232h { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
// Drive options |
UCHAR ALSlowSlew; // non-zero if AL pins have slow slew |
UCHAR ALSchmittInput; // non-zero if AL pins are Schmitt input |
UCHAR ALDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR AHSlowSlew; // non-zero if AH pins have slow slew |
UCHAR AHSchmittInput; // non-zero if AH pins are Schmitt input |
UCHAR AHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR BLSlowSlew; // non-zero if BL pins have slow slew |
UCHAR BLSchmittInput; // non-zero if BL pins are Schmitt input |
UCHAR BLDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR BHSlowSlew; // non-zero if BH pins have slow slew |
UCHAR BHSchmittInput; // non-zero if BH pins are Schmitt input |
UCHAR BHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
// Hardware options |
UCHAR AIsFifo; // non-zero if interface is 245 FIFO |
UCHAR AIsFifoTar; // non-zero if interface is 245 FIFO CPU target |
UCHAR AIsFastSer; // non-zero if interface is Fast serial |
UCHAR BIsFifo; // non-zero if interface is 245 FIFO |
UCHAR BIsFifoTar; // non-zero if interface is 245 FIFO CPU target |
UCHAR BIsFastSer; // non-zero if interface is Fast serial |
UCHAR PowerSaveEnable; // non-zero if using BCBUS7 to save power for self-powered designs |
// Driver option |
UCHAR ADriverType; // |
UCHAR BDriverType; // |
} FT_EEPROM_2232H, *PFT_EEPROM_2232H; |
|
|
// FT4232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_4232h { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
// Drive options |
UCHAR ASlowSlew; // non-zero if A pins have slow slew |
UCHAR ASchmittInput; // non-zero if A pins are Schmitt input |
UCHAR ADriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR BSlowSlew; // non-zero if B pins have slow slew |
UCHAR BSchmittInput; // non-zero if B pins are Schmitt input |
UCHAR BDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR CSlowSlew; // non-zero if C pins have slow slew |
UCHAR CSchmittInput; // non-zero if C pins are Schmitt input |
UCHAR CDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR DSlowSlew; // non-zero if D pins have slow slew |
UCHAR DSchmittInput; // non-zero if D pins are Schmitt input |
UCHAR DDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
// Hardware options |
UCHAR ARIIsTXDEN; // non-zero if port A uses RI as RS485 TXDEN |
UCHAR BRIIsTXDEN; // non-zero if port B uses RI as RS485 TXDEN |
UCHAR CRIIsTXDEN; // non-zero if port C uses RI as RS485 TXDEN |
UCHAR DRIIsTXDEN; // non-zero if port D uses RI as RS485 TXDEN |
// Driver option |
UCHAR ADriverType; // |
UCHAR BDriverType; // |
UCHAR CDriverType; // |
UCHAR DDriverType; // |
} FT_EEPROM_4232H, *PFT_EEPROM_4232H; |
|
|
// FT232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_232h { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
// Drive options |
UCHAR ACSlowSlew; // non-zero if AC bus pins have slow slew |
UCHAR ACSchmittInput; // non-zero if AC bus pins are Schmitt input |
UCHAR ACDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR ADSlowSlew; // non-zero if AD bus pins have slow slew |
UCHAR ADSchmittInput; // non-zero if AD bus pins are Schmitt input |
UCHAR ADDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
// CBUS options |
UCHAR Cbus0; // Cbus Mux control |
UCHAR Cbus1; // Cbus Mux control |
UCHAR Cbus2; // Cbus Mux control |
UCHAR Cbus3; // Cbus Mux control |
UCHAR Cbus4; // Cbus Mux control |
UCHAR Cbus5; // Cbus Mux control |
UCHAR Cbus6; // Cbus Mux control |
UCHAR Cbus7; // Cbus Mux control |
UCHAR Cbus8; // Cbus Mux control |
UCHAR Cbus9; // Cbus Mux control |
// FT1248 options |
UCHAR FT1248Cpol; // FT1248 clock polarity - clock idle high (1) or clock idle low (0) |
UCHAR FT1248Lsb; // FT1248 data is LSB (1) or MSB (0) |
UCHAR FT1248FlowControl; // FT1248 flow control enable |
// Hardware options |
UCHAR IsFifo; // non-zero if interface is 245 FIFO |
UCHAR IsFifoTar; // non-zero if interface is 245 FIFO CPU target |
UCHAR IsFastSer; // non-zero if interface is Fast serial |
UCHAR IsFT1248 ; // non-zero if interface is FT1248 |
UCHAR PowerSaveEnable; // |
// Driver option |
UCHAR DriverType; // |
} FT_EEPROM_232H, *PFT_EEPROM_232H; |
|
|
// FT X Series EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program |
typedef struct ft_eeprom_x_series { |
// Common header |
FT_EEPROM_HEADER common; // common elements for all device EEPROMs |
// Drive options |
UCHAR ACSlowSlew; // non-zero if AC bus pins have slow slew |
UCHAR ACSchmittInput; // non-zero if AC bus pins are Schmitt input |
UCHAR ACDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
UCHAR ADSlowSlew; // non-zero if AD bus pins have slow slew |
UCHAR ADSchmittInput; // non-zero if AD bus pins are Schmitt input |
UCHAR ADDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA |
// CBUS options |
UCHAR Cbus0; // Cbus Mux control |
UCHAR Cbus1; // Cbus Mux control |
UCHAR Cbus2; // Cbus Mux control |
UCHAR Cbus3; // Cbus Mux control |
UCHAR Cbus4; // Cbus Mux control |
UCHAR Cbus5; // Cbus Mux control |
UCHAR Cbus6; // Cbus Mux control |
// UART signal options |
UCHAR InvertTXD; // non-zero if invert TXD |
UCHAR InvertRXD; // non-zero if invert RXD |
UCHAR InvertRTS; // non-zero if invert RTS |
UCHAR InvertCTS; // non-zero if invert CTS |
UCHAR InvertDTR; // non-zero if invert DTR |
UCHAR InvertDSR; // non-zero if invert DSR |
UCHAR InvertDCD; // non-zero if invert DCD |
UCHAR InvertRI; // non-zero if invert RI |
// Battery Charge Detect options |
UCHAR BCDEnable; // Enable Battery Charger Detection |
UCHAR BCDForceCbusPWREN; // asserts the power enable signal on CBUS when charging port detected |
UCHAR BCDDisableSleep; // forces the device never to go into sleep mode |
// I2C options |
WORD I2CSlaveAddress; // I2C slave device address |
DWORD I2CDeviceId; // I2C device ID |
UCHAR I2CDisableSchmitt; // Disable I2C Schmitt trigger |
// FT1248 options |
UCHAR FT1248Cpol; // FT1248 clock polarity - clock idle high (1) or clock idle low (0) |
UCHAR FT1248Lsb; // FT1248 data is LSB (1) or MSB (0) |
UCHAR FT1248FlowControl; // FT1248 flow control enable |
// Hardware options |
UCHAR RS485EchoSuppress; // |
UCHAR PowerSaveEnable; // |
// Driver option |
UCHAR DriverType; // |
} FT_EEPROM_X_SERIES, *PFT_EEPROM_X_SERIES; |
|
|
FTD2XX_API |
FT_STATUS WINAPI FT_EEPROM_Read( |
FT_HANDLE ftHandle, |
void *eepromData, |
DWORD eepromDataSize, |
char *Manufacturer, |
char *ManufacturerId, |
char *Description, |
char *SerialNumber |
); |
|
|
FTD2XX_API |
FT_STATUS WINAPI FT_EEPROM_Program( |
FT_HANDLE ftHandle, |
void *eepromData, |
DWORD eepromDataSize, |
char *Manufacturer, |
char *ManufacturerId, |
char *Description, |
char *SerialNumber |
); |
|
|
FTD2XX_API |
FT_STATUS WINAPI FT_SetLatencyTimer( |
FT_HANDLE ftHandle, |
UCHAR ucLatency |
741,6 → 1002,35 |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_SetDeadmanTimeout( |
FT_HANDLE ftHandle, |
ULONG ulDeadmanTimeout |
); |
|
#ifndef _WIN32 |
// Extra functions for non-Windows platforms to compensate |
// for lack of .INF file to specify Vendor and Product IDs. |
|
FTD2XX_API |
FT_STATUS FT_SetVIDPID( |
DWORD dwVID, |
DWORD dwPID |
); |
|
FTD2XX_API |
FT_STATUS FT_GetVIDPID( |
DWORD * pdwVID, |
DWORD * pdwPID |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_GetDeviceLocId( |
FT_HANDLE ftHandle, |
LPDWORD lpdwLocId |
); |
#endif // _WIN32 |
|
FTD2XX_API |
FT_STATUS WINAPI FT_GetDeviceInfo( |
FT_HANDLE ftHandle, |
FT_DEVICE *lpftDevice, |
751,12 → 1041,6 |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_GetDeviceLocId( |
FT_HANDLE ftHandle, |
LPDWORD lpdwLocId |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_StopInTask( |
FT_HANDLE ftHandle |
); |
782,6 → 1066,7 |
FT_HANDLE ftHandle |
); |
|
|
// |
// Win32-type functions |
// |
788,7 → 1073,7 |
|
FTD2XX_API |
FT_HANDLE WINAPI FT_W32_CreateFile( |
LPCSTR lpszName, |
LPCTSTR lpszName, |
DWORD dwAccess, |
DWORD dwShareMode, |
LPSECURITY_ATTRIBUTES lpSecurityAttributes, |
949,6 → 1234,12 |
); |
|
FTD2XX_API |
BOOL WINAPI FT_W32_GetCommMask( |
FT_HANDLE ftHandle, |
LPDWORD lpdwEventMask |
); |
|
FTD2XX_API |
BOOL WINAPI FT_W32_SetCommState( |
FT_HANDLE ftHandle, |
LPFTDCB lpftDcb |
974,6 → 1265,7 |
LPOVERLAPPED lpOverlapped |
); |
|
|
// |
// Device information |
// |
994,6 → 1286,7 |
FT_FLAGS_HISPEED = 2 |
}; |
|
|
FTD2XX_API |
FT_STATUS WINAPI FT_CreateDeviceInfoList( |
LPDWORD lpdwNumDevs |
1033,55 → 1326,102 |
LPDWORD lpdwVersion |
); |
|
// |
// Events |
// |
|
#define EV_RXCHAR 0x0001 // Any Character received |
#define EV_RXFLAG 0x0002 // Received certain character |
#define EV_TXEMPTY 0x0004 // Transmitt Queue Empty |
#define EV_CTS 0x0008 // CTS changed state |
#define EV_DSR 0x0010 // DSR changed state |
#define EV_RLSD 0x0020 // RLSD changed state |
#define EV_BREAK 0x0040 // BREAK received |
#define EV_ERR 0x0080 // Line status error occurred |
#define EV_RING 0x0100 // Ring signal detected |
#define EV_PERR 0x0200 // Printer error occured |
#define EV_RX80FULL 0x0400 // Receive buffer is 80 percent full |
#define EV_EVENT1 0x0800 // Provider specific event 1 |
#define EV_EVENT2 0x1000 // Provider specific event 2 |
FTD2XX_API |
FT_STATUS WINAPI FT_Rescan( |
void |
); |
|
// |
// Escape Functions |
// |
FTD2XX_API |
FT_STATUS WINAPI FT_Reload( |
WORD wVid, |
WORD wPid |
); |
|
#define SETXOFF 1 // Simulate XOFF received |
#define SETXON 2 // Simulate XON received |
#define SETRTS 3 // Set RTS high |
#define CLRRTS 4 // Set RTS low |
#define SETDTR 5 // Set DTR high |
#define CLRDTR 6 // Set DTR low |
#define RESETDEV 7 // Reset device if possible |
#define SETBREAK 8 // Set the device break line. |
#define CLRBREAK 9 // Clear the device break line. |
FTD2XX_API |
FT_STATUS WINAPI FT_GetComPortNumber( |
FT_HANDLE ftHandle, |
LPLONG lpdwComPortNumber |
); |
|
|
// |
// PURGE function flags. |
// FT232H additional EEPROM functions |
// |
#define PURGE_TXABORT 0x0001 // Kill the pending/current writes to the comm port. |
#define PURGE_RXABORT 0x0002 // Kill the pending/current reads to the comm port. |
#define PURGE_TXCLEAR 0x0004 // Kill the transmit queue if there. |
#define PURGE_RXCLEAR 0x0008 // Kill the typeahead buffer if there. |
|
#ifdef __cplusplus |
} |
#endif |
FTD2XX_API |
FT_STATUS WINAPI FT_EE_ReadConfig( |
FT_HANDLE ftHandle, |
UCHAR ucAddress, |
PUCHAR pucValue |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_EE_WriteConfig( |
FT_HANDLE ftHandle, |
UCHAR ucAddress, |
UCHAR ucValue |
); |
|
#endif /* FTD2XX_H */ |
FTD2XX_API |
FT_STATUS WINAPI FT_EE_ReadECC( |
FT_HANDLE ftHandle, |
UCHAR ucOption, |
LPWORD lpwValue |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_GetQueueStatusEx( |
FT_HANDLE ftHandle, |
DWORD *dwRxBytes |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_ComPortIdle( |
FT_HANDLE ftHandle |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_ComPortCancelIdle( |
FT_HANDLE ftHandle |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_VendorCmdGet( |
FT_HANDLE ftHandle, |
UCHAR Request, |
UCHAR *Buf, |
USHORT Len |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_VendorCmdSet( |
FT_HANDLE ftHandle, |
UCHAR Request, |
UCHAR *Buf, |
USHORT Len |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_VendorCmdGetEx( |
FT_HANDLE ftHandle, |
USHORT wValue, |
UCHAR *Buf, |
USHORT Len |
); |
|
FTD2XX_API |
FT_STATUS WINAPI FT_VendorCmdSetEx( |
FT_HANDLE ftHandle, |
USHORT wValue, |
UCHAR *Buf, |
USHORT Len |
); |
|
#ifdef __cplusplus |
} |
#endif |
|
|
#endif /* FTD2XX_H */ |
|