Prusa MINI Firmware overview
screen_test_term.c File Reference
#include "gui.h"
#include "config.h"
#include "window_progress.h"
#include "stm32f4xx_hal.h"

Classes

struct  screen_test_term_data_t
 

Macros

#define pd   ((screen_test_term_data_t *)screen->pdata)
 

Functions

void screen_test_term_init (screen_t *screen)
 
void screen_test_term_done (screen_t *screen)
 
void screen_test_term_draw (screen_t *screen)
 
int screen_test_term_event (screen_t *screen, window_t *window, uint8_t event, void *param)
 

Variables

screen_t screen_test_term
 
const screen_tpscreen_test_term = &screen_test_term
 

Macro Definition Documentation

◆ pd

#define pd   ((screen_test_term_data_t *)screen->pdata)

Function Documentation

◆ screen_test_term_init()

void screen_test_term_init ( screen_t screen)
28  {
29  int16_t id;
30 
31  int16_t id0 = window_create_ptr(WINDOW_CLS_FRAME, -1, rect_ui16(0, 0, 0, 0), &(pd->frame));
32  pd->id_frame = id0;
34 
35  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 0, 220, 22), &(pd->text));
36  pd->id_text = id;
37  window_set_text(id, (const char *)"Test");
38 
39  id = window_create_ptr(WINDOW_CLS_TERM, id0, rect_ui16(10, 28, 11 * 20, 18 * 16), &(pd->term));
40  pd->id_term = id;
41  term_init(&(pd->terminal), 20, 16, pd->term_buff);
42  pd->term.term = &(pd->terminal);
43 }
Here is the call graph for this function:

◆ screen_test_term_done()

void screen_test_term_done ( screen_t screen)
45  {
46  window_destroy(pd->frame.win.id);
47 }
Here is the call graph for this function:

◆ screen_test_term_draw()

void screen_test_term_draw ( screen_t screen)
49  {
50 }

◆ screen_test_term_event()

int screen_test_term_event ( screen_t screen,
window_t window,
uint8_t  event,
void param 
)
52  {
53  int winid = -1;
54  if (event == WINDOW_EVENT_BTN_DN) {
55  screen_close();
56  return 1;
57  }
58  if (event != WINDOW_EVENT_LOOP) {
59  term_printf(pd->term.term, "%010d w:%d e:%d\n", HAL_GetTick(), winid, (int)event);
60  // else
61  // if (pd->term.term->flg & TERM_FLG_CHANGED)
62  window_invalidate(pd->term.win.id);
63  }
64  return 0;
65 }
Here is the call graph for this function:

Variable Documentation

◆ screen_test_term

◆ pscreen_test_term

const screen_t* pscreen_test_term = &screen_test_term
window_set_color_back
void window_set_color_back(int16_t id, color_t clr)
Definition: window.c:431
WINDOW_CLS_TERM
#define WINDOW_CLS_TERM
Definition: window.h:17
window_invalidate
void window_invalidate(int16_t id)
Definition: window.c:304
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_destroy
void window_destroy(int16_t id)
Definition: window.c:132
screen_test_term_draw
void screen_test_term_draw(screen_t *screen)
Definition: screen_test_term.c:49
screen_test_term_data_t
Definition: screen_test_graph.c:14
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
screen_close
void screen_close(void)
Definition: screen.c:80
COLOR_GRAY
#define COLOR_GRAY
Definition: guitypes.h:50
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
screen_test_term_init
void screen_test_term_init(screen_t *screen)
Definition: screen_test_term.c:28
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
term_init
void term_init(term_t *pt, uint8_t cols, uint8_t rows, uint8_t *buff)
Definition: term.c:6
screen_test_term_event
int screen_test_term_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_test_term.c:52
window_create_ptr
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
screen_test_term_done
void screen_test_term_done(screen_t *screen)
Definition: screen_test_term.c:45
WINDOW_EVENT_LOOP
#define WINDOW_EVENT_LOOP
Definition: window.h:49
WINDOW_EVENT_BTN_DN
#define WINDOW_EVENT_BTN_DN
Definition: window.h:38
pd
#define pd
Definition: screen_test_term.c:26
term_printf
int term_printf(term_t *pt, const char *fmt,...)
Definition: term.c:178