00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef FTD2XX_H
00042 #define FTD2XX_H
00043
00044
00045
00046
00047
00048
00049
00050
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
00071 #endif
00072
00073 typedef PVOID FT_HANDLE;
00074 typedef ULONG FT_STATUS;
00075
00076
00077
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
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
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
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
00149
00150
00151 #define FT_BITS_8 (UCHAR) 8
00152 #define FT_BITS_7 (UCHAR) 7
00153
00154
00155
00156
00157
00158 #define FT_STOP_BITS_1 (UCHAR) 0
00159 #define FT_STOP_BITS_2 (UCHAR) 2
00160
00161
00162
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
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
00182
00183 #define FT_PURGE_RX 1
00184 #define FT_PURGE_TX 2
00185
00186
00187
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
00198
00199
00200 #define FT_DEFAULT_RX_TIMEOUT 300
00201 #define FT_DEFAULT_TX_TIMEOUT 300
00202
00203
00204
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
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
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
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
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
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
00514
00515
00516 typedef struct ft_program_data {
00517
00518 DWORD Signature1;
00519 DWORD Signature2;
00520 DWORD Version;
00521
00522
00523
00524
00525
00526
00527
00528 WORD VendorId;
00529 WORD ProductId;
00530 char *Manufacturer;
00531 char *ManufacturerId;
00532 char *Description;
00533 char *SerialNumber;
00534 WORD MaxPower;
00535 WORD PnP;
00536 WORD SelfPowered;
00537 WORD RemoteWakeup;
00538
00539
00540
00541 UCHAR Rev4;
00542 UCHAR IsoIn;
00543 UCHAR IsoOut;
00544 UCHAR PullDownEnable;
00545 UCHAR SerNumEnable;
00546 UCHAR USBVersionEnable;
00547 WORD USBVersion;
00548
00549
00550
00551 UCHAR Rev5;
00552 UCHAR IsoInA;
00553 UCHAR IsoInB;
00554 UCHAR IsoOutA;
00555 UCHAR IsoOutB;
00556 UCHAR PullDownEnable5;
00557 UCHAR SerNumEnable5;
00558 UCHAR USBVersionEnable5;
00559 WORD USBVersion5;
00560 UCHAR AIsHighCurrent;
00561 UCHAR BIsHighCurrent;
00562 UCHAR IFAIsFifo;
00563 UCHAR IFAIsFifoTar;
00564 UCHAR IFAIsFastSer;
00565 UCHAR AIsVCP;
00566 UCHAR IFBIsFifo;
00567 UCHAR IFBIsFifoTar;
00568 UCHAR IFBIsFastSer;
00569 UCHAR BIsVCP;
00570
00571
00572
00573 UCHAR UseExtOsc;
00574 UCHAR HighDriveIOs;
00575 UCHAR EndpointSize;
00576 UCHAR PullDownEnableR;
00577 UCHAR SerNumEnableR;
00578 UCHAR InvertTXD;
00579 UCHAR InvertRXD;
00580 UCHAR InvertRTS;
00581 UCHAR InvertCTS;
00582 UCHAR InvertDTR;
00583 UCHAR InvertDSR;
00584 UCHAR InvertDCD;
00585 UCHAR InvertRI;
00586 UCHAR Cbus0;
00587 UCHAR Cbus1;
00588 UCHAR Cbus2;
00589 UCHAR Cbus3;
00590 UCHAR Cbus4;
00591 UCHAR RIsD2XX;
00592
00593
00594
00595 UCHAR PullDownEnable7;
00596 UCHAR SerNumEnable7;
00597 UCHAR ALSlowSlew;
00598 UCHAR ALSchmittInput;
00599 UCHAR ALDriveCurrent;
00600 UCHAR AHSlowSlew;
00601 UCHAR AHSchmittInput;
00602 UCHAR AHDriveCurrent;
00603 UCHAR BLSlowSlew;
00604 UCHAR BLSchmittInput;
00605 UCHAR BLDriveCurrent;
00606 UCHAR BHSlowSlew;
00607 UCHAR BHSchmittInput;
00608 UCHAR BHDriveCurrent;
00609 UCHAR IFAIsFifo7;
00610 UCHAR IFAIsFifoTar7;
00611 UCHAR IFAIsFastSer7;
00612 UCHAR AIsVCP7;
00613 UCHAR IFBIsFifo7;
00614 UCHAR IFBIsFifoTar7;
00615 UCHAR IFBIsFastSer7;
00616 UCHAR BIsVCP7;
00617 UCHAR PowerSaveEnable;
00618
00619
00620
00621 UCHAR PullDownEnable8;
00622 UCHAR SerNumEnable8;
00623 UCHAR ASlowSlew;
00624 UCHAR ASchmittInput;
00625 UCHAR ADriveCurrent;
00626 UCHAR BSlowSlew;
00627 UCHAR BSchmittInput;
00628 UCHAR BDriveCurrent;
00629 UCHAR CSlowSlew;
00630 UCHAR CSchmittInput;
00631 UCHAR CDriveCurrent;
00632 UCHAR DSlowSlew;
00633 UCHAR DSchmittInput;
00634 UCHAR DDriveCurrent;
00635 UCHAR ARIIsTXDEN;
00636 UCHAR BRIIsTXDEN;
00637 UCHAR CRIIsTXDEN;
00638 UCHAR DRIIsTXDEN;
00639 UCHAR AIsVCP8;
00640 UCHAR BIsVCP8;
00641 UCHAR CIsVCP8;
00642 UCHAR DIsVCP8;
00643
00644
00645
00646 UCHAR PullDownEnableH;
00647 UCHAR SerNumEnableH;
00648 UCHAR ACSlowSlewH;
00649 UCHAR ACSchmittInputH;
00650 UCHAR ACDriveCurrentH;
00651 UCHAR ADSlowSlewH;
00652 UCHAR ADSchmittInputH;
00653 UCHAR ADDriveCurrentH;
00654 UCHAR Cbus0H;
00655 UCHAR Cbus1H;
00656 UCHAR Cbus2H;
00657 UCHAR Cbus3H;
00658 UCHAR Cbus4H;
00659 UCHAR Cbus5H;
00660 UCHAR Cbus6H;
00661 UCHAR Cbus7H;
00662 UCHAR Cbus8H;
00663 UCHAR Cbus9H;
00664 UCHAR IsFifoH;
00665 UCHAR IsFifoTarH;
00666 UCHAR IsFastSerH;
00667 UCHAR IsFT1248H;
00668 UCHAR FT1248CpolH;
00669 UCHAR FT1248LsbH;
00670 UCHAR FT1248FlowControlH;
00671 UCHAR IsVCPH;
00672 UCHAR PowerSaveEnableH;
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;
00732
00733 WORD VendorId;
00734 WORD ProductId;
00735 UCHAR SerNumEnable;
00736
00737 WORD MaxPower;
00738 UCHAR SelfPowered;
00739 UCHAR RemoteWakeup;
00740
00741 UCHAR PullDownEnable;
00742 } FT_EEPROM_HEADER, *PFT_EEPROM_HEADER;
00743
00744
00745
00746 typedef struct ft_eeprom_232b {
00747
00748 FT_EEPROM_HEADER common;
00749 } FT_EEPROM_232B, *PFT_EEPROM_232B;
00750
00751
00752
00753 typedef struct ft_eeprom_2232 {
00754
00755 FT_EEPROM_HEADER common;
00756
00757 UCHAR AIsHighCurrent;
00758 UCHAR BIsHighCurrent;
00759
00760 UCHAR AIsFifo;
00761 UCHAR AIsFifoTar;
00762 UCHAR AIsFastSer;
00763 UCHAR BIsFifo;
00764 UCHAR BIsFifoTar;
00765 UCHAR BIsFastSer;
00766
00767 UCHAR ADriverType;
00768 UCHAR BDriverType;
00769 } FT_EEPROM_2232, *PFT_EEPROM_2232;
00770
00771
00772
00773 typedef struct ft_eeprom_232r {
00774
00775 FT_EEPROM_HEADER common;
00776
00777 UCHAR IsHighCurrent;
00778
00779 UCHAR UseExtOsc;
00780 UCHAR InvertTXD;
00781 UCHAR InvertRXD;
00782 UCHAR InvertRTS;
00783 UCHAR InvertCTS;
00784 UCHAR InvertDTR;
00785 UCHAR InvertDSR;
00786 UCHAR InvertDCD;
00787 UCHAR InvertRI;
00788 UCHAR Cbus0;
00789 UCHAR Cbus1;
00790 UCHAR Cbus2;
00791 UCHAR Cbus3;
00792 UCHAR Cbus4;
00793
00794 UCHAR DriverType;
00795 } FT_EEPROM_232R, *PFT_EEPROM_232R;
00796
00797
00798
00799 typedef struct ft_eeprom_2232h {
00800
00801 FT_EEPROM_HEADER common;
00802
00803 UCHAR ALSlowSlew;
00804 UCHAR ALSchmittInput;
00805 UCHAR ALDriveCurrent;
00806 UCHAR AHSlowSlew;
00807 UCHAR AHSchmittInput;
00808 UCHAR AHDriveCurrent;
00809 UCHAR BLSlowSlew;
00810 UCHAR BLSchmittInput;
00811 UCHAR BLDriveCurrent;
00812 UCHAR BHSlowSlew;
00813 UCHAR BHSchmittInput;
00814 UCHAR BHDriveCurrent;
00815
00816 UCHAR AIsFifo;
00817 UCHAR AIsFifoTar;
00818 UCHAR AIsFastSer;
00819 UCHAR BIsFifo;
00820 UCHAR BIsFifoTar;
00821 UCHAR BIsFastSer;
00822 UCHAR PowerSaveEnable;
00823
00824 UCHAR ADriverType;
00825 UCHAR BDriverType;
00826 } FT_EEPROM_2232H, *PFT_EEPROM_2232H;
00827
00828
00829
00830 typedef struct ft_eeprom_4232h {
00831
00832 FT_EEPROM_HEADER common;
00833
00834 UCHAR ASlowSlew;
00835 UCHAR ASchmittInput;
00836 UCHAR ADriveCurrent;
00837 UCHAR BSlowSlew;
00838 UCHAR BSchmittInput;
00839 UCHAR BDriveCurrent;
00840 UCHAR CSlowSlew;
00841 UCHAR CSchmittInput;
00842 UCHAR CDriveCurrent;
00843 UCHAR DSlowSlew;
00844 UCHAR DSchmittInput;
00845 UCHAR DDriveCurrent;
00846
00847 UCHAR ARIIsTXDEN;
00848 UCHAR BRIIsTXDEN;
00849 UCHAR CRIIsTXDEN;
00850 UCHAR DRIIsTXDEN;
00851
00852 UCHAR ADriverType;
00853 UCHAR BDriverType;
00854 UCHAR CDriverType;
00855 UCHAR DDriverType;
00856 } FT_EEPROM_4232H, *PFT_EEPROM_4232H;
00857
00858
00859
00860 typedef struct ft_eeprom_232h {
00861
00862 FT_EEPROM_HEADER common;
00863
00864 UCHAR ACSlowSlew;
00865 UCHAR ACSchmittInput;
00866 UCHAR ACDriveCurrent;
00867 UCHAR ADSlowSlew;
00868 UCHAR ADSchmittInput;
00869 UCHAR ADDriveCurrent;
00870
00871 UCHAR Cbus0;
00872 UCHAR Cbus1;
00873 UCHAR Cbus2;
00874 UCHAR Cbus3;
00875 UCHAR Cbus4;
00876 UCHAR Cbus5;
00877 UCHAR Cbus6;
00878 UCHAR Cbus7;
00879 UCHAR Cbus8;
00880 UCHAR Cbus9;
00881
00882 UCHAR FT1248Cpol;
00883 UCHAR FT1248Lsb;
00884 UCHAR FT1248FlowControl;
00885
00886 UCHAR IsFifo;
00887 UCHAR IsFifoTar;
00888 UCHAR IsFastSer;
00889 UCHAR IsFT1248 ;
00890 UCHAR PowerSaveEnable;
00891
00892 UCHAR DriverType;
00893 } FT_EEPROM_232H, *PFT_EEPROM_232H;
00894
00895
00896
00897 typedef struct ft_eeprom_x_series {
00898
00899 FT_EEPROM_HEADER common;
00900
00901 UCHAR ACSlowSlew;
00902 UCHAR ACSchmittInput;
00903 UCHAR ACDriveCurrent;
00904 UCHAR ADSlowSlew;
00905 UCHAR ADSchmittInput;
00906 UCHAR ADDriveCurrent;
00907
00908 UCHAR Cbus0;
00909 UCHAR Cbus1;
00910 UCHAR Cbus2;
00911 UCHAR Cbus3;
00912 UCHAR Cbus4;
00913 UCHAR Cbus5;
00914 UCHAR Cbus6;
00915
00916 UCHAR InvertTXD;
00917 UCHAR InvertRXD;
00918 UCHAR InvertRTS;
00919 UCHAR InvertCTS;
00920 UCHAR InvertDTR;
00921 UCHAR InvertDSR;
00922 UCHAR InvertDCD;
00923 UCHAR InvertRI;
00924
00925 UCHAR BCDEnable;
00926 UCHAR BCDForceCbusPWREN;
00927 UCHAR BCDDisableSleep;
00928
00929 WORD I2CSlaveAddress;
00930 DWORD I2CDeviceId;
00931 UCHAR I2CDisableSchmitt;
00932
00933 UCHAR FT1248Cpol;
00934 UCHAR FT1248Lsb;
00935 UCHAR FT1248FlowControl;
00936
00937 UCHAR RS485EchoSuppress;
00938 UCHAR PowerSaveEnable;
00939
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
01008
01009
01010
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
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
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
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;
01143 DWORD BaudRate;
01144 DWORD fBinary: 1;
01145 DWORD fParity: 1;
01146 DWORD fOutxCtsFlow:1;
01147 DWORD fOutxDsrFlow:1;
01148 DWORD fDtrControl:2;
01149 DWORD fDsrSensitivity:1;
01150 DWORD fTXContinueOnXoff: 1;
01151 DWORD fOutX: 1;
01152 DWORD fInX: 1;
01153 DWORD fErrorChar: 1;
01154 DWORD fNull: 1;
01155 DWORD fRtsControl:2;
01156 DWORD fAbortOnError:1;
01157 DWORD fDummy2:17;
01158 WORD wReserved;
01159 WORD XonLim;
01160 WORD XoffLim;
01161 BYTE ByteSize;
01162 BYTE Parity;
01163 BYTE StopBits;
01164 char XonChar;
01165 char XoffChar;
01166 char ErrorChar;
01167 char EofChar;
01168 char EvtChar;
01169 WORD wReserved1;
01170 } FTDCB, *LPFTDCB;
01171
01172 typedef struct _FTTIMEOUTS {
01173 DWORD ReadIntervalTimeout;
01174 DWORD ReadTotalTimeoutMultiplier;
01175 DWORD ReadTotalTimeoutConstant;
01176 DWORD WriteTotalTimeoutMultiplier;
01177 DWORD WriteTotalTimeoutConstant;
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
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
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
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
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
01384