GPS Device
Loading...
Searching...
No Matches
menu.h
Go to the documentation of this file.
1
32
38
39#ifndef MENU_H__
40#define MENU_H__
41
42#include <stdint.h>
43
44#include "common.h"
45#include "ssd1309.h"
46#include "err.h"
47#include "configuration.h"
48
55
69
78typedef struct {
81
88 char options[CONFIG_MENU_MAX_OPTIONS][SSD1309_MAX_CHARS_IN_LINE];
89
92
101 ERR_te (*get_value_fn)(uint8_t index, char **value_o);
102
104 char name[CONFIG_MENU_MAX_NAME_LEN];
106
116
118
125
143
156
165
174
196ERR_te menu_init_handle(MENU_CFG_ts *menu_cfg, MENU_HANDLE_ts **menu_handle_o);
197
211
222
240ERR_te menu_get_selected_option(MENU_HANDLE_ts const *menu_handle, char *selected_option_o);
241
257ERR_te menu_scroll(MENU_HANDLE_ts *menu_handle, VERTICAL_DIR_te vertical_dir);
258
274ERR_te menu_get_prev_menu(MENU_HANDLE_ts *menu_handle, MENU_HANDLE_ts **prev_menu_handle_o);
275
292ERR_te menu_set_prev_menu(MENU_HANDLE_ts *menu_handle, MENU_HANDLE_ts *prev_menu_handle);
293
295
296#endif
297
Common utility module public API.
System-wide error code definitions.
VERTICAL_DIR_te
Represents a vertical movement direction.
Definition common.h:106
ERR_te
Standard return type used by all public API functions.
Definition err.h:35
ERR_te menu_get_prev_menu(MENU_HANDLE_ts *menu_handle, MENU_HANDLE_ts **prev_menu_handle_o)
Pops and returns the previous menu from the navigation history stack.
Definition menu.c:402
ERR_te menu_init_handle(MENU_CFG_ts *menu_cfg, MENU_HANDLE_ts **menu_handle_o)
Initializes and registers a menu handle.
Definition menu.c:268
ERR_te menu_run_handle(MENU_HANDLE_ts *menu_handle)
Renders a single menu to the display.
Definition menu.c:340
ERR_te menu_stop_subsys(void)
Stops the menu subsystem.
Definition menu.c:244
ERR_te menu_scroll(MENU_HANDLE_ts *menu_handle, VERTICAL_DIR_te vertical_dir)
Moves the menu selection cursor by one step in the given direction.
Definition menu.c:387
ERR_te menu_start_subsys(void)
Starts the menu subsystem.
Definition menu.c:220
ERR_te menu_get_selected_option(MENU_HANDLE_ts const *menu_handle, char *selected_option_o)
Retrieves the string of the currently highlighted option.
Definition menu.c:367
ERR_te menu_deinit_subsys(void)
Deinitializes the menu subsystem.
Definition menu.c:195
ERR_te menu_set_prev_menu(MENU_HANDLE_ts *menu_handle, MENU_HANDLE_ts *prev_menu_handle)
Pushes a menu onto the navigation history stack of another menu.
Definition menu.c:412
ERR_te menu_init_subsys(void)
Initializes the menu subsystem.
Definition menu.c:159
ERR_te menu_run_handle_all(void)
Renders all registered menus to the display.
Definition menu.c:356
struct menu_handle_s MENU_HANDLE_ts
Opaque handle representing a menu instance.
Definition menu.h:115
MENU_TYPE_ts
Determines the rendering and interaction mode of a menu.
Definition menu.h:59
@ MENU_TYPE_DATA_VIEW
Definition menu.h:67
@ MENU_TYPE_SELECTABLE
Definition menu.h:61
#define SSD1309_MAX_CHARS_IN_LINE
Definition ssd1309.h:65
SSD1309 OLED display driver public API.
Configuration structure for initializing a menu handle.
Definition menu.h:78
MENU_TYPE_ts type
Definition menu.h:91
char title[SSD1309_MAX_CHARS_IN_LINE]
Definition menu.h:80
char options[CONFIG_MENU_MAX_OPTIONS][SSD1309_MAX_CHARS_IN_LINE]
Definition menu.h:88
ERR_te(* get_value_fn)(uint8_t index, char **value_o)
Definition menu.h:101
char name[CONFIG_MENU_MAX_NAME_LEN]
Definition menu.h:104
Internal structure representing a single menu instance.
Definition menu.c:31