Rev Author Line No. Line
3455 miho 1 /*++
2  
3 Copyright © 2001-2011 Future Technology Devices International Limited
4  
5 THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED "AS IS"
6 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
7 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
8 FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
10 OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION)
11 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
12 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
13 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  
15 FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
16  
17 FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
18  
19 IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE
20 RESPONSIBILITY OF THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL
21 RE-CERTIFICATION AS A RESULT OF MAKING THESE CHANGES.
22  
23  
24 Module Name:
25  
26 ftd2xx.h
27  
28 Abstract:
29  
30 Native USB device driver for FTDI FT232x, FT245x, FT2232x and FT4232x devices
31 FTD2XX library definitions
32  
33 Environment:
34  
35 kernel & user mode
36  
37  
38 --*/
39  
40  
41 #ifndef FTD2XX_H
42 #define FTD2XX_H
43  
44 // The following ifdef block is the standard way of creating macros
45 // which make exporting from a DLL simpler. All files within this DLL
46 // are compiled with the FTD2XX_EXPORTS symbol defined on the command line.
47 // This symbol should not be defined on any project that uses this DLL.
48 // This way any other project whose source files include this file see
49 // FTD2XX_API functions as being imported from a DLL, whereas this DLL
50 // sees symbols defined with this macro as being exported.
51  
52 #ifdef FTD2XX_EXPORTS
53 #define FTD2XX_API __declspec(dllexport)
54 #else
55 #define FTD2XX_API __declspec(dllimport)
56 #endif
57  
58  
59 typedef PVOID FT_HANDLE;
60 typedef ULONG FT_STATUS;
61  
62 //
63 // Device status
64 //
65 enum {
66 FT_OK,
67 FT_INVALID_HANDLE,
68 FT_DEVICE_NOT_FOUND,
69 FT_DEVICE_NOT_OPENED,
70 FT_IO_ERROR,
71 FT_INSUFFICIENT_RESOURCES,
72 FT_INVALID_PARAMETER,
73 FT_INVALID_BAUD_RATE,
74  
75 FT_DEVICE_NOT_OPENED_FOR_ERASE,
76 FT_DEVICE_NOT_OPENED_FOR_WRITE,
77 FT_FAILED_TO_WRITE_DEVICE,
78 FT_EEPROM_READ_FAILED,
79 FT_EEPROM_WRITE_FAILED,
80 FT_EEPROM_ERASE_FAILED,
81 FT_EEPROM_NOT_PRESENT,
82 FT_EEPROM_NOT_PROGRAMMED,
83 FT_INVALID_ARGS,
84 FT_NOT_SUPPORTED,
85 FT_OTHER_ERROR,
86 FT_DEVICE_LIST_NOT_READY,
87 };
88  
89  
90 #define FT_SUCCESS(status) ((status) == FT_OK)
91  
92 //
93 // FT_OpenEx Flags
94 //
95  
96 #define FT_OPEN_BY_SERIAL_NUMBER 1
97 #define FT_OPEN_BY_DESCRIPTION 2
98 #define FT_OPEN_BY_LOCATION 4
99  
100 //
101 // FT_ListDevices Flags (used in conjunction with FT_OpenEx Flags
102 //
103  
104 #define FT_LIST_NUMBER_ONLY 0x80000000
105 #define FT_LIST_BY_INDEX 0x40000000
106 #define FT_LIST_ALL 0x20000000
107  
108 #define FT_LIST_MASK (FT_LIST_NUMBER_ONLY|FT_LIST_BY_INDEX|FT_LIST_ALL)
109  
110 //
111 // Baud Rates
112 //
113  
114 #define FT_BAUD_300 300
115 #define FT_BAUD_600 600
116 #define FT_BAUD_1200 1200
117 #define FT_BAUD_2400 2400
118 #define FT_BAUD_4800 4800
119 #define FT_BAUD_9600 9600
120 #define FT_BAUD_14400 14400
121 #define FT_BAUD_19200 19200
122 #define FT_BAUD_38400 38400
123 #define FT_BAUD_57600 57600
124 #define FT_BAUD_115200 115200
125 #define FT_BAUD_230400 230400
126 #define FT_BAUD_460800 460800
127 #define FT_BAUD_921600 921600
128  
129 //
130 // Word Lengths
131 //
132  
133 #define FT_BITS_8 (UCHAR) 8
134 #define FT_BITS_7 (UCHAR) 7
135  
136 //
137 // Stop Bits
138 //
139  
140 #define FT_STOP_BITS_1 (UCHAR) 0
141 #define FT_STOP_BITS_2 (UCHAR) 2
142  
143 //
144 // Parity
145 //
146  
147 #define FT_PARITY_NONE (UCHAR) 0
148 #define FT_PARITY_ODD (UCHAR) 1
149 #define FT_PARITY_EVEN (UCHAR) 2
150 #define FT_PARITY_MARK (UCHAR) 3
151 #define FT_PARITY_SPACE (UCHAR) 4
152  
153 //
154 // Flow Control
155 //
156  
157 #define FT_FLOW_NONE 0x0000
158 #define FT_FLOW_RTS_CTS 0x0100
159 #define FT_FLOW_DTR_DSR 0x0200
160 #define FT_FLOW_XON_XOFF 0x0400
161  
162 //
163 // Purge rx and tx buffers
164 //
165 #define FT_PURGE_RX 1
166 #define FT_PURGE_TX 2
167  
168 //
169 // Events
170 //
171  
172 typedef void (*PFT_EVENT_HANDLER)(DWORD,DWORD);
173  
174 #define FT_EVENT_RXCHAR 1
175 #define FT_EVENT_MODEM_STATUS 2
176 #define FT_EVENT_LINE_STATUS 4
177  
178 //
179 // Timeouts
180 //
181  
182 #define FT_DEFAULT_RX_TIMEOUT 300
183 #define FT_DEFAULT_TX_TIMEOUT 300
184  
185 //
186 // Device types
187 //
188  
189 typedef ULONG FT_DEVICE;
190  
191 enum {
192 FT_DEVICE_BM,
193 FT_DEVICE_AM,
194 FT_DEVICE_100AX,
195 FT_DEVICE_UNKNOWN,
196 FT_DEVICE_2232C,
197 FT_DEVICE_232R,
198 FT_DEVICE_2232H,
199 FT_DEVICE_4232H,
200 FT_DEVICE_232H,
201 FT_DEVICE_X_SERIES
202 };
203  
204 //
205 // Bit Modes
206 //
207  
208 #define FT_BITMODE_RESET 0x00
209 #define FT_BITMODE_ASYNC_BITBANG 0x01
210 #define FT_BITMODE_MPSSE 0x02
211 #define FT_BITMODE_SYNC_BITBANG 0x04
212 #define FT_BITMODE_MCU_HOST 0x08
213 #define FT_BITMODE_FAST_SERIAL 0x10
214 #define FT_BITMODE_CBUS_BITBANG 0x20
215 #define FT_BITMODE_SYNC_FIFO 0x40
216  
217 //
218 // FT232R CBUS Options EEPROM values
219 //
220  
221 #define FT_232R_CBUS_TXDEN 0x00 // Tx Data Enable
222 #define FT_232R_CBUS_PWRON 0x01 // Power On
223 #define FT_232R_CBUS_RXLED 0x02 // Rx LED
224 #define FT_232R_CBUS_TXLED 0x03 // Tx LED
225 #define FT_232R_CBUS_TXRXLED 0x04 // Tx and Rx LED
226 #define FT_232R_CBUS_SLEEP 0x05 // Sleep
227 #define FT_232R_CBUS_CLK48 0x06 // 48MHz clock
228 #define FT_232R_CBUS_CLK24 0x07 // 24MHz clock
229 #define FT_232R_CBUS_CLK12 0x08 // 12MHz clock
230 #define FT_232R_CBUS_CLK6 0x09 // 6MHz clock
231 #define FT_232R_CBUS_IOMODE 0x0A // IO Mode for CBUS bit-bang
232 #define FT_232R_CBUS_BITBANG_WR 0x0B // Bit-bang write strobe
233 #define FT_232R_CBUS_BITBANG_RD 0x0C // Bit-bang read strobe
234  
235 //
236 // FT232H CBUS Options EEPROM values
237 //
238  
239 #define FT_232H_CBUS_TRISTATE 0x00 // Tristate
240 #define FT_232H_CBUS_TXLED 0x01 // Tx LED
241 #define FT_232H_CBUS_RXLED 0x02 // Rx LED
242 #define FT_232H_CBUS_TXRXLED 0x03 // Tx and Rx LED
243 #define FT_232H_CBUS_PWREN 0x04 // Power Enable
244 #define FT_232H_CBUS_SLEEP 0x05 // Sleep
245 #define FT_232H_CBUS_DRIVE_0 0x06 // Drive pin to logic 0
246 #define FT_232H_CBUS_DRIVE_1 0x07 // Drive pin to logic 1
247 #define FT_232H_CBUS_IOMODE 0x08 // IO Mode for CBUS bit-bang
248 #define FT_232H_CBUS_TXDEN 0x09 // Tx Data Enable
249 #define FT_232H_CBUS_CLK30 0x0A // 30MHz clock
250 #define FT_232H_CBUS_CLK15 0x0B // 15MHz clock
251 #define FT_232H_CBUS_CLK7_5 0x0C // 7.5MHz clock
252  
253 //
254 // FT X Series CBUS Options EEPROM values
255 //
256  
257 #define FT_X_SERIES_CBUS_TRISTATE 0x00 // Tristate
258 #define FT_X_SERIES_CBUS_RXLED 0x01 // Tx LED
259 #define FT_X_SERIES_CBUS_TXLED 0x02 // Rx LED
260 #define FT_X_SERIES_CBUS_TXRXLED 0x03 // Tx and Rx LED
261 #define FT_X_SERIES_CBUS_PWREN 0x04 // Power Enable
262 #define FT_X_SERIES_CBUS_SLEEP 0x05 // Sleep
263 #define FT_X_SERIES_CBUS_DRIVE_0 0x06 // Drive pin to logic 0
264 #define FT_X_SERIES_CBUS_DRIVE_1 0x07 // Drive pin to logic 1
265 #define FT_X_SERIES_CBUS_IOMODE 0x08 // IO Mode for CBUS bit-bang
266 #define FT_X_SERIES_CBUS_TXDEN 0x09 // Tx Data Enable
267 #define FT_X_SERIES_CBUS_CLK24 0x0A // 24MHz clock
268 #define FT_X_SERIES_CBUS_CLK12 0x0B // 12MHz clock
269 #define FT_X_SERIES_CBUS_CLK6 0x0C // 6MHz clock
270 #define FT_X_SERIES_CBUS_BCD_CHARGER 0x0D // Battery charger detected
271 #define FT_X_SERIES_CBUS_BCD_CHARGER_N 0x0E // Battery charger detected inverted
272 #define FT_X_SERIES_CBUS_I2C_TXE 0x0F // I2C Tx empty
273 #define FT_X_SERIES_CBUS_I2C_RXF 0x10 // I2C Rx full
274 #define FT_X_SERIES_CBUS_VBUS_SENSE 0x11 // Detect VBUS
275 #define FT_X_SERIES_CBUS_BITBANG_WR 0x12 // Bit-bang write strobe
276 #define FT_X_SERIES_CBUS_BITBANG_RD 0x13 // Bit-bang read strobe
277 #define FT_X_SERIES_CBUS_TIMESTAMP 0x14 // Toggle output when a USB SOF token is received
278 #define FT_X_SERIES_CBUS_KEEP_AWAKE 0x15 //
279  
280  
281 // Driver types
282 #define FT_DRIVER_TYPE_D2XX 0
283 #define FT_DRIVER_TYPE_VCP 1
284  
285  
286  
287 #ifdef __cplusplus
288 extern "C" {
289 #endif
290  
291  
292 FTD2XX_API
293 FT_STATUS WINAPI FT_Open(
294 int deviceNumber,
295 FT_HANDLE *pHandle
296 );
297  
298 FTD2XX_API
299 FT_STATUS WINAPI FT_OpenEx(
300 PVOID pArg1,
301 DWORD Flags,
302 FT_HANDLE *pHandle
303 );
304  
305 FTD2XX_API
306 FT_STATUS WINAPI FT_ListDevices(
307 PVOID pArg1,
308 PVOID pArg2,
309 DWORD Flags
310 );
311  
312 FTD2XX_API
313 FT_STATUS WINAPI FT_Close(
314 FT_HANDLE ftHandle
315 );
316  
317 FTD2XX_API
318 FT_STATUS WINAPI FT_Read(
319 FT_HANDLE ftHandle,
320 LPVOID lpBuffer,
321 DWORD dwBytesToRead,
322 LPDWORD lpBytesReturned
323 );
324  
325 FTD2XX_API
326 FT_STATUS WINAPI FT_Write(
327 FT_HANDLE ftHandle,
328 LPVOID lpBuffer,
329 DWORD dwBytesToWrite,
330 LPDWORD lpBytesWritten
331 );
332  
333 FTD2XX_API
334 FT_STATUS WINAPI FT_IoCtl(
335 FT_HANDLE ftHandle,
336 DWORD dwIoControlCode,
337 LPVOID lpInBuf,
338 DWORD nInBufSize,
339 LPVOID lpOutBuf,
340 DWORD nOutBufSize,
341 LPDWORD lpBytesReturned,
342 LPOVERLAPPED lpOverlapped
343 );
344  
345 FTD2XX_API
346 FT_STATUS WINAPI FT_SetBaudRate(
347 FT_HANDLE ftHandle,
348 ULONG BaudRate
349 );
350  
351 FTD2XX_API
352 FT_STATUS WINAPI FT_SetDivisor(
353 FT_HANDLE ftHandle,
354 USHORT Divisor
355 );
356  
357 FTD2XX_API
358 FT_STATUS WINAPI FT_SetDataCharacteristics(
359 FT_HANDLE ftHandle,
360 UCHAR WordLength,
361 UCHAR StopBits,
362 UCHAR Parity
363 );
364  
365 FTD2XX_API
366 FT_STATUS WINAPI FT_SetFlowControl(
367 FT_HANDLE ftHandle,
368 USHORT FlowControl,
369 UCHAR XonChar,
370 UCHAR XoffChar
371 );
372  
373 FTD2XX_API
374 FT_STATUS WINAPI FT_ResetDevice(
375 FT_HANDLE ftHandle
376 );
377  
378 FTD2XX_API
379 FT_STATUS WINAPI FT_SetDtr(
380 FT_HANDLE ftHandle
381 );
382  
383 FTD2XX_API
384 FT_STATUS WINAPI FT_ClrDtr(
385 FT_HANDLE ftHandle
386 );
387  
388 FTD2XX_API
389 FT_STATUS WINAPI FT_SetRts(
390 FT_HANDLE ftHandle
391 );
392  
393 FTD2XX_API
394 FT_STATUS WINAPI FT_ClrRts(
395 FT_HANDLE ftHandle
396 );
397  
398 FTD2XX_API
399 FT_STATUS WINAPI FT_GetModemStatus(
400 FT_HANDLE ftHandle,
401 ULONG *pModemStatus
402 );
403  
404 FTD2XX_API
405 FT_STATUS WINAPI FT_SetChars(
406 FT_HANDLE ftHandle,
407 UCHAR EventChar,
408 UCHAR EventCharEnabled,
409 UCHAR ErrorChar,
410 UCHAR ErrorCharEnabled
411 );
412  
413 FTD2XX_API
414 FT_STATUS WINAPI FT_Purge(
415 FT_HANDLE ftHandle,
416 ULONG Mask
417 );
418  
419 FTD2XX_API
420 FT_STATUS WINAPI FT_SetTimeouts(
421 FT_HANDLE ftHandle,
422 ULONG ReadTimeout,
423 ULONG WriteTimeout
424 );
425  
426 FTD2XX_API
427 FT_STATUS WINAPI FT_GetQueueStatus(
428 FT_HANDLE ftHandle,
429 DWORD *dwRxBytes
430 );
431  
432 FTD2XX_API
433 FT_STATUS WINAPI FT_SetEventNotification(
434 FT_HANDLE ftHandle,
435 DWORD Mask,
436 PVOID Param
437 );
438  
439 FTD2XX_API
440 FT_STATUS WINAPI FT_GetStatus(
441 FT_HANDLE ftHandle,
442 DWORD *dwRxBytes,
443 DWORD *dwTxBytes,
444 DWORD *dwEventDWord
445 );
446  
447 FTD2XX_API
448 FT_STATUS WINAPI FT_SetBreakOn(
449 FT_HANDLE ftHandle
450 );
451  
452 FTD2XX_API
453 FT_STATUS WINAPI FT_SetBreakOff(
454 FT_HANDLE ftHandle
455 );
456  
457 FTD2XX_API
458 FT_STATUS WINAPI FT_SetWaitMask(
459 FT_HANDLE ftHandle,
460 DWORD Mask
461 );
462  
463 FTD2XX_API
464 FT_STATUS WINAPI FT_WaitOnMask(
465 FT_HANDLE ftHandle,
466 DWORD *Mask
467 );
468  
469 FTD2XX_API
470 FT_STATUS WINAPI FT_GetEventStatus(
471 FT_HANDLE ftHandle,
472 DWORD *dwEventDWord
473 );
474  
475 FTD2XX_API
476 FT_STATUS WINAPI FT_ReadEE(
477 FT_HANDLE ftHandle,
478 DWORD dwWordOffset,
479 LPWORD lpwValue
480 );
481  
482 FTD2XX_API
483 FT_STATUS WINAPI FT_WriteEE(
484 FT_HANDLE ftHandle,
485 DWORD dwWordOffset,
486 WORD wValue
487 );
488  
489 FTD2XX_API
490 FT_STATUS WINAPI FT_EraseEE(
491 FT_HANDLE ftHandle
492 );
493  
494 //
495 // structure to hold program data for FT_EE_Program, FT_EE_ProgramEx, FT_EE_Read
496 // and FT_EE_ReadEx functions
497 //
498 typedef struct ft_program_data {
499  
500 DWORD Signature1; // Header - must be 0x00000000
501 DWORD Signature2; // Header - must be 0xffffffff
502 DWORD Version; // Header - FT_PROGRAM_DATA version
503 // 0 = original
504 // 1 = FT2232 extensions
505 // 2 = FT232R extensions
506 // 3 = FT2232H extensions
507 // 4 = FT4232H extensions
508 // 5 = FT232H extensions
509  
510 WORD VendorId; // 0x0403
511 WORD ProductId; // 0x6001
512 char *Manufacturer; // "FTDI"
513 char *ManufacturerId; // "FT"
514 char *Description; // "USB HS Serial Converter"
515 char *SerialNumber; // "FT000001" if fixed, or NULL
516 WORD MaxPower; // 0 < MaxPower <= 500
517 WORD PnP; // 0 = disabled, 1 = enabled
518 WORD SelfPowered; // 0 = bus powered, 1 = self powered
519 WORD RemoteWakeup; // 0 = not capable, 1 = capable
520 //
521 // Rev4 (FT232B) extensions
522 //
523 UCHAR Rev4; // non-zero if Rev4 chip, zero otherwise
524 UCHAR IsoIn; // non-zero if in endpoint is isochronous
525 UCHAR IsoOut; // non-zero if out endpoint is isochronous
526 UCHAR PullDownEnable; // non-zero if pull down enabled
527 UCHAR SerNumEnable; // non-zero if serial number to be used
528 UCHAR USBVersionEnable; // non-zero if chip uses USBVersion
529 WORD USBVersion; // BCD (0x0200 => USB2)
530 //
531 // Rev 5 (FT2232) extensions
532 //
533 UCHAR Rev5; // non-zero if Rev5 chip, zero otherwise
534 UCHAR IsoInA; // non-zero if in endpoint is isochronous
535 UCHAR IsoInB; // non-zero if in endpoint is isochronous
536 UCHAR IsoOutA; // non-zero if out endpoint is isochronous
537 UCHAR IsoOutB; // non-zero if out endpoint is isochronous
538 UCHAR PullDownEnable5; // non-zero if pull down enabled
539 UCHAR SerNumEnable5; // non-zero if serial number to be used
540 UCHAR USBVersionEnable5; // non-zero if chip uses USBVersion
541 WORD USBVersion5; // BCD (0x0200 => USB2)
542 UCHAR AIsHighCurrent; // non-zero if interface is high current
543 UCHAR BIsHighCurrent; // non-zero if interface is high current
544 UCHAR IFAIsFifo; // non-zero if interface is 245 FIFO
545 UCHAR IFAIsFifoTar; // non-zero if interface is 245 FIFO CPU target
546 UCHAR IFAIsFastSer; // non-zero if interface is Fast serial
547 UCHAR AIsVCP; // non-zero if interface is to use VCP drivers
548 UCHAR IFBIsFifo; // non-zero if interface is 245 FIFO
549 UCHAR IFBIsFifoTar; // non-zero if interface is 245 FIFO CPU target
550 UCHAR IFBIsFastSer; // non-zero if interface is Fast serial
551 UCHAR BIsVCP; // non-zero if interface is to use VCP drivers
552 //
553 // Rev 6 (FT232R) extensions
554 //
555 UCHAR UseExtOsc; // Use External Oscillator
556 UCHAR HighDriveIOs; // High Drive I/Os
557 UCHAR EndpointSize; // Endpoint size
558 UCHAR PullDownEnableR; // non-zero if pull down enabled
559 UCHAR SerNumEnableR; // non-zero if serial number to be used
560 UCHAR InvertTXD; // non-zero if invert TXD
561 UCHAR InvertRXD; // non-zero if invert RXD
562 UCHAR InvertRTS; // non-zero if invert RTS
563 UCHAR InvertCTS; // non-zero if invert CTS
564 UCHAR InvertDTR; // non-zero if invert DTR
565 UCHAR InvertDSR; // non-zero if invert DSR
566 UCHAR InvertDCD; // non-zero if invert DCD
567 UCHAR InvertRI; // non-zero if invert RI
568 UCHAR Cbus0; // Cbus Mux control
569 UCHAR Cbus1; // Cbus Mux control
570 UCHAR Cbus2; // Cbus Mux control
571 UCHAR Cbus3; // Cbus Mux control
572 UCHAR Cbus4; // Cbus Mux control
573 UCHAR RIsD2XX; // non-zero if using D2XX driver
574 //
575 // Rev 7 (FT2232H) Extensions
576 //
577 UCHAR PullDownEnable7; // non-zero if pull down enabled
578 UCHAR SerNumEnable7; // non-zero if serial number to be used
579 UCHAR ALSlowSlew; // non-zero if AL pins have slow slew
580 UCHAR ALSchmittInput; // non-zero if AL pins are Schmitt input
581 UCHAR ALDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
582 UCHAR AHSlowSlew; // non-zero if AH pins have slow slew
583 UCHAR AHSchmittInput; // non-zero if AH pins are Schmitt input
584 UCHAR AHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
585 UCHAR BLSlowSlew; // non-zero if BL pins have slow slew
586 UCHAR BLSchmittInput; // non-zero if BL pins are Schmitt input
587 UCHAR BLDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
588 UCHAR BHSlowSlew; // non-zero if BH pins have slow slew
589 UCHAR BHSchmittInput; // non-zero if BH pins are Schmitt input
590 UCHAR BHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
591 UCHAR IFAIsFifo7; // non-zero if interface is 245 FIFO
592 UCHAR IFAIsFifoTar7; // non-zero if interface is 245 FIFO CPU target
593 UCHAR IFAIsFastSer7; // non-zero if interface is Fast serial
594 UCHAR AIsVCP7; // non-zero if interface is to use VCP drivers
595 UCHAR IFBIsFifo7; // non-zero if interface is 245 FIFO
596 UCHAR IFBIsFifoTar7; // non-zero if interface is 245 FIFO CPU target
597 UCHAR IFBIsFastSer7; // non-zero if interface is Fast serial
598 UCHAR BIsVCP7; // non-zero if interface is to use VCP drivers
599 UCHAR PowerSaveEnable; // non-zero if using BCBUS7 to save power for self-powered designs
600 //
601 // Rev 8 (FT4232H) Extensions
602 //
603 UCHAR PullDownEnable8; // non-zero if pull down enabled
604 UCHAR SerNumEnable8; // non-zero if serial number to be used
605 UCHAR ASlowSlew; // non-zero if A pins have slow slew
606 UCHAR ASchmittInput; // non-zero if A pins are Schmitt input
607 UCHAR ADriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
608 UCHAR BSlowSlew; // non-zero if B pins have slow slew
609 UCHAR BSchmittInput; // non-zero if B pins are Schmitt input
610 UCHAR BDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
611 UCHAR CSlowSlew; // non-zero if C pins have slow slew
612 UCHAR CSchmittInput; // non-zero if C pins are Schmitt input
613 UCHAR CDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
614 UCHAR DSlowSlew; // non-zero if D pins have slow slew
615 UCHAR DSchmittInput; // non-zero if D pins are Schmitt input
616 UCHAR DDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
617 UCHAR ARIIsTXDEN; // non-zero if port A uses RI as RS485 TXDEN
618 UCHAR BRIIsTXDEN; // non-zero if port B uses RI as RS485 TXDEN
619 UCHAR CRIIsTXDEN; // non-zero if port C uses RI as RS485 TXDEN
620 UCHAR DRIIsTXDEN; // non-zero if port D uses RI as RS485 TXDEN
621 UCHAR AIsVCP8; // non-zero if interface is to use VCP drivers
622 UCHAR BIsVCP8; // non-zero if interface is to use VCP drivers
623 UCHAR CIsVCP8; // non-zero if interface is to use VCP drivers
624 UCHAR DIsVCP8; // non-zero if interface is to use VCP drivers
625 //
626 // Rev 9 (FT232H) Extensions
627 //
628 UCHAR PullDownEnableH; // non-zero if pull down enabled
629 UCHAR SerNumEnableH; // non-zero if serial number to be used
630 UCHAR ACSlowSlewH; // non-zero if AC pins have slow slew
631 UCHAR ACSchmittInputH; // non-zero if AC pins are Schmitt input
632 UCHAR ACDriveCurrentH; // valid values are 4mA, 8mA, 12mA, 16mA
633 UCHAR ADSlowSlewH; // non-zero if AD pins have slow slew
634 UCHAR ADSchmittInputH; // non-zero if AD pins are Schmitt input
635 UCHAR ADDriveCurrentH; // valid values are 4mA, 8mA, 12mA, 16mA
636 UCHAR Cbus0H; // Cbus Mux control
637 UCHAR Cbus1H; // Cbus Mux control
638 UCHAR Cbus2H; // Cbus Mux control
639 UCHAR Cbus3H; // Cbus Mux control
640 UCHAR Cbus4H; // Cbus Mux control
641 UCHAR Cbus5H; // Cbus Mux control
642 UCHAR Cbus6H; // Cbus Mux control
643 UCHAR Cbus7H; // Cbus Mux control
644 UCHAR Cbus8H; // Cbus Mux control
645 UCHAR Cbus9H; // Cbus Mux control
646 UCHAR IsFifoH; // non-zero if interface is 245 FIFO
647 UCHAR IsFifoTarH; // non-zero if interface is 245 FIFO CPU target
648 UCHAR IsFastSerH; // non-zero if interface is Fast serial
649 UCHAR IsFT1248H; // non-zero if interface is FT1248
650 UCHAR FT1248CpolH; // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
651 UCHAR FT1248LsbH; // FT1248 data is LSB (1) or MSB (0)
652 UCHAR FT1248FlowControlH; // FT1248 flow control enable
653 UCHAR IsVCPH; // non-zero if interface is to use VCP drivers
654 UCHAR PowerSaveEnableH; // non-zero if using ACBUS7 to save power for self-powered designs
655  
656 } FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;
657  
658 FTD2XX_API
659 FT_STATUS WINAPI FT_EE_Program(
660 FT_HANDLE ftHandle,
661 PFT_PROGRAM_DATA pData
662 );
663  
664 FTD2XX_API
665 FT_STATUS WINAPI FT_EE_ProgramEx(
666 FT_HANDLE ftHandle,
667 PFT_PROGRAM_DATA pData,
668 char *Manufacturer,
669 char *ManufacturerId,
670 char *Description,
671 char *SerialNumber
672 );
673  
674 FTD2XX_API
675 FT_STATUS WINAPI FT_EE_Read(
676 FT_HANDLE ftHandle,
677 PFT_PROGRAM_DATA pData
678 );
679  
680 FTD2XX_API
681 FT_STATUS WINAPI FT_EE_ReadEx(
682 FT_HANDLE ftHandle,
683 PFT_PROGRAM_DATA pData,
684 char *Manufacturer,
685 char *ManufacturerId,
686 char *Description,
687 char *SerialNumber
688 );
689  
690 FTD2XX_API
691 FT_STATUS WINAPI FT_EE_UASize(
692 FT_HANDLE ftHandle,
693 LPDWORD lpdwSize
694 );
695  
696 FTD2XX_API
697 FT_STATUS WINAPI FT_EE_UAWrite(
698 FT_HANDLE ftHandle,
699 PUCHAR pucData,
700 DWORD dwDataLen
701 );
702  
703 FTD2XX_API
704 FT_STATUS WINAPI FT_EE_UARead(
705 FT_HANDLE ftHandle,
706 PUCHAR pucData,
707 DWORD dwDataLen,
708 LPDWORD lpdwBytesRead
709 );
710  
711  
712 typedef struct ft_eeprom_header {
713 FT_DEVICE deviceType; // FTxxxx device type to be programmed
714 // Device descriptor options
715 WORD VendorId; // 0x0403
716 WORD ProductId; // 0x6001
717 UCHAR SerNumEnable; // non-zero if serial number to be used
718 // Config descriptor options
719 WORD MaxPower; // 0 < MaxPower <= 500
720 UCHAR SelfPowered; // 0 = bus powered, 1 = self powered
721 UCHAR RemoteWakeup; // 0 = not capable, 1 = capable
722 // Hardware options
723 UCHAR PullDownEnable; // non-zero if pull down in suspend enabled
724 } FT_EEPROM_HEADER, *PFT_EEPROM_HEADER;
725  
726  
727 // FT232B EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
728 typedef struct ft_eeprom_232b {
729 // Common header
730 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
731 } FT_EEPROM_232B, *PFT_EEPROM_232B;
732  
733  
734 // FT2232 EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
735 typedef struct ft_eeprom_2232 {
736 // Common header
737 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
738 // Drive options
739 UCHAR AIsHighCurrent; // non-zero if interface is high current
740 UCHAR BIsHighCurrent; // non-zero if interface is high current
741 // Hardware options
742 UCHAR AIsFifo; // non-zero if interface is 245 FIFO
743 UCHAR AIsFifoTar; // non-zero if interface is 245 FIFO CPU target
744 UCHAR AIsFastSer; // non-zero if interface is Fast serial
745 UCHAR BIsFifo; // non-zero if interface is 245 FIFO
746 UCHAR BIsFifoTar; // non-zero if interface is 245 FIFO CPU target
747 UCHAR BIsFastSer; // non-zero if interface is Fast serial
748 // Driver option
749 UCHAR ADriverType; //
750 UCHAR BDriverType; //
751 } FT_EEPROM_2232, *PFT_EEPROM_2232;
752  
753  
754 // FT232R EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
755 typedef struct ft_eeprom_232r {
756 // Common header
757 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
758 // Drive options
759 UCHAR IsHighCurrent; // non-zero if interface is high current
760 // Hardware options
761 UCHAR UseExtOsc; // Use External Oscillator
762 UCHAR InvertTXD; // non-zero if invert TXD
763 UCHAR InvertRXD; // non-zero if invert RXD
764 UCHAR InvertRTS; // non-zero if invert RTS
765 UCHAR InvertCTS; // non-zero if invert CTS
766 UCHAR InvertDTR; // non-zero if invert DTR
767 UCHAR InvertDSR; // non-zero if invert DSR
768 UCHAR InvertDCD; // non-zero if invert DCD
769 UCHAR InvertRI; // non-zero if invert RI
770 UCHAR Cbus0; // Cbus Mux control
771 UCHAR Cbus1; // Cbus Mux control
772 UCHAR Cbus2; // Cbus Mux control
773 UCHAR Cbus3; // Cbus Mux control
774 UCHAR Cbus4; // Cbus Mux control
775 // Driver option
776 UCHAR DriverType; //
777 } FT_EEPROM_232R, *PFT_EEPROM_232R;
778  
779  
780 // FT2232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
781 typedef struct ft_eeprom_2232h {
782 // Common header
783 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
784 // Drive options
785 UCHAR ALSlowSlew; // non-zero if AL pins have slow slew
786 UCHAR ALSchmittInput; // non-zero if AL pins are Schmitt input
787 UCHAR ALDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
788 UCHAR AHSlowSlew; // non-zero if AH pins have slow slew
789 UCHAR AHSchmittInput; // non-zero if AH pins are Schmitt input
790 UCHAR AHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
791 UCHAR BLSlowSlew; // non-zero if BL pins have slow slew
792 UCHAR BLSchmittInput; // non-zero if BL pins are Schmitt input
793 UCHAR BLDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
794 UCHAR BHSlowSlew; // non-zero if BH pins have slow slew
795 UCHAR BHSchmittInput; // non-zero if BH pins are Schmitt input
796 UCHAR BHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
797 // Hardware options
798 UCHAR AIsFifo; // non-zero if interface is 245 FIFO
799 UCHAR AIsFifoTar; // non-zero if interface is 245 FIFO CPU target
800 UCHAR AIsFastSer; // non-zero if interface is Fast serial
801 UCHAR BIsFifo; // non-zero if interface is 245 FIFO
802 UCHAR BIsFifoTar; // non-zero if interface is 245 FIFO CPU target
803 UCHAR BIsFastSer; // non-zero if interface is Fast serial
804 UCHAR PowerSaveEnable; // non-zero if using BCBUS7 to save power for self-powered designs
805 // Driver option
806 UCHAR ADriverType; //
807 UCHAR BDriverType; //
808 } FT_EEPROM_2232H, *PFT_EEPROM_2232H;
809  
810  
811 // FT4232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
812 typedef struct ft_eeprom_4232h {
813 // Common header
814 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
815 // Drive options
816 UCHAR ASlowSlew; // non-zero if A pins have slow slew
817 UCHAR ASchmittInput; // non-zero if A pins are Schmitt input
818 UCHAR ADriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
819 UCHAR BSlowSlew; // non-zero if B pins have slow slew
820 UCHAR BSchmittInput; // non-zero if B pins are Schmitt input
821 UCHAR BDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
822 UCHAR CSlowSlew; // non-zero if C pins have slow slew
823 UCHAR CSchmittInput; // non-zero if C pins are Schmitt input
824 UCHAR CDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
825 UCHAR DSlowSlew; // non-zero if D pins have slow slew
826 UCHAR DSchmittInput; // non-zero if D pins are Schmitt input
827 UCHAR DDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
828 // Hardware options
829 UCHAR ARIIsTXDEN; // non-zero if port A uses RI as RS485 TXDEN
830 UCHAR BRIIsTXDEN; // non-zero if port B uses RI as RS485 TXDEN
831 UCHAR CRIIsTXDEN; // non-zero if port C uses RI as RS485 TXDEN
832 UCHAR DRIIsTXDEN; // non-zero if port D uses RI as RS485 TXDEN
833 // Driver option
834 UCHAR ADriverType; //
835 UCHAR BDriverType; //
836 UCHAR CDriverType; //
837 UCHAR DDriverType; //
838 } FT_EEPROM_4232H, *PFT_EEPROM_4232H;
839  
840  
841 // FT232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
842 typedef struct ft_eeprom_232h {
843 // Common header
844 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
845 // Drive options
846 UCHAR ACSlowSlew; // non-zero if AC bus pins have slow slew
847 UCHAR ACSchmittInput; // non-zero if AC bus pins are Schmitt input
848 UCHAR ACDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
849 UCHAR ADSlowSlew; // non-zero if AD bus pins have slow slew
850 UCHAR ADSchmittInput; // non-zero if AD bus pins are Schmitt input
851 UCHAR ADDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
852 // CBUS options
853 UCHAR Cbus0; // Cbus Mux control
854 UCHAR Cbus1; // Cbus Mux control
855 UCHAR Cbus2; // Cbus Mux control
856 UCHAR Cbus3; // Cbus Mux control
857 UCHAR Cbus4; // Cbus Mux control
858 UCHAR Cbus5; // Cbus Mux control
859 UCHAR Cbus6; // Cbus Mux control
860 UCHAR Cbus7; // Cbus Mux control
861 UCHAR Cbus8; // Cbus Mux control
862 UCHAR Cbus9; // Cbus Mux control
863 // FT1248 options
864 UCHAR FT1248Cpol; // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
865 UCHAR FT1248Lsb; // FT1248 data is LSB (1) or MSB (0)
866 UCHAR FT1248FlowControl; // FT1248 flow control enable
867 // Hardware options
868 UCHAR IsFifo; // non-zero if interface is 245 FIFO
869 UCHAR IsFifoTar; // non-zero if interface is 245 FIFO CPU target
870 UCHAR IsFastSer; // non-zero if interface is Fast serial
871 UCHAR IsFT1248 ; // non-zero if interface is FT1248
872 UCHAR PowerSaveEnable; //
873 // Driver option
874 UCHAR DriverType; //
875 } FT_EEPROM_232H, *PFT_EEPROM_232H;
876  
877  
878 // FT X Series EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
879 typedef struct ft_eeprom_x_series {
880 // Common header
881 FT_EEPROM_HEADER common; // common elements for all device EEPROMs
882 // Drive options
883 UCHAR ACSlowSlew; // non-zero if AC bus pins have slow slew
884 UCHAR ACSchmittInput; // non-zero if AC bus pins are Schmitt input
885 UCHAR ACDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
886 UCHAR ADSlowSlew; // non-zero if AD bus pins have slow slew
887 UCHAR ADSchmittInput; // non-zero if AD bus pins are Schmitt input
888 UCHAR ADDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
889 // CBUS options
890 UCHAR Cbus0; // Cbus Mux control
891 UCHAR Cbus1; // Cbus Mux control
892 UCHAR Cbus2; // Cbus Mux control
893 UCHAR Cbus3; // Cbus Mux control
894 UCHAR Cbus4; // Cbus Mux control
895 UCHAR Cbus5; // Cbus Mux control
896 UCHAR Cbus6; // Cbus Mux control
897 // UART signal options
898 UCHAR InvertTXD; // non-zero if invert TXD
899 UCHAR InvertRXD; // non-zero if invert RXD
900 UCHAR InvertRTS; // non-zero if invert RTS
901 UCHAR InvertCTS; // non-zero if invert CTS
902 UCHAR InvertDTR; // non-zero if invert DTR
903 UCHAR InvertDSR; // non-zero if invert DSR
904 UCHAR InvertDCD; // non-zero if invert DCD
905 UCHAR InvertRI; // non-zero if invert RI
906 // Battery Charge Detect options
907 UCHAR BCDEnable; // Enable Battery Charger Detection
908 UCHAR BCDForceCbusPWREN; // asserts the power enable signal on CBUS when charging port detected
909 UCHAR BCDDisableSleep; // forces the device never to go into sleep mode
910 // I2C options
911 WORD I2CSlaveAddress; // I2C slave device address
912 DWORD I2CDeviceId; // I2C device ID
913 UCHAR I2CDisableSchmitt; // Disable I2C Schmitt trigger
914 // FT1248 options
915 UCHAR FT1248Cpol; // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
916 UCHAR FT1248Lsb; // FT1248 data is LSB (1) or MSB (0)
917 UCHAR FT1248FlowControl; // FT1248 flow control enable
918 // Hardware options
919 UCHAR RS485EchoSuppress; //
920 UCHAR PowerSaveEnable; //
921 // Driver option
922 UCHAR DriverType; //
923 } FT_EEPROM_X_SERIES, *PFT_EEPROM_X_SERIES;
924  
925  
926 FTD2XX_API
927 FT_STATUS WINAPI FT_EEPROM_Read(
928 FT_HANDLE ftHandle,
929 void *eepromData,
930 DWORD eepromDataSize,
931 char *Manufacturer,
932 char *ManufacturerId,
933 char *Description,
934 char *SerialNumber
935 );
936  
937  
938 FTD2XX_API
939 FT_STATUS WINAPI FT_EEPROM_Program(
940 FT_HANDLE ftHandle,
941 void *eepromData,
942 DWORD eepromDataSize,
943 char *Manufacturer,
944 char *ManufacturerId,
945 char *Description,
946 char *SerialNumber
947 );
948  
949  
950 FTD2XX_API
951 FT_STATUS WINAPI FT_SetLatencyTimer(
952 FT_HANDLE ftHandle,
953 UCHAR ucLatency
954 );
955  
956 FTD2XX_API
957 FT_STATUS WINAPI FT_GetLatencyTimer(
958 FT_HANDLE ftHandle,
959 PUCHAR pucLatency
960 );
961  
962 FTD2XX_API
963 FT_STATUS WINAPI FT_SetBitMode(
964 FT_HANDLE ftHandle,
965 UCHAR ucMask,
966 UCHAR ucEnable
967 );
968  
969 FTD2XX_API
970 FT_STATUS WINAPI FT_GetBitMode(
971 FT_HANDLE ftHandle,
972 PUCHAR pucMode
973 );
974  
975 FTD2XX_API
976 FT_STATUS WINAPI FT_SetUSBParameters(
977 FT_HANDLE ftHandle,
978 ULONG ulInTransferSize,
979 ULONG ulOutTransferSize
980 );
981  
982 FTD2XX_API
983 FT_STATUS WINAPI FT_SetDeadmanTimeout(
984 FT_HANDLE ftHandle,
985 ULONG ulDeadmanTimeout
986 );
987  
988 FTD2XX_API
989 FT_STATUS WINAPI FT_GetDeviceInfo(
990 FT_HANDLE ftHandle,
991 FT_DEVICE *lpftDevice,
992 LPDWORD lpdwID,
993 PCHAR SerialNumber,
994 PCHAR Description,
995 LPVOID Dummy
996 );
997  
998 FTD2XX_API
999 FT_STATUS WINAPI FT_StopInTask(
1000 FT_HANDLE ftHandle
1001 );
1002  
1003 FTD2XX_API
1004 FT_STATUS WINAPI FT_RestartInTask(
1005 FT_HANDLE ftHandle
1006 );
1007  
1008 FTD2XX_API
1009 FT_STATUS WINAPI FT_SetResetPipeRetryCount(
1010 FT_HANDLE ftHandle,
1011 DWORD dwCount
1012 );
1013  
1014 FTD2XX_API
1015 FT_STATUS WINAPI FT_ResetPort(
1016 FT_HANDLE ftHandle
1017 );
1018  
1019 FTD2XX_API
1020 FT_STATUS WINAPI FT_CyclePort(
1021 FT_HANDLE ftHandle
1022 );
1023  
1024  
1025 //
1026 // Win32-type functions
1027 //
1028  
1029 FTD2XX_API
1030 FT_HANDLE WINAPI FT_W32_CreateFile(
1031 LPCTSTR lpszName,
1032 DWORD dwAccess,
1033 DWORD dwShareMode,
1034 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
1035 DWORD dwCreate,
1036 DWORD dwAttrsAndFlags,
1037 HANDLE hTemplate
1038 );
1039  
1040 FTD2XX_API
1041 BOOL WINAPI FT_W32_CloseHandle(
1042 FT_HANDLE ftHandle
1043 );
1044  
1045 FTD2XX_API
1046 BOOL WINAPI FT_W32_ReadFile(
1047 FT_HANDLE ftHandle,
1048 LPVOID lpBuffer,
1049 DWORD nBufferSize,
1050 LPDWORD lpBytesReturned,
1051 LPOVERLAPPED lpOverlapped
1052 );
1053  
1054 FTD2XX_API
1055 BOOL WINAPI FT_W32_WriteFile(
1056 FT_HANDLE ftHandle,
1057 LPVOID lpBuffer,
1058 DWORD nBufferSize,
1059 LPDWORD lpBytesWritten,
1060 LPOVERLAPPED lpOverlapped
1061 );
1062  
1063 FTD2XX_API
1064 DWORD WINAPI FT_W32_GetLastError(
1065 FT_HANDLE ftHandle
1066 );
1067  
1068 FTD2XX_API
1069 BOOL WINAPI FT_W32_GetOverlappedResult(
1070 FT_HANDLE ftHandle,
1071 LPOVERLAPPED lpOverlapped,
1072 LPDWORD lpdwBytesTransferred,
1073 BOOL bWait
1074 );
1075  
1076 FTD2XX_API
1077 BOOL WINAPI FT_W32_CancelIo(
1078 FT_HANDLE ftHandle
1079 );
1080  
1081  
1082 //
1083 // Win32 COMM API type functions
1084 //
1085 typedef struct _FTCOMSTAT {
1086 DWORD fCtsHold : 1;
1087 DWORD fDsrHold : 1;
1088 DWORD fRlsdHold : 1;
1089 DWORD fXoffHold : 1;
1090 DWORD fXoffSent : 1;
1091 DWORD fEof : 1;
1092 DWORD fTxim : 1;
1093 DWORD fReserved : 25;
1094 DWORD cbInQue;
1095 DWORD cbOutQue;
1096 } FTCOMSTAT, *LPFTCOMSTAT;
1097  
1098 typedef struct _FTDCB {
1099 DWORD DCBlength; /* sizeof(FTDCB) */
1100 DWORD BaudRate; /* Baudrate at which running */
1101 DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
1102 DWORD fParity: 1; /* Enable parity checking */
1103 DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
1104 DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
1105 DWORD fDtrControl:2; /* DTR Flow control */
1106 DWORD fDsrSensitivity:1; /* DSR Sensitivity */
1107 DWORD fTXContinueOnXoff: 1; /* Continue TX when Xoff sent */
1108 DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
1109 DWORD fInX: 1; /* Enable input X-ON/X-OFF */
1110 DWORD fErrorChar: 1; /* Enable Err Replacement */
1111 DWORD fNull: 1; /* Enable Null stripping */
1112 DWORD fRtsControl:2; /* Rts Flow control */
1113 DWORD fAbortOnError:1; /* Abort all reads and writes on Error */
1114 DWORD fDummy2:17; /* Reserved */
1115 WORD wReserved; /* Not currently used */
1116 WORD XonLim; /* Transmit X-ON threshold */
1117 WORD XoffLim; /* Transmit X-OFF threshold */
1118 BYTE ByteSize; /* Number of bits/byte, 4-8 */
1119 BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
1120 BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
1121 char XonChar; /* Tx and Rx X-ON character */
1122 char XoffChar; /* Tx and Rx X-OFF character */
1123 char ErrorChar; /* Error replacement char */
1124 char EofChar; /* End of Input character */
1125 char EvtChar; /* Received Event character */
1126 WORD wReserved1; /* Fill for now. */
1127 } FTDCB, *LPFTDCB;
1128  
1129 typedef struct _FTTIMEOUTS {
1130 DWORD ReadIntervalTimeout; /* Maximum time between read chars. */
1131 DWORD ReadTotalTimeoutMultiplier; /* Multiplier of characters. */
1132 DWORD ReadTotalTimeoutConstant; /* Constant in milliseconds. */
1133 DWORD WriteTotalTimeoutMultiplier; /* Multiplier of characters. */
1134 DWORD WriteTotalTimeoutConstant; /* Constant in milliseconds. */
1135 } FTTIMEOUTS,*LPFTTIMEOUTS;
1136  
1137  
1138 FTD2XX_API
1139 BOOL WINAPI FT_W32_ClearCommBreak(
1140 FT_HANDLE ftHandle
1141 );
1142  
1143 FTD2XX_API
1144 BOOL WINAPI FT_W32_ClearCommError(
1145 FT_HANDLE ftHandle,
1146 LPDWORD lpdwErrors,
1147 LPFTCOMSTAT lpftComstat
1148 );
1149  
1150 FTD2XX_API
1151 BOOL WINAPI FT_W32_EscapeCommFunction(
1152 FT_HANDLE ftHandle,
1153 DWORD dwFunc
1154 );
1155  
1156 FTD2XX_API
1157 BOOL WINAPI FT_W32_GetCommModemStatus(
1158 FT_HANDLE ftHandle,
1159 LPDWORD lpdwModemStatus
1160 );
1161  
1162 FTD2XX_API
1163 BOOL WINAPI FT_W32_GetCommState(
1164 FT_HANDLE ftHandle,
1165 LPFTDCB lpftDcb
1166 );
1167  
1168 FTD2XX_API
1169 BOOL WINAPI FT_W32_GetCommTimeouts(
1170 FT_HANDLE ftHandle,
1171 FTTIMEOUTS *pTimeouts
1172 );
1173  
1174 FTD2XX_API
1175 BOOL WINAPI FT_W32_PurgeComm(
1176 FT_HANDLE ftHandle,
1177 DWORD dwMask
1178 );
1179  
1180 FTD2XX_API
1181 BOOL WINAPI FT_W32_SetCommBreak(
1182 FT_HANDLE ftHandle
1183 );
1184  
1185 FTD2XX_API
1186 BOOL WINAPI FT_W32_SetCommMask(
1187 FT_HANDLE ftHandle,
1188 ULONG ulEventMask
1189 );
1190  
1191 FTD2XX_API
1192 BOOL WINAPI FT_W32_GetCommMask(
1193 FT_HANDLE ftHandle,
1194 LPDWORD lpdwEventMask
1195 );
1196  
1197 FTD2XX_API
1198 BOOL WINAPI FT_W32_SetCommState(
1199 FT_HANDLE ftHandle,
1200 LPFTDCB lpftDcb
1201 );
1202  
1203 FTD2XX_API
1204 BOOL WINAPI FT_W32_SetCommTimeouts(
1205 FT_HANDLE ftHandle,
1206 FTTIMEOUTS *pTimeouts
1207 );
1208  
1209 FTD2XX_API
1210 BOOL WINAPI FT_W32_SetupComm(
1211 FT_HANDLE ftHandle,
1212 DWORD dwReadBufferSize,
1213 DWORD dwWriteBufferSize
1214 );
1215  
1216 FTD2XX_API
1217 BOOL WINAPI FT_W32_WaitCommEvent(
1218 FT_HANDLE ftHandle,
1219 PULONG pulEvent,
1220 LPOVERLAPPED lpOverlapped
1221 );
1222  
1223  
1224 //
1225 // Device information
1226 //
1227  
1228 typedef struct _ft_device_list_info_node {
1229 ULONG Flags;
1230 ULONG Type;
1231 ULONG ID;
1232 DWORD LocId;
1233 char SerialNumber[16];
1234 char Description[64];
1235 FT_HANDLE ftHandle;
1236 } FT_DEVICE_LIST_INFO_NODE;
1237  
1238 // Device information flags
1239 enum {
1240 FT_FLAGS_OPENED = 1,
1241 FT_FLAGS_HISPEED = 2
1242 };
1243  
1244  
1245 FTD2XX_API
1246 FT_STATUS WINAPI FT_CreateDeviceInfoList(
1247 LPDWORD lpdwNumDevs
1248 );
1249  
1250 FTD2XX_API
1251 FT_STATUS WINAPI FT_GetDeviceInfoList(
1252 FT_DEVICE_LIST_INFO_NODE *pDest,
1253 LPDWORD lpdwNumDevs
1254 );
1255  
1256 FTD2XX_API
1257 FT_STATUS WINAPI FT_GetDeviceInfoDetail(
1258 DWORD dwIndex,
1259 LPDWORD lpdwFlags,
1260 LPDWORD lpdwType,
1261 LPDWORD lpdwID,
1262 LPDWORD lpdwLocId,
1263 LPVOID lpSerialNumber,
1264 LPVOID lpDescription,
1265 FT_HANDLE *pftHandle
1266 );
1267  
1268  
1269 //
1270 // Version information
1271 //
1272  
1273 FTD2XX_API
1274 FT_STATUS WINAPI FT_GetDriverVersion(
1275 FT_HANDLE ftHandle,
1276 LPDWORD lpdwVersion
1277 );
1278  
1279 FTD2XX_API
1280 FT_STATUS WINAPI FT_GetLibraryVersion(
1281 LPDWORD lpdwVersion
1282 );
1283  
1284  
1285 FTD2XX_API
1286 FT_STATUS WINAPI FT_Rescan(
1287 void
1288 );
1289  
1290 FTD2XX_API
1291 FT_STATUS WINAPI FT_Reload(
1292 WORD wVid,
1293 WORD wPid
1294 );
1295  
1296 FTD2XX_API
1297 FT_STATUS WINAPI FT_GetComPortNumber(
1298 FT_HANDLE ftHandle,
1299 LPLONG lpdwComPortNumber
1300 );
1301  
1302  
1303 //
1304 // FT232H additional EEPROM functions
1305 //
1306  
1307 FTD2XX_API
1308 FT_STATUS WINAPI FT_EE_ReadConfig(
1309 FT_HANDLE ftHandle,
1310 UCHAR ucAddress,
1311 PUCHAR pucValue
1312 );
1313  
1314 FTD2XX_API
1315 FT_STATUS WINAPI FT_EE_WriteConfig(
1316 FT_HANDLE ftHandle,
1317 UCHAR ucAddress,
1318 UCHAR ucValue
1319 );
1320  
1321 FTD2XX_API
1322 FT_STATUS WINAPI FT_EE_ReadECC(
1323 FT_HANDLE ftHandle,
1324 UCHAR ucOption,
1325 LPWORD lpwValue
1326 );
1327  
1328 FTD2XX_API
1329 FT_STATUS WINAPI FT_GetQueueStatusEx(
1330 FT_HANDLE ftHandle,
1331 DWORD *dwRxBytes
1332 );
1333  
1334  
1335 #ifdef __cplusplus
1336 }
1337 #endif
1338  
1339  
1340 #endif /* FTD2XX_H */
1341