Prusa MINI Firmware overview
|
#include "term.h"
#include "gui.h"
#include <stdarg.h>
|
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) |
|
uint8_t | term_get_attr (term_t *pt) |
|
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_scroll_up (term_t *pt) |
|
void | term_write_escape_char (term_t *pt, uint8_t ch) |
|
void | term_write_CR (term_t *pt) |
|
void | term_write_LF (term_t *pt) |
|
void | term_write_control_char (term_t *pt, uint8_t ch) |
|
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_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_get_attr()
92 if (!pt || !(pt->
buff))
◆ term_set_attr()
98 if (!pt || !(pt->
buff))
◆ term_set_pos()
104 if (!pt || !(pt->
buff))
◆ term_scroll_up()
116 if (!pt || !(pt->
buff))
121 for (c = 0; c < pt->
cols; c++) {
125 memset(pt->
buff + pt->
size, 0xff, (pt->
size + 15) >> 4);
◆ term_write_escape_char()
◆ term_write_CR()
◆ term_write_LF()
◆ term_write_control_char()
◆ 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++)
uint8_t attr
Definition: term.h:49
int vterm_printf(term_t *pt, const char *fmt, va_list va)
Definition: term.c:191
void term_write_escape_char(term_t *pt, uint8_t ch)
Definition: term.c:128
void gui_free(void *ptr)
Definition: gui.c:39
void term_write_char(term_t *pt, uint8_t ch)
Definition: term.c:157
uint8_t row
Definition: term.h:51
#define TERM_PRINTF_MAX
Definition: term.h:38
void term_write_LF(term_t *pt)
Definition: term.c:139
uint8_t rows
Definition: term.h:45
#define TERM_FLG_ESCAPE
Definition: term.h:30
void term_scroll_up(term_t *pt)
Definition: term.c:114
#define TERM_FLG_CHANGED
Definition: term.h:29
void term_write_CR(term_t *pt)
Definition: term.c:135
void * gui_malloc(unsigned int size)
Definition: gui.c:35
uint8_t i
Definition: screen_test_graph.c:72
uint8_t col
Definition: term.h:50
uint8_t cols
Definition: term.h:44
#define TERM_DEF_ATTR
Definition: term.h:34
void term_clear(term_t *pt)
Definition: term.c:34
uint16_t flg
Definition: term.h:46
void term_write_control_char(term_t *pt, uint8_t ch)
Definition: term.c:146
const uint8_t[]
Definition: 404_html.c:3
#define TERM_FLG_FREEMEM
Definition: term.h:28
#define TERM_DEF_CHAR
Definition: term.h:33
#define TERM_BUFF_SIZE(c, r)
Definition: term.h:36
FILE * file
Definition: term.h:52
uint8_t * buff
Definition: term.h:47
#define TERM_FLG_AUTOCR
Definition: term.h:31
uint16_t size
Definition: term.h:48