nrf_cli_vt100.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. /**
  2. * Copyright (c) 2017 - 2020, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef NRF_CLI_VT100_H__
  41. #define NRF_CLI_VT100_H__
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #define NRF_CLI_VT100_ASCII_ESC (0x1b)
  46. #define NRF_CLI_VT100_ASCII_DEL (0x7F)
  47. #define NRF_CLI_VT100_ASCII_BSPACE (0x08)
  48. #define NRF_CLI_VT100_ASCII_CTRL_A (0x1)
  49. #define NRF_CLI_VT100_ASCII_CTRL_C (0x03)
  50. #define NRF_CLI_VT100_ASCII_CTRL_E (0x5)
  51. #define NRF_CLI_VT100_ASCII_CTRL_L (0x0C)
  52. #define NRF_CLI_VT100_ASCII_CTRL_U (0x15)
  53. #define NRF_CLI_VT100_ASCII_CTRL_W (0x17)
  54. #define NRF_CLI_VT100_SETNL \
  55. { \
  56. NRF_CLI_VT100_ASCII_ESC, '[', '2', '0', 'h', '\0' \
  57. } /* Set new line mode */
  58. #define NRF_CLI_VT100_SETAPPL \
  59. { \
  60. NRF_CLI_VT100_ASCII_ESC, '[', '?', '1', 'h', '\0' \
  61. } /* Set cursor key to application */
  62. #define NRF_CLI_VT100_SETCOL_132 \
  63. { \
  64. NRF_CLI_VT100_ASCII_ESC, '[', '?', '3', 'h', '\0' \
  65. } /* Set number of columns to 132 */
  66. #define NRF_CLI_VT100_SETSMOOTH \
  67. { \
  68. NRF_CLI_VT100_ASCII_ESC, '[', '?', '4', 'h', '\0' \
  69. } /* Set smooth scrolling */
  70. #define NRF_CLI_VT100_SETREVSCRN \
  71. { \
  72. NRF_CLI_VT100_ASCII_ESC, '[', '?', '5', 'h', '\0' \
  73. } /* Set reverse video on screen */
  74. #define NRF_CLI_VT100_SETORGREL \
  75. { \
  76. NRF_CLI_VT100_ASCII_ESC, '[', '?', '6', 'h', '\0' \
  77. } /* Set origin to relative */
  78. #define NRF_CLI_VT100_SETWRAP_ON \
  79. { \
  80. NRF_CLI_VT100_ASCII_ESC, '[', '?', '7', 'h', '\0' \
  81. } /* Set auto-wrap mode */
  82. #define NRF_CLI_VT100_SETWRAP_OFF \
  83. { \
  84. NRF_CLI_VT100_ASCII_ESC, '[', '?', '7', 'l', '\0' \
  85. } /* Set auto-wrap mode */
  86. #define NRF_CLI_VT100_SETREP \
  87. { \
  88. NRF_CLI_VT100_ASCII_ESC, '[', '?', '8', 'h', '\0' \
  89. } /* Set auto-repeat mode */
  90. #define NRF_CLI_VT100_SETINTER \
  91. { \
  92. NRF_CLI_VT100_ASCII_ESC, '[', '?', '9', 'h', '\0' \
  93. } /* Set interlacing mode */
  94. #define NRF_CLI_VT100_SETLF \
  95. { \
  96. NRF_CLI_VT100_ASCII_ESC, '[', '2', '0', 'l', '\0' \
  97. } /* Set line feed mode */
  98. #define NRF_CLI_VT100_SETCURSOR \
  99. { \
  100. NRF_CLI_VT100_ASCII_ESC, '[', '?', '1', 'l', '\0' \
  101. } /* Set cursor key to cursor */
  102. #define NRF_CLI_VT100_SETVT52 \
  103. { \
  104. NRF_CLI_VT100_ASCII_ESC, '[', '?', '2', 'l', '\0' \
  105. } /* Set VT52 (versus ANSI) */
  106. #define NRF_CLI_VT100_SETCOL_80 \
  107. { \
  108. NRF_CLI_VT100_ASCII_ESC, '[', '?', '3', 'l', '\0' \
  109. } /* Set number of columns to 80 */
  110. #define NRF_CLI_VT100_SETJUMP \
  111. { \
  112. NRF_CLI_VT100_ASCII_ESC, '[', '?', '4', 'l', '\0' \
  113. } /* Set jump scrolling */
  114. #define NRF_CLI_VT100_SETNORMSCRN \
  115. { \
  116. NRF_CLI_VT100_ASCII_ESC, '[', '?', '5', 'l', '\0' \
  117. } /* Set normal video on screen */
  118. #define NRF_CLI_VT100_SETORGABS \
  119. { \
  120. NRF_CLI_VT100_ASCII_ESC, '[', '?', '6', 'l', '\0' \
  121. } /* Set origin to absolute */
  122. #define NRF_CLI_VT100_RESETWRAP \
  123. { \
  124. NRF_CLI_VT100_ASCII_ESC, '[', '?', '7', 'l', '\0' \
  125. } /* Reset auto-wrap mode */
  126. #define NRF_CLI_VT100_RESETREP \
  127. { \
  128. NRF_CLI_VT100_ASCII_ESC, '[', '?', '8', 'l', '\0' \
  129. } /* Reset auto-repeat mode */
  130. #define NRF_CLI_VT100_RESETINTER \
  131. { \
  132. NRF_CLI_VT100_ASCII_ESC, '[', '?', '9', 'l', '\0' \
  133. } /* Reset interlacing mode */
  134. #define NRF_CLI_VT100_ALTKEYPAD \
  135. { \
  136. NRF_CLI_VT100_ASCII_ESC, '=', '\0' \
  137. } /* Set alternate keypad mode */
  138. #define NRF_CLI_VT100_NUMKEYPAD \
  139. { \
  140. NRF_CLI_VT100_ASCII_ESC, '>', '\0' \
  141. } /* Set numeric keypad mode */
  142. #define NRF_CLI_VT100_SETUKG0 \
  143. { \
  144. NRF_CLI_VT100_ASCII_ESC, '(', 'A', '\0' \
  145. } /* Set United Kingdom G0 character set */
  146. #define NRF_CLI_VT100_SETUKG1 \
  147. { \
  148. NRF_CLI_VT100_ASCII_ESC, ')', 'A', '\0' \
  149. } /* Set United Kingdom G1 character set */
  150. #define NRF_CLI_VT100_SETUSG0 \
  151. { \
  152. NRF_CLI_VT100_ASCII_ESC, '(', 'B', '\0' \
  153. } /* Set United States G0 character set */
  154. #define NRF_CLI_VT100_SETUSG1 \
  155. { \
  156. NRF_CLI_VT100_ASCII_ESC, ')', 'B', '\0' \
  157. } /* Set United States G1 character set */
  158. #define NRF_CLI_VT100_SETSPECG0 \
  159. { \
  160. NRF_CLI_VT100_ASCII_ESC, '(', '0', '\0' \
  161. } /* Set G0 special chars. & line set */
  162. #define NRF_CLI_VT100_SETSPECG1 \
  163. { \
  164. NRF_CLI_VT100_ASCII_ESC, ')', '0', '\0' \
  165. } /* Set G1 special chars. & line set */
  166. #define NRF_CLI_VT100_SETALTG0 \
  167. { \
  168. NRF_CLI_VT100_ASCII_ESC, '(', '1', '\0' \
  169. } /* Set G0 alternate character ROM */
  170. #define NRF_CLI_VT100_SETALTG1 \
  171. { \
  172. NRF_CLI_VT100_ASCII_ESC, ')', '1', '\0' \
  173. } /* Set G1 alternate character ROM */
  174. #define NRF_CLI_VT100_SETALTSPECG0 \
  175. { \
  176. NRF_CLI_VT100_ASCII_ESC, '(', '2', '\0' \
  177. } /* Set G0 alt char ROM and spec. graphics */
  178. #define NRF_CLI_VT100_SETALTSPECG1 \
  179. { \
  180. NRF_CLI_VT100_ASCII_ESC, ')', '2', '\0' \
  181. } /* Set G1 alt char ROM and spec. graphics */
  182. #define NRF_CLI_VT100_SETSS2 \
  183. { \
  184. NRF_CLI_VT100_ASCII_ESC, 'N', '\0' \
  185. } /* Set single shift 2 */
  186. #define NRF_CLI_VT100_SETSS3 \
  187. { \
  188. NRF_CLI_VT100_ASCII_ESC, 'O', '\0' \
  189. } /* Set single shift 3 */
  190. #define NRF_CLI_VT100_MODESOFF \
  191. { \
  192. NRF_CLI_VT100_ASCII_ESC, '[', 'm', '\0' \
  193. } /* Turn off character attributes */
  194. #define NRF_CLI_VT100_MODESOFF_ \
  195. { \
  196. NRF_CLI_VT100_ASCII_ESC, '[', '0', 'm', '\0' \
  197. } /* Turn off character attributes */
  198. #define NRF_CLI_VT100_BOLD \
  199. { \
  200. NRF_CLI_VT100_ASCII_ESC, '[', '1', 'm', '\0' \
  201. } /* Turn bold mode on */
  202. #define NRF_CLI_VT100_LOWINT \
  203. { \
  204. NRF_CLI_VT100_ASCII_ESC, '[', '2', 'm', '\0' \
  205. } /* Turn low intensity mode on */
  206. #define NRF_CLI_VT100_UNDERLINE \
  207. { \
  208. NRF_CLI_VT100_ASCII_ESC, '[', '4', 'm', '\0' \
  209. } /* Turn underline mode on */
  210. #define NRF_CLI_VT100_BLINK \
  211. { \
  212. NRF_CLI_VT100_ASCII_ESC, '[', '5', 'm', '\0' \
  213. } /* Turn blinking mode on */
  214. #define NRF_CLI_VT100_REVERSE \
  215. { \
  216. NRF_CLI_VT100_ASCII_ESC, '[', '7', 'm', '\0' \
  217. } /* Turn reverse video on */
  218. #define NRF_CLI_VT100_INVISIBLE \
  219. { \
  220. NRF_CLI_VT100_ASCII_ESC, '[', '8', 'm', '\0' \
  221. } /* Turn invisible text mode on */
  222. #define NRF_CLI_VT100_SETWIN(t, b) \
  223. { \
  224. NRF_CLI_VT100_ASCII_ESC, '[', (t), ';', (b), 'r', '\0' \
  225. } /* Set top and bottom line#s of a window */
  226. #define NRF_CLI_VT100_CURSORUP(n) \
  227. { \
  228. NRF_CLI_VT100_ASCII_ESC, '[', (n), 'A', '\0' \
  229. } /* Move cursor up n lines */
  230. #define NRF_CLI_VT100_CURSORDN(n) \
  231. { \
  232. NRF_CLI_VT100_ASCII_ESC, '[', (n), 'B', '\0' \
  233. } /* Move cursor down n lines */
  234. #define NRF_CLI_VT100_CURSORRT(n) \
  235. { \
  236. NRF_CLI_VT100_ASCII_ESC, '[', (n), 'C', '\0' \
  237. } /* Move cursor right n lines */
  238. #define NRF_CLI_VT100_CURSORLF(n) \
  239. { \
  240. NRF_CLI_VT100_ASCII_ESC, '[', (n), 'D', '\0' \
  241. } /* Move cursor left n lines */
  242. #define NRF_CLI_VT100_CURSORHOME \
  243. { \
  244. NRF_CLI_VT100_ASCII_ESC, '[', 'H', '\0' \
  245. } /* Move cursor to upper left corner */
  246. #define NRF_CLI_VT100_CURSORHOME_ \
  247. { \
  248. NRF_CLI_VT100_ASCII_ESC, '[', ';', 'H', '\0' \
  249. } /* Move cursor to upper left corner */
  250. #define NRF_CLI_VT100_CURSORPOS(v, h) \
  251. { \
  252. NRF_CLI_VT100_ASCII_ESC, '[', (v), ';', (h), 'H', '\0' \
  253. } /* Move cursor to screen location v,h */
  254. #define NRF_CLI_VT100_HVHOME \
  255. { \
  256. NRF_CLI_VT100_ASCII_ESC, '[', 'f', '\0' \
  257. } /* Move cursor to upper left corner */
  258. #define NRF_CLI_VT100_HVHOME_ \
  259. { \
  260. NRF_CLI_VT100_ASCII_ESC, '[', ';', 'f', '\0' \
  261. } /* Move cursor to upper left corner */
  262. #define NRF_CLI_VT100_HVPOS(v, h) \
  263. { \
  264. NRF_CLI_VT100_ASCII_ESC, '[', (v), ';', (h), 'f', '\0' \
  265. } /* Move cursor to screen location v,h */
  266. #define NRF_CLI_VT100_INDEX \
  267. { \
  268. NRF_CLI_VT100_ASCII_ESC, 'D', '\0' \
  269. } /* Move/scroll window up one line */
  270. #define NRF_CLI_VT100_REVINDEX \
  271. { \
  272. NRF_CLI_VT100_ASCII_ESC, 'M', '\0' \
  273. } /* Move/scroll window down one line */
  274. #define NRF_CLI_VT100_NEXTLINE \
  275. { \
  276. NRF_CLI_VT100_ASCII_ESC, 'E', '\0' \
  277. } /* Move to next line */
  278. #define NRF_CLI_VT100_SAVECURSOR \
  279. { \
  280. NRF_CLI_VT100_ASCII_ESC, '7', '\0' \
  281. } /* Save cursor position and attributes */
  282. #define NRF_CLI_VT100_RESTORECURSOR \
  283. { \
  284. NRF_CLI_VT100_ASCII_ESC, '8', '\0' \
  285. } /* Restore cursor position and attribute */
  286. #define NRF_CLI_VT100_TABSET \
  287. { \
  288. NRF_CLI_VT100_ASCII_ESC, 'H', '\0' \
  289. } /* Set a tab at the current column */
  290. #define NRF_CLI_VT100_TABCLR \
  291. { \
  292. NRF_CLI_VT100_ASCII_ESC, '[', 'g', '\0' \
  293. } /* Clear a tab at the current column */
  294. #define NRF_CLI_VT100_TABCLR_ \
  295. { \
  296. NRF_CLI_VT100_ASCII_ESC, '[', '0', 'g', '\0' \
  297. } /* Clear a tab at the current column */
  298. #define NRF_CLI_VT100_TABCLRALL \
  299. { \
  300. NRF_CLI_VT100_ASCII_ESC, '[', '3', 'g', '\0' \
  301. } /* Clear all tabs */
  302. #define NRF_CLI_VT100_DHTOP \
  303. { \
  304. NRF_CLI_VT100_ASCII_ESC, '#', '3', '\0' \
  305. } /* Double-height letters, top half */
  306. #define NRF_CLI_VT100_DHBOT \
  307. { \
  308. NRF_CLI_VT100_ASCII_ESC, '#', '4', '\0' \
  309. } /* Double-height letters, bottom hal */
  310. #define NRF_CLI_VT100_SWSH \
  311. { \
  312. NRF_CLI_VT100_ASCII_ESC, '#', '5', '\0' \
  313. } /* Single width, single height letters */
  314. #define NRF_CLI_VT100_DWSH \
  315. { \
  316. NRF_CLI_VT100_ASCII_ESC, '#', '6', '\0' \
  317. } /* Double width, single height letters */
  318. #define NRF_CLI_VT100_CLEAREOL \
  319. { \
  320. NRF_CLI_VT100_ASCII_ESC, '[', 'K', '\0' \
  321. } /* Clear line from cursor right */
  322. #define NRF_CLI_VT100_CLEAREOL_ \
  323. { \
  324. NRF_CLI_VT100_ASCII_ESC, '[', '0', 'K', '\0' \
  325. } /* Clear line from cursor right */
  326. #define NRF_CLI_VT100_CLEARBOL \
  327. { \
  328. NRF_CLI_VT100_ASCII_ESC, '[', '1', 'K', '\0' \
  329. } /* Clear line from cursor left */
  330. #define NRF_CLI_VT100_CLEARLINE \
  331. { \
  332. NRF_CLI_VT100_ASCII_ESC, '[', '2', 'K', '\0' \
  333. } /* Clear entire line */
  334. #define NRF_CLI_VT100_CLEAREOS \
  335. { \
  336. NRF_CLI_VT100_ASCII_ESC, '[', 'J', '\0' \
  337. } /* Clear screen from cursor down */
  338. #define NRF_CLI_VT100_CLEAREOS_ \
  339. { \
  340. NRF_CLI_VT100_ASCII_ESC, '[', '0', 'J', '\0' \
  341. } /* Clear screen from cursor down */
  342. #define NRF_CLI_VT100_CLEARBOS \
  343. { \
  344. NRF_CLI_VT100_ASCII_ESC, '[', '1', 'J', '\0' \
  345. } /* Clear screen from cursor up */
  346. #define NRF_CLI_VT100_CLEARSCREEN \
  347. { \
  348. NRF_CLI_VT100_ASCII_ESC, '[', '2', 'J', '\0' \
  349. } /* Clear entire screen */
  350. #define NRF_CLI_VT100_DEVSTAT \
  351. { \
  352. NRF_CLI_VT100_ASCII_ESC, '5', 'n', '\0' \
  353. } /* Device status report */
  354. #define NRF_CLI_VT100_TERMOK \
  355. { \
  356. NRF_CLI_VT100_ASCII_ESC, '0', 'n', '\0' \
  357. } /* Response: terminal is OK */
  358. #define NRF_CLI_VT100_TERMNOK \
  359. { \
  360. NRF_CLI_VT100_ASCII_ESC, '3', 'n', '\0' \
  361. } /* Response: terminal is not OK */
  362. #define NRF_CLI_VT100_GETCURSOR \
  363. { \
  364. NRF_CLI_VT100_ASCII_ESC, '[', '6', 'n', '\0' \
  365. } /* Get cursor position */
  366. #define NRF_CLI_VT100_CURSORPOSAT \
  367. { \
  368. NRF_CLI_VT100_ASCII_ESC, (v), ';', (h), 'R', '\0' \
  369. } /* Response: cursor is at v,h */
  370. #define NRF_CLI_VT100_IDENT \
  371. { \
  372. NRF_CLI_VT100_ASCII_ESC, '[', 'c', '\0' \
  373. } /* Identify what terminal type */
  374. #define NRF_CLI_VT100_IDENT_ \
  375. { \
  376. NRF_CLI_VT100_ASCII_ESC, '[', '0', 'c', '\0' \
  377. } /* Identify what terminal type */
  378. #define NRF_CLI_VT100_GETTYPE \
  379. { \
  380. NRF_CLI_VT100_ASCII_ESC, '[', '?', '1', ';', (n), '0', 'c', '\0'\
  381. } /* Response: terminal type code n */
  382. #define NRF_CLI_VT100_RESET \
  383. { \
  384. NRF_CLI_VT100_ASCII_ESC, 'c', '\0' \
  385. } /* Reset terminal to initial state */
  386. #define NRF_CLI_VT100_ALIGN \
  387. { \
  388. NRF_CLI_VT100_ASCII_ESC, '#', '8', '\0' \
  389. } /* Screen alignment display */
  390. #define NRF_CLI_VT100_TESTPU \
  391. { \
  392. NRF_CLI_VT100_ASCII_ESC, '[', '2', ';', '1', 'y', '\0' \
  393. } /* Confidence power up test */
  394. #define NRF_CLI_VT100_TESTLB \
  395. { \
  396. NRF_CLI_VT100_ASCII_ESC, '[', '2', ';', '2', 'y', '\0' \
  397. } /* Confidence loopback test */
  398. #define NRF_CLI_VT100_TESTPUREP \
  399. { \
  400. NRF_CLI_VT100_ASCII_ESC, '[', '2', ';', '9', 'y', '\0' \
  401. } /* Repeat power up test */
  402. #define NRF_CLI_VT100_TESTLBREP \
  403. { \
  404. NRF_CLI_VT100_ASCII_ESC, '[', '2', ';', '1', '0', 'y', '\0' \
  405. } /* Repeat loopback test */
  406. #define NRF_CLI_VT100_LEDSOFF \
  407. { \
  408. NRF_CLI_VT100_ASCII_ESC, '[', '0', 'q', '\0' \
  409. } /* Turn off all four leds */
  410. #define NRF_CLI_VT100_LED1 \
  411. { \
  412. NRF_CLI_VT100_ASCII_ESC, '[', '1', 'q', '\0' \
  413. } /* Turn on LED #1 */
  414. #define NRF_CLI_VT100_LED2 \
  415. { \
  416. NRF_CLI_VT100_ASCII_ESC, '[', '2', 'q', '\0' \
  417. } /* Turn on LED #2 */
  418. #define NRF_CLI_VT100_LED3 \
  419. { \
  420. NRF_CLI_VT100_ASCII_ESC, '[', '3', 'q', '\0' \
  421. } /* Turn on LED #3 */
  422. #define NRF_CLI_VT100_LED4 \
  423. { \
  424. NRF_CLI_VT100_ASCII_ESC, '[', '4', 'q', '\0' \
  425. } /* Turn on LED #4 */
  426. /* Function Keys */
  427. #define NRF_CLI_VT100_PF1 \
  428. { \
  429. NRF_CLI_VT100_ASCII_ESC, 'O', 'P', '\0' \
  430. }
  431. #define NRF_CLI_VT100_PF2 \
  432. { \
  433. NRF_CLI_VT100_ASCII_ESC, 'O', 'Q', '\0' \
  434. }
  435. #define NRF_CLI_VT100_PF3 \
  436. { \
  437. NRF_CLI_VT100_ASCII_ESC, 'O', 'R', '\0' \
  438. }
  439. #define NRF_CLI_VT100_PF4 \
  440. { \
  441. NRF_CLI_VT100_ASCII_ESC, 'O', 'S', '\0' \
  442. }
  443. /* Arrow keys */
  444. #define NRF_CLI_VT100_UP_RESET \
  445. { \
  446. NRF_CLI_VT100_ASCII_ESC, 'A', '\0' \
  447. }
  448. #define NRF_CLI_VT100_UP_SET \
  449. { \
  450. NRF_CLI_VT100_ASCII_ESC, 'O', 'A', '\0' \
  451. }
  452. #define NRF_CLI_VT100_DOWN_RESET \
  453. { \
  454. NRF_CLI_VT100_ASCII_ESC, 'B', '\0' \
  455. }
  456. #define NRF_CLI_VT100_DOWN_SET \
  457. { \
  458. NRF_CLI_VT100_ASCII_ESC, 'O', 'B', '\0' \
  459. }
  460. #define NRF_CLI_VT100_RIGHT_RESET \
  461. { \
  462. NRF_CLI_VT100_ASCII_ESC, 'C', '\0' \
  463. }
  464. #define NRF_CLI_VT100_RIGHT_SET \
  465. { \
  466. NRF_CLI_VT100_ASCII_ESC, 'O', 'C', '\0' \
  467. }
  468. #define NRF_CLI_VT100_LEFT_RESET \
  469. { \
  470. NRF_CLI_VT100_ASCII_ESC, 'D', '\0' \
  471. }
  472. #define NRF_CLI_VT100_LEFT_SET \
  473. { \
  474. NRF_CLI_VT100_ASCII_ESC, 'O', 'D', '\0' \
  475. }
  476. /* Numeric Keypad Keys */
  477. #define NRF_CLI_VT100_NUMERIC_0 \
  478. { \
  479. '0', '\0' \
  480. }
  481. #define NRF_CLI_VT100_ALT_0 \
  482. { \
  483. NRF_CLI_VT100_ASCII_ESC, 'O', 'p', '\0' \
  484. }
  485. #define NRF_CLI_VT100_NUMERIC_1 \
  486. { \
  487. '1', '\0' \
  488. }
  489. #define NRF_CLI_VT100_ALT_1 \
  490. { \
  491. NRF_CLI_VT100_ASCII_ESC, 'O', 'q', '\0' \
  492. }
  493. #define NRF_CLI_VT100_NUMERIC_2 \
  494. { \
  495. '2', '\0' \
  496. }
  497. #define NRF_CLI_VT100_ALT_2 \
  498. { \
  499. NRF_CLI_VT100_ASCII_ESC, 'O', 'r', '\0' \
  500. }
  501. #define NRF_CLI_VT100_NUMERIC_3 \
  502. { \
  503. '3', '\0' \
  504. }
  505. #define NRF_CLI_VT100_ALT_3 \
  506. { \
  507. NRF_CLI_VT100_ASCII_ESC, 'O', 's', '\0' \
  508. }
  509. #define NRF_CLI_VT100_NUMERIC_4 \
  510. { \
  511. '4', '\0' \
  512. }
  513. #define NRF_CLI_VT100_ALT_4 \
  514. { \
  515. NRF_CLI_VT100_ASCII_ESC, 'O', 't', '\0' \
  516. }
  517. #define NRF_CLI_VT100_NUMERIC_5 \
  518. { \
  519. '5', '\0' \
  520. }
  521. #define NRF_CLI_VT100_ALT_5 \
  522. { \
  523. NRF_CLI_VT100_ASCII_ESC, 'O', 'u', '\0' \
  524. }
  525. #define NRF_CLI_VT100_NUMERIC_6 \
  526. { \
  527. '6', '\0' \
  528. }
  529. #define NRF_CLI_VT100_ALT_6 \
  530. { \
  531. NRF_CLI_VT100_ASCII_ESC, 'O', 'v', '\0' \
  532. }
  533. #define NRF_CLI_VT100_NUMERIC_7 \
  534. { \
  535. '7', '\0' \
  536. }
  537. #define NRF_CLI_VT100_ALT_7 \
  538. { \
  539. NRF_CLI_VT100_ASCII_ESC, 'O', 'w', '\0' \
  540. }
  541. #define NRF_CLI_VT100_NUMERIC_8 \
  542. { \
  543. '8', '\0' \
  544. }
  545. #define NRF_CLI_VT100_ALT_8 \
  546. { \
  547. NRF_CLI_VT100_ASCII_ESC, 'O', 'x', '\0' \
  548. }
  549. #define NRF_CLI_VT100_NUMERIC_9 \
  550. { \
  551. '9', '\0'
  552. #define NRF_CLI_VT100_ALT_9 \
  553. { \
  554. NRF_CLI_VT100_ASCII_ESC, 'O', 'y' \
  555. }
  556. #define NRF_CLI_VT100_NUMERIC_MINUS \
  557. { \
  558. '-', '\0' \
  559. }
  560. #define NRF_CLI_VT100_ALT_MINUS \
  561. { \
  562. NRF_CLI_VT100_ASCII_ESC, 'O', 'm', '\0' \
  563. }
  564. #define NRF_CLI_VT100_NUMERIC_COMMA \
  565. { \
  566. ',', '\0' \
  567. }
  568. #define NRF_CLI_VT100_ALT_COMMA \
  569. { \
  570. NRF_CLI_VT100_ASCII_ESC, 'O', 'l', '\0' \
  571. }
  572. #define NRF_CLI_VT100_NUMERIC_PERIOD \
  573. { \
  574. '.', '\0' \
  575. }
  576. #define NRF_CLI_VT100_ALT_PERIOD \
  577. { \
  578. NRF_CLI_VT100_ASCII_ESC, 'O', 'n', '\0' \
  579. }
  580. #define NRF_CLI_VT100_NUMERIC_ENTER \
  581. { \
  582. ASCII_CR \
  583. }
  584. #define NRF_CLI_VT100_ALT_ENTER \
  585. { \
  586. NRF_CLI_VT100_ASCII_ESC, 'O', 'M', '\0' \
  587. }
  588. #define NRF_CLI_VT100_COLOR(__col) \
  589. { \
  590. NRF_CLI_VT100_ASCII_ESC, '[', '1', ';', '3', '0' + (__col), 'm', '\0' \
  591. }
  592. #define NRF_CLI_VT100_BGCOLOR(__col) \
  593. { \
  594. NRF_CLI_VT100_ASCII_ESC, '[', '4', '0' + (__col), 'm', '\0' \
  595. }
  596. #ifdef __cplusplus
  597. }
  598. #endif
  599. #endif /* NRF_CLI_VT100_H__ */