ftd2xx.h
Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright © 2001-2011 Future Technology Devices International Limited
00004 
00005 THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED "AS IS"
00006 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00007 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
00008 FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00009 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00010 OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION)
00011 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
00012 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00013 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00014 
00015 FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
00016 
00017 FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
00018 
00019 IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE
00020 RESPONSIBILITY OF THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL
00021 RE-CERTIFICATION AS A RESULT OF MAKING THESE CHANGES.
00022 
00023 
00024 Module Name:
00025 
00026 ftd2xx.h
00027 
00028 Abstract:
00029 
00030 Native USB device driver for FTDI FT232x, FT245x, FT2232x and FT4232x devices
00031 FTD2XX library definitions
00032 
00033 Environment:
00034 
00035 kernel & user mode
00036 
00037 
00038 --*/
00039 
00040 
00041 #ifndef FTD2XX_H
00042 #define FTD2XX_H
00043 
00044 // The following ifdef block is the standard way of creating macros
00045 // which make exporting from a DLL simpler.  All files within this DLL
00046 // are compiled with the FTD2XX_EXPORTS symbol defined on the command line.
00047 // This symbol should not be defined on any project that uses this DLL.
00048 // This way any other project whose source files include this file see
00049 // FTD2XX_API functions as being imported from a DLL, whereas this DLL
00050 // sees symbols defined with this macro as being exported.
00051 
00052 #ifdef FTD2XX_EXPORTS
00053 #define FTD2XX_API __declspec(dllexport)
00054 #else
00055 #define FTD2XX_API __declspec(dllimport)
00056 #endif
00057 
00058 #ifndef _WINDOWS
00059 #include <pthread.h>
00060 #include "WinTypes.h"
00062 typedef struct _EVENT_HANDLE{
00063         pthread_cond_t eCondVar;
00064         pthread_mutex_t eMutex;
00065         int iVar;
00066 } EVENT_HANDLE;
00067 #ifdef FTD2XX_API
00068 #undef FTD2XX_API
00069 #define FTD2XX_API
00070 #endif /* FTD2XX_API */
00071 #endif /* _WINDOWS */
00072 
00073 typedef PVOID   FT_HANDLE;
00074 typedef ULONG   FT_STATUS;
00075 
00076 //
00077 // Device status
00078 //
00079 enum {
00080         FT_OK,
00081         FT_INVALID_HANDLE,
00082         FT_DEVICE_NOT_FOUND,
00083         FT_DEVICE_NOT_OPENED,
00084         FT_IO_ERROR,
00085         FT_INSUFFICIENT_RESOURCES,
00086         FT_INVALID_PARAMETER,
00087         FT_INVALID_BAUD_RATE,
00088 
00089         FT_DEVICE_NOT_OPENED_FOR_ERASE,
00090         FT_DEVICE_NOT_OPENED_FOR_WRITE,
00091         FT_FAILED_TO_WRITE_DEVICE,
00092         FT_EEPROM_READ_FAILED,
00093         FT_EEPROM_WRITE_FAILED,
00094         FT_EEPROM_ERASE_FAILED,
00095         FT_EEPROM_NOT_PRESENT,
00096         FT_EEPROM_NOT_PROGRAMMED,
00097         FT_INVALID_ARGS,
00098         FT_NOT_SUPPORTED,
00099         FT_OTHER_ERROR,
00100         FT_DEVICE_LIST_NOT_READY,
00101 };
00102 
00103 
00104 #define FT_SUCCESS(status) ((status) == FT_OK)
00105 
00106 //
00107 // FT_OpenEx Flags
00108 //
00109 
00110 #define FT_OPEN_BY_SERIAL_NUMBER        1
00111 #define FT_OPEN_BY_DESCRIPTION          2
00112 #define FT_OPEN_BY_LOCATION                     4
00113 
00114 #define FT_OPEN_MASK (FT_OPEN_BY_SERIAL_NUMBER | \
00115                       FT_OPEN_BY_DESCRIPTION | \
00116                       FT_OPEN_BY_LOCATION)
00117 
00118 //
00119 // FT_ListDevices Flags (used in conjunction with FT_OpenEx Flags
00120 //
00121 
00122 #define FT_LIST_NUMBER_ONLY                     0x80000000
00123 #define FT_LIST_BY_INDEX                        0x40000000
00124 #define FT_LIST_ALL                                     0x20000000
00125 
00126 #define FT_LIST_MASK (FT_LIST_NUMBER_ONLY|FT_LIST_BY_INDEX|FT_LIST_ALL)
00127 
00128 //
00129 // Baud Rates
00130 //
00131 
00132 #define FT_BAUD_300                     300
00133 #define FT_BAUD_600                     600
00134 #define FT_BAUD_1200            1200
00135 #define FT_BAUD_2400            2400
00136 #define FT_BAUD_4800            4800
00137 #define FT_BAUD_9600            9600
00138 #define FT_BAUD_14400           14400
00139 #define FT_BAUD_19200           19200
00140 #define FT_BAUD_38400           38400
00141 #define FT_BAUD_57600           57600
00142 #define FT_BAUD_115200          115200
00143 #define FT_BAUD_230400          230400
00144 #define FT_BAUD_460800          460800
00145 #define FT_BAUD_921600          921600
00146 
00147 //
00148 // Word Lengths
00149 //
00150 
00151 #define FT_BITS_8                       (UCHAR) 8
00152 #define FT_BITS_7                       (UCHAR) 7
00153 
00154 //
00155 // Stop Bits
00156 //
00157 
00158 #define FT_STOP_BITS_1          (UCHAR) 0
00159 #define FT_STOP_BITS_2          (UCHAR) 2
00160 
00161 //
00162 // Parity
00163 //
00164 
00165 #define FT_PARITY_NONE          (UCHAR) 0
00166 #define FT_PARITY_ODD           (UCHAR) 1
00167 #define FT_PARITY_EVEN          (UCHAR) 2
00168 #define FT_PARITY_MARK          (UCHAR) 3
00169 #define FT_PARITY_SPACE         (UCHAR) 4
00170 
00171 //
00172 // Flow Control
00173 //
00174 
00175 #define FT_FLOW_NONE            0x0000
00176 #define FT_FLOW_RTS_CTS         0x0100
00177 #define FT_FLOW_DTR_DSR         0x0200
00178 #define FT_FLOW_XON_XOFF        0x0400
00179 
00180 //
00181 // Purge rx and tx buffers
00182 //
00183 #define FT_PURGE_RX                     1
00184 #define FT_PURGE_TX                     2
00185 
00186 //
00187 // Events
00188 //
00189 
00190 typedef void (*PFT_EVENT_HANDLER)(DWORD,DWORD);
00191 
00192 #define FT_EVENT_RXCHAR                 1
00193 #define FT_EVENT_MODEM_STATUS   2
00194 #define FT_EVENT_LINE_STATUS    4
00195 
00196 //
00197 // Timeouts
00198 //
00199 
00200 #define FT_DEFAULT_RX_TIMEOUT   300
00201 #define FT_DEFAULT_TX_TIMEOUT   300
00202 
00203 //
00204 // Device types
00205 //
00206 
00207 typedef ULONG   FT_DEVICE;
00208 
00209 enum {
00210         FT_DEVICE_BM,
00211         FT_DEVICE_AM,
00212         FT_DEVICE_100AX,
00213         FT_DEVICE_UNKNOWN,
00214         FT_DEVICE_2232C,
00215         FT_DEVICE_232R,
00216         FT_DEVICE_2232H,
00217         FT_DEVICE_4232H,
00218         FT_DEVICE_232H,
00219         FT_DEVICE_X_SERIES
00220 };
00221 
00222 //
00223 // Bit Modes
00224 //
00225 
00226 #define FT_BITMODE_RESET                                        0x00
00227 #define FT_BITMODE_ASYNC_BITBANG                        0x01
00228 #define FT_BITMODE_MPSSE                                        0x02
00229 #define FT_BITMODE_SYNC_BITBANG                         0x04
00230 #define FT_BITMODE_MCU_HOST                                     0x08
00231 #define FT_BITMODE_FAST_SERIAL                          0x10
00232 #define FT_BITMODE_CBUS_BITBANG                         0x20
00233 #define FT_BITMODE_SYNC_FIFO                            0x40
00234 
00235 //
00236 // FT232R CBUS Options EEPROM values
00237 //
00238 
00239 #define FT_232R_CBUS_TXDEN                                      0x00    //      Tx Data Enable
00240 #define FT_232R_CBUS_PWRON                                      0x01    //      Power On
00241 #define FT_232R_CBUS_RXLED                                      0x02    //      Rx LED
00242 #define FT_232R_CBUS_TXLED                                      0x03    //      Tx LED
00243 #define FT_232R_CBUS_TXRXLED                            0x04    //      Tx and Rx LED
00244 #define FT_232R_CBUS_SLEEP                                      0x05    //      Sleep
00245 #define FT_232R_CBUS_CLK48                                      0x06    //      48MHz clock
00246 #define FT_232R_CBUS_CLK24                                      0x07    //      24MHz clock
00247 #define FT_232R_CBUS_CLK12                                      0x08    //      12MHz clock
00248 #define FT_232R_CBUS_CLK6                                       0x09    //      6MHz clock
00249 #define FT_232R_CBUS_IOMODE                                     0x0A    //      IO Mode for CBUS bit-bang
00250 #define FT_232R_CBUS_BITBANG_WR                         0x0B    //      Bit-bang write strobe
00251 #define FT_232R_CBUS_BITBANG_RD                         0x0C    //      Bit-bang read strobe
00252 
00253 //
00254 // FT232H CBUS Options EEPROM values
00255 //
00256 
00257 #define FT_232H_CBUS_TRISTATE                           0x00    //      Tristate
00258 #define FT_232H_CBUS_TXLED                                      0x01    //      Tx LED
00259 #define FT_232H_CBUS_RXLED                                      0x02    //      Rx LED
00260 #define FT_232H_CBUS_TXRXLED                            0x03    //      Tx and Rx LED
00261 #define FT_232H_CBUS_PWREN                                      0x04    //      Power Enable
00262 #define FT_232H_CBUS_SLEEP                                      0x05    //      Sleep
00263 #define FT_232H_CBUS_DRIVE_0                            0x06    //      Drive pin to logic 0
00264 #define FT_232H_CBUS_DRIVE_1                            0x07    //      Drive pin to logic 1
00265 #define FT_232H_CBUS_IOMODE                                     0x08    //      IO Mode for CBUS bit-bang
00266 #define FT_232H_CBUS_TXDEN                                      0x09    //      Tx Data Enable
00267 #define FT_232H_CBUS_CLK30                                      0x0A    //      30MHz clock
00268 #define FT_232H_CBUS_CLK15                                      0x0B    //      15MHz clock
00269 #define FT_232H_CBUS_CLK7_5                                     0x0C    //      7.5MHz clock
00270 
00271 //
00272 // FT X Series CBUS Options EEPROM values
00273 //
00274 
00275 #define FT_X_SERIES_CBUS_TRISTATE                       0x00    //      Tristate
00276 #define FT_X_SERIES_CBUS_RXLED                          0x01    //      Tx LED
00277 #define FT_X_SERIES_CBUS_TXLED                          0x02    //      Rx LED
00278 #define FT_X_SERIES_CBUS_TXRXLED                        0x03    //      Tx and Rx LED
00279 #define FT_X_SERIES_CBUS_PWREN                          0x04    //      Power Enable
00280 #define FT_X_SERIES_CBUS_SLEEP                          0x05    //      Sleep
00281 #define FT_X_SERIES_CBUS_DRIVE_0                        0x06    //      Drive pin to logic 0
00282 #define FT_X_SERIES_CBUS_DRIVE_1                        0x07    //      Drive pin to logic 1
00283 #define FT_X_SERIES_CBUS_IOMODE                         0x08    //      IO Mode for CBUS bit-bang
00284 #define FT_X_SERIES_CBUS_TXDEN                          0x09    //      Tx Data Enable
00285 #define FT_X_SERIES_CBUS_CLK24                          0x0A    //      24MHz clock
00286 #define FT_X_SERIES_CBUS_CLK12                          0x0B    //      12MHz clock
00287 #define FT_X_SERIES_CBUS_CLK6                           0x0C    //      6MHz clock
00288 #define FT_X_SERIES_CBUS_BCD_CHARGER            0x0D    //      Battery charger detected
00289 #define FT_X_SERIES_CBUS_BCD_CHARGER_N          0x0E    //      Battery charger detected inverted
00290 #define FT_X_SERIES_CBUS_I2C_TXE                        0x0F    //      I2C Tx empty
00291 #define FT_X_SERIES_CBUS_I2C_RXF                        0x10    //      I2C Rx full
00292 #define FT_X_SERIES_CBUS_VBUS_SENSE                     0x11    //      Detect VBUS
00293 #define FT_X_SERIES_CBUS_BITBANG_WR                     0x12    //      Bit-bang write strobe
00294 #define FT_X_SERIES_CBUS_BITBANG_RD                     0x13    //      Bit-bang read strobe
00295 #define FT_X_SERIES_CBUS_TIMESTAMP                      0x14    //      Toggle output when a USB SOF token is received
00296 #define FT_X_SERIES_CBUS_KEEP_AWAKE                     0x15    //      
00297 
00298 
00299 // Driver types
00300 #define FT_DRIVER_TYPE_D2XX             0
00301 #define FT_DRIVER_TYPE_VCP              1
00302 
00303 
00304 
00305 #ifdef __cplusplus
00306 extern "C" {
00307 #endif
00308 
00309 
00310         FTD2XX_API
00311                 FT_STATUS WINAPI FT_Open(
00312                 int deviceNumber,
00313                 FT_HANDLE *pHandle
00314                 );
00315 
00316         FTD2XX_API
00317                 FT_STATUS WINAPI FT_OpenEx(
00318                 PVOID pArg1,
00319                 DWORD Flags,
00320                 FT_HANDLE *pHandle
00321                 );
00322 
00323         FTD2XX_API 
00324                 FT_STATUS WINAPI FT_ListDevices(
00325                 PVOID pArg1,
00326                 PVOID pArg2,
00327                 DWORD Flags
00328                 );
00329 
00330         FTD2XX_API
00331                 FT_STATUS WINAPI FT_Close(
00332                 FT_HANDLE ftHandle
00333                 );
00334 
00335         FTD2XX_API
00336                 FT_STATUS WINAPI FT_Read(
00337                 FT_HANDLE ftHandle,
00338                 LPVOID lpBuffer,
00339                 DWORD dwBytesToRead,
00340                 LPDWORD lpBytesReturned
00341                 );
00342 
00343         FTD2XX_API 
00344                 FT_STATUS WINAPI FT_Write(
00345                 FT_HANDLE ftHandle,
00346                 LPVOID lpBuffer,
00347                 DWORD dwBytesToWrite,
00348                 LPDWORD lpBytesWritten
00349                 );
00350 
00351         FTD2XX_API 
00352                 FT_STATUS WINAPI FT_IoCtl(
00353                 FT_HANDLE ftHandle,
00354                 DWORD dwIoControlCode,
00355                 LPVOID lpInBuf,
00356                 DWORD nInBufSize,
00357                 LPVOID lpOutBuf,
00358                 DWORD nOutBufSize,
00359                 LPDWORD lpBytesReturned,
00360                 LPOVERLAPPED lpOverlapped
00361                 );
00362 
00363         FTD2XX_API
00364                 FT_STATUS WINAPI FT_SetBaudRate(
00365                 FT_HANDLE ftHandle,
00366                 ULONG BaudRate
00367                 );
00368 
00369         FTD2XX_API
00370                 FT_STATUS WINAPI FT_SetDivisor(
00371                 FT_HANDLE ftHandle,
00372                 USHORT Divisor
00373                 );
00374 
00375         FTD2XX_API
00376                 FT_STATUS WINAPI FT_SetDataCharacteristics(
00377                 FT_HANDLE ftHandle,
00378                 UCHAR WordLength,
00379                 UCHAR StopBits,
00380                 UCHAR Parity
00381                 );
00382 
00383         FTD2XX_API
00384                 FT_STATUS WINAPI FT_SetFlowControl(
00385                 FT_HANDLE ftHandle,
00386                 USHORT FlowControl,
00387                 UCHAR XonChar,
00388                 UCHAR XoffChar
00389                 );
00390 
00391         FTD2XX_API
00392                 FT_STATUS WINAPI FT_ResetDevice(
00393                 FT_HANDLE ftHandle
00394                 );
00395 
00396         FTD2XX_API
00397                 FT_STATUS WINAPI FT_SetDtr(
00398                 FT_HANDLE ftHandle
00399                 );
00400 
00401         FTD2XX_API
00402                 FT_STATUS WINAPI FT_ClrDtr(
00403                 FT_HANDLE ftHandle
00404                 );
00405 
00406         FTD2XX_API
00407                 FT_STATUS WINAPI FT_SetRts(
00408                 FT_HANDLE ftHandle
00409                 );
00410 
00411         FTD2XX_API
00412                 FT_STATUS WINAPI FT_ClrRts(
00413                 FT_HANDLE ftHandle
00414                 );
00415 
00416         FTD2XX_API
00417                 FT_STATUS WINAPI FT_GetModemStatus(
00418                 FT_HANDLE ftHandle,
00419                 ULONG *pModemStatus
00420                 );
00421 
00422         FTD2XX_API
00423                 FT_STATUS WINAPI FT_SetChars(
00424                 FT_HANDLE ftHandle,
00425                 UCHAR EventChar,
00426                 UCHAR EventCharEnabled,
00427                 UCHAR ErrorChar,
00428                 UCHAR ErrorCharEnabled
00429                 );
00430 
00431         FTD2XX_API
00432                 FT_STATUS WINAPI FT_Purge(
00433                 FT_HANDLE ftHandle,
00434                 ULONG Mask
00435                 );
00436 
00437         FTD2XX_API
00438                 FT_STATUS WINAPI FT_SetTimeouts(
00439                 FT_HANDLE ftHandle,
00440                 ULONG ReadTimeout,
00441                 ULONG WriteTimeout
00442                 );
00443 
00444         FTD2XX_API
00445                 FT_STATUS WINAPI FT_GetQueueStatus(
00446                 FT_HANDLE ftHandle,
00447                 DWORD *dwRxBytes
00448                 );
00449 
00450         FTD2XX_API
00451                 FT_STATUS WINAPI FT_SetEventNotification(
00452                 FT_HANDLE ftHandle,
00453                 DWORD Mask,
00454                 PVOID Param
00455                 );
00456 
00457         FTD2XX_API
00458                 FT_STATUS WINAPI FT_GetStatus(
00459                 FT_HANDLE ftHandle,
00460                 DWORD *dwRxBytes,
00461                 DWORD *dwTxBytes,
00462                 DWORD *dwEventDWord
00463                 );
00464 
00465         FTD2XX_API
00466                 FT_STATUS WINAPI FT_SetBreakOn(
00467                 FT_HANDLE ftHandle
00468                 );
00469 
00470         FTD2XX_API
00471                 FT_STATUS WINAPI FT_SetBreakOff(
00472                 FT_HANDLE ftHandle
00473                 );
00474 
00475         FTD2XX_API
00476                 FT_STATUS WINAPI FT_SetWaitMask(
00477                 FT_HANDLE ftHandle,
00478                 DWORD Mask
00479                 );
00480 
00481         FTD2XX_API
00482                 FT_STATUS WINAPI FT_WaitOnMask(
00483                 FT_HANDLE ftHandle,
00484                 DWORD *Mask
00485                 );
00486 
00487         FTD2XX_API
00488                 FT_STATUS WINAPI FT_GetEventStatus(
00489                 FT_HANDLE ftHandle,
00490                 DWORD *dwEventDWord
00491                 );
00492 
00493         FTD2XX_API
00494                 FT_STATUS WINAPI FT_ReadEE(
00495                 FT_HANDLE ftHandle,
00496                 DWORD dwWordOffset,
00497                 LPWORD lpwValue
00498                 );
00499 
00500         FTD2XX_API
00501                 FT_STATUS WINAPI FT_WriteEE(
00502                 FT_HANDLE ftHandle,
00503                 DWORD dwWordOffset,
00504                 WORD wValue
00505                 );
00506 
00507         FTD2XX_API
00508                 FT_STATUS WINAPI FT_EraseEE(
00509                 FT_HANDLE ftHandle
00510                 );
00511 
00512         //
00513         // structure to hold program data for FT_EE_Program, FT_EE_ProgramEx, FT_EE_Read 
00514         // and FT_EE_ReadEx functions
00515         //
00516         typedef struct ft_program_data {
00517 
00518                 DWORD Signature1;                       // Header - must be 0x00000000 
00519                 DWORD Signature2;                       // Header - must be 0xffffffff
00520                 DWORD Version;                          // Header - FT_PROGRAM_DATA version
00521                 //                      0 = original
00522                 //                      1 = FT2232 extensions
00523                 //                      2 = FT232R extensions
00524                 //                      3 = FT2232H extensions
00525                 //                      4 = FT4232H extensions
00526                 //                      5 = FT232H extensions
00527 
00528                 WORD VendorId;                          // 0x0403
00529                 WORD ProductId;                         // 0x6001
00530                 char *Manufacturer;                     // "FTDI"
00531                 char *ManufacturerId;           // "FT"
00532                 char *Description;                      // "USB HS Serial Converter"
00533                 char *SerialNumber;                     // "FT000001" if fixed, or NULL
00534                 WORD MaxPower;                          // 0 < MaxPower <= 500
00535                 WORD PnP;                                       // 0 = disabled, 1 = enabled
00536                 WORD SelfPowered;                       // 0 = bus powered, 1 = self powered
00537                 WORD RemoteWakeup;                      // 0 = not capable, 1 = capable
00538                 //
00539                 // Rev4 (FT232B) extensions
00540                 //
00541                 UCHAR Rev4;                                     // non-zero if Rev4 chip, zero otherwise
00542                 UCHAR IsoIn;                            // non-zero if in endpoint is isochronous
00543                 UCHAR IsoOut;                           // non-zero if out endpoint is isochronous
00544                 UCHAR PullDownEnable;           // non-zero if pull down enabled
00545                 UCHAR SerNumEnable;                     // non-zero if serial number to be used
00546                 UCHAR USBVersionEnable;         // non-zero if chip uses USBVersion
00547                 WORD USBVersion;                        // BCD (0x0200 => USB2)
00548                 //
00549                 // Rev 5 (FT2232) extensions
00550                 //
00551                 UCHAR Rev5;                                     // non-zero if Rev5 chip, zero otherwise
00552                 UCHAR IsoInA;                           // non-zero if in endpoint is isochronous
00553                 UCHAR IsoInB;                           // non-zero if in endpoint is isochronous
00554                 UCHAR IsoOutA;                          // non-zero if out endpoint is isochronous
00555                 UCHAR IsoOutB;                          // non-zero if out endpoint is isochronous
00556                 UCHAR PullDownEnable5;          // non-zero if pull down enabled
00557                 UCHAR SerNumEnable5;            // non-zero if serial number to be used
00558                 UCHAR USBVersionEnable5;        // non-zero if chip uses USBVersion
00559                 WORD USBVersion5;                       // BCD (0x0200 => USB2)
00560                 UCHAR AIsHighCurrent;           // non-zero if interface is high current
00561                 UCHAR BIsHighCurrent;           // non-zero if interface is high current
00562                 UCHAR IFAIsFifo;                        // non-zero if interface is 245 FIFO
00563                 UCHAR IFAIsFifoTar;                     // non-zero if interface is 245 FIFO CPU target
00564                 UCHAR IFAIsFastSer;                     // non-zero if interface is Fast serial
00565                 UCHAR AIsVCP;                           // non-zero if interface is to use VCP drivers
00566                 UCHAR IFBIsFifo;                        // non-zero if interface is 245 FIFO
00567                 UCHAR IFBIsFifoTar;                     // non-zero if interface is 245 FIFO CPU target
00568                 UCHAR IFBIsFastSer;                     // non-zero if interface is Fast serial
00569                 UCHAR BIsVCP;                           // non-zero if interface is to use VCP drivers
00570                 //
00571                 // Rev 6 (FT232R) extensions
00572                 //
00573                 UCHAR UseExtOsc;                        // Use External Oscillator
00574                 UCHAR HighDriveIOs;                     // High Drive I/Os
00575                 UCHAR EndpointSize;                     // Endpoint size
00576                 UCHAR PullDownEnableR;          // non-zero if pull down enabled
00577                 UCHAR SerNumEnableR;            // non-zero if serial number to be used
00578                 UCHAR InvertTXD;                        // non-zero if invert TXD
00579                 UCHAR InvertRXD;                        // non-zero if invert RXD
00580                 UCHAR InvertRTS;                        // non-zero if invert RTS
00581                 UCHAR InvertCTS;                        // non-zero if invert CTS
00582                 UCHAR InvertDTR;                        // non-zero if invert DTR
00583                 UCHAR InvertDSR;                        // non-zero if invert DSR
00584                 UCHAR InvertDCD;                        // non-zero if invert DCD
00585                 UCHAR InvertRI;                         // non-zero if invert RI
00586                 UCHAR Cbus0;                            // Cbus Mux control
00587                 UCHAR Cbus1;                            // Cbus Mux control
00588                 UCHAR Cbus2;                            // Cbus Mux control
00589                 UCHAR Cbus3;                            // Cbus Mux control
00590                 UCHAR Cbus4;                            // Cbus Mux control
00591                 UCHAR RIsD2XX;                          // non-zero if using D2XX driver
00592                 //
00593                 // Rev 7 (FT2232H) Extensions
00594                 //
00595                 UCHAR PullDownEnable7;          // non-zero if pull down enabled
00596                 UCHAR SerNumEnable7;            // non-zero if serial number to be used
00597                 UCHAR ALSlowSlew;                       // non-zero if AL pins have slow slew
00598                 UCHAR ALSchmittInput;           // non-zero if AL pins are Schmitt input
00599                 UCHAR ALDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00600                 UCHAR AHSlowSlew;                       // non-zero if AH pins have slow slew
00601                 UCHAR AHSchmittInput;           // non-zero if AH pins are Schmitt input
00602                 UCHAR AHDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00603                 UCHAR BLSlowSlew;                       // non-zero if BL pins have slow slew
00604                 UCHAR BLSchmittInput;           // non-zero if BL pins are Schmitt input
00605                 UCHAR BLDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00606                 UCHAR BHSlowSlew;                       // non-zero if BH pins have slow slew
00607                 UCHAR BHSchmittInput;           // non-zero if BH pins are Schmitt input
00608                 UCHAR BHDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00609                 UCHAR IFAIsFifo7;                       // non-zero if interface is 245 FIFO
00610                 UCHAR IFAIsFifoTar7;            // non-zero if interface is 245 FIFO CPU target
00611                 UCHAR IFAIsFastSer7;            // non-zero if interface is Fast serial
00612                 UCHAR AIsVCP7;                          // non-zero if interface is to use VCP drivers
00613                 UCHAR IFBIsFifo7;                       // non-zero if interface is 245 FIFO
00614                 UCHAR IFBIsFifoTar7;            // non-zero if interface is 245 FIFO CPU target
00615                 UCHAR IFBIsFastSer7;            // non-zero if interface is Fast serial
00616                 UCHAR BIsVCP7;                          // non-zero if interface is to use VCP drivers
00617                 UCHAR PowerSaveEnable;          // non-zero if using BCBUS7 to save power for self-powered designs
00618                 //
00619                 // Rev 8 (FT4232H) Extensions
00620                 //
00621                 UCHAR PullDownEnable8;          // non-zero if pull down enabled
00622                 UCHAR SerNumEnable8;            // non-zero if serial number to be used
00623                 UCHAR ASlowSlew;                        // non-zero if A pins have slow slew
00624                 UCHAR ASchmittInput;            // non-zero if A pins are Schmitt input
00625                 UCHAR ADriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00626                 UCHAR BSlowSlew;                        // non-zero if B pins have slow slew
00627                 UCHAR BSchmittInput;            // non-zero if B pins are Schmitt input
00628                 UCHAR BDriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00629                 UCHAR CSlowSlew;                        // non-zero if C pins have slow slew
00630                 UCHAR CSchmittInput;            // non-zero if C pins are Schmitt input
00631                 UCHAR CDriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00632                 UCHAR DSlowSlew;                        // non-zero if D pins have slow slew
00633                 UCHAR DSchmittInput;            // non-zero if D pins are Schmitt input
00634                 UCHAR DDriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00635                 UCHAR ARIIsTXDEN;                       // non-zero if port A uses RI as RS485 TXDEN
00636                 UCHAR BRIIsTXDEN;                       // non-zero if port B uses RI as RS485 TXDEN
00637                 UCHAR CRIIsTXDEN;                       // non-zero if port C uses RI as RS485 TXDEN
00638                 UCHAR DRIIsTXDEN;                       // non-zero if port D uses RI as RS485 TXDEN
00639                 UCHAR AIsVCP8;                          // non-zero if interface is to use VCP drivers
00640                 UCHAR BIsVCP8;                          // non-zero if interface is to use VCP drivers
00641                 UCHAR CIsVCP8;                          // non-zero if interface is to use VCP drivers
00642                 UCHAR DIsVCP8;                          // non-zero if interface is to use VCP drivers
00643                 //
00644                 // Rev 9 (FT232H) Extensions
00645                 //
00646                 UCHAR PullDownEnableH;          // non-zero if pull down enabled
00647                 UCHAR SerNumEnableH;            // non-zero if serial number to be used
00648                 UCHAR ACSlowSlewH;                      // non-zero if AC pins have slow slew
00649                 UCHAR ACSchmittInputH;          // non-zero if AC pins are Schmitt input
00650                 UCHAR ACDriveCurrentH;          // valid values are 4mA, 8mA, 12mA, 16mA
00651                 UCHAR ADSlowSlewH;                      // non-zero if AD pins have slow slew
00652                 UCHAR ADSchmittInputH;          // non-zero if AD pins are Schmitt input
00653                 UCHAR ADDriveCurrentH;          // valid values are 4mA, 8mA, 12mA, 16mA
00654                 UCHAR Cbus0H;                           // Cbus Mux control
00655                 UCHAR Cbus1H;                           // Cbus Mux control
00656                 UCHAR Cbus2H;                           // Cbus Mux control
00657                 UCHAR Cbus3H;                           // Cbus Mux control
00658                 UCHAR Cbus4H;                           // Cbus Mux control
00659                 UCHAR Cbus5H;                           // Cbus Mux control
00660                 UCHAR Cbus6H;                           // Cbus Mux control
00661                 UCHAR Cbus7H;                           // Cbus Mux control
00662                 UCHAR Cbus8H;                           // Cbus Mux control
00663                 UCHAR Cbus9H;                           // Cbus Mux control
00664                 UCHAR IsFifoH;                          // non-zero if interface is 245 FIFO
00665                 UCHAR IsFifoTarH;                       // non-zero if interface is 245 FIFO CPU target
00666                 UCHAR IsFastSerH;                       // non-zero if interface is Fast serial
00667                 UCHAR IsFT1248H;                        // non-zero if interface is FT1248
00668                 UCHAR FT1248CpolH;                      // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
00669                 UCHAR FT1248LsbH;                       // FT1248 data is LSB (1) or MSB (0)
00670                 UCHAR FT1248FlowControlH;       // FT1248 flow control enable
00671                 UCHAR IsVCPH;                           // non-zero if interface is to use VCP drivers
00672                 UCHAR PowerSaveEnableH;         // non-zero if using ACBUS7 to save power for self-powered designs
00673                 
00674         } FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;
00675 
00676         FTD2XX_API
00677                 FT_STATUS WINAPI FT_EE_Program(
00678                 FT_HANDLE ftHandle,
00679                 PFT_PROGRAM_DATA pData
00680                 );
00681 
00682         FTD2XX_API
00683                 FT_STATUS WINAPI FT_EE_ProgramEx(
00684                 FT_HANDLE ftHandle,
00685                 PFT_PROGRAM_DATA pData,
00686                 char *Manufacturer,
00687                 char *ManufacturerId,
00688                 char *Description,
00689                 char *SerialNumber
00690                 );
00691 
00692         FTD2XX_API
00693                 FT_STATUS WINAPI FT_EE_Read(
00694                 FT_HANDLE ftHandle,
00695                 PFT_PROGRAM_DATA pData
00696                 );
00697 
00698         FTD2XX_API
00699                 FT_STATUS WINAPI FT_EE_ReadEx(
00700                 FT_HANDLE ftHandle,
00701                 PFT_PROGRAM_DATA pData,
00702                 char *Manufacturer,
00703                 char *ManufacturerId,
00704                 char *Description,
00705                 char *SerialNumber
00706                 );
00707 
00708         FTD2XX_API
00709                 FT_STATUS WINAPI FT_EE_UASize(
00710                 FT_HANDLE ftHandle,
00711                 LPDWORD lpdwSize
00712                 );
00713 
00714         FTD2XX_API
00715                 FT_STATUS WINAPI FT_EE_UAWrite(
00716                 FT_HANDLE ftHandle,
00717                 PUCHAR pucData,
00718                 DWORD dwDataLen
00719                 );
00720 
00721         FTD2XX_API
00722                 FT_STATUS WINAPI FT_EE_UARead(
00723                 FT_HANDLE ftHandle,
00724                 PUCHAR pucData,
00725                 DWORD dwDataLen,
00726                 LPDWORD lpdwBytesRead
00727                 );
00728 
00729 
00730         typedef struct ft_eeprom_header {
00731                 FT_DEVICE deviceType;           // FTxxxx device type to be programmed
00732                 // Device descriptor options
00733                 WORD VendorId;                          // 0x0403
00734                 WORD ProductId;                         // 0x6001
00735                 UCHAR SerNumEnable;                     // non-zero if serial number to be used
00736                 // Config descriptor options
00737                 WORD MaxPower;                          // 0 < MaxPower <= 500
00738                 UCHAR SelfPowered;                      // 0 = bus powered, 1 = self powered
00739                 UCHAR RemoteWakeup;                     // 0 = not capable, 1 = capable
00740                 // Hardware options
00741                 UCHAR PullDownEnable;           // non-zero if pull down in suspend enabled
00742         } FT_EEPROM_HEADER, *PFT_EEPROM_HEADER;
00743 
00744 
00745         // FT232B EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00746         typedef struct ft_eeprom_232b {
00747                 // Common header
00748                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00749         } FT_EEPROM_232B, *PFT_EEPROM_232B;
00750 
00751 
00752         // FT2232 EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00753         typedef struct ft_eeprom_2232 {
00754                 // Common header
00755                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00756                 // Drive options
00757                 UCHAR AIsHighCurrent;           // non-zero if interface is high current
00758                 UCHAR BIsHighCurrent;           // non-zero if interface is high current
00759                 // Hardware options
00760                 UCHAR AIsFifo;                          // non-zero if interface is 245 FIFO
00761                 UCHAR AIsFifoTar;                       // non-zero if interface is 245 FIFO CPU target
00762                 UCHAR AIsFastSer;                       // non-zero if interface is Fast serial
00763                 UCHAR BIsFifo;                          // non-zero if interface is 245 FIFO
00764                 UCHAR BIsFifoTar;                       // non-zero if interface is 245 FIFO CPU target
00765                 UCHAR BIsFastSer;                       // non-zero if interface is Fast serial
00766                 // Driver option
00767                 UCHAR ADriverType;                      // 
00768                 UCHAR BDriverType;                      // 
00769         } FT_EEPROM_2232, *PFT_EEPROM_2232;
00770 
00771 
00772         // FT232R EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00773         typedef struct ft_eeprom_232r {
00774                 // Common header
00775                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00776                 // Drive options
00777                 UCHAR IsHighCurrent;            // non-zero if interface is high current
00778                 // Hardware options
00779                 UCHAR UseExtOsc;                        // Use External Oscillator
00780                 UCHAR InvertTXD;                        // non-zero if invert TXD
00781                 UCHAR InvertRXD;                        // non-zero if invert RXD
00782                 UCHAR InvertRTS;                        // non-zero if invert RTS
00783                 UCHAR InvertCTS;                        // non-zero if invert CTS
00784                 UCHAR InvertDTR;                        // non-zero if invert DTR
00785                 UCHAR InvertDSR;                        // non-zero if invert DSR
00786                 UCHAR InvertDCD;                        // non-zero if invert DCD
00787                 UCHAR InvertRI;                         // non-zero if invert RI
00788                 UCHAR Cbus0;                            // Cbus Mux control
00789                 UCHAR Cbus1;                            // Cbus Mux control
00790                 UCHAR Cbus2;                            // Cbus Mux control
00791                 UCHAR Cbus3;                            // Cbus Mux control
00792                 UCHAR Cbus4;                            // Cbus Mux control
00793                 // Driver option
00794                 UCHAR DriverType;                       // 
00795         } FT_EEPROM_232R, *PFT_EEPROM_232R;
00796 
00797 
00798         // FT2232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00799         typedef struct ft_eeprom_2232h {
00800                 // Common header
00801                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00802                 // Drive options
00803                 UCHAR ALSlowSlew;                       // non-zero if AL pins have slow slew
00804                 UCHAR ALSchmittInput;           // non-zero if AL pins are Schmitt input
00805                 UCHAR ALDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00806                 UCHAR AHSlowSlew;                       // non-zero if AH pins have slow slew
00807                 UCHAR AHSchmittInput;           // non-zero if AH pins are Schmitt input
00808                 UCHAR AHDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00809                 UCHAR BLSlowSlew;                       // non-zero if BL pins have slow slew
00810                 UCHAR BLSchmittInput;           // non-zero if BL pins are Schmitt input
00811                 UCHAR BLDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00812                 UCHAR BHSlowSlew;                       // non-zero if BH pins have slow slew
00813                 UCHAR BHSchmittInput;           // non-zero if BH pins are Schmitt input
00814                 UCHAR BHDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00815                 // Hardware options
00816                 UCHAR AIsFifo;                          // non-zero if interface is 245 FIFO
00817                 UCHAR AIsFifoTar;                       // non-zero if interface is 245 FIFO CPU target
00818                 UCHAR AIsFastSer;                       // non-zero if interface is Fast serial
00819                 UCHAR BIsFifo;                          // non-zero if interface is 245 FIFO
00820                 UCHAR BIsFifoTar;                       // non-zero if interface is 245 FIFO CPU target
00821                 UCHAR BIsFastSer;                       // non-zero if interface is Fast serial
00822                 UCHAR PowerSaveEnable;          // non-zero if using BCBUS7 to save power for self-powered designs
00823                 // Driver option
00824                 UCHAR ADriverType;                      // 
00825                 UCHAR BDriverType;                      // 
00826         } FT_EEPROM_2232H, *PFT_EEPROM_2232H;
00827 
00828 
00829         // FT4232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00830         typedef struct ft_eeprom_4232h {
00831                 // Common header
00832                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00833                 // Drive options
00834                 UCHAR ASlowSlew;                        // non-zero if A pins have slow slew
00835                 UCHAR ASchmittInput;            // non-zero if A pins are Schmitt input
00836                 UCHAR ADriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00837                 UCHAR BSlowSlew;                        // non-zero if B pins have slow slew
00838                 UCHAR BSchmittInput;            // non-zero if B pins are Schmitt input
00839                 UCHAR BDriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00840                 UCHAR CSlowSlew;                        // non-zero if C pins have slow slew
00841                 UCHAR CSchmittInput;            // non-zero if C pins are Schmitt input
00842                 UCHAR CDriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00843                 UCHAR DSlowSlew;                        // non-zero if D pins have slow slew
00844                 UCHAR DSchmittInput;            // non-zero if D pins are Schmitt input
00845                 UCHAR DDriveCurrent;            // valid values are 4mA, 8mA, 12mA, 16mA
00846                 // Hardware options
00847                 UCHAR ARIIsTXDEN;                       // non-zero if port A uses RI as RS485 TXDEN
00848                 UCHAR BRIIsTXDEN;                       // non-zero if port B uses RI as RS485 TXDEN
00849                 UCHAR CRIIsTXDEN;                       // non-zero if port C uses RI as RS485 TXDEN
00850                 UCHAR DRIIsTXDEN;                       // non-zero if port D uses RI as RS485 TXDEN
00851                 // Driver option
00852                 UCHAR ADriverType;                      // 
00853                 UCHAR BDriverType;                      // 
00854                 UCHAR CDriverType;                      // 
00855                 UCHAR DDriverType;                      // 
00856         } FT_EEPROM_4232H, *PFT_EEPROM_4232H;
00857 
00858 
00859         // FT232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00860         typedef struct ft_eeprom_232h {
00861                 // Common header
00862                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00863                 // Drive options
00864                 UCHAR ACSlowSlew;                       // non-zero if AC bus pins have slow slew
00865                 UCHAR ACSchmittInput;           // non-zero if AC bus pins are Schmitt input
00866                 UCHAR ACDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00867                 UCHAR ADSlowSlew;                       // non-zero if AD bus pins have slow slew
00868                 UCHAR ADSchmittInput;           // non-zero if AD bus pins are Schmitt input
00869                 UCHAR ADDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00870                 // CBUS options
00871                 UCHAR Cbus0;                            // Cbus Mux control
00872                 UCHAR Cbus1;                            // Cbus Mux control
00873                 UCHAR Cbus2;                            // Cbus Mux control
00874                 UCHAR Cbus3;                            // Cbus Mux control
00875                 UCHAR Cbus4;                            // Cbus Mux control
00876                 UCHAR Cbus5;                            // Cbus Mux control
00877                 UCHAR Cbus6;                            // Cbus Mux control
00878                 UCHAR Cbus7;                            // Cbus Mux control
00879                 UCHAR Cbus8;                            // Cbus Mux control
00880                 UCHAR Cbus9;                            // Cbus Mux control
00881                 // FT1248 options
00882                 UCHAR FT1248Cpol;                       // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
00883                 UCHAR FT1248Lsb;                        // FT1248 data is LSB (1) or MSB (0)
00884                 UCHAR FT1248FlowControl;        // FT1248 flow control enable
00885                 // Hardware options
00886                 UCHAR IsFifo;                           // non-zero if interface is 245 FIFO
00887                 UCHAR IsFifoTar;                        // non-zero if interface is 245 FIFO CPU target
00888                 UCHAR IsFastSer;                        // non-zero if interface is Fast serial
00889                 UCHAR IsFT1248  ;                       // non-zero if interface is FT1248
00890                 UCHAR PowerSaveEnable;          // 
00891                 // Driver option
00892                 UCHAR DriverType;                       // 
00893         } FT_EEPROM_232H, *PFT_EEPROM_232H;
00894 
00895 
00896         // FT X Series EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
00897         typedef struct ft_eeprom_x_series {
00898                 // Common header
00899                 FT_EEPROM_HEADER common;        // common elements for all device EEPROMs
00900                 // Drive options
00901                 UCHAR ACSlowSlew;                       // non-zero if AC bus pins have slow slew
00902                 UCHAR ACSchmittInput;           // non-zero if AC bus pins are Schmitt input
00903                 UCHAR ACDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00904                 UCHAR ADSlowSlew;                       // non-zero if AD bus pins have slow slew
00905                 UCHAR ADSchmittInput;           // non-zero if AD bus pins are Schmitt input
00906                 UCHAR ADDriveCurrent;           // valid values are 4mA, 8mA, 12mA, 16mA
00907                 // CBUS options
00908                 UCHAR Cbus0;                            // Cbus Mux control
00909                 UCHAR Cbus1;                            // Cbus Mux control
00910                 UCHAR Cbus2;                            // Cbus Mux control
00911                 UCHAR Cbus3;                            // Cbus Mux control
00912                 UCHAR Cbus4;                            // Cbus Mux control
00913                 UCHAR Cbus5;                            // Cbus Mux control
00914                 UCHAR Cbus6;                            // Cbus Mux control
00915                 // UART signal options
00916                 UCHAR InvertTXD;                        // non-zero if invert TXD
00917                 UCHAR InvertRXD;                        // non-zero if invert RXD
00918                 UCHAR InvertRTS;                        // non-zero if invert RTS
00919                 UCHAR InvertCTS;                        // non-zero if invert CTS
00920                 UCHAR InvertDTR;                        // non-zero if invert DTR
00921                 UCHAR InvertDSR;                        // non-zero if invert DSR
00922                 UCHAR InvertDCD;                        // non-zero if invert DCD
00923                 UCHAR InvertRI;                         // non-zero if invert RI
00924                 // Battery Charge Detect options
00925                 UCHAR BCDEnable;                        // Enable Battery Charger Detection
00926                 UCHAR BCDForceCbusPWREN;        // asserts the power enable signal on CBUS when charging port detected
00927                 UCHAR BCDDisableSleep;          // forces the device never to go into sleep mode
00928                 // I2C options
00929                 WORD I2CSlaveAddress;           // I2C slave device address
00930                 DWORD I2CDeviceId;                      // I2C device ID
00931                 UCHAR I2CDisableSchmitt;        // Disable I2C Schmitt trigger
00932                 // FT1248 options
00933                 UCHAR FT1248Cpol;                       // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
00934                 UCHAR FT1248Lsb;                        // FT1248 data is LSB (1) or MSB (0)
00935                 UCHAR FT1248FlowControl;        // FT1248 flow control enable
00936                 // Hardware options
00937                 UCHAR RS485EchoSuppress;        // 
00938                 UCHAR PowerSaveEnable;          // 
00939                 // Driver option
00940                 UCHAR DriverType;                       // 
00941         } FT_EEPROM_X_SERIES, *PFT_EEPROM_X_SERIES;
00942 
00943 
00944         FTD2XX_API
00945                 FT_STATUS WINAPI FT_EEPROM_Read(
00946                 FT_HANDLE ftHandle,
00947                 void *eepromData,
00948                 DWORD eepromDataSize,
00949                 char *Manufacturer,
00950                 char *ManufacturerId,
00951                 char *Description,
00952                 char *SerialNumber
00953                 );
00954 
00955 
00956         FTD2XX_API
00957                 FT_STATUS WINAPI FT_EEPROM_Program(
00958                 FT_HANDLE ftHandle,
00959                 void *eepromData,
00960                 DWORD eepromDataSize,
00961                 char *Manufacturer,
00962                 char *ManufacturerId,
00963                 char *Description,
00964                 char *SerialNumber
00965                 );
00966 
00967 
00968         FTD2XX_API
00969                 FT_STATUS WINAPI FT_SetLatencyTimer(
00970                 FT_HANDLE ftHandle,
00971                 UCHAR ucLatency
00972                 );
00973 
00974         FTD2XX_API
00975                 FT_STATUS WINAPI FT_GetLatencyTimer(
00976                 FT_HANDLE ftHandle,
00977                 PUCHAR pucLatency
00978                 );
00979 
00980         FTD2XX_API
00981                 FT_STATUS WINAPI FT_SetBitMode(
00982                 FT_HANDLE ftHandle,
00983                 UCHAR ucMask,
00984                 UCHAR ucEnable
00985                 );
00986 
00987         FTD2XX_API
00988                 FT_STATUS WINAPI FT_GetBitMode(
00989                 FT_HANDLE ftHandle,
00990                 PUCHAR pucMode
00991                 );
00992 
00993         FTD2XX_API
00994                 FT_STATUS WINAPI FT_SetUSBParameters(
00995                 FT_HANDLE ftHandle,
00996                 ULONG ulInTransferSize,
00997                 ULONG ulOutTransferSize
00998                 );
00999 
01000 #ifdef _WINDOWS
01001         FTD2XX_API
01002                 FT_STATUS WINAPI FT_SetDeadmanTimeout(
01003                 FT_HANDLE ftHandle,
01004                 ULONG ulDeadmanTimeout
01005                 );
01006 #else
01007         /* Linux, Mac etc. define FT_SetDeadmanTimeout differently elsewhere. */
01008         
01009         /* Linux etc. offer extra functions to compensate for lack of .INF file
01010          * to specify VID+PID combinations.
01011          */
01012         FTD2XX_API
01013                 FT_STATUS FT_SetVIDPID(
01014                 DWORD dwVID, 
01015                 DWORD dwPID
01016                 );
01017                         
01018         FTD2XX_API
01019                 FT_STATUS FT_GetVIDPID(
01020                 DWORD * pdwVID, 
01021                 DWORD * pdwPID
01022                 );
01023 
01024         FTD2XX_API
01025                 FT_STATUS WINAPI FT_GetDeviceLocId(
01026                 FT_HANDLE ftHandle,
01027                 LPDWORD lpdwLocId
01028                 );
01029 #endif /* _WINDOWS */           
01030                 
01031         FTD2XX_API
01032                 FT_STATUS WINAPI FT_GetDeviceInfo(
01033                 FT_HANDLE ftHandle,
01034                 FT_DEVICE *lpftDevice,
01035                 LPDWORD lpdwID,
01036                 PCHAR SerialNumber,
01037                 PCHAR Description,
01038                 LPVOID Dummy
01039                 );
01040 
01041         FTD2XX_API
01042                 FT_STATUS WINAPI FT_StopInTask(
01043                 FT_HANDLE ftHandle
01044                 );
01045 
01046         FTD2XX_API
01047                 FT_STATUS WINAPI FT_RestartInTask(
01048                 FT_HANDLE ftHandle
01049                 );
01050 
01051         FTD2XX_API
01052                 FT_STATUS WINAPI FT_SetResetPipeRetryCount(
01053                 FT_HANDLE ftHandle,
01054                 DWORD dwCount
01055                 );
01056 
01057         FTD2XX_API
01058                 FT_STATUS WINAPI FT_ResetPort(
01059                 FT_HANDLE ftHandle
01060                 );
01061 
01062         FTD2XX_API
01063                 FT_STATUS WINAPI FT_CyclePort(
01064                 FT_HANDLE ftHandle
01065                 );
01066 
01067 
01068         //
01069         // Win32-type functions
01070         //
01071 
01072         FTD2XX_API
01073                 FT_HANDLE WINAPI FT_W32_CreateFile(
01074                 LPCTSTR                                 lpszName,
01075                 DWORD                                   dwAccess,
01076                 DWORD                                   dwShareMode,
01077                 LPSECURITY_ATTRIBUTES   lpSecurityAttributes,
01078                 DWORD                                   dwCreate,
01079                 DWORD                                   dwAttrsAndFlags,
01080                 HANDLE                                  hTemplate
01081                 );
01082 
01083         FTD2XX_API
01084                 BOOL WINAPI FT_W32_CloseHandle(
01085                 FT_HANDLE ftHandle
01086                 );
01087 
01088         FTD2XX_API
01089                 BOOL WINAPI FT_W32_ReadFile(
01090                 FT_HANDLE ftHandle,
01091                 LPVOID lpBuffer,
01092                 DWORD nBufferSize,
01093                 LPDWORD lpBytesReturned,
01094                 LPOVERLAPPED lpOverlapped
01095                 );
01096 
01097         FTD2XX_API
01098                 BOOL WINAPI FT_W32_WriteFile(
01099                 FT_HANDLE ftHandle,
01100                 LPVOID lpBuffer,
01101                 DWORD nBufferSize,
01102                 LPDWORD lpBytesWritten,
01103                 LPOVERLAPPED lpOverlapped
01104                 );
01105 
01106         FTD2XX_API
01107                 DWORD WINAPI FT_W32_GetLastError(
01108                 FT_HANDLE ftHandle
01109                 );
01110 
01111         FTD2XX_API
01112                 BOOL WINAPI FT_W32_GetOverlappedResult(
01113                 FT_HANDLE ftHandle,
01114                 LPOVERLAPPED lpOverlapped,
01115                 LPDWORD lpdwBytesTransferred,
01116                 BOOL bWait
01117                 );
01118 
01119         FTD2XX_API
01120                 BOOL WINAPI FT_W32_CancelIo(
01121                 FT_HANDLE ftHandle
01122                 );
01123 
01124 
01125         //
01126         // Win32 COMM API type functions
01127         //
01128         typedef struct _FTCOMSTAT {
01129                 DWORD fCtsHold : 1;
01130                 DWORD fDsrHold : 1;
01131                 DWORD fRlsdHold : 1;
01132                 DWORD fXoffHold : 1;
01133                 DWORD fXoffSent : 1;
01134                 DWORD fEof : 1;
01135                 DWORD fTxim : 1;
01136                 DWORD fReserved : 25;
01137                 DWORD cbInQue;
01138                 DWORD cbOutQue;
01139         } FTCOMSTAT, *LPFTCOMSTAT;
01140 
01141         typedef struct _FTDCB {
01142                 DWORD DCBlength;                        /* sizeof(FTDCB)                                                */
01143                 DWORD BaudRate;                         /* Baudrate at which running                    */
01144                 DWORD fBinary: 1;                       /* Binary Mode (skip EOF check)                 */
01145                 DWORD fParity: 1;                       /* Enable parity checking                               */
01146                 DWORD fOutxCtsFlow:1;           /* CTS handshaking on output                    */
01147                 DWORD fOutxDsrFlow:1;           /* DSR handshaking on output                    */
01148                 DWORD fDtrControl:2;            /* DTR Flow control                                             */
01149                 DWORD fDsrSensitivity:1;        /* DSR Sensitivity                                              */
01150                 DWORD fTXContinueOnXoff: 1;     /* Continue TX when Xoff sent                   */
01151                 DWORD fOutX: 1;                         /* Enable output X-ON/X-OFF                             */
01152                 DWORD fInX: 1;                          /* Enable input X-ON/X-OFF                              */
01153                 DWORD fErrorChar: 1;            /* Enable Err Replacement                               */
01154                 DWORD fNull: 1;                         /* Enable Null stripping                                */
01155                 DWORD fRtsControl:2;            /* Rts Flow control                                             */
01156                 DWORD fAbortOnError:1;          /* Abort all reads and writes on Error  */
01157                 DWORD fDummy2:17;                       /* Reserved                                                             */
01158                 WORD wReserved;                         /* Not currently used                                   */
01159                 WORD XonLim;                            /* Transmit X-ON threshold                              */
01160                 WORD XoffLim;                           /* Transmit X-OFF threshold                             */
01161                 BYTE ByteSize;                          /* Number of bits/byte, 4-8                             */
01162                 BYTE Parity;                            /* 0-4=None,Odd,Even,Mark,Space                 */
01163                 BYTE StopBits;                          /* 0,1,2 = 1, 1.5, 2                                    */
01164                 char XonChar;                           /* Tx and Rx X-ON character                             */
01165                 char XoffChar;                          /* Tx and Rx X-OFF character                    */
01166                 char ErrorChar;                         /* Error replacement char                               */
01167                 char EofChar;                           /* End of Input character                               */
01168                 char EvtChar;                           /* Received Event character                             */
01169                 WORD wReserved1;                        /* Fill for now.                                                */
01170         } FTDCB, *LPFTDCB;
01171 
01172         typedef struct _FTTIMEOUTS {
01173                 DWORD ReadIntervalTimeout;                      /* Maximum time between read chars.     */
01174                 DWORD ReadTotalTimeoutMultiplier;       /* Multiplier of characters.            */
01175                 DWORD ReadTotalTimeoutConstant;         /* Constant in milliseconds.            */
01176                 DWORD WriteTotalTimeoutMultiplier;      /* Multiplier of characters.            */
01177                 DWORD WriteTotalTimeoutConstant;        /* Constant in milliseconds.            */
01178         } FTTIMEOUTS,*LPFTTIMEOUTS;
01179 
01180 
01181         FTD2XX_API
01182                 BOOL WINAPI FT_W32_ClearCommBreak(
01183                 FT_HANDLE ftHandle
01184                 );
01185 
01186         FTD2XX_API
01187                 BOOL WINAPI FT_W32_ClearCommError(
01188                 FT_HANDLE ftHandle,
01189                 LPDWORD lpdwErrors,
01190                 LPFTCOMSTAT lpftComstat
01191                 );
01192 
01193         FTD2XX_API
01194                 BOOL WINAPI FT_W32_EscapeCommFunction(
01195                 FT_HANDLE ftHandle,
01196                 DWORD dwFunc
01197                 );
01198 
01199         FTD2XX_API
01200                 BOOL WINAPI FT_W32_GetCommModemStatus(
01201                 FT_HANDLE ftHandle,
01202                 LPDWORD lpdwModemStatus
01203                 );
01204 
01205         FTD2XX_API
01206                 BOOL WINAPI FT_W32_GetCommState(
01207                 FT_HANDLE ftHandle,
01208                 LPFTDCB lpftDcb
01209                 );
01210 
01211         FTD2XX_API
01212                 BOOL WINAPI FT_W32_GetCommTimeouts(
01213                 FT_HANDLE ftHandle,
01214                 FTTIMEOUTS *pTimeouts
01215                 );
01216 
01217         FTD2XX_API
01218                 BOOL WINAPI FT_W32_PurgeComm(
01219                 FT_HANDLE ftHandle,
01220                 DWORD dwMask
01221                 );
01222 
01223         FTD2XX_API
01224                 BOOL WINAPI FT_W32_SetCommBreak(
01225                 FT_HANDLE ftHandle
01226                 );
01227 
01228         FTD2XX_API
01229                 BOOL WINAPI FT_W32_SetCommMask(
01230                 FT_HANDLE ftHandle,
01231                 ULONG ulEventMask
01232                 );
01233 
01234         FTD2XX_API
01235                 BOOL WINAPI FT_W32_GetCommMask(
01236                 FT_HANDLE ftHandle,
01237                 LPDWORD lpdwEventMask
01238                 );
01239 
01240         FTD2XX_API
01241                 BOOL WINAPI FT_W32_SetCommState(
01242                 FT_HANDLE ftHandle,
01243                 LPFTDCB lpftDcb
01244                 );
01245 
01246         FTD2XX_API
01247                 BOOL WINAPI FT_W32_SetCommTimeouts(
01248                 FT_HANDLE ftHandle,
01249                 FTTIMEOUTS *pTimeouts
01250                 );
01251 
01252         FTD2XX_API
01253                 BOOL WINAPI FT_W32_SetupComm(
01254                 FT_HANDLE ftHandle,
01255                 DWORD dwReadBufferSize,
01256                 DWORD dwWriteBufferSize
01257                 );
01258 
01259         FTD2XX_API
01260                 BOOL WINAPI FT_W32_WaitCommEvent(
01261                 FT_HANDLE ftHandle,
01262                 PULONG pulEvent,
01263                 LPOVERLAPPED lpOverlapped
01264                 );
01265 
01266 
01267         //
01268         // Device information
01269         //
01270 
01271         typedef struct _ft_device_list_info_node {
01272                 ULONG Flags;
01273                 ULONG Type;
01274                 ULONG ID;
01275                 DWORD LocId;
01276                 char SerialNumber[16];
01277                 char Description[64];
01278                 FT_HANDLE ftHandle;
01279         } FT_DEVICE_LIST_INFO_NODE;
01280 
01281         // Device information flags
01282         enum {
01283                 FT_FLAGS_OPENED = 1,
01284                 FT_FLAGS_HISPEED = 2
01285         };
01286 
01287 
01288         FTD2XX_API
01289                 FT_STATUS WINAPI FT_CreateDeviceInfoList(
01290                 LPDWORD lpdwNumDevs
01291                 );
01292 
01293         FTD2XX_API
01294                 FT_STATUS WINAPI FT_GetDeviceInfoList(
01295                 FT_DEVICE_LIST_INFO_NODE *pDest,
01296                 LPDWORD lpdwNumDevs
01297                 );
01298 
01299         FTD2XX_API
01300                 FT_STATUS WINAPI FT_GetDeviceInfoDetail(
01301                 DWORD dwIndex,
01302                 LPDWORD lpdwFlags,
01303                 LPDWORD lpdwType,
01304                 LPDWORD lpdwID,
01305                 LPDWORD lpdwLocId,
01306                 LPVOID lpSerialNumber,
01307                 LPVOID lpDescription,
01308                 FT_HANDLE *pftHandle
01309                 );
01310 
01311 
01312         //
01313         // Version information
01314         //
01315 
01316         FTD2XX_API
01317                 FT_STATUS WINAPI FT_GetDriverVersion(
01318                 FT_HANDLE ftHandle,
01319                 LPDWORD lpdwVersion
01320                 );
01321 
01322         FTD2XX_API
01323                 FT_STATUS WINAPI FT_GetLibraryVersion(
01324                 LPDWORD lpdwVersion
01325                 );
01326 
01327 
01328         FTD2XX_API
01329                 FT_STATUS WINAPI FT_Rescan(
01330                 void
01331                 );
01332 
01333         FTD2XX_API
01334                 FT_STATUS WINAPI FT_Reload(
01335                 WORD wVid,
01336                 WORD wPid
01337                 );
01338 
01339         FTD2XX_API
01340                 FT_STATUS WINAPI FT_GetComPortNumber(
01341                 FT_HANDLE ftHandle,
01342                 LPLONG  lpdwComPortNumber
01343                 );
01344 
01345 
01346         //
01347         // FT232H additional EEPROM functions
01348         //
01349 
01350         FTD2XX_API
01351                 FT_STATUS WINAPI FT_EE_ReadConfig(
01352                 FT_HANDLE ftHandle,
01353                 UCHAR ucAddress,
01354                 PUCHAR pucValue
01355                 );
01356 
01357         FTD2XX_API
01358                 FT_STATUS WINAPI FT_EE_WriteConfig(
01359                 FT_HANDLE ftHandle,
01360                 UCHAR ucAddress,
01361                 UCHAR ucValue
01362                 );
01363 
01364         FTD2XX_API
01365                 FT_STATUS WINAPI FT_EE_ReadECC(
01366                 FT_HANDLE ftHandle,
01367                 UCHAR ucOption,
01368                 LPWORD lpwValue
01369                 );
01370 
01371         FTD2XX_API
01372                 FT_STATUS WINAPI FT_GetQueueStatusEx(
01373                 FT_HANDLE ftHandle,
01374                 DWORD *dwRxBytes
01375                 );
01376 
01377 
01378 #ifdef __cplusplus
01379 }
01380 #endif
01381 
01382 
01383 #endif  /* FTD2XX_H */
01384 


libsegwayrmp
Author(s): William Woodall
autogenerated on Fri Jan 3 2014 11:28:21