ftdi.h 17 KB

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