Prusa MINI Firmware overview
window_lcdsim.c File Reference
#include "window_lcdsim.h"
#include "lcdsim.h"
#include "gui.h"

Functions

void window_lcdsim_init (window_lcdsim_t *window)
 
void window_lcdsim_done (window_lcdsim_t *window)
 
void window_lcdsim_draw (window_lcdsim_t *window)
 

Variables

int16_t WINDOW_CLS_LCDSIM = 0
 
const window_class_lcdsim_t window_class_lcdsim
 

Function Documentation

◆ window_lcdsim_init()

void window_lcdsim_init ( window_lcdsim_t window)
8  {
9  window->color_back = COLOR_BLUE;
10  window->color_text = COLOR_WHITE;
11  //window->font = GUI_DEF_FONT;
12  window->font = resource_font(IDR_FNT_BIG);
13 }
Here is the call graph for this function:

◆ window_lcdsim_done()

void window_lcdsim_done ( window_lcdsim_t window)
15  {
16 }

◆ window_lcdsim_draw()

void window_lcdsim_draw ( window_lcdsim_t window)
18  {
20  font_t font2 = { 8, 8, 1, 0 /*FONT_FLG_LSBF*/, lcdsim_user_charset_ptr(), 0, 7 };
21  uint16_t x = window->win.rect.x;
22  uint16_t y = window->win.rect.y;
23  font_t *font = window->font;
24  uint8_t ch_w = font->w;
25  uint8_t ch_h = font->h;
26  color_t clr0 = window->color_back;
27  color_t clr1 = window->color_text;
28  uint32_t inval;
29  uint32_t mask;
30  uint8_t ch;
31  uint8_t c;
32  uint8_t r;
33  for (r = 0; r < 4; r++) {
34  inval = lcdsim_inval_mask[r];
35  lcdsim_inval_mask[r] &= ~inval;
36  if (inval) {
37  mask = 0x01;
38  for (c = 0; c < 20; c++) {
39  if (inval & mask) {
40  ch = lcdsim_char_at(c, r);
41  if ((ch >= 32) && (ch <= 127))
42  display->draw_char(point_ui16(x + c * ch_w, y + r * ch_h), ch, font, clr0, clr1);
43  else if (ch < 8) {
44  display->fill_rect(rect_ui16(x + c * ch_w, y + r * ch_h, ch_w, ch_h), clr0);
45  display->draw_char(point_ui16(x + c * ch_w, y + r * ch_h), ch, &font2, clr0, clr1);
46  //display->draw_char(point_ui16(x + c * ch_w, y + r * ch_h), '0'+ch, font, clr0, COLOR_RED);
47  } else
48  display->fill_rect(rect_ui16(x + c * ch_w, y + r * ch_h, ch_w, ch_h), COLOR_RED);
49  }
50  mask <<= 1;
51  }
52  }
53  }
54  window->win.flg &= ~WINDOW_FLG_INVALID;
55  }
56 }
Here is the call graph for this function:

Variable Documentation

◆ WINDOW_CLS_LCDSIM

int16_t WINDOW_CLS_LCDSIM = 0

◆ window_class_lcdsim

_rect_ui16_t::y
uint16_t y
Definition: guitypes.h:71
_font_t::h
uint8_t h
Definition: guitypes.h:78
_font_t
Definition: guitypes.h:76
_display_t::draw_char
display_draw_char_t * draw_char
Definition: display.h:34
COLOR_WHITE
#define COLOR_WHITE
Definition: guitypes.h:41
lcdsim_char_at
uint8_t lcdsim_char_at(uint8_t col, uint8_t row)
Definition: lcdsim.c:85
COLOR_RED
#define COLOR_RED
Definition: guitypes.h:42
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
window_lcdsim_t
struct _window_lcdsim_t window_lcdsim_t
WINDOW_CLS_USER
#define WINDOW_CLS_USER
Definition: window.h:21
WINDOW_FLG_VISIBLE
#define WINDOW_FLG_VISIBLE
Definition: window.h:24
_window_lcdsim_t::win
window_t win
Definition: window_lcdsim.h:16
window_lcdsim_done
void window_lcdsim_done(window_lcdsim_t *window)
Definition: window_lcdsim.c:15
lcdsim_user_charset_ptr
uint8_t * lcdsim_user_charset_ptr(void)
Definition: lcdsim.c:89
lcdsim_inval_mask
uint32_t lcdsim_inval_mask[LCDSIM_ROWS]
Definition: lcdsim.c:40
_display_t::fill_rect
display_fill_rect_t * fill_rect
Definition: display.h:33
_window_lcdsim_t::font
font_t * font
Definition: window_lcdsim.h:19
window_lcdsim_draw
void window_lcdsim_draw(window_lcdsim_t *window)
Definition: window_lcdsim.c:18
_window_lcdsim_t::color_text
color_t color_text
Definition: window_lcdsim.h:18
_font_t::w
uint8_t w
Definition: guitypes.h:77
window_lcdsim_init
void window_lcdsim_init(window_lcdsim_t *window)
Definition: window_lcdsim.c:8
uint8_t
const uint8_t[]
Definition: 404_html.c:3
IDR_FNT_BIG
#define IDR_FNT_BIG
Definition: resource.h:11
display
display_t * display
Definition: display.c:6
_window_t::rect
rect_ui16_t rect
Definition: window.h:101
COLOR_BLUE
#define COLOR_BLUE
Definition: guitypes.h:45
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
_rect_ui16_t::x
uint16_t x
Definition: guitypes.h:70
color_t
uint32_t color_t
Definition: guitypes.h:62
window_init_t
void() window_init_t(void *window)
Definition: window.h:55
_window_t::flg
uint32_t flg
Definition: window.h:81
_window_lcdsim_t::color_back
color_t color_back
Definition: window_lcdsim.h:17
WINDOW_FLG_INVALID
#define WINDOW_FLG_INVALID
Definition: window.h:26
point_ui16
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154