shell_vt100.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. /*
  2. * Copyright (c) 2018 Nordic Semiconductor ASA
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef SHELL_VT100_H__
  7. #define SHELL_VT100_H__
  8. #define SHELL_VT100_ASCII_ESC (0x1b)
  9. #define SHELL_VT100_ASCII_DEL (0x7F)
  10. #define SHELL_VT100_ASCII_BSPACE (0x08)
  11. #define SHELL_VT100_ASCII_CTRL_A (0x01)
  12. #define SHELL_VT100_ASCII_CTRL_B (0x02)
  13. #define SHELL_VT100_ASCII_CTRL_C (0x03)
  14. #define SHELL_VT100_ASCII_CTRL_D (0x04)
  15. #define SHELL_VT100_ASCII_CTRL_E (0x05)
  16. #define SHELL_VT100_ASCII_CTRL_F (0x06)
  17. #define SHELL_VT100_ASCII_CTRL_K (0x0B)
  18. #define SHELL_VT100_ASCII_CTRL_L (0x0C)
  19. #define SHELL_VT100_ASCII_CTRL_N (0x0E)
  20. #define SHELL_VT100_ASCII_CTRL_P (0x10)
  21. #define SHELL_VT100_ASCII_CTRL_U (0x15)
  22. #define SHELL_VT100_ASCII_CTRL_W (0x17)
  23. #define SHELL_VT100_ASCII_ALT_B (0x62)
  24. #define SHELL_VT100_ASCII_ALT_F (0x66)
  25. #define SHELL_VT100_ASCII_ALT_R (0x72)
  26. #define SHELL_VT100_SETNL \
  27. { \
  28. SHELL_VT100_ASCII_ESC, '[', '2', '0', 'h', '\0' \
  29. } /* Set new line mode */
  30. #define SHELL_VT100_SETAPPL \
  31. { \
  32. SHELL_VT100_ASCII_ESC, '[', '?', '1', 'h', '\0' \
  33. } /* Set cursor key to application */
  34. #define SHELL_VT100_SETCOL_132 \
  35. { \
  36. SHELL_VT100_ASCII_ESC, '[', '?', '3', 'h', '\0' \
  37. } /* Set number of columns to 132 */
  38. #define SHELL_VT100_SETSMOOTH \
  39. { \
  40. SHELL_VT100_ASCII_ESC, '[', '?', '4', 'h', '\0' \
  41. } /* Set smooth scrolling */
  42. #define SHELL_VT100_SETREVSCRN \
  43. { \
  44. SHELL_VT100_ASCII_ESC, '[', '?', '5', 'h', '\0' \
  45. } /* Set reverse video on screen */
  46. #define SHELL_VT100_SETORGREL \
  47. { \
  48. SHELL_VT100_ASCII_ESC, '[', '?', '6', 'h', '\0' \
  49. } /* Set origin to relative */
  50. #define SHELL_VT100_SETWRAP_ON \
  51. { \
  52. SHELL_VT100_ASCII_ESC, '[', '?', '7', 'h', '\0' \
  53. } /* Set auto-wrap mode */
  54. #define SHELL_VT100_SETWRAP_OFF \
  55. { \
  56. SHELL_VT100_ASCII_ESC, '[', '?', '7', 'l', '\0' \
  57. } /* Set auto-wrap mode */
  58. #define SHELL_VT100_SETREP \
  59. { \
  60. SHELL_VT100_ASCII_ESC, '[', '?', '8', 'h', '\0' \
  61. } /* Set auto-repeat mode */
  62. #define SHELL_VT100_SETINTER \
  63. { \
  64. SHELL_VT100_ASCII_ESC, '[', '?', '9', 'h', '\0' \
  65. } /* Set interlacing mode */
  66. #define SHELL_VT100_SETLF \
  67. { \
  68. SHELL_VT100_ASCII_ESC, '[', '2', '0', 'l', '\0' \
  69. } /* Set line feed mode */
  70. #define SHELL_VT100_SETCURSOR \
  71. { \
  72. SHELL_VT100_ASCII_ESC, '[', '?', '1', 'l', '\0' \
  73. } /* Set cursor key to cursor */
  74. #define SHELL_VT100_SETVT52 \
  75. { \
  76. SHELL_VT100_ASCII_ESC, '[', '?', '2', 'l', '\0' \
  77. } /* Set VT52 (versus ANSI) */
  78. #define SHELL_VT100_SETCOL_80 \
  79. { \
  80. SHELL_VT100_ASCII_ESC, '[', '?', '3', 'l', '\0' \
  81. } /* Set number of columns to 80 */
  82. #define SHELL_VT100_SETJUMP \
  83. { \
  84. SHELL_VT100_ASCII_ESC, '[', '?', '4', 'l', '\0' \
  85. } /* Set jump scrolling */
  86. #define SHELL_VT100_SETNORMSCRN \
  87. { \
  88. SHELL_VT100_ASCII_ESC, '[', '?', '5', 'l', '\0' \
  89. } /* Set normal video on screen */
  90. #define SHELL_VT100_SETORGABS \
  91. { \
  92. SHELL_VT100_ASCII_ESC, '[', '?', '6', 'l', '\0' \
  93. } /* Set origin to absolute */
  94. #define SHELL_VT100_RESETWRAP \
  95. { \
  96. SHELL_VT100_ASCII_ESC, '[', '?', '7', 'l', '\0' \
  97. } /* Reset auto-wrap mode */
  98. #define SHELL_VT100_RESETREP \
  99. { \
  100. SHELL_VT100_ASCII_ESC, '[', '?', '8', 'l', '\0' \
  101. } /* Reset auto-repeat mode */
  102. #define SHELL_VT100_RESETINTER \
  103. { \
  104. SHELL_VT100_ASCII_ESC, '[', '?', '9', 'l', '\0' \
  105. } /* Reset interlacing mode */
  106. #define SHELL_VT100_ALTKEYPAD \
  107. { \
  108. SHELL_VT100_ASCII_ESC, '=', '\0' \
  109. } /* Set alternate keypad mode */
  110. #define SHELL_VT100_NUMKEYPAD \
  111. { \
  112. SHELL_VT100_ASCII_ESC, '>', '\0' \
  113. } /* Set numeric keypad mode */
  114. #define SHELL_VT100_SETUKG0 \
  115. { \
  116. SHELL_VT100_ASCII_ESC, '(', 'A', '\0' \
  117. } /* Set United Kingdom G0 character set */
  118. #define SHELL_VT100_SETUKG1 \
  119. { \
  120. SHELL_VT100_ASCII_ESC, ')', 'A', '\0' \
  121. } /* Set United Kingdom G1 character set */
  122. #define SHELL_VT100_SETUSG0 \
  123. { \
  124. SHELL_VT100_ASCII_ESC, '(', 'B', '\0' \
  125. } /* Set United States G0 character set */
  126. #define SHELL_VT100_SETUSG1 \
  127. { \
  128. SHELL_VT100_ASCII_ESC, ')', 'B', '\0' \
  129. } /* Set United States G1 character set */
  130. #define SHELL_VT100_SETSPECG0 \
  131. { \
  132. SHELL_VT100_ASCII_ESC, '(', '0', '\0' \
  133. } /* Set G0 special chars. & line set */
  134. #define SHELL_VT100_SETSPECG1 \
  135. { \
  136. SHELL_VT100_ASCII_ESC, ')', '0', '\0' \
  137. } /* Set G1 special chars. & line set */
  138. #define SHELL_VT100_SETALTG0 \
  139. { \
  140. SHELL_VT100_ASCII_ESC, '(', '1', '\0' \
  141. } /* Set G0 alternate character ROM */
  142. #define SHELL_VT100_SETALTG1 \
  143. { \
  144. SHELL_VT100_ASCII_ESC, ')', '1', '\0' \
  145. } /* Set G1 alternate character ROM */
  146. #define SHELL_VT100_SETALTSPECG0 \
  147. { \
  148. SHELL_VT100_ASCII_ESC, '(', '2', '\0' \
  149. } /* Set G0 alt char ROM and spec. graphics */
  150. #define SHELL_VT100_SETALTSPECG1 \
  151. { \
  152. SHELL_VT100_ASCII_ESC, ')', '2', '\0' \
  153. } /* Set G1 alt char ROM and spec. graphics */
  154. #define SHELL_VT100_SETSS2 \
  155. { \
  156. SHELL_VT100_ASCII_ESC, 'N', '\0' \
  157. } /* Set single shift 2 */
  158. #define SHELL_VT100_SETSS3 \
  159. { \
  160. SHELL_VT100_ASCII_ESC, 'O', '\0' \
  161. } /* Set single shift 3 */
  162. #define SHELL_VT100_MODESOFF \
  163. { \
  164. SHELL_VT100_ASCII_ESC, '[', 'm', '\0' \
  165. } /* Turn off character attributes */
  166. #define SHELL_VT100_MODESOFF_ \
  167. { \
  168. SHELL_VT100_ASCII_ESC, '[', '0', 'm', '\0' \
  169. } /* Turn off character attributes */
  170. #define SHELL_VT100_BOLD \
  171. { \
  172. SHELL_VT100_ASCII_ESC, '[', '1', 'm', '\0' \
  173. } /* Turn bold mode on */
  174. #define SHELL_VT100_LOWINT \
  175. { \
  176. SHELL_VT100_ASCII_ESC, '[', '2', 'm', '\0' \
  177. } /* Turn low intensity mode on */
  178. #define SHELL_VT100_UNDERLINE \
  179. { \
  180. SHELL_VT100_ASCII_ESC, '[', '4', 'm', '\0' \
  181. } /* Turn underline mode on */
  182. #define SHELL_VT100_BLINK \
  183. { \
  184. SHELL_VT100_ASCII_ESC, '[', '5', 'm', '\0' \
  185. } /* Turn blinking mode on */
  186. #define SHELL_VT100_REVERSE \
  187. { \
  188. SHELL_VT100_ASCII_ESC, '[', '7', 'm', '\0' \
  189. } /* Turn reverse video on */
  190. #define SHELL_VT100_INVISIBLE \
  191. { \
  192. SHELL_VT100_ASCII_ESC, '[', '8', 'm', '\0' \
  193. } /* Turn invisible text mode on */
  194. #define SHELL_VT100_SETWIN(t, b) \
  195. { \
  196. SHELL_VT100_ASCII_ESC, '[', (t), ';', (b), 'r', '\0' \
  197. } /* Set top and bottom line#s of a window */
  198. #define SHELL_VT100_CURSORUP(n) \
  199. { \
  200. SHELL_VT100_ASCII_ESC, '[', (n), 'A', '\0' \
  201. } /* Move cursor up n lines */
  202. #define SHELL_VT100_CURSORDN(n) \
  203. { \
  204. SHELL_VT100_ASCII_ESC, '[', (n), 'B', '\0' \
  205. } /* Move cursor down n lines */
  206. #define SHELL_VT100_CURSORRT(n) \
  207. { \
  208. SHELL_VT100_ASCII_ESC, '[', (n), 'C', '\0' \
  209. } /* Move cursor right n lines */
  210. #define SHELL_VT100_CURSORLF(n) \
  211. { \
  212. SHELL_VT100_ASCII_ESC, '[', (n), 'D', '\0' \
  213. } /* Move cursor left n lines */
  214. #define SHELL_VT100_CURSORHOME \
  215. { \
  216. SHELL_VT100_ASCII_ESC, '[', 'H', '\0' \
  217. } /* Move cursor to upper left corner */
  218. #define SHELL_VT100_CURSORHOME_ \
  219. { \
  220. SHELL_VT100_ASCII_ESC, '[', ';', 'H', '\0' \
  221. } /* Move cursor to upper left corner */
  222. #define SHELL_VT100_CURSORPOS(v, h) \
  223. { \
  224. SHELL_VT100_ASCII_ESC, '[', (v), ';', (h), 'H', '\0' \
  225. } /* Move cursor to screen location v,h */
  226. #define SHELL_VT100_HVHOME \
  227. { \
  228. SHELL_VT100_ASCII_ESC, '[', 'f', '\0' \
  229. } /* Move cursor to upper left corner */
  230. #define SHELL_VT100_HVHOME_ \
  231. { \
  232. SHELL_VT100_ASCII_ESC, '[', ';', 'f', '\0' \
  233. } /* Move cursor to upper left corner */
  234. #define SHELL_VT100_HVPOS(v, h) \
  235. { \
  236. SHELL_VT100_ASCII_ESC, '[', (v), ';', (h), 'f', '\0' \
  237. } /* Move cursor to screen location v,h */
  238. #define SHELL_VT100_INDEX \
  239. { \
  240. SHELL_VT100_ASCII_ESC, 'D', '\0' \
  241. } /* Move/scroll window up one line */
  242. #define SHELL_VT100_REVINDEX \
  243. { \
  244. SHELL_VT100_ASCII_ESC, 'M', '\0' \
  245. } /* Move/scroll window down one line */
  246. #define SHELL_VT100_NEXTLINE \
  247. { \
  248. SHELL_VT100_ASCII_ESC, 'E', '\0' \
  249. } /* Move to next line */
  250. #define SHELL_VT100_SAVECURSOR \
  251. { \
  252. SHELL_VT100_ASCII_ESC, '7', '\0' \
  253. } /* Save cursor position and attributes */
  254. #define SHELL_VT100_RESTORECURSOR \
  255. { \
  256. SHELL_VT100_ASCII_ESC, '8', '\0' \
  257. } /* Restore cursor position and attribute */
  258. #define SHELL_VT100_TABSET \
  259. { \
  260. SHELL_VT100_ASCII_ESC, 'H', '\0' \
  261. } /* Set a tab at the current column */
  262. #define SHELL_VT100_TABCLR \
  263. { \
  264. SHELL_VT100_ASCII_ESC, '[', 'g', '\0' \
  265. } /* Clear a tab at the current column */
  266. #define SHELL_VT100_TABCLR_ \
  267. { \
  268. SHELL_VT100_ASCII_ESC, '[', '0', 'g', '\0' \
  269. } /* Clear a tab at the current column */
  270. #define SHELL_VT100_TABCLRALL \
  271. { \
  272. SHELL_VT100_ASCII_ESC, '[', '3', 'g', '\0' \
  273. } /* Clear all tabs */
  274. #define SHELL_VT100_DHTOP \
  275. { \
  276. SHELL_VT100_ASCII_ESC, '#', '3', '\0' \
  277. } /* Double-height letters, top half */
  278. #define SHELL_VT100_DHBOT \
  279. { \
  280. SHELL_VT100_ASCII_ESC, '#', '4', '\0' \
  281. } /* Double-height letters, bottom hal */
  282. #define SHELL_VT100_SWSH \
  283. { \
  284. SHELL_VT100_ASCII_ESC, '#', '5', '\0' \
  285. } /* Single width, single height letters */
  286. #define SHELL_VT100_DWSH \
  287. { \
  288. SHELL_VT100_ASCII_ESC, '#', '6', '\0' \
  289. } /* Double width, single height letters */
  290. #define SHELL_VT100_CLEAREOL \
  291. { \
  292. SHELL_VT100_ASCII_ESC, '[', 'K', '\0' \
  293. } /* Clear line from cursor right */
  294. #define SHELL_VT100_CLEAREOL_ \
  295. { \
  296. SHELL_VT100_ASCII_ESC, '[', '0', 'K', '\0' \
  297. } /* Clear line from cursor right */
  298. #define SHELL_VT100_CLEARBOL \
  299. { \
  300. SHELL_VT100_ASCII_ESC, '[', '1', 'K', '\0' \
  301. } /* Clear line from cursor left */
  302. #define SHELL_VT100_CLEARLINE \
  303. { \
  304. SHELL_VT100_ASCII_ESC, '[', '2', 'K', '\0' \
  305. } /* Clear entire line */
  306. #define SHELL_VT100_CLEAREOS \
  307. { \
  308. SHELL_VT100_ASCII_ESC, '[', 'J', '\0' \
  309. } /* Clear screen from cursor down */
  310. #define SHELL_VT100_CLEAREOS_ \
  311. { \
  312. SHELL_VT100_ASCII_ESC, '[', '0', 'J', '\0' \
  313. } /* Clear screen from cursor down */
  314. #define SHELL_VT100_CLEARBOS \
  315. { \
  316. SHELL_VT100_ASCII_ESC, '[', '1', 'J', '\0' \
  317. } /* Clear screen from cursor up */
  318. #define SHELL_VT100_CLEARSCREEN \
  319. { \
  320. SHELL_VT100_ASCII_ESC, '[', '2', 'J', '\0' \
  321. } /* Clear entire screen */
  322. #define SHELL_VT100_DEVSTAT \
  323. { \
  324. SHELL_VT100_ASCII_ESC, '5', 'n', '\0' \
  325. } /* Device status report */
  326. #define SHELL_VT100_TERMOK \
  327. { \
  328. SHELL_VT100_ASCII_ESC, '0', 'n', '\0' \
  329. } /* Response: terminal is OK */
  330. #define SHELL_VT100_TERMNOK \
  331. { \
  332. SHELL_VT100_ASCII_ESC, '3', 'n', '\0' \
  333. } /* Response: terminal is not OK */
  334. #define SHELL_VT100_GETCURSOR \
  335. { \
  336. SHELL_VT100_ASCII_ESC, '[', '6', 'n', '\0' \
  337. } /* Get cursor position */
  338. #define SHELL_VT100_CURSORPOSAT \
  339. { \
  340. SHELL_VT100_ASCII_ESC, (v), ';', (h), 'R', '\0' \
  341. } /* Response: cursor is at v,h */
  342. #define SHELL_VT100_IDENT \
  343. { \
  344. SHELL_VT100_ASCII_ESC, '[', 'c', '\0' \
  345. } /* Identify what terminal type */
  346. #define SHELL_VT100_IDENT_ \
  347. { \
  348. SHELL_VT100_ASCII_ESC, '[', '0', 'c', '\0' \
  349. } /* Identify what terminal type */
  350. #define SHELL_VT100_GETTYPE \
  351. { \
  352. SHELL_VT100_ASCII_ESC, '[', '?', '1', ';', (n), '0', 'c', '\0' \
  353. } /* Response: terminal type code n */
  354. #define SHELL_VT100_RESET \
  355. { \
  356. SHELL_VT100_ASCII_ESC, 'c', '\0' \
  357. } /*Reset terminal to initial state */
  358. #define SHELL_VT100_ALIGN \
  359. { \
  360. SHELL_VT100_ASCII_ESC, '#', '8', '\0' \
  361. } /* Screen alignment display */
  362. #define SHELL_VT100_TESTPU \
  363. { \
  364. SHELL_VT100_ASCII_ESC, '[', '2', ';', '1', 'y', '\0' \
  365. } /* Confidence power up test */
  366. #define SHELL_VT100_TESTLB \
  367. { \
  368. SHELL_VT100_ASCII_ESC, '[', '2', ';', '2', 'y', '\0' \
  369. } /* Confidence loopback test */
  370. #define SHELL_VT100_TESTPUREP \
  371. { \
  372. SHELL_VT100_ASCII_ESC, '[', '2', ';', '9', 'y', '\0' \
  373. } /* Repeat power up test */
  374. #define SHELL_VT100_TESTLBREP \
  375. { \
  376. SHELL_VT100_ASCII_ESC, '[', '2', ';', '1', '0', 'y', '\0' \
  377. } /* Repeat loopback test */
  378. #define SHELL_VT100_LEDSOFF \
  379. { \
  380. SHELL_VT100_ASCII_ESC, '[', '0', 'q', '\0' \
  381. } /* Turn off all four leds */
  382. #define SHELL_VT100_LED1 \
  383. { \
  384. SHELL_VT100_ASCII_ESC, '[', '1', 'q', '\0' \
  385. } /* Turn on LED #1 */
  386. #define SHELL_VT100_LED2 \
  387. { \
  388. SHELL_VT100_ASCII_ESC, '[', '2', 'q', '\0' \
  389. } /* Turn on LED #2 */
  390. #define SHELL_VT100_LED3 \
  391. { \
  392. SHELL_VT100_ASCII_ESC, '[', '3', 'q', '\0' \
  393. } /* Turn on LED #3 */
  394. #define SHELL_VT100_LED4 \
  395. { \
  396. SHELL_VT100_ASCII_ESC, '[', '4', 'q', '\0' \
  397. } /* Turn on LED #4 */
  398. /* Function Keys */
  399. #define SHELL_VT100_PF1 \
  400. { \
  401. SHELL_VT100_ASCII_ESC, 'O', 'P', '\0' \
  402. }
  403. #define SHELL_VT100_PF2 \
  404. { \
  405. SHELL_VT100_ASCII_ESC, 'O', 'Q', '\0' \
  406. }
  407. #define SHELL_VT100_PF3 \
  408. { \
  409. SHELL_VT100_ASCII_ESC, 'O', 'R', '\0' \
  410. }
  411. #define SHELL_VT100_PF4 \
  412. { \
  413. SHELL_VT100_ASCII_ESC, 'O', 'S', '\0' \
  414. }
  415. /* Arrow keys */
  416. #define SHELL_VT100_UP_RESET \
  417. { \
  418. SHELL_VT100_ASCII_ESC, 'A', '\0' \
  419. }
  420. #define SHELL_VT100_UP_SET \
  421. { \
  422. SHELL_VT100_ASCII_ESC, 'O', 'A', '\0' \
  423. }
  424. #define SHELL_VT100_DOWN_RESET \
  425. { \
  426. SHELL_VT100_ASCII_ESC, 'B', '\0' \
  427. }
  428. #define SHELL_VT100_DOWN_SET \
  429. { \
  430. SHELL_VT100_ASCII_ESC, 'O', 'B', '\0' \
  431. }
  432. #define SHELL_VT100_RIGHT_RESET \
  433. { \
  434. SHELL_VT100_ASCII_ESC, 'C', '\0' \
  435. }
  436. #define SHELL_VT100_RIGHT_SET \
  437. { \
  438. SHELL_VT100_ASCII_ESC, 'O', 'C', '\0' \
  439. }
  440. #define SHELL_VT100_LEFT_RESET \
  441. { \
  442. SHELL_VT100_ASCII_ESC, 'D', '\0' \
  443. }
  444. #define SHELL_VT100_LEFT_SET \
  445. { \
  446. SHELL_VT100_ASCII_ESC, 'O', 'D', '\0' \
  447. }
  448. /* Numeric Keypad Keys */
  449. #define SHELL_VT100_NUMERIC_0 \
  450. { \
  451. '0', '\0' \
  452. }
  453. #define SHELL_VT100_ALT_0 \
  454. { \
  455. SHELL_VT100_ASCII_ESC, 'O', 'p', '\0' \
  456. }
  457. #define SHELL_VT100_NUMERIC_1 \
  458. { \
  459. '1', '\0' \
  460. }
  461. #define SHELL_VT100_ALT_1 \
  462. { \
  463. SHELL_VT100_ASCII_ESC, 'O', 'q', '\0' \
  464. }
  465. #define SHELL_VT100_NUMERIC_2 \
  466. { \
  467. '2', '\0' \
  468. }
  469. #define SHELL_VT100_ALT_2 \
  470. { \
  471. SHELL_VT100_ASCII_ESC, 'O', 'r', '\0' \
  472. }
  473. #define SHELL_VT100_NUMERIC_3 \
  474. { \
  475. '3', '\0' \
  476. }
  477. #define SHELL_VT100_ALT_3 \
  478. { \
  479. SHELL_VT100_ASCII_ESC, 'O', 's', '\0' \
  480. }
  481. #define SHELL_VT100_NUMERIC_4 \
  482. { \
  483. '4', '\0' \
  484. }
  485. #define SHELL_VT100_ALT_4 \
  486. { \
  487. SHELL_VT100_ASCII_ESC, 'O', 't', '\0' \
  488. }
  489. #define SHELL_VT100_NUMERIC_5 \
  490. { \
  491. '5', '\0' \
  492. }
  493. #define SHELL_VT100_ALT_5 \
  494. { \
  495. SHELL_VT100_ASCII_ESC, 'O', 'u', '\0' \
  496. }
  497. #define SHELL_VT100_NUMERIC_6 \
  498. { \
  499. '6', '\0' \
  500. }
  501. #define SHELL_VT100_ALT_6 \
  502. { \
  503. SHELL_VT100_ASCII_ESC, 'O', 'v', '\0' \
  504. }
  505. #define SHELL_VT100_NUMERIC_7 \
  506. { \
  507. '7', '\0' \
  508. }
  509. #define SHELL_VT100_ALT_7 \
  510. { \
  511. SHELL_VT100_ASCII_ESC, 'O', 'w', '\0' \
  512. }
  513. #define SHELL_VT100_NUMERIC_8 \
  514. { \
  515. '8', '\0' \
  516. }
  517. #define SHELL_VT100_ALT_8 \
  518. { \
  519. SHELL_VT100_ASCII_ESC, 'O', 'x', '\0' \
  520. }
  521. #define SHELL_VT100_NUMERIC_9 \
  522. { \
  523. '9', '\0' \
  524. }
  525. #define SHELL_VT100_ALT_9 \
  526. { \
  527. SHELL_VT100_ASCII_ESC, 'O', 'y' \
  528. }
  529. #define SHELL_VT100_NUMERIC_MINUS \
  530. { \
  531. '-', '\0' \
  532. }
  533. #define SHELL_VT100_ALT_MINUS \
  534. { \
  535. SHELL_VT100_ASCII_ESC, 'O', 'm', '\0' \
  536. }
  537. #define SHELL_VT100_NUMERIC_COMMA \
  538. { \
  539. ',', '\0' \
  540. }
  541. #define SHELL_VT100_ALT_COMMA \
  542. { \
  543. SHELL_VT100_ASCII_ESC, 'O', 'l', '\0' \
  544. }
  545. #define SHELL_VT100_NUMERIC_ENTER \
  546. { \
  547. ASCII_CR \
  548. }
  549. #define SHELL_VT100_NUMERIC_PERIOD \
  550. { \
  551. '.', '\0' \
  552. }
  553. #define SHELL_VT100_ALT_PERIOD \
  554. { \
  555. SHELL_VT100_ASCII_ESC, 'O', 'n', '\0' \
  556. }
  557. #define SHELL_VT100_ALT_ENTER \
  558. { \
  559. SHELL_VT100_ASCII_ESC, 'O', 'M', '\0' \
  560. }
  561. #define SHELL_VT100_BGCOLOR(__col) \
  562. { \
  563. SHELL_VT100_ASCII_ESC, '[', '4', '0' + (__col), 'm', '\0' \
  564. }
  565. #define SHELL_VT100_COLOR(__col) \
  566. { \
  567. SHELL_VT100_ASCII_ESC, '[', '1', ';', '3', '0' + (__col), 'm', '\0' \
  568. }
  569. #endif /* SHELL_VT100_H__ */