diff options
Diffstat (limited to 'firmware/2lib/include/2ui.h')
-rw-r--r-- | firmware/2lib/include/2ui.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h index c5fdc1c6..f179024f 100644 --- a/firmware/2lib/include/2ui.h +++ b/firmware/2lib/include/2ui.h @@ -8,6 +8,56 @@ #ifndef VBOOT_REFERENCE_2UI_H_ #define VBOOT_REFERENCE_2UI_H_ +#include <2api.h> +#include <2sysincludes.h> + +/*****************************************************************************/ +/* Data structures */ + +struct vb2_screen_info { + /* Screen id */ + enum vb2_screen id; + /* Screen name for printing to console only */ + const char *name; + /* Number of menu items */ + uint16_t num_items; + /* List of menu items */ + const struct vb2_menu_item *items; +}; + +struct vb2_menu_item { + /* Text description */ + const char *text; + /* Target screen */ + enum vb2_screen target; +}; + +struct vb2_screen_state { + const struct vb2_screen_info *screen; + uint32_t locale_id; + uint32_t selected_item; + uint32_t disabled_item_mask; +}; + +struct vb2_ui_context { + struct vb2_context *ctx; + const struct vb2_screen_info *root_screen; + struct vb2_screen_state state; + uint32_t key; +}; + +/** + * Get info struct of a screen. + * + * @param screen Screen from enum vb2_screen + * + * @return screen info struct on success, NULL on error. + */ +const struct vb2_screen_info *vb2_get_screen_info(enum vb2_screen id); + +/*****************************************************************************/ +/* UI loops */ + /** * UI for a developer-mode boot. * |