Prusa MINI Firmware overview
|
Go to the documentation of this file.
10 #define ALIGN_LEFT 0x00
11 #define ALIGN_HCENTER 0x01
12 #define ALIGN_RIGHT 0x02
13 #define ALIGN_HMASK 0x03
14 #define ALIGN_TOP 0x00
15 #define ALIGN_VCENTER 0x10
16 #define ALIGN_BOTTOM 0x20
17 #define ALIGN_VMASK 0x30
18 #define ALIGN_MASK 0x33
19 #define ALIGN_CENTER (ALIGN_HCENTER | ALIGN_VCENTER)
20 #define ALIGN_LEFT_TOP (ALIGN_LEFT | ALIGN_TOP)
21 #define ALIGN_LEFT_CENTER (ALIGN_LEFT | ALIGN_VCENTER)
22 #define ALIGN_LEFT_BOTTOM (ALIGN_LEFT | ALIGN_BOTTOM)
23 #define ALIGN_RIGHT_TOP (ALIGN_RIGHT | ALIGN_TOP)
24 #define ALIGN_RIGHT_CENTER (ALIGN_RIGHT | ALIGN_VCENTER)
25 #define ALIGN_RIGHT_BOTTOM (ALIGN_RIGHT | ALIGN_BOTTOM)
26 #define ALIGN_CENTER_TOP (ALIGN_HCENTER | ALIGN_TOP)
27 #define ALIGN_CENTER_BOTTOM (ALIGN_HCENTER | ALIGN_BOTTOM)
30 #define ROPFN_COPY 0x00 //copy (no operation)
31 #define ROPFN_INVERT 0x01 //invert
32 #define ROPFN_SWAPBW 0x02 //swap black-white
33 #define ROPFN_DISABLE 0x04 //disables (darker colors)
36 #define FONT_FLG_SWAP 0x00000001 // swap low/high byte
37 #define FONT_FLG_LSBF 0x00000002 // LSB first
40 #define COLOR_BLACK 0x00000000L
41 #define COLOR_WHITE 0x00ffffffL
42 #define COLOR_RED 0x000000ffL
43 #define COLOR_RED_ALERT 0x002646e7L
44 #define COLOR_LIME 0x0000ff00L
45 #define COLOR_BLUE 0x00ff0000L
46 #define COLOR_YELLOW 0x0000ffffL
47 #define COLOR_CYAN 0x00ffff00L
48 #define COLOR_MAGENTA 0x00ff00ffL
49 #define COLOR_SILVER 0x00c0c0c0L
50 #define COLOR_GRAY 0x00808080L
51 #define COLOR_MAROON 0x00000080L
52 #define COLOR_OLIVE 0x00008080L
53 #define COLOR_GREEN 0x00008000L
54 #define COLOR_PURPLE 0x00800080L
55 #define COLOR_TEAL 0x00808000L
56 #define COLOR_NAVY 0x00800000L
57 #define COLOR_ORANGE 0x001B65F8L
121 return (val >> 8) | ((val & 0xff) << 8);
125 return (val >> 16) | ((val & 0xffff) << 16);
129 return r | ((uint32_t)g << 8) | ((uint32_t)
b << 16);
133 return swap_ui16(((clr >> 19) & 0x001f) | ((clr >> 5) & 0x07e0) | ((clr << 8) & 0xf800));
143 uint8_t g0 = (clr0 >> 8) & 0xff;
144 uint8_t b0 = (clr0 >> 16) & 0xff;
146 uint8_t g1 = (clr1 >> 8) & 0xff;
147 uint8_t b1 = (clr1 >> 16) & 0xff;
148 uint8_t r = ((255 - alpha) * r0 + alpha * r1) / 255;
149 uint8_t g = ((255 - alpha) * g0 + alpha * g1) / 255;
150 uint8_t b = ((255 - alpha) * b0 + alpha * b1) / 255;
170 return ((pt.
x >= rc.
x) && (pt.
x < (rc.
x + rc.
w)) && (pt.
y >= rc.
y) && (pt.
y < (rc.
y + rc.
h))) ? 1 : 0;
174 return ((rc.
x >= rc1.
x) && ((rc.
x + rc.
w) <= (rc1.
x + rc1.
w)) && (rc.
y >= rc1.
y) && ((rc.
y + rc.
h) <= (rc1.
y + rc1.
h))) ? 1 : 0;
178 return ((rc.
w == 0) || (rc.
h == 0)) ? 1 : 0;
212 #define RESOURCE_TYPE_RAW 0 //raw binary resource
213 #define RESOURCE_TYPE_TXT 1 //text resource
214 #define RESOURCE_TYPE_FNT 2 //font resource
215 #define RESOURCE_TYPE_BMP 3 //bitmap picture resource
216 #define RESOURCE_TYPE_PNG 4 //png picture resource
219 #define RESOURCE_TABLE_BEGIN const resource_entry_t resource_table[] = {
220 #define RESOURCE_TABLE_END \
223 const uint16_t resource_table_size = sizeof(resource_table); \
224 const uint16_t resource_count = sizeof(resource_table) / sizeof(resource_entry_t);
226 #define RESOURCE_ENTRY_NUL() { 0, 0 },
227 #define RESOURCE_ENTRY_PNG(v) { v, sizeof(v) },
228 #define RESOURCE_ENTRY_FNT(v) { (uint8_t *)&v, sizeof(font_t) },
Definition: guitypes.h:106
uint16_t y
Definition: guitypes.h:71
uint8_t h
Definition: guitypes.h:78
uint16_t w
Definition: guitypes.h:72
uint16_t h
Definition: guitypes.h:95
static color_t color_alpha(color_t clr0, color_t clr1, uint8_t alpha)
Definition: guitypes.h:141
Definition: guitypes.h:76
uint8_t bottom
Definition: guitypes.h:90
color_t color_text
Definition: guitypes.h:108
uint8_t top
Definition: guitypes.h:88
uint8_t right
Definition: guitypes.h:89
void * pcs
Definition: guitypes.h:81
FILE * resource_fopen(uint16_t id, const char *opentype)
Definition: guitypes.c:180
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
uint16_t x
Definition: guitypes.h:65
rect_ui16_t rect_ui16_add_padding_ui8(rect_ui16_t rc, padding_ui8_t pad)
Definition: guitypes.c:46
font_t * font
Definition: guitypes.h:110
uint8_t bpp
Definition: guitypes.h:96
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
static uint16_t swap_ui32(uint32_t val)
Definition: guitypes.h:124
const uint8_t * ptr
Definition: guitypes.h:102
rect_ui16_t msg_box_sz
Definition: guitypes.h:114
uint8_t bpr
Definition: guitypes.h:97
struct _bitmap_t bitmap_t
static int rect_in_rect_ui16(rect_ui16_t rc, rect_ui16_t rc1)
Definition: guitypes.h:173
color_t color_disabled
Definition: guitypes.h:109
Definition: guitypes.h:64
int font_line_chars(font_t *pf, const char *str, uint16_t line_width)
Definition: guitypes.c:122
rect_ui16_t rect_ui16_sub_padding_ui8(rect_ui16_t rc, padding_ui8_t pad)
Definition: guitypes.c:55
uint8_t left
Definition: guitypes.h:87
static color_t color_from_565(uint16_t clr565)
Definition: guitypes.h:136
padding_ui8_t padding
Definition: guitypes.h:112
struct _rect_ui16_t rect_ui16_t
struct _padding_ui8_t padding_ui8_t
static uint16_t swap_ui16(uint16_t val)
Definition: guitypes.h:120
void * ppx
Definition: guitypes.h:98
uint16_t resource_size(uint16_t id)
Definition: guitypes.c:174
struct _resource_entry_t resource_entry_t
uint16_t y
Definition: guitypes.h:66
static int rect_empty_ui16(rect_ui16_t rc)
Definition: guitypes.h:177
rect_ui16_t rect_intersect_ui16(rect_ui16_t rc, rect_ui16_t rc1)
Definition: guitypes.c:37
char asc_max
Definition: guitypes.h:83
uint8_t bpr
Definition: guitypes.h:79
Definition: guitypes.h:93
color_t color_back
Definition: guitypes.h:107
uint8_t w
Definition: guitypes.h:77
struct _gui_defaults_t gui_defaults_t
point_ui16_t icon_meas(const uint8_t *pi)
Definition: guitypes.c:155
uint8_t btn_spacing
Definition: guitypes.h:115
Definition: guitypes.h:86
Definition: guitypes.h:69
const uint8_t[]
Definition: 404_html.c:3
const uint8_t * resource_ptr(uint16_t id)
Definition: guitypes.c:168
static uint16_t color_to_565(color_t clr)
Definition: guitypes.h:132
uint16_t h
Definition: guitypes.h:73
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
uint16_t w
Definition: guitypes.h:94
const uint16_t size
Definition: guitypes.h:103
uint32_t flg
Definition: guitypes.h:80
Definition: guitypes.h:101
uint16_t x
Definition: guitypes.h:70
static color_t color_rgb(uint8_t r, uint8_t g, uint8_t b)
Definition: guitypes.h:128
uint32_t color_t
Definition: guitypes.h:62
font_t * font_big
Definition: guitypes.h:111
point_ui16_t font_meas_text(font_t *pf, const char *str)
Definition: guitypes.c:97
char asc_min
Definition: guitypes.h:82
uint8_t alignment
Definition: guitypes.h:113
static int point_in_rect_ui16(point_ui16_t pt, rect_ui16_t rc)
Definition: guitypes.h:169
list b
Definition: createSpeedLookupTable.py:30
struct _point_ui16_t point_ui16_t
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154
rect_ui16_t rect_align_ui16(rect_ui16_t rc, rect_ui16_t rc1, uint8_t align)
Definition: guitypes.c:64