1 /* 2 * Copyright (c) 2018 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef SHELL_TYPES_H__ 7 #define SHELL_TYPES_H__ 8 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 enum shell_vt100_color { 15 SHELL_VT100_COLOR_BLACK, 16 SHELL_VT100_COLOR_RED, 17 SHELL_VT100_COLOR_GREEN, 18 SHELL_VT100_COLOR_YELLOW, 19 SHELL_VT100_COLOR_BLUE, 20 SHELL_VT100_COLOR_MAGENTA, 21 SHELL_VT100_COLOR_CYAN, 22 SHELL_VT100_COLOR_WHITE, 23 24 SHELL_VT100_COLOR_DEFAULT, 25 26 VT100_COLOR_END 27 }; 28 29 struct shell_vt100_colors { 30 enum shell_vt100_color col; /*!< Text color. */ 31 enum shell_vt100_color bgcol; /*!< Background color. */ 32 }; 33 34 struct shell_multiline_cons { 35 uint16_t cur_x; /*!< horizontal cursor position in edited command line.*/ 36 uint16_t cur_x_end; /*!< horizontal cursor position at the end of command.*/ 37 uint16_t cur_y; /*!< vertical cursor position in edited command.*/ 38 uint16_t cur_y_end; /*!< vertical cursor position at the end of command.*/ 39 uint16_t terminal_hei; /*!< terminal screen height.*/ 40 uint16_t terminal_wid; /*!< terminal screen width.*/ 41 uint8_t name_len; /*!<console name length.*/ 42 }; 43 44 struct shell_vt100_ctx { 45 struct shell_multiline_cons cons; 46 struct shell_vt100_colors col; 47 uint16_t printed_cmd; /*!< printed commands counter */ 48 }; 49 50 #ifdef __cplusplus 51 } 52 #endif 53 54 #endif /* SHELL_TYPES_H__ */ 55