#include <inttypes.h>
#include <stdio.h>
Go to the source code of this file.
|
void | term_init (term_t *pt, uint8_t cols, uint8_t rows, uint8_t *buff) |
|
void | term_done (term_t *pt) |
|
void | term_clear (term_t *pt) |
|
uint8_t | term_get_char_at (term_t *pt, uint8_t col, uint8_t row) |
|
void | term_set_char_at (term_t *pt, uint8_t col, uint8_t row, uint8_t ch) |
|
uint8_t | term_get_attr_at (term_t *pt, uint8_t col, uint8_t row) |
|
void | term_set_attr_at (term_t *pt, uint8_t col, uint8_t row, uint8_t attr) |
|
void | term_set_attr (term_t *pt, uint8_t attr) |
|
void | term_set_pos (term_t *pt, uint8_t col, uint8_t row) |
|
void | term_write_char (term_t *pt, uint8_t ch) |
|
int | term_printf (term_t *pt, const char *fmt,...) |
|
int | vterm_printf (term_t *pt, const char *fmt, va_list va) |
|
◆ TERM_ATTR_BACK_MASK
#define TERM_ATTR_BACK_MASK 0x00 |
◆ TERM_ATTR_BACK_BLACK
#define TERM_ATTR_BACK_BLACK 0x00 |
◆ TERM_ATTR_BACK_WHITE
#define TERM_ATTR_BACK_WHITE 0x00 |
◆ TERM_ATTR_TEXT_MASK
#define TERM_ATTR_TEXT_MASK 0x00 |
◆ TERM_ATTR_TEXT_BLACK
#define TERM_ATTR_TEXT_BLACK 0x00 |
◆ TERM_ATTR_TEXT_WHITE
#define TERM_ATTR_TEXT_WHITE 0x00 |
◆ TERM_ATTR_INVERT
#define TERM_ATTR_INVERT 0x40 |
◆ TERM_ATTR_BLINK
#define TERM_ATTR_BLINK 0x80 |
◆ TERM_COLOR_BLACK
#define TERM_COLOR_BLACK 0 |
◆ TERM_COLOR_RED
◆ TERM_COLOR_GREEN
#define TERM_COLOR_GREEN 2 |
◆ TERM_COLOR_YELLOW
#define TERM_COLOR_YELLOW 3 |
◆ TERM_COLOR_BLUE
#define TERM_COLOR_BLUE 4 |
◆ TERM_COLOR_MAGENTA
#define TERM_COLOR_MAGENTA 5 |
◆ TERM_COLOR_CYAN
#define TERM_COLOR_CYAN 6 |
◆ TERM_COLOR_WHITE
#define TERM_COLOR_WHITE 7 |
◆ TERM_FLG_FREEMEM
#define TERM_FLG_FREEMEM 0x0080 |
◆ TERM_FLG_CHANGED
#define TERM_FLG_CHANGED 0x0040 |
◆ TERM_FLG_ESCAPE
#define TERM_FLG_ESCAPE 0x0020 |
◆ TERM_FLG_AUTOCR
#define TERM_FLG_AUTOCR 0x0010 |
◆ TERM_DEF_CHAR
#define TERM_DEF_CHAR ' ' |
◆ TERM_DEF_ATTR
◆ TERM_BUFF_SIZE
#define TERM_BUFF_SIZE |
( |
|
c, |
|
|
|
r |
|
) |
| ((r * c * 2) + (r * c + 7) / 8) |
◆ TERM_PRINTF_MAX
#define TERM_PRINTF_MAX 0xff |
◆ term_t
◆ term_init()
11 pt->
size = cols * rows * 2;
◆ term_done()
27 if (!pt || !(pt->
buff))
◆ term_clear()
38 if (!pt || !(pt->
buff))
40 for (r = 0; r < pt->
rows; r++)
41 for (c = 0; c < pt->
cols; c++) {
45 memset(pt->
buff + pt->
size, 0xff, 40 );
◆ term_get_char_at()
52 if (!pt || !(pt->
buff))
54 if ((col >= pt->
cols) || (row >= pt->
rows))
56 int i = col + row * pt->
cols;
57 return pt->
buff[2 *
i + 0];
◆ term_set_char_at()
61 if (!pt || !(pt->
buff))
63 if ((col >= pt->
cols) || (row >= pt->
rows))
65 int i = col + row * pt->
cols;
66 pt->
buff[2 *
i + 0] = ch;
67 pt->
buff[pt->
size + (
i >> 3)] |= (1 << (
i % 8));
◆ term_get_attr_at()
72 if (!pt || !(pt->
buff))
74 if ((col >= pt->
cols) || (row >= pt->
rows))
76 int i = col + row * pt->
cols;
77 return pt->
buff[2 *
i + 1];
◆ term_set_attr_at()
81 if (!pt || !(pt->
buff))
83 if ((col >= pt->
cols) || (row >= pt->
rows))
85 int i = col + row * pt->
cols;
86 pt->
buff[2 *
i + 1] = attr;
87 pt->
buff[pt->
size + (
i >> 3)] |= (1 << (
i % 8));
◆ term_set_attr()
98 if (!pt || !(pt->
buff))
◆ term_set_pos()
104 if (!pt || !(pt->
buff))
◆ term_write_char()
158 if (!pt || !(pt->
buff))
166 pt->
buff[2 *
i + 0] = ch;
168 pt->
buff[pt->
size + (
i >> 3)] |= (1 << (
i % 8));
◆ term_printf()
◆ vterm_printf()
int vterm_printf |
( |
term_t * |
pt, |
|
|
const char * |
fmt, |
|
|
va_list |
va |
|
) |
| |
196 ret = vsnprintf(text,
sizeof(text), fmt, va);
198 for (
i = 0;
i < ret;
i++)