UCHAR Unsigned char (1 byte)

PUCHAR Pointer to unsigned char (4 bytes)

PCHAR Pointer to char (4 bytes)

DWORD Unsigned long (4 bytes)

LPDWORD Pointer to unsigned long (4 bytes)

FT_HANDLE DWORD

FT_STATUS (DWORD)

FT_OK = 0
FT_INVALID_HANDLE = 1
FT_DEVICE_NOT_FOUND = 2
FT_DEVICE_NOT_OPENED = 3
FT_IO_ERROR = 4
FT_INSUFFICIENT_RESOURCES = 5
FT_INVALID_PARAMETER = 6
FT_INVALID_BAUD_RATE = 7
FT_DEVICE_NOT_OPENED_FOR_ERASE = 8
FT_DEVICE_NOT_OPENED_FOR_WRITE = 9
FT_FAILED_TO_WRITE_DEVICE = 10
FT_EEPROM_READ_FAILED = 11
FT_EEPROM_WRITE_FAILED = 12
FT_EEPROM_ERASE_FAILED = 13
FT_EEPROM_NOT_PRESENT = 14
FT_EEPROM_NOT_PROGRAMMED = 15
FT_INVALID_ARGS = 16
FT_NOT_SUPPORTED = 17
FT_OTHER_ERROR = 18

Flags (see FT_ListDevices)

FT_LIST_NUMBER_ONLY = 0x80000000
FT_LIST_BY_INDEX = 0x40000000
FT_LIST_ALL = 0x20000000

Flags (see FT_OpenEx)

FT_OPEN_BY_SERIAL_NUMBER = 1
FT_OPEN_BY_DESCRIPTION = 2
FT_OPEN_BY_LOCATION = 4

FT_DEVICE (DWORD)

FT_DEVICE_232BM = 0
FT_DEVICE_232AM = 1
FT_DEVICE_100AX = 2
FT_DEVICE_UNKNOWN = 3
FT_DEVICE_2232C = 4
FT_DEVICE_232R = 5
FT_DEVICE_2232H = 6
FT_DEVICE_4232H = 7
FT_DEVICE_232H = 8
FT_DEVICE_X_SERIES = 9

Driver types

FT_DRIVER_TYPE_D2XX 0
FT_DRIVER_TYPE_VCP 1

Word Length (see FT_SetDataCharacteristics)

FT_BITS_8 = 8
FT_BITS_7 = 7

Stop Bits (see FT_SetDataCharacteristics)

FT_STOP_BITS_1 = 0
FT_STOP_BITS_2 = 2

Parity (see FT_SetDataCharacteristics)

FT_PARITY_NONE = 0
FT_PARITY_ODD = 1
FT_PARITY_EVEN = 2
FT_PARITY_MARK = 3
FT_PARITY_SPACE = 4

Flow Control (see FT_SetFlowControl)

FT_FLOW_NONE = 0x0000
FT_FLOW_RTS_CTS = 0x0100
FT_FLOW_DTR_DSR = 0x0200
FT_FLOW_XON_XOFF = 0x0400

Purge RX and TX Buffers (see FT_Purge)

FT_PURGE_RX = 1
FT_PURGE_TX = 2

Notification Events (see FT_SetEventNotification)

FT_EVENT_RXCHAR = 1
FT_EVENT_MODEM_STATUS = 2
FT_EVENT_LINE_STATUS = 4

Modem Status (see FT_GetModemStatus)

CTS = 0x10
DSR = 0x20
RI = 0x40
DCD = 0x80

Line Status (see FT_GetModemStatus)

OE = 0x02
PE = 0x04
FE = 0x08
BI = 0x10

Bit Modes (see FT_SetBitMode)

FT_BITMODE_RESET = 0x00
FT_BITMODE_ASYNC_BITBANG = 0x01
FT_BITMODE_MPSSE = 0x02
FT_BITMODE_SYNC_BITBANG = 0x04
FT_BITMODE_MCU_HOST = 0x08
FT_BITMODE_FAST_SERIAL = 0x10

FT_BITMODE_CBUS_BITBANG = 0x20
FT_BITMODE_SYNC_FIFO = 0x40

FT232R CBUS EEPROM OPTIONS – Ignored for FT245R (see FT_EE_Program and FT_EE_Read)

FT_232R_CBUS_TXDEN = 0x00
FT_232R_CBUS_PWRON = 0x01
FT_232R_CBUS_RXLED = 0x02
FT_232R_CBUS_TXLED = 0x03
FT_232R_CBUS_TXRXLED = 0x04
FT_232R_CBUS_SLEEP = 0x05
FT_232R_CBUS_CLK48 = 0x06
FT_232R_CBUS_CLK24 = 0x07
FT_232R_CBUS_CLK12 = 0x08
FT_232R_CBUS_CLK6 = 0x09
FT_232R_CBUS_IOMODE = 0x0A
FT_232R_CBUS_BITBANG_WR = 0x0B
FT_232R_CBUS_BITBANG_RD = 0x0C

FT232H CBUS EEPROM OPTIONS (see FT_EE_Program and FT_EE_Read)

FT_232H_CBUS_TRISTATE = 0x00
FT_232H_CBUS_RXLED = 0x01
FT_232H_CBUS_TXLED = 0x02
FT_232H_CBUS_TXRXLED = 0x03
FT_232H_CBUS_PWREN = 0x04
FT_232H_CBUS_SLEEP = 0x05
FT_232H_CBUS_DRIVE_0 = 0x06
FT_232H_CBUS_DRIVE_1 = 0x07
FT_232H_CBUS_IOMODE = 0x08
FT_232H_CBUS_TXDEN = 0x09
FT_232H_CBUS_CLK30 = 0x0A
FT_232H_CBUS_CLK15 = 0x0B
FT_232H_CBUS_CLK7_5 = 0x0C

FT X Series CBUS Options EEPROM values (see FT_EEPROM_Read and FT_EEPROM_Program)

FT_X_SERIES_CBUS_TRISTATE = 0x00
FT_X_SERIES_CBUS_RXLED = 0x01
FT_X_SERIES_CBUS_TXLED = 0x02
FT_X_SERIES_CBUS_TXRXLED = 0x03
FT_X_SERIES_CBUS_PWREN = 0x04
FT_X_SERIES_CBUS_SLEEP = 0x05
FT_X_SERIES_CBUS_DRIVE_0 = 0x06
FT_X_SERIES_CBUS_DRIVE_1 = 0x07
FT_X_SERIES_CBUS_IOMODE = 0x08
FT_X_SERIES_CBUS_TXDEN = 0x09
FT_X_SERIES_CBUS_CLK24 = 0x0A
FT_X_SERIES_CBUS_CLK12 = 0x0B
FT_X_SERIES_CBUS_CLK6 = 0x0C
FT_X_SERIES_CBUS_BCD_CHARGER = 0x0D
FT_X_SERIES_CBUS_BCD_CHARGER_N = 0x0E
FT_X_SERIES_CBUS_I2C_TXE = 0x0F
FT_X_SERIES_CBUS_I2C_RXF = 0x10
FT_X_SERIES_CBUS_VBUS_SENSE = 0x11
FT_X_SERIES_CBUS_BITBANG_WR = 0x12
FT_X_SERIES_CBUS_BITBANG_RD = 0x13
FT_X_SERIES_CBUS_TIMESTAMP = 0x14
FT_X_SERIES_CBUS_KEEP_AWAKE = 0x15

FT_DEVICE_LIST_INFO_NODE (see FT_GetDeviceInfoList and FT_GetDeviceInfoDetail)

typedef struct _ft_device_list_info_node {
DWORD Flag;

DWORD Type;
DWORD ID;
DWORD LocId;
char SerialNumber[16];
char Description[64];
FT_HANDLE ftHandle;
} FT_DEVICE_LIST_INFO_NODE;
FT_FLAGS (see FT_DEVICE_LIST_INFO_NODE)
FT_FLAGS_OPENED = 0x00000001
FT_PROGRAM_DATA_STRUCTURE
typedef struct ft_program_data {
DWORD Signature1; // Header – must be 0x0000000
DWORD Signature2; // Header – must be 0xffffffff
DWORD Version; // Header – FT_PROGRAM_DATA version
// 0 = original (FT232B)
// 1 = FT2232 extensions
// 2 = FT232R extensions
// 3 = FT2232H extensions
// 4 = FT4232H extensions
// 5 = FT232H extensions
WORD VendorId; // 0x0403
WORD ProductId; // 0x6001
char *Manufacturer; // “FTDI”
char *ManufacturerId; // “FT”
char *Description; // “USB HS Serial Converter”
char *SerialNumber; // “FT000001” if fixed, or NULL
WORD MaxPower; // 0 < MaxPower <= 500
WORD PnP; // 0 = disabled, 1 = enabled
WORD SelfPowered; // 0 = bus powered, 1 = self powered
WORD RemoteWakeup; // 0 = not capable, 1 = capable
//
// Rev4 (FT232B) extensions
//
UCHAR Rev4; // non-zero if Rev4 chip, zero otherwise
UCHAR IsoIn; // non-zero if in endpoint is isochronous
UCHAR IsoOut; // non-zero if out endpoint is isochronous
UCHAR PullDownEnable; // non-zero if pull down enabled
UCHAR SerNumEnable; // non-zero if serial number to be used
UCHAR USBVersionEnable; // non-zero if chip uses USBVersion
WORD USBVersion; // BCD (0x0200 => USB2)
//
// Rev 5 (FT2232) extensions
//
UCHAR Rev5; // non-zero if Rev5 chip, zero otherwise
UCHAR IsoInA; // non-zero if in endpoint is isochronous
UCHAR IsoInB; // non-zero if in endpoint is isochronous
UCHAR IsoOutA; // non-zero if out endpoint is isochronous
UCHAR IsoOutB; // non-zero if out endpoint is isochronous
UCHAR PullDownEnable5; // non-zero if pull down enabled
UCHAR SerNumEnable5; // non-zero if serial number to be used
UCHAR USBVersionEnable5; // non-zero if chip uses USBVersion
WORD USBVersion5; // BCD (0x0200 => USB2)
UCHAR AIsHighCurrent; // non-zero if interface is high current
UCHAR BIsHighCurrent; // non-zero if interface is high current
UCHAR IFAIsFifo; // non-zero if interface is 245 FIFO
UCHAR IFAIsFifoTar; // non-zero if interface is 245 FIFO CPU target
UCHAR IFAIsFastSer; // non-zero if interface is Fast serial
UCHAR AIsVCP; // non-zero if interface is to use VCP drivers
UCHAR IFBIsFifo; // non-zero if interface is 245 FIFO

UCHAR IFBIsFifoTar; // non-zero if interface is 245 FIFO CPU target
UCHAR IFBIsFastSer; // non-zero if interface is Fast serial
UCHAR BIsVCP; // non-zero if interface is to use VCP drivers
//
// Rev 6 (FT232R) extensions
//
UCHAR UseExtOsc; // Use External Oscillator
UCHAR HighDriveIOs; // High Drive I/Os
UCHAR EndpointSize; // Endpoint size
UCHAR PullDownEnableR; // non-zero if pull down enabled
UCHAR SerNumEnableR; // non-zero if serial number to be used
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
UCHAR RIsD2XX; // non-zero if using D2XX driver
//
// Rev 7 (FT2232H) Extensions
//
UCHAR PullDownEnable7; // non-zero if pull down enabled
UCHAR SerNumEnable7; // non-zero if serial number to be used
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
UCHAR IFAIsFifo7; // non-zero if interface is 245 FIFO
UCHAR IFAIsFifoTar7; // non-zero if interface is 245 FIFO CPU target
UCHAR IFAIsFastSer7; // non-zero if interface is Fast serial
UCHAR AIsVCP7; // non-zero if interface is to use VCP drivers
UCHAR IFBIsFifo7; // non-zero if interface is 245 FIFO
UCHAR IFBIsFifoTar7; // non-zero if interface is 245 FIFO CPU target
UCHAR IFBIsFastSer7; // non-zero if interface is Fast serial
UCHAR BIsVCP7; // non-zero if interface is to use VCP drivers
UCHAR PowerSaveEnable; // non-zero if using BCBUS7 to save power for self-powered
designs
//
// Rev 8 (FT4232H) Extensions
//
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 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 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 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 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
UCHAR CRIIsTXDEN; // non-zero if port C uses RI as RS485 TXDEN
UCHAR DRIIsTXDEN; // non-zero if port D uses RI as RS485 TXDEN
UCHAR AIsVCP8; // non-zero if interface is to use VCP drivers
UCHAR BIsVCP8; // non-zero if interface is to use VCP drivers
UCHAR CIsVCP8; // non-zero if interface is to use VCP drivers
UCHAR DIsVCP8; // non-zero if interface is to use VCP drivers
//
// Rev 9 (FT232H) Extensions
//
UCHAR PullDownEnableH; // non-zero if pull down enabled
UCHAR SerNumEnableH; // non-zero if serial number to be used
UCHAR ACSlowSlewH; // non-zero if AC pins have slow slew
UCHAR ACSchmittInputH; // non-zero if AC pins are Schmitt input
UCHAR ACDriveCurrentH; // valid values are 4mA, 8mA, 12mA, 16mA
UCHAR ADSlowSlewH; // non-zero if AD pins have slow slew
UCHAR ADSchmittInputH; // non-zero if AD pins are Schmitt input
UCHAR ADDriveCurrentH; // valid values are 4mA, 8mA, 12mA, 16mA
UCHAR Cbus0H; // Cbus Mux control
UCHAR Cbus1H; // Cbus Mux control
UCHAR Cbus2H; // Cbus Mux control
UCHAR Cbus3H; // Cbus Mux control
UCHAR Cbus4H; // Cbus Mux control
UCHAR Cbus5H; // Cbus Mux control
UCHAR Cbus6H; // Cbus Mux control
UCHAR Cbus7H; // Cbus Mux control
UCHAR Cbus8H; // Cbus Mux control
UCHAR Cbus9H; // Cbus Mux control
UCHAR IsFifoH; // non-zero if interface is 245 FIFO
UCHAR IsFifoTarH; // non-zero if interface is 245 FIFO CPU target
UCHAR IsFastSerH; // non-zero if interface is Fast serial
UCHAR IsFT1248H; // non-zero if interface is FT1248
UCHAR FT1248CpolH; // FT1248 clock polarity – clock idle high (1) or clock idle low (0)
UCHAR FT1248LsbH; // FT1248 data is LSB (1) or MSB (0)
UCHAR FT1248FlowControlH; // FT1248 flow control enable
UCHAR IsVCPH; // non-zero if interface is to use VCP drivers
UCHAR PowerSaveEnableH; // non-zero if using ACBUS7 to save power for self-powered
designs
} FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;
EEPROM_HEADER STRUCTURE (See FT_EEPROM_Read and FT_EEPROM_Program)
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;
Win32
OPEN_EXISTING = 3
FILE_ATTRIBUTE_NORMAL = 0x00000080
FILE_FLAG_OVERLAPPED = 0x40000000
GENERIC_READ = 0x80000000
GENERIC_WRITE = 0x40000000
OVERLAPPED structure
typedef struct _OVERLAPPED {
ULONG_PTR Internal;
ULONG_PTR InternalHigh;
union {
struct {
DWORD Offset;
DWORD OffsetHigh;
};
PVOID Pointer;
};
HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED;
CLRDTR = 6 – Clear the DTR signal
CLRRTS = 4 – Clear the RTS signal
SETDTR = 5 – Set the DTR signal
SETRTS = 3 – Set the RTS signal
SETBREAK = 8 – Set the BREAK condition
CLRBREAK = 9 – Clear the BREAK condition
MS_CTS_ON = 0x0010 – Clear To Send (CTS) is on
MS_DSR_ON = 0x0020 – Data Set Ready (DSR) is on
MS_RING_ON = 0x0040 – Ring Indicator (RI) is on
MS_RLSD_ON = 0x0080 – Receive Line Signal Detect (RLSD) is on
FTDCB structure
typedef struct _FTDCB {
DWORD DCBlength; // sizeof(FTDCB)
DWORD BaudRate; // Baud rate at which running
DWORD fBinary: 1; // Binary Mode (skip EOF check)
DWORD fParity: 1; // Enable parity checking
DWORD fOutxCtsFlow:1; // CTS handshaking on output
DWORD fOutxDsrFlow:1; // DSR handshaking on output
DWORD fDtrControl:2; // DTR Flow control
DWORD fDsrSensitivity:1; // DSR Sensitivity
DWORD fTXContinueOnXoff: 1; // Continue TX when Xoff sent
DWORD fOutX: 1; // Enable output X-ON/X-OFF
DWORD fInX: 1; // Enable input X-ON/X-OFF
DWORD fErrorChar: 1; // Enable Err Replacement
DWORD fNull: 1; // Enable Null stripping
DWORD fRtsControl:2; // Rts Flow control
DWORD fAbortOnError:1; // Abort all reads and writes on Error
DWORD fDummy2:17; // Reserved
WORD wReserved; // Not currently used
WORD XonLim; // Transmit X-ON threshold
WORD XoffLim; // Transmit X-OFF threshold

BYTE ByteSize; // Number of bits/byte, 7-8
BYTE Parity; // 0-4=None,Odd,Even,Mark,Space
BYTE StopBits; // 0,2 = 1, 2
char XonChar; // Tx and Rx X-ON character
char XoffChar; // Tx and Rx X-OFF character
char ErrorChar; // Error replacement char
char EofChar; // End of Input character
char EvtChar; // Received Event character
WORD wReserved1; // Fill
} FTDCB, *LPFTDCB;
FTTIMEOUTS structure
typedef struct _FTTIMEOUTS {
DWORD ReadIntervalTimeout; // Maximum time between read chars
DWORD ReadTotalTimeoutMultiplier; // Multiplier of characters
DWORD ReadTotalTimeoutConstant; // Constant in milliseconds
DWORD WriteTotalTimeoutMultiplier; // Multiplier of characters
DWORD WriteTotalTimeoutConstant; // Constant in milliseconds
} FTTIMEOUTS, *LPFTTIMEOUTS;
EV_BREAK = 0x0040 – BREAK condition detected
EV_CTS = 0x0008 – Change in Clear To Send (CTS)
EV_DSR = 0x0010 – Change in Data Set Ready (DSR)
EV_ERR = 0x0080 – Error in line status
EV_RING = 0x0100 – Change in Ring Indicator (RI)
EV_RLSD = 0x0020 – Change in Receive Line Signal Detect (RLSD)
EV_RXCHAR = 0x0001 – Character received
EV_RXFLAG = 0x0002 – Event character received
EV_TXEMPTY = 0x0004 – Transmitter empty
PURGE_TXABORT = 0x0001 – Terminate outstanding overlapped writes
PURGE_RXABORT = 0x0002 – Terminate outstanding overlapped reads
PURGE_TXCLEAR = 0x0004 – Clear the transmit buffer
PURGE_RXCLEAR = 0x0008 – Clear the receive buffer
FTCOMSTAT structure
typedef struct _FTCOMSTAT {
DWORD fCtsHold : 1;
DWORD fDsrHold : 1;
DWORD fRlsdHold : 1;
DWORD fXoffHold : 1;
DWORD fXoffSent : 1;
DWORD fEof : 1;
DWORD fTxim : 1;
DWORD fReserved : 25;
DWORD cbInQue;
DWORD cbOutQue;
} FTCOMSTAT, *LPFTCOMSTAT;

评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容