From 6d4ad089c5b758ad8af4f68bf385a26ec4e9653a Mon Sep 17 00:00:00 2001 From: Thomas Albers Raviola Date: Thu, 21 Nov 2024 15:55:03 +0100 Subject: Initial commit --- include/tty.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/tty.h (limited to 'include/tty.h') 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 +#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 -- cgit v1.2.3