diff options
Diffstat (limited to 'include/tty.h')
-rw-r--r-- | include/tty.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/tty.h b/include/tty.h new file mode 100644 index 0000000..ea73e5f --- /dev/null +++ b/include/tty.h @@ -0,0 +1,34 @@ +#ifndef TTY_H +#define TTY_H + +#include <tft.h> +#define TTY_WIDTH (TFT_WIDTH / 8) +#define TTY_HEIGHT (TFT_HEIGHT / 8) + +void +addch(char c); + +void +addstr(const char *str); + +void +setcur(unsigned int ncol, unsigned int nrow); + +void +swap_colors(void); + +static inline void +mvaddch(int y, int x, char c) +{ + setcur(x, y); + addch(c); +} + +static inline void +mvaddstr(int y, int x, const char *str) +{ + setcur(x, y); + addstr(str); +} + +#endif // TTY_H |