text
[RRG-proxmark3.git] / armsrc / vtsend.h
blob63d3d2461718da1842bdda456cb8d2b6aca4fe53
1 /**
2 * @file vtsend.h
3 * @author CuBeatSystems
4 * @author Shinichiro Nakamura
5 * @copyright
6 * ===============================================================
7 * Natural Tiny Shell (NT-Shell) Version 0.3.1
8 * ===============================================================
9 * Copyright (c) 2010-2016 Shinichiro Nakamura
11 * Permission is hereby granted, free of charge, to any person
12 * obtaining a copy of this software and associated documentation
13 * files (the "Software"), to deal in the Software without
14 * restriction, including without limitation the rights to use,
15 * copy, modify, merge, publish, distribute, sublicense, and/or
16 * sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following
18 * conditions:
20 * The above copyright notice and this permission notice shall be
21 * included in all copies or substantial portions of the Software.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30 * OTHER DEALINGS IN THE SOFTWARE.
33 #ifndef VTSEND_H
34 #define VTSEND_H
36 #include "common.h"
38 #define VTSEND_COLOR_BLACK (0)
39 #define VTSEND_COLOR_RED (1)
40 #define VTSEND_COLOR_GREEN (2)
41 #define VTSEND_COLOR_YELLOW (3)
42 #define VTSEND_COLOR_BLUE (4)
43 #define VTSEND_COLOR_MAGENTA (5)
44 #define VTSEND_COLOR_CYAN (6)
45 #define VTSEND_COLOR_WHITE (7)
47 #define VTSEND_ATTR_OFF (0)
48 #define VTSEND_ATTR_BOLD_ON (1)
49 #define VTSEND_ATTR_UNDERSCORE (4)
50 #define VTSEND_ATTR_BLINK_ON (5)
51 #define VTSEND_ATTR_REVERSE (7)
52 #define VTSEND_ATTR_CONCEALED_ON (8)
54 typedef int (*VTSEND_SERIAL_WRITE)(const char *buf, const int siz, void *extobj);
56 typedef struct {
57 VTSEND_SERIAL_WRITE uart_write;
58 void *extobj;
59 } vtsend_t;
61 int vtsend_init(vtsend_t *p, VTSEND_SERIAL_WRITE uart_write, void *extobj);
62 int vtsend_cursor_position(vtsend_t *p, const int column, const int line);
63 int vtsend_cursor_up(vtsend_t *p, const int n);
64 int vtsend_cursor_down(vtsend_t *p, const int n);
65 int vtsend_cursor_forward(vtsend_t *p, const int n);
66 int vtsend_cursor_backward(vtsend_t *p, const int n);
67 int vtsend_cursor_position_save(vtsend_t *p);
68 int vtsend_cursor_position_restore(vtsend_t *p);
69 int vtsend_erase_display(vtsend_t *p);
70 int vtsend_erase_line(vtsend_t *p);
71 int vtsend_set_color_foreground(vtsend_t *p, const int color);
72 int vtsend_set_color_background(vtsend_t *p, const int color);
73 int vtsend_set_attribute(vtsend_t *p, const int attr);
74 int vtsend_set_scroll_region(vtsend_t *p, const int top, const int bottom);
75 int vtsend_set_cursor(vtsend_t *p, const int visible);
76 int vtsend_reset(vtsend_t *p);
78 int vtsend_draw_box(
79 vtsend_t *p,
80 const int x1, const int y1, const int x2, const int y2);
81 int vtsend_fill_box(
82 vtsend_t *p,
83 const int x1, const int y1, const int x2, const int y2);
85 #endif