20 #include "os_helpers.h"
23 #include "os_io_seproxyhal.h"
33 {{BAGL_RECTANGLE , 0x80, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, 0xFFFFFF, 0, 0}, .
text=NULL},
36 {{BAGL_ICON , 0x81, 3, 14, 7, 4, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_UP }, .text=NULL },
37 {{BAGL_ICON , 0x82, 118, 14, 7, 4, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_DOWN }, .text=NULL },
40 {{BAGL_LABELINE , 0x41, 14, 3, 100, 12, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
42 {{BAGL_LABELINE , 0x42, 14, 35, 100, 12, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
45 {{BAGL_ICON , 0x10, 14, 9, 0, 0, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, .text=NULL },
47 {{BAGL_LABELINE , 0x20, 14, 19, 100, 12, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
50 {{BAGL_LABELINE , 0x21, 14, 12, 100, 12, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
51 {{BAGL_LABELINE , 0x22, 14, 26, 100, 12, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
72 if (current_entry == NULL) {
75 const bagl_icon_details_t *current_entry_icon
76 = (
const bagl_icon_details_t *) PIC(current_entry->
icon);
101 if (current_entry->
line2 != NULL || current_entry->
icon != NULL
103 || previous_entry->
icon != NULL || previous_entry->
line2 != NULL) {
106 G_ux.tmp_element.text = previous_entry->
line1;
110 if (current_entry->
line2 != NULL || current_entry->
icon != NULL
115 G_ux.tmp_element.text = next_entry->
line1;
118 if (current_entry->
icon == NULL) {
121 G_ux.tmp_element.text = (
const char *) current_entry->
icon;
122 if (current_entry->
icon_x) {
123 G_ux.tmp_element.component.x = current_entry->
icon_x;
127 if (current_entry->
line2 != NULL) {
130 G_ux.tmp_element.text = current_entry->
line1;
133 if (current_entry->
line2 == NULL) {
136 G_ux.tmp_element.text = current_entry->
line1;
139 if (current_entry->
line2 == NULL) {
142 G_ux.tmp_element.text = current_entry->
line2;
144 if (current_entry_icon) {
145 G_ux.tmp_element.component.x += current_entry_icon->width;
146 G_ux.tmp_element.component.width -= current_entry_icon->width;
148 if (current_entry->
text_x) {
149 G_ux.tmp_element.component.x = current_entry->
text_x;
151 G_ux.tmp_element.component.font_id = BAGL_FONT_OPEN_SANS_EXTRABOLD_11px;
161 return &
G_ux.tmp_element;
166 UNUSED(button_mask_counter);
170 if (current_entry == NULL) {
174 switch (button_mask) {
178 if (current_entry->
menu) {
255 G_ux.stack[0].element_arrays[0].element_array = ux_menu_elements;
256 G_ux.stack[0].element_arrays[0].element_array_count = ARRAYLEN(ux_menu_elements);
257 G_ux.stack[0].element_arrays_count = 1;
273 {{BAGL_RECTANGLE , 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, 0xFFFFFF, 0, 0}, .
text=NULL},
276 {{BAGL_ICON , 0x00, 3, 12, 7, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_CROSS }, .text=NULL },
277 {{BAGL_ICON , 0x00, 117, 13, 8, 6, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_CHECK }, .text=NULL },
280 {{BAGL_ICON , 0x03, 0, 9, 14, 14, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, .text=NULL },
283 {{BAGL_LABELINE , 0x04, 0, 19, 128, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
285 {{BAGL_LABELINE , 0x05, 0, 12, 128, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
286 {{BAGL_LABELINE , 0x06, 0, 26, 128, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, .text=NULL },
311 G_ux.tmp_element.component.font_id
321 G_ux.tmp_element.component.font_id
331 G_ux.tmp_element.component.font_id
341 return &
G_ux.tmp_element;
344 unsigned int ux_turner_elements_button(
unsigned int button_mask,
unsigned int button_mask_counter)
350 unsigned int ux_turner_ticker_bolos_ux(
unsigned int ignored)
369 UX_DISPLAY(ux_turner_elements, ux_turner_element_preprocessor);
376 unsigned int steps_count,
396 G_ux.stack[0].element_arrays[0].element_array = ux_turner_elements;
397 G_ux.stack[0].element_arrays[0].element_array_count = ARRAYLEN(ux_turner_elements);
398 G_ux.stack[0].element_arrays_count = 1;
401 G_ux.stack[0].screen_before_element_display_callback = ux_turner_element_preprocessor;
402 G_ux.stack[0].button_push_callback = ux_turner_elements_button;
405 G_ux.stack[0].ticker_callback = ux_turner_ticker_bolos_ux;
411 UX_DISPLAY(ux_turner_elements, ux_turner_element_preprocessor);
418 {BAGL_RECTANGLE, 0, 0, 0, 128, 32, 0, 0, 0, 0x000000, 0x000000, 0, 0},
430 BAGL_FONT_OPEN_SANS_EXTRABOLD_11px | BAGL_FONT_ALIGNMENT_CENTER | BAGL_FONT_ALIGNMENT_MIDDLE
432 BAGL_FONT_OPEN_SANS_REGULAR_8_11PX
436 .
text =
"Default printf"
445 #if defined(HAVE_DEBUG) || defined(BOLOS_DEBUG)
448 void debug_printf(
void *buffer)
455 G_ux.tmp_element.text = buffer;
466 io_seproxyhal_general_status();
473 #define L(x) debug_printf(x)
uint8_t G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]
bagl_component_t component
unsigned int current_step
const ux_turner_step_t * steps
button_push_callback_t button_callback
const bagl_icon_details_t * icon
unsigned int next_step_ms
void(* ux_menu_callback_t)(unsigned int userid)
const bagl_element_t *(* ux_menu_preprocessor_t)(const ux_menu_entry_t *, bagl_element_t *element)
#define UX_TURNER_UNCHANGED_ENTRY
#define UX_MENU_DISPLAY(current_entry, menu_entries, menu_entry_preprocessor)
const bagl_element_t * ux_menu_element_preprocessor(const bagl_element_t *element)
void ux_turner_display(unsigned int current_step, const ux_turner_step_t *steps, unsigned int steps_count, button_push_callback_t button_callback)
#define BUTTON_EVT_RELEASED
void ux_turner_ticker(unsigned int elpased_ms)
void ux_stack_display(unsigned int stack_slot)
void io_seproxyhal_display_default(const bagl_element_t *element)
ux_turner_state_t ux_turner
void ux_stack_init(unsigned int stack_slot)
unsigned int(* button_push_callback_t)(unsigned int button_mask, unsigned int button_mask_counter)
void ux_menu_display(unsigned int current_entry, const ux_menu_entry_t *menu_entries, ux_menu_preprocessor_t menu_entry_preprocessor)
#define UX_MENU_UNCHANGED_ENTRY
#define UX_DISPLAY(elements_array, preprocessor)
unsigned int ux_menu_elements_button(unsigned int button_mask, unsigned int button_mask_counter)
const bagl_element_t clear_element
void debug_wait_displayed(void)
const bagl_element_t printf_element