Prusa MINI Firmware overview
screen.h
Go to the documentation of this file.
1 //screen.h
2 #ifndef _SCREEN_H
3 #define _SCREEN_H
4 
5 #include <inttypes.h>
6 #include "window.h"
7 
8 typedef struct _screen_t screen_t;
9 
10 typedef void(screen_init_t)(screen_t *screen);
11 typedef void(screen_done_t)(screen_t *screen);
12 typedef void(screen_draw_t)(screen_t *screen);
13 typedef int(screen_event_t)(screen_t *screen, window_t *window, uint8_t event, void *param);
14 
15 #pragma pack(push)
16 #pragma pack(1)
17 
18 typedef struct _screen_t {
19  int16_t id; // (2 bytes) screen identifier (2bytes)
20  uint32_t flg; // (4 bytes) flags
21  screen_init_t *init; // (4 bytes) init callback
22  screen_done_t *done; // (4 bytes) done callback
23  screen_draw_t *draw; // (4 bytes) draw callback
24  screen_event_t *event; // (4 bytes) event callback
25  uint16_t data_size; // (2 bytes) dynamic data size
26  void *pdata; // (4 bytes) data pointer - automaticaly allocated before init
27 } screen_t; // (28 bytes total)
28 
29 #pragma pack(pop)
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif //__cplusplus
34 
35 extern int16_t screen_id(void);
36 
37 extern int16_t screen_register(screen_t *pscreen);
38 
39 extern screen_t *screen_unregister(int16_t screen_id);
40 
41 extern void screen_stack_push(int16_t screen_id);
42 
43 extern int16_t screen_stack_pop(void);
44 
45 extern void screen_open(int16_t screen_id);
46 
47 extern void screen_close(void);
48 
49 extern void screen_draw(void);
50 
51 extern void screen_dispatch_event(window_t *window, uint8_t event, void *param);
52 
53 extern screen_t *screen_get_curr(void);
54 
55 #ifdef __cplusplus
56 }
57 #endif //__cplusplus
58 
59 #endif // _SCREEN_H
screen_stack_pop
int16_t screen_stack_pop(void)
Definition: screen.c:55
_screen_t::flg
uint32_t flg
Definition: screen.h:20
_screen_t::event
screen_event_t * event
Definition: screen.h:24
screen_register
int16_t screen_register(screen_t *pscreen)
Definition: screen.c:24
_screen_t::data_size
uint16_t data_size
Definition: screen.h:25
screen_open
void screen_open(int16_t screen_id)
Definition: screen.c:62
screen_event_t
int() screen_event_t(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen.h:13
_screen_t::pdata
void * pdata
Definition: screen.h:26
screen_get_curr
screen_t * screen_get_curr(void)
Definition: screen.c:114
screen_close
void screen_close(void)
Definition: screen.c:80
_screen_t::draw
screen_draw_t * draw
Definition: screen.h:23
screen_unregister
screen_t * screen_unregister(int16_t screen_id)
Definition: screen.c:43
_window_t
Definition: window.h:76
void
void
Definition: png.h:1083
screen_init_t
void() screen_init_t(screen_t *screen)
Definition: screen.h:10
_screen_t::done
screen_done_t * done
Definition: screen.h:22
screen_t
struct _screen_t screen_t
Definition: screen.h:8
screen_stack_push
void screen_stack_push(int16_t screen_id)
Definition: screen.c:48
screen_id
int16_t screen_id(void)
Definition: screen.c:18
uint8_t
const uint8_t[]
Definition: 404_html.c:3
_screen_t
Definition: screen.h:18
_screen_t::init
screen_init_t * init
Definition: screen.h:21
_screen_t::id
int16_t id
Definition: screen.h:19
window.h
screen_draw_t
void() screen_draw_t(screen_t *screen)
Definition: screen.h:12
createSpeedLookupTable.int
int
Definition: createSpeedLookupTable.py:15
screen_draw
void screen_draw(void)
Definition: screen.c:98
screen_done_t
void() screen_done_t(screen_t *screen)
Definition: screen.h:11
screen_dispatch_event
void screen_dispatch_event(window_t *window, uint8_t event, void *param)
Definition: screen.c:103