Merge pull request #2616 from jmichelp/fix14b
[RRG-proxmark3.git] / armsrc / vtsend.h
blobc6d46ebec81efdb3bcac141a462d09ee83349ba3
1 //-----------------------------------------------------------------------------
2 // Borrowed initially from https://cubeatsystems.com/ntshell/index.html
3 // Copyright (C) 2010-2016 Shinichiro Nakamura (CuBeatSystems)
4 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // See LICENSE.txt for the text of the license.
17 //-----------------------------------------------------------------------------
18 // Natural Tiny Shell (NT-Shell) Version 0.3.1
19 //-----------------------------------------------------------------------------
21 #ifndef VTSEND_H
22 #define VTSEND_H
24 #include "common.h"
26 #define VTSEND_COLOR_BLACK (0)
27 #define VTSEND_COLOR_RED (1)
28 #define VTSEND_COLOR_GREEN (2)
29 #define VTSEND_COLOR_YELLOW (3)
30 #define VTSEND_COLOR_BLUE (4)
31 #define VTSEND_COLOR_MAGENTA (5)
32 #define VTSEND_COLOR_CYAN (6)
33 #define VTSEND_COLOR_WHITE (7)
35 #define VTSEND_ATTR_OFF (0)
36 #define VTSEND_ATTR_BOLD_ON (1)
37 #define VTSEND_ATTR_UNDERSCORE (4)
38 #define VTSEND_ATTR_BLINK_ON (5)
39 #define VTSEND_ATTR_REVERSE (7)
40 #define VTSEND_ATTR_CONCEALED_ON (8)
42 typedef int (*VTSEND_SERIAL_WRITE)(const char *buf, const int siz, void *extobj);
44 typedef struct {
45 VTSEND_SERIAL_WRITE uart_write;
46 void *extobj;
47 } vtsend_t;
49 int vtsend_init(vtsend_t *p, VTSEND_SERIAL_WRITE uart_write, void *extobj);
50 int vtsend_cursor_position(vtsend_t *p, const int column, const int line);
51 int vtsend_cursor_up(vtsend_t *p, const int n);
52 int vtsend_cursor_down(vtsend_t *p, const int n);
53 int vtsend_cursor_forward(vtsend_t *p, const int n);
54 int vtsend_cursor_backward(vtsend_t *p, const int n);
55 int vtsend_cursor_position_save(vtsend_t *p);
56 int vtsend_cursor_position_restore(vtsend_t *p);
57 int vtsend_erase_display(vtsend_t *p);
58 int vtsend_erase_line(vtsend_t *p);
59 int vtsend_set_color_foreground(vtsend_t *p, const int color);
60 int vtsend_set_color_background(vtsend_t *p, const int color);
61 int vtsend_set_attribute(vtsend_t *p, const int attr);
62 int vtsend_set_scroll_region(vtsend_t *p, const int top, const int bottom);
63 int vtsend_set_cursor(vtsend_t *p, const int visible);
64 int vtsend_reset(vtsend_t *p);
66 int vtsend_draw_box(
67 vtsend_t *p,
68 const int x1, const int y1, const int x2, const int y2);
69 int vtsend_fill_box(
70 vtsend_t *p,
71 const int x1, const int y1, const int x2, const int y2);
73 #endif