xref: /plan9/sys/src/cmd/usb/serial/ftdi.h (revision 7d7728c9ff780bb29e70ac5c0f1bb4c0d6187a9b)
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 
391 /* Commands */
392 enum {
393 	FTRESET		= 0,		/* Reset the port */
394 	FTSETMODEMCTRL,			/* Set the modem control register */
395 	FTSETFLOWCTRL,			/* Set flow control register */
396 	FTSETBAUDRATE,			/* Set baud rate */
397 	FTSETDATA,			/* Set the parameters, parity */
398 	FTGETMODEMSTATUS,		/* Retrieve current value of modem ctl */
399 	FTSETEVENTCHAR,			/* Set the event character */
400 	FTSETERRORCHAR,			/* Set the error character */
401 	FTUNKNOWN,
402 	FTSETLATENCYTIMER,		/* Set the latency timer */
403 	FTGETLATENCYTIMER,		/* Get the latency timer */
404 	FTSETBITMODE,			/* Set bit mode */
405 	FTGETPINS,			/* Read pins state */
406 	FTGETE2READ	= 0x90,		/* Read address from 128-byte I2C EEPROM */
407 	FTSETE2WRITE,			/* Write to address on 128-byte I2C EEPROM */
408 	FTSETE2ERASE,			/* Erase address on 128-byte I2C EEPROM */
409 };
410 
411 /* Port Identifier Table, index for interfaces */
412 enum {
413 	PITDEFAULT = 0,		/* SIOA */
414 	PITA,			/* SIOA jtag if there is one */
415 };
416 
417 enum {
418 	Rftdireq = 1<<6,		/* bit for type of request */
419 };
420 
421 /*
422  * Commands Data size
423  * Sets have wLength = 0
424  * Gets have wValue = 0
425  */
426 enum {
427 	FTMODEMSTATUSSZ	= 1,
428 	FTLATENCYTIMERSZ= 1,
429 	FTPINSSZ	= 1,
430 	FTE2READSZ	= 2,
431 };
432 
433 /*
434  * bRequest: FTGETE2READ
435  * wIndex: Address of word to read
436  * Data: Will return a word (2 bytes) of data from E2Address
437  * Results put in the I2C 128 byte EEPROM string eeprom+(2*index)
438  */
439 
440 /*
441  * bRequest: FTSETE2WRITE
442  * wIndex: Address of word to read
443  * wValue: Value of the word
444  * Data: Will return a word (2 bytes) of data from E2Address
445  */
446 
447 /*
448  * bRequest: FTSETE2ERASE
449  * Erases the EEPROM
450  * wIndex: 0
451  */
452 
453 /*
454  * bRequest: FTRESET
455  * wValue: Ctl Val
456  * wIndex: Port
457  */
458 enum {
459 	FTRESETCTLVAL		= 0,
460 	FTRESETCTLVALPURGERX	= 1,
461 	FTRESETCTLVALPURGETX	= 2,
462 };
463 
464 /*
465  * BmRequestType: SET
466  * bRequest: FTSETBAUDRATE
467  * wValue: BaudDivisor value - see below
468  * Bits 15 to 0 of the 17-bit divisor are placed in the request value.
469  * Bit 16 is placed in bit 0 of the request index.
470  */
471 
472 /* chip type */
473 enum {
474 	SIO		= 1,
475 	FT8U232AM	= 2,
476 	FT232BM		= 3,
477 	FT2232C		= 4,
478 	FTKINDR		= 5,
479 	FT2232H		= 6,
480 	FT4232H		= 7,
481 };
482 
483 enum {
484 	 FTb300		= 0,
485 	 FTb600		= 1,
486 	 FTb1200	= 2,
487 	 FTb2400	= 3,
488 	 FTb4800	= 4,
489 	 FTb9600	= 5,
490 	 FTb19200	= 6,
491 	 FTb38400	= 7,
492 	 FTb57600	= 8,
493 	 FTb115200	= 9,
494 };
495 
496 /*
497  * bRequest: FTSETDATA
498  * wValue: Data characteristics
499  *	bits 0-7 number of data bits
500  * wIndex: Port
501  */
502 enum {
503 	FTSETDATAParNONE	= 0 << 8,
504 	FTSETDATAParODD		= 1 << 8,
505 	FTSETDATAParEVEN	= 2 << 8,
506 	FTSETDATAParMARK	= 3 << 8,
507 	FTSETDATAParSPACE	= 4 << 8,
508 	FTSETDATASTOPBITS1	= 0 << 11,
509 	FTSETDATASTOPBITS15	= 1 << 11,
510 	FTSETDATASTOPBITS2	= 2 << 11,
511 	FTSETBREAK		= 1 << 14,
512 };
513 
514 /*
515  * bRequest: FTSETMODEMCTRL
516  * wValue: ControlValue (see below)
517  * wIndex: Port
518  */
519 
520 /*
521  * bRequest: FTSETFLOWCTRL
522  * wValue: Xoff/Xon
523  * wIndex: Protocol/Port - hIndex is protocol; lIndex is port
524  */
525 enum {
526 	FTDISABLEFLOWCTRL= 0,
527 	FTRTSCTSHS	= 1 << 8,
528 	FTDTRDSRHS	= 2 << 8,
529 	FTXONXOFFHS	= 4 << 8,
530 };
531 
532 /*
533  * bRequest: FTGETLATENCYTIMER
534  * wIndex: Port
535  * wLength: 0
536  * Data: latency (on return)
537  */
538 
539 /*
540  * bRequest: FTSETBITMODE
541  * wIndex: Port
542  * either it is big bang mode, in which case
543  * wValue: 1 byte L is the big bang mode BIG*
544  *	or BM is
545  * wValue: 1 byte bitbang mode H, 1 byte bitmask for lines L
546  */
547 enum {
548 	BMSERIAL	= 0,		/* reset, turn off bit-bang mode */
549 
550 	BIGBMNORMAL	= 1,		/* normal bit-bang mode */
551 	BIGBMSPI	= 2,		/* spi bit-bang mode */
552 
553 	BMABM		= 1<<8,		/* async mode */
554 	BMMPSSE		= 2<<8,
555 	BMSYNCBB	= 4<<8,		/* sync bit-bang -- 2232x and R-type */
556 	BMMCU		= 8<<8,		/* MCU Host Bus -- 2232x */
557 	BMOPTO		= 0x10<<8,	/* opto-isolated<<8, 2232x */
558 	BMCBUS		= 0x20<<8,	/* CBUS pins of R-type chips */
559 	BMSYNCFF	= 0x40<<8,	/* Single Channel Sync FIFO, 2232H only */
560 };
561 
562 /*
563  * bRequest: FTSETLATENCYTIMER
564  * wValue: Latency (milliseconds 1-255)
565  * wIndex: Port
566  */
567 enum {
568 	FTLATENCYDEFAULT = 2,
569 };
570 
571 /*
572  * BmRequestType: SET
573  * bRequest: FTSETEVENTCHAR
574  * wValue: EventChar
575  * wIndex: Port
576  * 0-7 lower bits event char
577  * 8 enable
578  */
579 enum {
580 	FTEVCHARENAB = 1<<8,
581 };
582 
583 /*
584  * BmRequestType: SET
585  * bRequest: FTSETERRORCHAR
586  * wValue: Error Char
587  * wIndex: Port
588  * 0-7 lower bits event char
589  * 8 enable
590  */
591 enum {
592 	FTERRCHARENAB = 1<<8,
593 };
594 /*
595  * BmRequestType: GET
596  * bRequest: FTGETMODEMSTATUS
597  * wIndex: Port
598  * wLength: 1
599  * Data: Status
600  */
601 enum {
602 	FTCTSMASK	= 0x10,
603 	FTDSRMASK	= 0x20,
604 	FTRIMASK	= 0x40,
605 	FTRLSDMASK	= 0x80,
606 };
607 
608 enum {
609 	/* byte 0 of in data hdr */
610 	FTICTS	= 1 << 4,
611 	FTIDSR	= 1 << 5,
612 	FTIRI	= 1 << 6,
613 	FTIRLSD	= 1 << 7,	/* receive line signal detect */
614 
615 	/* byte 1 of in data hdr */
616 	FTIDR	= 1<<0,		/* data ready */
617 	FTIOE	= 1<<1,		/* overrun error */
618 	FTIPE	= 1<<2,		/* parity error */
619 	FTIFE	= 1<<3,		/* framing error */
620 	FTIBI	= 1<<4,		/* break interrupt */
621 	FTITHRE	= 1<<5,		/* xmitter holding register */
622 	FTITEMT	= 1<<6,		/* xmitter empty */
623 	FTIFIFO	= 1<<7,		/* error in rcv fifo */
624 
625 	/* byte 0 of out data hdr len does not include byte 0 */
626 	FTOLENMSK= 0x3F,
627 	FTOPORT	= 0x80,		/* must be set */
628 };
629 
630 extern Serialops ftops;
631 
632 int	ftmatch(Serial *ser, char *info);
633