1
0

ftdi.h 18 KB

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