Prusa MINI Firmware overview
window_header.h File Reference
#include "gui.h"
#include "marlin_events.h"

Go to the source code of this file.

Classes

struct  _window_class_header_t
 
struct  _window_header_t
 

Macros

#define HEADER_ICON_COUNT   HEADER_ICON_WIFI + 1
 
#define window_header_events(window)
 

Typedefs

typedef struct _window_class_header_t window_class_header_t
 
typedef struct _window_header_t window_header_t
 

Enumerations

enum  header_states_t { HEADER_ISTATE_OFF, HEADER_ISTATE_ON, HEADER_ISTATE_ACTIVE }
 
enum  header_icons_t { HEADER_ICON_USB, HEADER_ICON_LAN, HEADER_ICON_WIFI }
 

Functions

void p_window_header_set_icon (window_header_t *window, uint16_t id_res)
 
void p_window_header_icon_off (window_header_t *window, header_icons_t icon)
 
void p_window_header_icon_on (window_header_t *window, header_icons_t icon)
 
void p_window_header_icon_active (window_header_t *window, header_icons_t icon)
 
header_states_t p_window_header_get_state (window_header_t *window, header_icons_t icon)
 
void p_window_header_set_text (window_header_t *window, const char *text)
 
int p_window_header_event_clr (window_header_t *window, uint8_t evt_id)
 

Variables

int16_t WINDOW_CLS_HEADER
 
const window_class_header_t window_class_header
 

Macro Definition Documentation

◆ HEADER_ICON_COUNT

#define HEADER_ICON_COUNT   HEADER_ICON_WIFI + 1

◆ window_header_events

#define window_header_events (   window)
Value:
p_window_header_event_clr(window, MARLIN_EVT_MediaRemoved); \
p_window_header_event_clr(window, MARLIN_EVT_MediaError);

Typedef Documentation

◆ window_class_header_t

◆ window_header_t

Enumeration Type Documentation

◆ header_states_t

Enumerator
HEADER_ISTATE_OFF 
HEADER_ISTATE_ON 
HEADER_ISTATE_ACTIVE 

◆ header_icons_t

Enumerator
HEADER_ICON_USB 
HEADER_ICON_LAN 
HEADER_ICON_WIFI 
20  {
21  HEADER_ICON_USB, // must be first!
24  // for next icon, update HEADER_ICON_COUNT define !

Function Documentation

◆ p_window_header_set_icon()

void p_window_header_set_icon ( window_header_t window,
uint16_t  id_res 
)
121  {
122  window->id_res = id_res;
123  _window_invalidate((window_t *)window);
124 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_window_header_icon_off()

void p_window_header_icon_off ( window_header_t window,
header_icons_t  icon 
)
126  {
127  if (window->icons[icon] != HEADER_ISTATE_OFF) {
128  window->icons[icon] = HEADER_ISTATE_OFF;
129  _window_invalidate((window_t *)window);
130  }
131 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_window_header_icon_on()

void p_window_header_icon_on ( window_header_t window,
header_icons_t  icon 
)
133  {
134  if (window->icons[icon] != HEADER_ISTATE_ON) {
135  window->icons[icon] = HEADER_ISTATE_ON;
136  _window_invalidate((window_t *)window);
137  }
138 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_window_header_icon_active()

void p_window_header_icon_active ( window_header_t window,
header_icons_t  icon 
)
140  {
141  if (window->icons[icon] != HEADER_ISTATE_ACTIVE) {
142  window->icons[icon] = HEADER_ISTATE_ACTIVE;
143  _window_invalidate((window_t *)window);
144  }
145 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_window_header_get_state()

header_states_t p_window_header_get_state ( window_header_t window,
header_icons_t  icon 
)
148  {
149  return window->icons[icon];
150 }

◆ p_window_header_set_text()

void p_window_header_set_text ( window_header_t window,
const char *  text 
)
152  {
153  window->label = text;
154  _window_invalidate((window_t *)window);
155 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_window_header_event_clr()

int p_window_header_event_clr ( window_header_t window,
uint8_t  evt_id 
)
157  {
158  /* lwip fces only read states, invalid states by another thread never mind */
159  if (netif_is_up(&eth0)) {
160  if (dhcp_supplied_address(&eth0)) {
162  } else {
164  }
165  } else {
167  }
168 
169  if (marlin_event_clr(evt_id)) {
170  switch (evt_id) {
173  break;
176  break;
177  }
178  return 1;
179  }
180  return 0;
181 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ WINDOW_CLS_HEADER

int16_t WINDOW_CLS_HEADER

◆ window_class_header

const window_class_header_t window_class_header
MARLIN_EVT_MediaError
#define MARLIN_EVT_MediaError
Definition: marlin_events.h:12
HEADER_ISTATE_OFF
Definition: window_header.h:15
HEADER_ISTATE_ON
Definition: window_header.h:16
MARLIN_EVT_MediaInserted
#define MARLIN_EVT_MediaInserted
Definition: marlin_events.h:11
_window_header_t::icons
header_states_t icons[HEADER_ICON_COUNT]
Definition: window_header.h:45
eth0
struct netif eth0
Definition: lwip.c:72
HEADER_ICON_USB
Definition: window_header.h:21
_window_t
Definition: window.h:76
header_states_t
header_states_t
Definition: window_header.h:14
p_window_header_icon_off
void p_window_header_icon_off(window_header_t *window, header_icons_t icon)
Definition: window_header.c:126
_window_header_t::id_res
uint16_t id_res
Definition: window_header.h:44
HEADER_ICON_WIFI
Definition: window_header.h:23
header_icons_t
header_icons_t
Definition: window_header.h:20
MARLIN_EVT_MediaRemoved
#define MARLIN_EVT_MediaRemoved
Definition: marlin_events.h:13
p_window_header_icon_active
void p_window_header_icon_active(window_header_t *window, header_icons_t icon)
Definition: window_header.c:140
p_window_header_icon_on
void p_window_header_icon_on(window_header_t *window, header_icons_t icon)
Definition: window_header.c:133
HEADER_ISTATE_ACTIVE
Definition: window_header.h:17
HEADER_ICON_LAN
Definition: window_header.h:22
p_window_header_event_clr
int p_window_header_event_clr(window_header_t *window, uint8_t evt_id)
Definition: window_header.c:157
_window_invalidate
static void _window_invalidate(window_t *window)
Definition: window.h:257
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
netif_is_up
#define netif_is_up(netif)
Definition: netif.h:401
_window_header_t::label
const char * label
Definition: window_header.h:46