GPS Device
Loading...
Searching...
No Matches
menu_handle_s Struct Reference

Internal structure representing a single menu instance. More...

Collaboration diagram for menu_handle_s:

Public Attributes

char title [SSD1309_MAX_CHARS_IN_LINE]
char options [CONFIG_MENU_MAX_OPTIONS][SSD1309_MAX_CHARS_IN_LINE]
MENU_TYPE_ts type
ERR_te(* get_value_fn )(uint8_t index, char **value_o)
uint8_t line_to_highlight
uint8_t options_count
int8_t selected_option
int8_t prev_selected_option
int8_t first_visible_option
int8_t last_visible_option
MENU_HANDLE_tsprev_menu [CONFIG_MENU_MAX_BUF_SIZE]
uint8_t prev_menu_count
char name [CONFIG_MENU_MAX_NAME_LEN]
bool in_use

Detailed Description

Internal structure representing a single menu instance.

Holds all runtime state for one menu, including the copied configuration, scroll/selection tracking, the navigation history stack, and lifecycle flags.

This structure is opaque to the caller; it is accessed only through the MENU_HANDLE_ts pointer returned by menu_init_handle.

Definition at line 31 of file menu.c.

Member Data Documentation

◆ title

char menu_handle_s::title[SSD1309_MAX_CHARS_IN_LINE]

Title string displayed at the bottom of the screen.

Definition at line 33 of file menu.c.

◆ options

char menu_handle_s::options[CONFIG_MENU_MAX_OPTIONS][SSD1309_MAX_CHARS_IN_LINE]

Array of option label strings copied from the configuration.

Definition at line 36 of file menu.c.

◆ type

MENU_TYPE_ts menu_handle_s::type

Rendering and interaction mode of this menu.

Definition at line 39 of file menu.c.

◆ get_value_fn

ERR_te(* menu_handle_s::get_value_fn) (uint8_t index, char **value_o)

Callback for fetching live values in MENU_TYPE_DATA_VIEW mode. NULL for MENU_TYPE_SELECTABLE menus.

Definition at line 45 of file menu.c.

◆ line_to_highlight

uint8_t menu_handle_s::line_to_highlight

Display line number (1-based) that is currently inverted as the selection highlight.

Definition at line 48 of file menu.c.

◆ options_count

uint8_t menu_handle_s::options_count

Total number of scrollable rows. For MENU_TYPE_DATA_VIEW menus this is twice the number of options (labels + values interleaved).

Definition at line 54 of file menu.c.

◆ selected_option

int8_t menu_handle_s::selected_option

Zero-based index of the currently selected option.

Definition at line 57 of file menu.c.

◆ prev_selected_option

int8_t menu_handle_s::prev_selected_option

Zero-based index of the selected option on the previous render, used to detect scroll direction.

Definition at line 60 of file menu.c.

◆ first_visible_option

int8_t menu_handle_s::first_visible_option

Zero-based index of the first option row currently visible on screen.

Definition at line 63 of file menu.c.

◆ last_visible_option

int8_t menu_handle_s::last_visible_option

Zero-based index of the last option row currently visible on screen.

Definition at line 66 of file menu.c.

◆ prev_menu

MENU_HANDLE_ts* menu_handle_s::prev_menu[CONFIG_MENU_MAX_BUF_SIZE]

Stack of previous menu handles for back-navigation.

Definition at line 69 of file menu.c.

◆ prev_menu_count

uint8_t menu_handle_s::prev_menu_count

Number of entries currently on the prev_menu stack.

Definition at line 72 of file menu.c.

◆ name

char menu_handle_s::name[CONFIG_MENU_MAX_NAME_LEN]

Human-readable name of this menu instance (null-terminated).

Definition at line 75 of file menu.c.

◆ in_use

bool menu_handle_s::in_use

True when this slot is occupied by an active menu instance.

Definition at line 78 of file menu.c.


The documentation for this struct was generated from the following file: