i2cmd.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. /*******************************************************************************
  2. *
  3. * (c) 1999 by Computone Corporation
  4. *
  5. ********************************************************************************
  6. *
  7. *
  8. * PACKAGE: Linux tty Device Driver for IntelliPort II family of multiport
  9. * serial I/O controllers.
  10. *
  11. * DESCRIPTION: Definitions and support for In-line and Bypass commands.
  12. * Applicable only when the standard loadware is active.
  13. *
  14. *******************************************************************************/
  15. //------------------------------------------------------------------------------
  16. // Revision History:
  17. //
  18. // 10 October 1991 MAG First Draft
  19. // 7 November 1991 MAG Reflects some new commands
  20. // 20 February 1992 MAG CMD_HOTACK corrected: no argument.
  21. // 24 February 1992 MAG Support added for new commands for 1.4.x loadware.
  22. // 11 March 1992 MAG Additional commands.
  23. // 16 March 1992 MAG Additional commands.
  24. // 30 March 1992 MAG Additional command: CMD_DSS_NOW
  25. // 18 May 1992 MAG Changed CMD_OPOST
  26. //
  27. //------------------------------------------------------------------------------
  28. #ifndef I2CMD_H // To prevent multiple includes
  29. #define I2CMD_H 1
  30. #include "ip2types.h"
  31. // This module is designed to provide a uniform method of sending commands to
  32. // the board through command packets. The difficulty is, some commands take
  33. // parameters, others do not. Furthermore, it is often useful to send several
  34. // commands to the same channel as part of the same packet. (See also i2pack.h.)
  35. //
  36. // This module is designed so that the caller should not be responsible for
  37. // remembering the exact syntax of each command, or at least so that the
  38. // compiler could check things somewhat. I'll explain as we go...
  39. //
  40. // First, a structure which can embody the syntax of each type of command.
  41. //
  42. typedef struct _cmdSyntax
  43. {
  44. UCHAR length; // Number of bytes in the command
  45. UCHAR flags; // Information about the command (see below)
  46. // The command and its parameters, which may be of arbitrary length. Don't
  47. // worry yet how the parameters will be initialized; macros later take care
  48. // of it. Also, don't worry about the arbitrary length issue; this structure
  49. // is never used to allocate space (see i2cmd.c).
  50. UCHAR cmd[2];
  51. } cmdSyntax, *cmdSyntaxPtr;
  52. // Bit assignments for flags
  53. #define INL 1 // Set if suitable for inline commands
  54. #define BYP 2 // Set if suitable for bypass commands
  55. #define BTH (INL|BYP) // suitable for either!
  56. #define END 4 // Set if this must be the last command in a block
  57. #define VIP 8 // Set if this command is special in some way and really
  58. // should only be sent from the library-level and not
  59. // directly from user-level
  60. #define VAR 0x10 // This command is of variable length!
  61. // Declarations for the global arrays used to bear the commands and their
  62. // arguments.
  63. //
  64. // Note: Since these are globals and the arguments might change, it is important
  65. // that the library routine COPY these into buffers from whence they would be
  66. // sent, rather than merely storing the pointers. In multi-threaded
  67. // environments, important that the copy should obtain before any context switch
  68. // is allowed. Also, for parameterized commands, DO NOT ISSUE THE SAME COMMAND
  69. // MORE THAN ONCE WITH THE SAME PARAMETERS in the same call.
  70. //
  71. static UCHAR ct02[];
  72. static UCHAR ct03[];
  73. static UCHAR ct04[];
  74. static UCHAR ct05[];
  75. static UCHAR ct06[];
  76. static UCHAR ct07[];
  77. static UCHAR ct08[];
  78. static UCHAR ct09[];
  79. static UCHAR ct10[];
  80. static UCHAR ct11[];
  81. static UCHAR ct12[];
  82. static UCHAR ct13[];
  83. static UCHAR ct14[];
  84. static UCHAR ct15[];
  85. static UCHAR ct16[];
  86. static UCHAR ct17[];
  87. static UCHAR ct18[];
  88. static UCHAR ct19[];
  89. static UCHAR ct20[];
  90. static UCHAR ct21[];
  91. static UCHAR ct22[];
  92. static UCHAR ct23[];
  93. static UCHAR ct24[];
  94. static UCHAR ct25[];
  95. static UCHAR ct26[];
  96. static UCHAR ct27[];
  97. static UCHAR ct28[];
  98. static UCHAR ct29[];
  99. static UCHAR ct30[];
  100. static UCHAR ct31[];
  101. static UCHAR ct32[];
  102. static UCHAR ct33[];
  103. static UCHAR ct34[];
  104. static UCHAR ct35[];
  105. static UCHAR ct36[];
  106. static UCHAR ct36a[];
  107. static UCHAR ct41[];
  108. static UCHAR ct42[];
  109. static UCHAR ct43[];
  110. static UCHAR ct44[];
  111. static UCHAR ct45[];
  112. static UCHAR ct46[];
  113. static UCHAR ct48[];
  114. static UCHAR ct49[];
  115. static UCHAR ct50[];
  116. static UCHAR ct51[];
  117. static UCHAR ct52[];
  118. static UCHAR ct56[];
  119. static UCHAR ct57[];
  120. static UCHAR ct58[];
  121. static UCHAR ct59[];
  122. static UCHAR ct60[];
  123. static UCHAR ct61[];
  124. static UCHAR ct62[];
  125. static UCHAR ct63[];
  126. static UCHAR ct64[];
  127. static UCHAR ct65[];
  128. static UCHAR ct66[];
  129. static UCHAR ct67[];
  130. static UCHAR ct68[];
  131. static UCHAR ct69[];
  132. static UCHAR ct70[];
  133. static UCHAR ct71[];
  134. static UCHAR ct72[];
  135. static UCHAR ct73[];
  136. static UCHAR ct74[];
  137. static UCHAR ct75[];
  138. static UCHAR ct76[];
  139. static UCHAR ct77[];
  140. static UCHAR ct78[];
  141. static UCHAR ct79[];
  142. static UCHAR ct80[];
  143. static UCHAR ct81[];
  144. static UCHAR ct82[];
  145. static UCHAR ct83[];
  146. static UCHAR ct84[];
  147. static UCHAR ct85[];
  148. static UCHAR ct86[];
  149. static UCHAR ct87[];
  150. static UCHAR ct88[];
  151. static UCHAR ct89[];
  152. static UCHAR ct90[];
  153. static UCHAR ct91[];
  154. static UCHAR cc01[];
  155. static UCHAR cc02[];
  156. // Now, refer to i2cmd.c, and see the character arrays defined there. They are
  157. // cast here to cmdSyntaxPtr.
  158. //
  159. // There are library functions for issuing bypass or inline commands. These
  160. // functions take one or more arguments of the type cmdSyntaxPtr. The routine
  161. // then can figure out how long each command is supposed to be and easily add it
  162. // to the list.
  163. //
  164. // For ease of use, we define manifests which return pointers to appropriate
  165. // cmdSyntaxPtr things. But some commands also take arguments. If a single
  166. // argument is used, we define a macro which performs the single assignment and
  167. // (through the expedient of a comma expression) references the appropriate
  168. // pointer. For commands requiring several arguments, we actually define a
  169. // function to perform the assignments.
  170. #define CMD_DTRUP (cmdSyntaxPtr)(ct02) // Raise DTR
  171. #define CMD_DTRDN (cmdSyntaxPtr)(ct03) // Lower DTR
  172. #define CMD_RTSUP (cmdSyntaxPtr)(ct04) // Raise RTS
  173. #define CMD_RTSDN (cmdSyntaxPtr)(ct05) // Lower RTS
  174. #define CMD_STARTFL (cmdSyntaxPtr)(ct06) // Start Flushing Data
  175. #define CMD_DTRRTS_UP (cmdSyntaxPtr)(cc01) // Raise DTR and RTS
  176. #define CMD_DTRRTS_DN (cmdSyntaxPtr)(cc02) // Lower DTR and RTS
  177. // Set Baud Rate for transmit and receive
  178. #define CMD_SETBAUD(arg) \
  179. (((cmdSyntaxPtr)(ct07))->cmd[1] = (arg),(cmdSyntaxPtr)(ct07))
  180. #define CBR_50 1
  181. #define CBR_75 2
  182. #define CBR_110 3
  183. #define CBR_134 4
  184. #define CBR_150 5
  185. #define CBR_200 6
  186. #define CBR_300 7
  187. #define CBR_600 8
  188. #define CBR_1200 9
  189. #define CBR_1800 10
  190. #define CBR_2400 11
  191. #define CBR_4800 12
  192. #define CBR_9600 13
  193. #define CBR_19200 14
  194. #define CBR_38400 15
  195. #define CBR_2000 16
  196. #define CBR_3600 17
  197. #define CBR_7200 18
  198. #define CBR_56000 19
  199. #define CBR_57600 20
  200. #define CBR_64000 21
  201. #define CBR_76800 22
  202. #define CBR_115200 23
  203. #define CBR_C1 24 // Custom baud rate 1
  204. #define CBR_C2 25 // Custom baud rate 2
  205. #define CBR_153600 26
  206. #define CBR_230400 27
  207. #define CBR_307200 28
  208. #define CBR_460800 29
  209. #define CBR_921600 30
  210. // Set Character size
  211. //
  212. #define CMD_SETBITS(arg) \
  213. (((cmdSyntaxPtr)(ct08))->cmd[1] = (arg),(cmdSyntaxPtr)(ct08))
  214. #define CSZ_5 0
  215. #define CSZ_6 1
  216. #define CSZ_7 2
  217. #define CSZ_8 3
  218. // Set number of stop bits
  219. //
  220. #define CMD_SETSTOP(arg) \
  221. (((cmdSyntaxPtr)(ct09))->cmd[1] = (arg),(cmdSyntaxPtr)(ct09))
  222. #define CST_1 0
  223. #define CST_15 1 // 1.5 stop bits
  224. #define CST_2 2
  225. // Set parity option
  226. //
  227. #define CMD_SETPAR(arg) \
  228. (((cmdSyntaxPtr)(ct10))->cmd[1] = (arg),(cmdSyntaxPtr)(ct10))
  229. #define CSP_NP 0 // no parity
  230. #define CSP_OD 1 // odd parity
  231. #define CSP_EV 2 // Even parity
  232. #define CSP_SP 3 // Space parity
  233. #define CSP_MK 4 // Mark parity
  234. // Define xon char for transmitter flow control
  235. //
  236. #define CMD_DEF_IXON(arg) \
  237. (((cmdSyntaxPtr)(ct11))->cmd[1] = (arg),(cmdSyntaxPtr)(ct11))
  238. // Define xoff char for transmitter flow control
  239. //
  240. #define CMD_DEF_IXOFF(arg) \
  241. (((cmdSyntaxPtr)(ct12))->cmd[1] = (arg),(cmdSyntaxPtr)(ct12))
  242. #define CMD_STOPFL (cmdSyntaxPtr)(ct13) // Stop Flushing data
  243. // Acknowledge receipt of hotkey signal
  244. //
  245. #define CMD_HOTACK (cmdSyntaxPtr)(ct14)
  246. // Define irq level to use. Should actually be sent by library-level code, not
  247. // directly from user...
  248. //
  249. #define CMDVALUE_IRQ 15 // For library use at initialization. Until this command
  250. // is sent, board processing doesn't really start.
  251. #define CMD_SET_IRQ(arg) \
  252. (((cmdSyntaxPtr)(ct15))->cmd[1] = (arg),(cmdSyntaxPtr)(ct15))
  253. #define CIR_POLL 0 // No IRQ - Poll
  254. #define CIR_3 3 // IRQ 3
  255. #define CIR_4 4 // IRQ 4
  256. #define CIR_5 5 // IRQ 5
  257. #define CIR_7 7 // IRQ 7
  258. #define CIR_10 10 // IRQ 10
  259. #define CIR_11 11 // IRQ 11
  260. #define CIR_12 12 // IRQ 12
  261. #define CIR_15 15 // IRQ 15
  262. // Select transmit flow xon/xoff options
  263. //
  264. #define CMD_IXON_OPT(arg) \
  265. (((cmdSyntaxPtr)(ct16))->cmd[1] = (arg),(cmdSyntaxPtr)(ct16))
  266. #define CIX_NONE 0 // Incoming Xon/Xoff characters not special
  267. #define CIX_XON 1 // Xoff disable, Xon enable
  268. #define CIX_XANY 2 // Xoff disable, any key enable
  269. // Select receive flow xon/xoff options
  270. //
  271. #define CMD_OXON_OPT(arg) \
  272. (((cmdSyntaxPtr)(ct17))->cmd[1] = (arg),(cmdSyntaxPtr)(ct17))
  273. #define COX_NONE 0 // Don't send Xon/Xoff
  274. #define COX_XON 1 // Send xon/xoff to start/stop incoming data
  275. #define CMD_CTS_REP (cmdSyntaxPtr)(ct18) // Enable CTS reporting
  276. #define CMD_CTS_NREP (cmdSyntaxPtr)(ct19) // Disable CTS reporting
  277. #define CMD_DCD_REP (cmdSyntaxPtr)(ct20) // Enable DCD reporting
  278. #define CMD_DCD_NREP (cmdSyntaxPtr)(ct21) // Disable DCD reporting
  279. #define CMD_DSR_REP (cmdSyntaxPtr)(ct22) // Enable DSR reporting
  280. #define CMD_DSR_NREP (cmdSyntaxPtr)(ct23) // Disable DSR reporting
  281. #define CMD_RI_REP (cmdSyntaxPtr)(ct24) // Enable RI reporting
  282. #define CMD_RI_NREP (cmdSyntaxPtr)(ct25) // Disable RI reporting
  283. // Enable break reporting and select style
  284. //
  285. #define CMD_BRK_REP(arg) \
  286. (((cmdSyntaxPtr)(ct26))->cmd[1] = (arg),(cmdSyntaxPtr)(ct26))
  287. #define CBK_STAT 0x00 // Report breaks as a status (exception,irq)
  288. #define CBK_NULL 0x01 // Report breaks as a good null
  289. #define CBK_STAT_SEQ 0x02 // Report breaks as a status AND as in-band character
  290. // sequence FFh, 01h, 10h
  291. #define CBK_SEQ 0x03 // Report breaks as the in-band
  292. //sequence FFh, 01h, 10h ONLY.
  293. #define CBK_FLSH 0x04 // if this bit set also flush input data
  294. #define CBK_POSIX 0x08 // if this bit set report as FF,0,0 sequence
  295. #define CBK_SINGLE 0x10 // if this bit set with CBK_SEQ or CBK_STAT_SEQ
  296. //then reports single null instead of triple
  297. #define CMD_BRK_NREP (cmdSyntaxPtr)(ct27) // Disable break reporting
  298. // Specify maximum block size for received data
  299. //
  300. #define CMD_MAX_BLOCK(arg) \
  301. (((cmdSyntaxPtr)(ct28))->cmd[1] = (arg),(cmdSyntaxPtr)(ct28))
  302. // -- COMMAND 29 is reserved --
  303. #define CMD_CTSFL_ENAB (cmdSyntaxPtr)(ct30) // Enable CTS flow control
  304. #define CMD_CTSFL_DSAB (cmdSyntaxPtr)(ct31) // Disable CTS flow control
  305. #define CMD_RTSFL_ENAB (cmdSyntaxPtr)(ct32) // Enable RTS flow control
  306. #define CMD_RTSFL_DSAB (cmdSyntaxPtr)(ct33) // Disable RTS flow control
  307. // Specify istrip option
  308. //
  309. #define CMD_ISTRIP_OPT(arg) \
  310. (((cmdSyntaxPtr)(ct34))->cmd[1] = (arg),(cmdSyntaxPtr)(ct34))
  311. #define CIS_NOSTRIP 0 // Strip characters to character size
  312. #define CIS_STRIP 1 // Strip any 8-bit characters to 7 bits
  313. // Send a break of arg milliseconds
  314. //
  315. #define CMD_SEND_BRK(arg) \
  316. (((cmdSyntaxPtr)(ct35))->cmd[1] = (arg),(cmdSyntaxPtr)(ct35))
  317. // Set error reporting mode
  318. //
  319. #define CMD_SET_ERROR(arg) \
  320. (((cmdSyntaxPtr)(ct36))->cmd[1] = (arg),(cmdSyntaxPtr)(ct36))
  321. #define CSE_ESTAT 0 // Report error in a status packet
  322. #define CSE_NOREP 1 // Treat character as though it were good
  323. #define CSE_DROP 2 // Discard the character
  324. #define CSE_NULL 3 // Replace with a null
  325. #define CSE_MARK 4 // Replace with a 3-character sequence (as Unix)
  326. #define CMD_SET_REPLACEMENT(arg,ch) \
  327. (((cmdSyntaxPtr)(ct36a))->cmd[1] = (arg), \
  328. (((cmdSyntaxPtr)(ct36a))->cmd[2] = (ch), \
  329. (cmdSyntaxPtr)(ct36a))
  330. #define CSE_REPLACE 0x8 // Replace the errored character with the
  331. // replacement character defined here
  332. #define CSE_STAT_REPLACE 0x18 // Replace the errored character with the
  333. // replacement character defined here AND
  334. // report the error as a status packet (as in
  335. // CSE_ESTAT).
  336. // COMMAND 37, to send flow control packets, is handled only by low-level
  337. // library code in response to data movement and shouldn't ever be sent by the
  338. // user code. See i2pack.h and the body of i2lib.c for details.
  339. // Enable on-board post-processing, using options given in oflag argument.
  340. // Formerly, this command was automatically preceded by a CMD_OPOST_OFF command
  341. // because the loadware does not permit sending back-to-back CMD_OPOST_ON
  342. // commands without an intervening CMD_OPOST_OFF. BUT, WE LEARN 18 MAY 92, that
  343. // CMD_OPOST_ON and CMD_OPOST_OFF must each be at the end of a packet (or in a
  344. // solo packet). This means the caller must specify separately CMD_OPOST_OFF,
  345. // CMD_OPOST_ON(parm) when he calls i2QueueCommands(). That function will ensure
  346. // each gets a separate packet. Extra CMD_OPOST_OFF's are always ok.
  347. //
  348. #define CMD_OPOST_ON(oflag) \
  349. (*(USHORT *)(((cmdSyntaxPtr)(ct39))->cmd[1]) = (oflag), \
  350. (cmdSyntaxPtr)(ct39))
  351. #define CMD_OPOST_OFF (cmdSyntaxPtr)(ct40) // Disable on-board post-proc
  352. #define CMD_RESUME (cmdSyntaxPtr)(ct41) // Resume: behave as though an XON
  353. // were received;
  354. // Set Transmit baud rate (see command 7 for arguments)
  355. //
  356. #define CMD_SETBAUD_TX(arg) \
  357. (((cmdSyntaxPtr)(ct42))->cmd[1] = (arg),(cmdSyntaxPtr)(ct42))
  358. // Set Receive baud rate (see command 7 for arguments)
  359. //
  360. #define CMD_SETBAUD_RX(arg) \
  361. (((cmdSyntaxPtr)(ct43))->cmd[1] = (arg),(cmdSyntaxPtr)(ct43))
  362. // Request interrupt from board each arg milliseconds. Interrupt will specify
  363. // "received data", even though there may be no data present. If arg == 0,
  364. // disables any such interrupts.
  365. //
  366. #define CMD_PING_REQ(arg) \
  367. (((cmdSyntaxPtr)(ct44))->cmd[1] = (arg),(cmdSyntaxPtr)(ct44))
  368. #define CMD_HOT_ENAB (cmdSyntaxPtr)(ct45) // Enable Hot-key checking
  369. #define CMD_HOT_DSAB (cmdSyntaxPtr)(ct46) // Disable Hot-key checking
  370. #if 0
  371. // COMMAND 47: Send Protocol info via Unix flags:
  372. // iflag = Unix tty t_iflag
  373. // cflag = Unix tty t_cflag
  374. // lflag = Unix tty t_lflag
  375. // See System V Unix/Xenix documentation for the meanings of the bit fields
  376. // within these flags
  377. //
  378. #define CMD_UNIX_FLAGS(iflag,cflag,lflag) i2cmdUnixFlags(iflag,cflag,lflag)
  379. #endif /* 0 */
  380. #define CMD_DSRFL_ENAB (cmdSyntaxPtr)(ct48) // Enable DSR receiver ctrl
  381. #define CMD_DSRFL_DSAB (cmdSyntaxPtr)(ct49) // Disable DSR receiver ctrl
  382. #define CMD_DTRFL_ENAB (cmdSyntaxPtr)(ct50) // Enable DTR flow control
  383. #define CMD_DTRFL_DSAB (cmdSyntaxPtr)(ct51) // Disable DTR flow control
  384. #define CMD_BAUD_RESET (cmdSyntaxPtr)(ct52) // Reset baudrate table
  385. // COMMAND 54: Define custom rate #1
  386. // rate = (short) 1/10 of the desired baud rate
  387. //
  388. #define CMD_BAUD_DEF1(rate) i2cmdBaudDef(1,rate)
  389. // COMMAND 55: Define custom rate #2
  390. // rate = (short) 1/10 of the desired baud rate
  391. //
  392. #define CMD_BAUD_DEF2(rate) i2cmdBaudDef(2,rate)
  393. // Pause arg hundredths of seconds. (Note, this is NOT milliseconds.)
  394. //
  395. #define CMD_PAUSE(arg) \
  396. (((cmdSyntaxPtr)(ct56))->cmd[1] = (arg),(cmdSyntaxPtr)(ct56))
  397. #define CMD_SUSPEND (cmdSyntaxPtr)(ct57) // Suspend output
  398. #define CMD_UNSUSPEND (cmdSyntaxPtr)(ct58) // Un-Suspend output
  399. // Set parity-checking options
  400. //
  401. #define CMD_PARCHK(arg) \
  402. (((cmdSyntaxPtr)(ct59))->cmd[1] = (arg),(cmdSyntaxPtr)(ct59))
  403. #define CPK_ENAB 0 // Enable parity checking on input
  404. #define CPK_DSAB 1 // Disable parity checking on input
  405. #define CMD_BMARK_REQ (cmdSyntaxPtr)(ct60) // Bookmark request
  406. // Enable/Disable internal loopback mode
  407. //
  408. #define CMD_INLOOP(arg) \
  409. (((cmdSyntaxPtr)(ct61))->cmd[1] = (arg),(cmdSyntaxPtr)(ct61))
  410. #define CIN_DISABLE 0 // Normal operation (default)
  411. #define CIN_ENABLE 1 // Internal (local) loopback
  412. #define CIN_REMOTE 2 // Remote loopback
  413. // Specify timeout for hotkeys: Delay will be (arg x 10) milliseconds, arg == 0
  414. // --> no timeout: wait forever.
  415. //
  416. #define CMD_HOT_TIME(arg) \
  417. (((cmdSyntaxPtr)(ct62))->cmd[1] = (arg),(cmdSyntaxPtr)(ct62))
  418. // Define (outgoing) xon for receive flow control
  419. //
  420. #define CMD_DEF_OXON(arg) \
  421. (((cmdSyntaxPtr)(ct63))->cmd[1] = (arg),(cmdSyntaxPtr)(ct63))
  422. // Define (outgoing) xoff for receiver flow control
  423. //
  424. #define CMD_DEF_OXOFF(arg) \
  425. (((cmdSyntaxPtr)(ct64))->cmd[1] = (arg),(cmdSyntaxPtr)(ct64))
  426. // Enable/Disable RTS on transmit (1/2 duplex-style)
  427. //
  428. #define CMD_RTS_XMIT(arg) \
  429. (((cmdSyntaxPtr)(ct65))->cmd[1] = (arg),(cmdSyntaxPtr)(ct65))
  430. #define CHD_DISABLE 0
  431. #define CHD_ENABLE 1
  432. // Set high-water-mark level (debugging use only)
  433. //
  434. #define CMD_SETHIGHWAT(arg) \
  435. (((cmdSyntaxPtr)(ct66))->cmd[1] = (arg),(cmdSyntaxPtr)(ct66))
  436. // Start flushing tagged data (tag = 0-14)
  437. //
  438. #define CMD_START_SELFL(tag) \
  439. (((cmdSyntaxPtr)(ct67))->cmd[1] = (tag),(cmdSyntaxPtr)(ct67))
  440. // End flushing tagged data (tag = 0-14)
  441. //
  442. #define CMD_END_SELFL(tag) \
  443. (((cmdSyntaxPtr)(ct68))->cmd[1] = (tag),(cmdSyntaxPtr)(ct68))
  444. #define CMD_HWFLOW_OFF (cmdSyntaxPtr)(ct69) // Disable HW TX flow control
  445. #define CMD_ODSRFL_ENAB (cmdSyntaxPtr)(ct70) // Enable DSR output f/c
  446. #define CMD_ODSRFL_DSAB (cmdSyntaxPtr)(ct71) // Disable DSR output f/c
  447. #define CMD_ODCDFL_ENAB (cmdSyntaxPtr)(ct72) // Enable DCD output f/c
  448. #define CMD_ODCDFL_DSAB (cmdSyntaxPtr)(ct73) // Disable DCD output f/c
  449. // Set transmit interrupt load level. Count should be an even value 2-12
  450. //
  451. #define CMD_LOADLEVEL(count) \
  452. (((cmdSyntaxPtr)(ct74))->cmd[1] = (count),(cmdSyntaxPtr)(ct74))
  453. // If reporting DSS changes, map to character sequence FFh, 2, MSR
  454. //
  455. #define CMD_STATDATA(arg) \
  456. (((cmdSyntaxPtr)(ct75))->cmd[1] = (arg),(cmdSyntaxPtr)(ct75))
  457. #define CSTD_DISABLE// Report DSS changes as status packets only (default)
  458. #define CSTD_ENABLE // Report DSS changes as in-band data sequence as well as
  459. // by status packet.
  460. #define CMD_BREAK_ON (cmdSyntaxPtr)(ct76)// Set break and stop xmit
  461. #define CMD_BREAK_OFF (cmdSyntaxPtr)(ct77)// End break and restart xmit
  462. #define CMD_GETFC (cmdSyntaxPtr)(ct78)// Request for flow control packet
  463. // from board.
  464. // Transmit this character immediately
  465. //
  466. #define CMD_XMIT_NOW(ch) \
  467. (((cmdSyntaxPtr)(ct79))->cmd[1] = (ch),(cmdSyntaxPtr)(ct79))
  468. // Set baud rate via "divisor latch"
  469. //
  470. #define CMD_DIVISOR_LATCH(which,value) \
  471. (((cmdSyntaxPtr)(ct80))->cmd[1] = (which), \
  472. *(USHORT *)(((cmdSyntaxPtr)(ct80))->cmd[2]) = (value), \
  473. (cmdSyntaxPtr)(ct80))
  474. #define CDL_RX 1 // Set receiver rate
  475. #define CDL_TX 2 // Set transmit rate
  476. // (CDL_TX | CDL_RX) Set both rates
  477. // Request for special diagnostic status pkt from the board.
  478. //
  479. #define CMD_GET_STATUS (cmdSyntaxPtr)(ct81)
  480. // Request time-stamped transmit character count packet.
  481. //
  482. #define CMD_GET_TXCNT (cmdSyntaxPtr)(ct82)
  483. // Request time-stamped receive character count packet.
  484. //
  485. #define CMD_GET_RXCNT (cmdSyntaxPtr)(ct83)
  486. // Request for box/board I.D. packet.
  487. #define CMD_GET_BOXIDS (cmdSyntaxPtr)(ct84)
  488. // Enable or disable multiple channels according to bit-mapped ushorts box 1-4
  489. //
  490. #define CMD_ENAB_MULT(enable, box1, box2, box3, box4) \
  491. (((cmdSytaxPtr)(ct85))->cmd[1] = (enable), \
  492. *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[2]) = (box1), \
  493. *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[4]) = (box2), \
  494. *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[6]) = (box3), \
  495. *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[8]) = (box4), \
  496. (cmdSyntaxPtr)(ct85))
  497. #define CEM_DISABLE 0
  498. #define CEM_ENABLE 1
  499. // Enable or disable receiver or receiver interrupts (default both enabled)
  500. //
  501. #define CMD_RCV_ENABLE(ch) \
  502. (((cmdSyntaxPtr)(ct86))->cmd[1] = (ch),(cmdSyntaxPtr)(ct86))
  503. #define CRE_OFF 0 // Disable the receiver
  504. #define CRE_ON 1 // Enable the receiver
  505. #define CRE_INTOFF 2 // Disable receiver interrupts (to loadware)
  506. #define CRE_INTON 3 // Enable receiver interrupts (to loadware)
  507. // Starts up a hardware test process, which runs transparently, and sends a
  508. // STAT_HWFAIL packet in case a hardware failure is detected.
  509. //
  510. #define CMD_HW_TEST (cmdSyntaxPtr)(ct87)
  511. // Change receiver threshold and timeout value:
  512. // Defaults: timeout = 20mS
  513. // threshold count = 8 when DTRflow not in use,
  514. // threshold count = 5 when DTRflow in use.
  515. //
  516. #define CMD_RCV_THRESHOLD(count,ms) \
  517. (((cmdSyntaxPtr)(ct88))->cmd[1] = (count), \
  518. ((cmdSyntaxPtr)(ct88))->cmd[2] = (ms), \
  519. (cmdSyntaxPtr)(ct88))
  520. // Makes the loadware report DSS signals for this channel immediately.
  521. //
  522. #define CMD_DSS_NOW (cmdSyntaxPtr)(ct89)
  523. // Set the receive silo parameters
  524. // timeout is ms idle wait until delivery (~VTIME)
  525. // threshold is max characters cause interrupt (~VMIN)
  526. //
  527. #define CMD_SET_SILO(timeout,threshold) \
  528. (((cmdSyntaxPtr)(ct90))->cmd[1] = (timeout), \
  529. ((cmdSyntaxPtr)(ct90))->cmd[2] = (threshold), \
  530. (cmdSyntaxPtr)(ct90))
  531. // Set timed break in decisecond (1/10s)
  532. //
  533. #define CMD_LBREAK(ds) \
  534. (((cmdSyntaxPtr)(ct91))->cmd[1] = (ds),(cmdSyntaxPtr)(ct66))
  535. #endif // I2CMD_H