]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/nusb/serial/ftdi.h
merge
[plan9front.git] / sys / src / cmd / nusb / serial / ftdi.h
1 enum {
2         /* used by devices which don't provide their own Vid */
3         FTVid           = 0x0403,
4
5         FTSheevaVid     = 0x9E88,
6         FTSheevaDid     = 0x9E8F,
7         FTOpenRDUltDid  = 0x9E90,
8
9         FTSIODid        = 0x8372,       /* Product Id SIO appl'n of 8U100AX */
10         FT8U232AMDid    = 0x6001,       /* Similar device to SIO above */
11         FT8U232AMALTDid = 0x6006,       /* FT's alternate Did for above*/
12         FT8U2232CDid    = 0x6010,       /* Dual channel device */
13         FTRELAISDid     = 0xFA10,       /* Relais device */
14
15         /* NF reader */
16         FTNFRICVid      = 0x0DCD,
17         FTNFRICDid      = 0x0001,
18
19         FTACTZWAVEDid   = 0xF2D0,               /* www.irtrans.de device */
20
21         /*
22          * ACT Solutions HomePro ZWave interface
23          * http://www.act-solutions.com/HomePro.htm)
24          */
25         FTIRTRANSDid    = 0xFC60,
26
27         /*
28          * www.thoughttechnology.com/ TT-USB
29          */
30         FTTTUSBDid      = 0xFF20,
31
32         /* iPlus device */
33         FTIPLUSDid      = 0xD070,
34
35         /* www.crystalfontz.com devices */
36         FTXF632Did = 0xFC08,    /* 632: 16x2 Character Display */
37         FTXF634Did = 0xFC09,    /* 634: 20x4 Character Display */
38         FTXF547Did = 0xFC0A,    /* 547: Two line Display */
39         FTXF633Did = 0xFC0B,    /* 633: 16x2 Character Display with Keys */
40         FTXF631Did = 0xFC0C,    /* 631: 20x2 Character Display */
41         FTXF635Did = 0xFC0D,    /* 635: 20x4 Character Display */
42         FTXF640Did = 0xFC0E,    /* 640: Two line Display */
43         FTXF642Did = 0xFC0F,    /* 642: Two line Display */
44
45         /*
46          * Video Networks Limited / Homechoice in the UK
47          * use an ftdi-based device for their 1Mb broadband
48          */
49         FTVNHCPCUSBDDid = 0xfe38,
50
51         /*
52          * PCDJ use ftdi based dj-controllers
53          * DAC-2 device http://www.pcdjhardware.com/DAC2.asp
54          */
55         FTPCDJDAC2Did = 0xFA88,
56
57         /*
58          * Matrix Orbital LCD displays,
59          * which are the FT232BM (similar to the 8U232AM)
60          */
61         FTMTXORB0Did = 0xFA00,
62         FTMTXORB1Did = 0xFA01,
63         FTMTXORB2Did = 0xFA02,
64         FTMTXORB3Did = 0xFA03,
65         FTMTXORB4Did = 0xFA04,
66         FTMTXORB5Did = 0xFA05,
67         FTMTXORB6Did = 0xFA06,
68
69         /* Interbiometrics USB I/O Board */
70         INTERBIOMVid            = 0x1209,
71         INTERBIOMIOBRDDid       = 0x1002,
72         INTERBIOMMINIIOBRDDid   = 0x1006,
73
74         /*
75          * The following are the values for the Perle Systems
76          * UltraPort USB serial converters
77          */
78         FTPERLEULTRAPORTDid = 0xF0C0,
79
80         /*
81          * Sealevel SeaLINK+ adapters.
82          */
83
84         SEALEVELVid = 0x0c52,
85
86         SEALEVEL2101Did = 0x2101,       /* SeaLINK+232 (2101/2105) */
87         SEALEVEL2102Did = 0x2102,       /* SeaLINK+485 (2102) */
88         SEALEVEL2103Did = 0x2103,       /* SeaLINK+232I (2103) */
89         SEALEVEL2104Did = 0x2104,       /* SeaLINK+485I (2104) */
90         SEALEVEL22011Did = 0x2211,      /* SeaPORT+2/232 (2201) Port 1 */
91         SEALEVEL22012Did = 0x2221,      /* SeaPORT+2/232 (2201) Port 2 */
92         SEALEVEL22021Did = 0x2212,      /* SeaPORT+2/485 (2202) Port 1 */
93         SEALEVEL22022Did = 0x2222,      /* SeaPORT+2/485 (2202) Port 2 */
94         SEALEVEL22031Did = 0x2213,      /* SeaPORT+2 (2203) Port 1 */
95         SEALEVEL22032Did = 0x2223,      /* SeaPORT+2 (2203) Port 2 */
96         SEALEVEL24011Did = 0x2411,      /* SeaPORT+4/232 (2401) Port 1 */
97         SEALEVEL24012Did = 0x2421,      /* SeaPORT+4/232 (2401) Port 2 */
98         SEALEVEL24013Did = 0x2431,      /* SeaPORT+4/232 (2401) Port 3 */
99         SEALEVEL24014Did = 0x2441,      /* SeaPORT+4/232 (2401) Port 4 */
100         SEALEVEL24021Did = 0x2412,      /* SeaPORT+4/485 (2402) Port 1 */
101         SEALEVEL24022Did = 0x2422,      /* SeaPORT+4/485 (2402) Port 2 */
102         SEALEVEL24023Did = 0x2432,      /* SeaPORT+4/485 (2402) Port 3 */
103         SEALEVEL24024Did = 0x2442,      /* SeaPORT+4/485 (2402) Port 4 */
104         SEALEVEL24031Did = 0x2413,      /* SeaPORT+4 (2403) Port 1 */
105         SEALEVEL24032Did = 0x2423,      /* SeaPORT+4 (2403) Port 2 */
106         SEALEVEL24033Did = 0x2433,      /* SeaPORT+4 (2403) Port 3 */
107         SEALEVEL24034Did = 0x2443,      /* SeaPORT+4 (2403) Port 4 */
108         SEALEVEL28011Did = 0x2811,      /* SeaLINK+8/232 (2801) Port 1 */
109         SEALEVEL28012Did = 0x2821,      /* SeaLINK+8/232 (2801) Port 2 */
110         SEALEVEL28013Did = 0x2831,      /* SeaLINK+8/232 (2801) Port 3 */
111         SEALEVEL28014Did = 0x2841,      /* SeaLINK+8/232 (2801) Port 4 */
112         SEALEVEL28015Did = 0x2851,      /* SeaLINK+8/232 (2801) Port 5 */
113         SEALEVEL28016Did = 0x2861,      /* SeaLINK+8/232 (2801) Port 6 */
114         SEALEVEL28017Did = 0x2871,      /* SeaLINK+8/232 (2801) Port 7 */
115         SEALEVEL28018Did = 0x2881,      /* SeaLINK+8/232 (2801) Port 8 */
116         SEALEVEL28021Did = 0x2812,      /* SeaLINK+8/485 (2802) Port 1 */
117         SEALEVEL28022Did = 0x2822,      /* SeaLINK+8/485 (2802) Port 2 */
118         SEALEVEL28023Did = 0x2832,      /* SeaLINK+8/485 (2802) Port 3 */
119         SEALEVEL28024Did = 0x2842,      /* SeaLINK+8/485 (2802) Port 4 */
120         SEALEVEL28025Did = 0x2852,      /* SeaLINK+8/485 (2802) Port 5 */
121         SEALEVEL28026Did = 0x2862,      /* SeaLINK+8/485 (2802) Port 6 */
122         SEALEVEL28027Did = 0x2872,      /* SeaLINK+8/485 (2802) Port 7 */
123         SEALEVEL28028Did = 0x2882,      /* SeaLINK+8/485 (2802) Port 8 */
124         SEALEVEL28031Did = 0x2813,      /* SeaLINK+8 (2803) Port 1 */
125         SEALEVEL28032Did = 0x2823,      /* SeaLINK+8 (2803) Port 2 */
126         SEALEVEL28033Did = 0x2833,      /* SeaLINK+8 (2803) Port 3 */
127         SEALEVEL28034Did = 0x2843,      /* SeaLINK+8 (2803) Port 4 */
128         SEALEVEL28035Did = 0x2853,      /* SeaLINK+8 (2803) Port 5 */
129         SEALEVEL28036Did = 0x2863,      /* SeaLINK+8 (2803) Port 6 */
130         SEALEVEL28037Did = 0x2873,      /* SeaLINK+8 (2803) Port 7 */
131         SEALEVEL28038Did = 0x2883,      /* SeaLINK+8 (2803) Port 8 */
132
133         /* KOBIL Vendor ID chipcard terminals */
134         KOBILVid        = 0x0d46,
135         KOBILCONVB1Did  = 0x2020,       /* KOBIL Konverter for B1 */
136         KOBILCONVKAANDid = 0x2021,      /* KOBILKonverter for KAAN */
137
138         /* Icom ID-1 digital transceiver */
139         ICOMID1Vid      = 0x0C26,
140         ICOMID1Did      = 0x0004,
141
142         FTASKRDR400Did  = 0xC991,       /* ASK RDR 400 series card reader */
143         FTDSS20Did      = 0xFC82,       /* DSS-20 Sync Station for Sony Ericsson P800 */
144
145         /*
146          * Home Electronics (www.home-electro.com) USB gadgets
147          */
148         FTHETIRA1Did    = 0xFA78,       /* Tira-1 IR transceiver */
149
150         /*
151          * An infrared receiver and transmitter using the 8U232AM chip
152          * http://www.usbuirt.com
153          */
154         FTUSBUIRTDid    = 0xF850,
155
156         FTELVUR100Did   = 0xFB58,       /* USB-RS232-Umsetzer (UR 100) */
157         FTELVUM100Did   = 0xFB5A,       /* USB-Modul UM 100 */
158         FTELVUO100Did   = 0xFB5B,       /* USB-Modul UO 100 */
159         FTELVALC8500Did = 0xF06E,       /* ALC 8500 Expert */
160         FTELVCLI7000Did = 0xFB59,       /* Computer-Light-Interface */
161         FTELVPPS7330Did = 0xFB5C,       /* Processor-Power-Supply (PPS 7330) */
162         FTELVTFM100Did  = 0xFB5D,       /* Temperartur-Feuchte Messgeraet (TFM 100) */
163         FTELVUDF77Did   = 0xFB5E,       /* USB DCF Funkurh (UDF 77) */
164         FTELVUIO88Did   = 0xFB5F,       /* USB-I/O Interface (UIO 88) */
165         FTELVUAD8Did    = 0xF068,       /* USB-AD-Wandler (UAD 8) */
166         FTELVUDA7Did    = 0xF069,       /* USB-DA-Wandler (UDA 7) */
167         FTELVUSI2Did    = 0xF06A,       /* USB-Schrittmotoren-Interface (USI 2) */
168         FTELVT1100Did   = 0xF06B,       /* Thermometer (T 1100) */
169         FTELVPCD200Did  = 0xF06C,       /* PC-Datenlogger (PCD 200) */
170         FTELVULA200Did  = 0xF06D,       /* USB-LCD-Ansteuerung (ULA 200) */
171         FTELVFHZ1000PCDid= 0xF06F,      /* FHZ 1000 PC */
172         FTELVCSI8Did    = 0xE0F0,       /* Computer-Schalt-Interface (CSI 8) */
173         FTELVEM1000DLDid= 0xE0F1,       /* PC-Datenlogger fuer Energiemonitor (EM 1000 DL) */
174         FTELVPCK100Did  = 0xE0F2,       /* PC-Kabeltester (PCK 100) */
175         FTELVRFP500Did  = 0xE0F3,       /* HF-Leistungsmesser (RFP 500) */
176         FTELVFS20SIGDid = 0xE0F4,       /* Signalgeber (FS 20 SIG) */
177         FTELVWS300PCDid = 0xE0F6,       /* PC-Wetterstation (WS 300 PC) */
178         FTELVFHZ1300PCDid= 0xE0E8,      /* FHZ 1300 PC */
179         FTELVWS500Did   = 0xE0E9,       /* PC-Wetterstation (WS 500) */
180
181         /*
182          * Definitions for ID TECH (http://www.idt-net.com) devices
183          */
184         IDTECHVid       = 0x0ACD,       /* ID TECH Vendor ID */
185         IDTECHIDT1221UDid= 0x0300,      /* IDT1221U USB to RS-232 */
186
187         /*
188          * Definitions for Omnidirectional Control Technology, Inc. devices
189          */
190         OCTVid          = 0x0B39,       /* OCT vendor ID */
191
192         /*
193          * Note: OCT US101 is also rebadged as Dick Smith Electronics
194          * (NZ) XH6381, Dick Smith Electronics (Aus) XH6451, and SIIG
195          * Inc. model US2308 hardware version 1.
196          */
197         OCTUS101Did     = 0x0421,       /* OCT US101 USB to RS-232 */
198
199         /*
200          *      infrared receiver for access control with IR tags
201          */
202         FTPIEGROUPDid   = 0xF208,
203
204         /*
205          * Definitions for Artemis astronomical USB based cameras
206          * http://www.artemisccd.co.uk/
207          */
208
209         FTARTEMISDid    = 0xDF28,       /* All Artemis Cameras */
210
211         FTATIKATK16Did  = 0xDF30,       /* ATIK ATK-16 Grayscale Camera */
212         FTATIKATK16CDid = 0xDF32,       /* ATIK ATK-16C Colour Camera */
213         FTATIKATK16HRDid= 0xDF31,       /* ATIK ATK-16HR Grayscale */
214         FTATIKATK16HRCDid= 0xDF33,      /* ATIK ATK-16HRC Colour Camera */
215
216         /*
217          * Protego products
218          */
219         PROTEGOSPECIAL1 = 0xFC70,       /* special/unknown device */
220         PROTEGOR2X0     = 0xFC71,       /* R200-USB TRNG unit (R210, R220, and R230) */
221         PROTEGOSPECIAL3 = 0xFC72,       /* special/unknown device */
222         PROTEGOSPECIAL4 = 0xFC73,       /* special/unknown device */
223
224         /*
225          * Gude Analog- und Digitalsysteme GmbH
226          */
227         FTGUDEADSE808Did = 0xE808,
228         FTGUDEADSE809Did = 0xE809,
229         FTGUDEADSE80ADid = 0xE80A,
230         FTGUDEADSE80BDid = 0xE80B,
231         FTGUDEADSE80CDid = 0xE80C,
232         FTGUDEADSE80DDid = 0xE80D,
233         FTGUDEADSE80EDid = 0xE80E,
234         FTGUDEADSE80FDid = 0xE80F,
235         FTGUDEADSE888Did = 0xE888,      /* Expert ISDN Control USB */
236         FTGUDEADSE889Did = 0xE889,      /* USB RS-232 OptoBridge */
237         FTGUDEADSE88ADid = 0xE88A,
238         FTGUDEADSE88BDid = 0xE88B,
239         FTGUDEADSE88CDid = 0xE88C,
240         FTGUDEADSE88DDid = 0xE88D,
241         FTGUDEADSE88EDid = 0xE88E,
242         FTGUDEADSE88FDid = 0xE88F,
243
244         /*
245          * Linx Technologies
246          */
247         LINXSDMUSBQSSDid= 0xF448,       /* Linx SDM-USB-QS-S */
248         LINXMASTERDEVEL2Did= 0xF449,    /* Linx Master Development.0 */
249         LINXFUTURE0Did  = 0xF44A,       /* Linx future device */
250         LINXFUTURE1Did  = 0xF44B,       /* Linx future device */
251         LINXFUTURE2Did  = 0xF44C,       /* Linx future device */
252
253         /*
254          * CCS Inc. ICDU/ICDU40 - the FT232BM used in a in-circuit-debugger
255          * unit for PIC16's/PIC18's
256          */
257         FTCCSICDU200Did = 0xF9D0,
258         FTCCSICDU401Did = 0xF9D1,
259
260         /* Inside Accesso contactless reader (http://www.insidefr.com) */
261         INSIDEACCESSO   = 0xFAD0,
262
263         /*
264          * Intrepid Control Systems (http://www.intrepidcs.com/)
265          * ValueCAN and NeoVI
266          */
267         INTREDidVid     = 0x093C,
268         INTREDidVALUECANDid= 0x0601,
269         INTREDidNEOVIDid= 0x0701,
270
271         /*
272          * Falcom Wireless Communications GmbH
273          */
274         FALCOMVid       = 0x0F94,
275         FALCOMTWISTDid  = 0x0001,       /* Falcom Twist USB GPRS modem */
276         FALCOMSAMBADid  = 0x0005,       /* Falcom Samba USB GPRS modem */
277
278         /*
279          * SUUNTO
280          */
281         FTSUUNTOSPORTSDid= 0xF680,      /* Suunto Sports instrument */
282
283         /*
284          * B&B Electronics
285          */
286         BANDBVid        = 0x0856,       /* B&B Electronics Vendor ID */
287         BANDBUSOTL4Did  = 0xAC01,       /* USOTL4 Isolated RS-485 */
288         BANDBUSTL4Did   = 0xAC02,       /* USTL4 RS-485 Converter */
289         BANDBUSO9ML2Did = 0xAC03,       /* USO9ML2 Isolated RS-232 */
290
291         /*
292          * RM Michaelides CANview USB (http://www.rmcan.com)
293          * CAN fieldbus interface adapter
294          */
295         FTRMCANVIEWDid  = 0xfd60,
296
297         /*
298          * EVER Eco Pro UPS (http://www.ever.com.pl/)
299          */
300         EVERECOPROCDSDid = 0xe520,      /* RS-232 converter */
301
302         /*
303          * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485,
304          * USB-TTY activ, USB-TTY passiv. Some PIDs are used by several devices
305          */
306         FT4NGALAXYDE0Did = 0x8372,
307         FT4NGALAXYDE1Did = 0xF3C0,
308         FT4NGALAXYDE2Did = 0xF3C1,
309
310         /*
311          * Mobility Electronics products.
312          */
313         MOBILITYVid     = 0x1342,
314         MOBILITYUSBSERIALDid= 0x0202,   /* EasiDock USB 200 serial */
315
316         /*
317          * microHAM product IDs (http://www.microham.com)
318          */
319         FTMHAMKWDid     = 0xEEE8,       /* USB-KW interface */
320         FTMHAMYSDid     = 0xEEE9,       /* USB-YS interface */
321         FTMHAMY6Did     = 0xEEEA,       /* USB-Y6 interface */
322         FTMHAMY8Did     = 0xEEEB,       /* USB-Y8 interface */
323         FTMHAMICDid     = 0xEEEC,       /* USB-IC interface */
324         FTMHAMDB9Did    = 0xEEED,       /* USB-DB9 interface */
325         FTMHAMRS232Did  = 0xEEEE,       /* USB-RS232 interface */
326         FTMHAMY9Did     = 0xEEEF,       /* USB-Y9 interface */
327
328         /*
329          * Active Robots product ids.
330          */
331         FTACTIVEROBOTSDid       = 0xE548,       /* USB comms board */
332         XSENSCONVERTER0Did      = 0xD388,
333         XSENSCONVERTER1Did      = 0xD389,
334         XSENSCONVERTER2Did      = 0xD38A,
335         XSENSCONVERTER3Did      = 0xD38B,
336         XSENSCONVERTER4Did      = 0xD38C,
337         XSENSCONVERTER5Did      = 0xD38D,
338         XSENSCONVERTER6Did      = 0xD38E,
339         XSENSCONVERTER7Did      = 0xD38F,
340
341         /*
342          * Xsens Technologies BV products (http://www.xsens.com).
343          */
344         FTTERATRONIKVCPDid      = 0xEC88,       /* Teratronik device */
345         FTTERATRONIKD2XXDid     = 0xEC89,       /* Teratronik device */
346
347         /*
348          * Evolution Robotics products (http://www.evolution.com/).
349          */
350         EVOLUTIONVid    = 0xDEEE,
351         EVOLUTIONER1Did = 0x0300,               /* ER1 Control Module */
352
353         /* Pyramid Computer GmbH */
354         FTPYRAMIDDid    = 0xE6C8,               /* Pyramid Appliance Display */
355
356         /*
357          * Posiflex inc retail equipment (http://www.posiflex.com.tw)
358          */
359         POSIFLEXVid     = 0x0d3a,
360         POSIFLEXPP7000Did= 0x0300,              /* PP-7000II thermal printer */
361
362         /*
363          * Westrex International devices
364          */
365         FTWESTREXMODEL777Did    = 0xDC00,       /* Model 777 */
366         FTWESTREXMODEL8900FDid  = 0xDC01,       /* Model 8900F */
367
368         /*
369          * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
370          */
371         FTRRCIRKITSLOCOBUFFERDid= 0xc7d0,       /* LocoBuffer USB */
372         FTECLOCOM1WIREDid       = 0xEA90,       /* COM to 1-Wire USB */
373
374         /*
375          * Papouch products (http://www.papouch.com/)
376          */
377         PAPOUCHVid      = 0x5050,
378         PAPOUCHTMUDid   = 0x0400,               /* TMU USB Thermometer */
379
380         /*
381          * ACG Identification Technologies GmbH products http://www.acg.de/
382          */
383         FTACGHFDUALDid  = 0xDD20,               /* HF Dual ISO Reader (RFID) */
384         /*
385          * new high speed devices
386          */
387         FT4232HDid      = 0x6011,               /* FTDI FT4232H based device */
388
389         /*
390          * Amontec JTAGkey (http://www.amontec.com/)
391          */
392         AMONKEYDid      = 0xCFF8,
393 };
394
395 /* Commands */
396 enum {
397         FTRESET         = 0,            /* Reset the port */
398         FTSETMODEMCTRL,                 /* Set the modem control register */
399         FTSETFLOWCTRL,                  /* Set flow control register */
400         FTSETBAUDRATE,                  /* Set baud rate */
401         FTSETDATA,                      /* Set the parameters, parity */
402         FTGETMODEMSTATUS,               /* Retrieve current value of modem ctl */
403         FTSETEVENTCHAR,                 /* Set the event character */
404         FTSETERRORCHAR,                 /* Set the error character */
405         FTUNKNOWN,
406         FTSETLATENCYTIMER,              /* Set the latency timer */
407         FTGETLATENCYTIMER,              /* Get the latency timer */
408         FTSETBITMODE,                   /* Set bit mode */
409         FTGETPINS,                      /* Read pins state */
410         FTGETE2READ     = 0x90,         /* Read address from 128-byte I2C EEPROM */
411         FTSETE2WRITE,                   /* Write to address on 128-byte I2C EEPROM */
412         FTSETE2ERASE,                   /* Erase address on 128-byte I2C EEPROM */
413 };
414
415 /* Port Identifier Table, index for interfaces */
416 enum {
417         PITDEFAULT = 0,         /* SIOA */
418         PITA,                   /* SIOA jtag if there is one */
419 };
420
421 enum {
422         Rftdireq = 1<<6,                /* bit for type of request */
423 };
424
425 /*
426  * Commands Data size
427  * Sets have wLength = 0
428  * Gets have wValue = 0
429  */
430 enum {
431         FTMODEMSTATUSSZ = 1,
432         FTLATENCYTIMERSZ= 1,
433         FTPINSSZ        = 1,
434         FTE2READSZ      = 2,
435 };
436
437 /*
438  * bRequest: FTGETE2READ
439  * wIndex: Address of word to read
440  * Data: Will return a word (2 bytes) of data from E2Address
441  * Results put in the I2C 128 byte EEPROM string eeprom+(2*index)
442  */
443
444 /*
445  * bRequest: FTSETE2WRITE
446  * wIndex: Address of word to read
447  * wValue: Value of the word
448  * Data: Will return a word (2 bytes) of data from E2Address
449  */
450
451 /*
452  * bRequest: FTSETE2ERASE
453  * Erases the EEPROM
454  * wIndex: 0
455  */
456
457 /*
458  * bRequest: FTRESET
459  * wValue: Ctl Val
460  * wIndex: Port
461  */
462 enum {
463         FTRESETCTLVAL           = 0,
464         FTRESETCTLVALPURGERX    = 1,
465         FTRESETCTLVALPURGETX    = 2,
466 };
467
468 /*
469  * BmRequestType: SET
470  * bRequest: FTSETBAUDRATE
471  * wValue: BaudDivisor value - see below
472  * Bits 15 to 0 of the 17-bit divisor are placed in the request value.
473  * Bit 16 is placed in bit 0 of the request index.
474  */
475
476 /* chip type */
477 enum {
478         SIO             = 1,
479         FT8U232AM       = 2,
480         FT232BM         = 3,
481         FT2232C         = 4,
482         FTKINDR         = 5,
483         FT2232H         = 6,
484         FT4232H         = 7,
485 };
486
487 enum {
488          FTb300         = 0,
489          FTb600         = 1,
490          FTb1200        = 2,
491          FTb2400        = 3,
492          FTb4800        = 4,
493          FTb9600        = 5,
494          FTb19200       = 6,
495          FTb38400       = 7,
496          FTb57600       = 8,
497          FTb115200      = 9,
498 };
499
500 /*
501  * bRequest: FTSETDATA
502  * wValue: Data characteristics
503  *      bits 0-7 number of data bits
504  * wIndex: Port
505  */
506 enum {
507         FTSETDATAParNONE        = 0 << 8,
508         FTSETDATAParODD         = 1 << 8,
509         FTSETDATAParEVEN        = 2 << 8,
510         FTSETDATAParMARK        = 3 << 8,
511         FTSETDATAParSPACE       = 4 << 8,
512         FTSETDATASTOPBITS1      = 0 << 11,
513         FTSETDATASTOPBITS15     = 1 << 11,
514         FTSETDATASTOPBITS2      = 2 << 11,
515         FTSETBREAK              = 1 << 14,
516 };
517
518 /*
519  * bRequest: FTSETMODEMCTRL
520  * wValue: ControlValue (see below)
521  * wIndex: Port
522  */
523
524 /*
525  * bRequest: FTSETFLOWCTRL
526  * wValue: Xoff/Xon
527  * wIndex: Protocol/Port - hIndex is protocol; lIndex is port
528  */
529 enum {
530         FTDISABLEFLOWCTRL= 0,
531         FTRTSCTSHS      = 1 << 8,
532         FTDTRDSRHS      = 2 << 8,
533         FTXONXOFFHS     = 4 << 8,
534 };
535
536 /*
537  * bRequest: FTGETLATENCYTIMER
538  * wIndex: Port
539  * wLength: 0
540  * Data: latency (on return)
541  */
542
543 /*
544  * bRequest: FTSETBITMODE
545  * wIndex: Port
546  * either it is big bang mode, in which case
547  * wValue: 1 byte L is the big bang mode BIG*
548  *      or BM is
549  * wValue: 1 byte bitbang mode H, 1 byte bitmask for lines L
550  */
551 enum {
552         BMSERIAL        = 0,            /* reset, turn off bit-bang mode */
553
554         BIGBMNORMAL     = 1,            /* normal bit-bang mode */
555         BIGBMSPI        = 2,            /* spi bit-bang mode */
556
557         BMABM           = 1<<8,         /* async mode */
558         BMMPSSE         = 2<<8,
559         BMSYNCBB        = 4<<8,         /* sync bit-bang -- 2232x and R-type */
560         BMMCU           = 8<<8,         /* MCU Host Bus -- 2232x */
561         BMOPTO          = 0x10<<8,      /* opto-isolated<<8, 2232x */
562         BMCBUS          = 0x20<<8,      /* CBUS pins of R-type chips */
563         BMSYNCFF        = 0x40<<8,      /* Single Channel Sync FIFO, 2232H only */
564 };
565
566 /*
567  * bRequest: FTSETLATENCYTIMER
568  * wValue: Latency (milliseconds 1-255)
569  * wIndex: Port
570  */
571 enum {
572         FTLATENCYDEFAULT = 2,
573 };
574
575 /*
576  * BmRequestType: SET
577  * bRequest: FTSETEVENTCHAR
578  * wValue: EventChar
579  * wIndex: Port
580  * 0-7 lower bits event char
581  * 8 enable
582  */
583 enum {
584         FTEVCHARENAB = 1<<8,
585 };
586
587 /*
588  * BmRequestType: SET
589  * bRequest: FTSETERRORCHAR
590  * wValue: Error Char
591  * wIndex: Port
592  * 0-7 lower bits event char
593  * 8 enable
594  */
595 enum {
596         FTERRCHARENAB = 1<<8,
597 };
598 /*
599  * BmRequestType: GET
600  * bRequest: FTGETMODEMSTATUS
601  * wIndex: Port
602  * wLength: 1
603  * Data: Status
604  */
605 enum {
606         FTCTSMASK       = 0x10,
607         FTDSRMASK       = 0x20,
608         FTRIMASK        = 0x40,
609         FTRLSDMASK      = 0x80,
610 };
611
612 enum {
613         /* byte 0 of in data hdr */
614         FTICTS  = 1 << 4,
615         FTIDSR  = 1 << 5,
616         FTIRI   = 1 << 6,
617         FTIRLSD = 1 << 7,       /* receive line signal detect */
618
619         /* byte 1 of in data hdr */
620         FTIDR   = 1<<0,         /* data ready */
621         FTIOE   = 1<<1,         /* overrun error */
622         FTIPE   = 1<<2,         /* parity error */
623         FTIFE   = 1<<3,         /* framing error */
624         FTIBI   = 1<<4,         /* break interrupt */
625         FTITHRE = 1<<5,         /* xmitter holding register */
626         FTITEMT = 1<<6,         /* xmitter empty */
627         FTIFIFO = 1<<7,         /* error in rcv fifo */
628
629         /* byte 0 of out data hdr len does not include byte 0 */
630         FTOLENMSK= 0x3F,
631         FTOPORT = 0x80,         /* must be set */
632 };
633
634 extern Serialops ftops;
635
636 int     ftmatch(Serial *ser, char *info);