| PDM-IR SDK 3.0.2 PDM-IR SDK

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