forked from afarhan/ubitxv6
-
Notifications
You must be signed in to change notification settings - Fork 11
/
nano_gui.h
31 lines (25 loc) · 1.06 KB
/
nano_gui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _NANO_GUI_H_
#define _NANO_GUI_H_
enum TextJustification_e : uint8_t
{
Left,
Right,
Center
};
void displayInit();
void displayClear(unsigned int color);
void displayPixel(unsigned int x, unsigned int y, unsigned int c);
void displayHline(unsigned int x, unsigned int y, unsigned int l, unsigned int c);
void displayVline(unsigned int x, unsigned int y, unsigned int l, unsigned int c);
void displayRect(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int c);
void displayFillrect(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int c);
void displayChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg);
void displayText(const char *const text, int x1, int y1, int w, int h, int color, int background, int border, TextJustification_e justification = TextJustification_e::Center);
/* these functions are called universally to update the display */
void drawTx();
#define TEXT_LINE_HEIGHT 18
#define TEXT_LINE_INDENT 5
#define BUTTON_PUSH
#define BUTTON_CHECK
#define BUTTON_SPINNER
#endif // _NANO_GUI_H_