PER Firmware
Loading...
Searching...
No Matches
menu_system.h File Reference

Implementation of menu system for LCD display interface. More...

#include <stdint.h>
Include dependency graph for menu_system.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  menu_element_t
 
struct  menu_page_t
 

Enumerations

enum  element_type_t {
  ELEMENT_VAL = 0 , ELEMENT_FLT = 1 , ELEMENT_BAR = 2 , ELEMENT_BUTTON = 3 ,
  ELEMENT_OPTION = 4 , ELEMENT_LIST = 5
}
 
enum  element_state_t { STATE_NORMAL = 0 , STATE_HOVER = 1 , STATE_SELECTED = 2 }
 

Functions

void MS_moveUp (menu_page_t *page)
 Moves menu selection up or increments selected element value.
 
void MS_moveDown (menu_page_t *page)
 Moves menu selection down or increments selected element value.
 
void MS_select (menu_page_t *page)
 Handles menu element selection and actions.
 
void MS_incrementValue (menu_element_t *element)
 Increments the value of a menu element and updates its display.
 
void MS_decrementValue (menu_element_t *element)
 Decrements the value of a menu element and updates its display.
 
void MS_refreshPage (menu_page_t *page)
 Refreshes the menu page by resetting selection state and updating all elements.
 
int8_t MS_listGetSelected (const menu_page_t *page)
 Gets the index of the selected element in a menu page.
 

Detailed Description

Implementation of menu system for LCD display interface.

Provides functions for managing menu navigation, element styling, and user interaction with the LCD display menu system.

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Enumeration Type Documentation

◆ element_state_t

Enumerator
STATE_NORMAL 
STATE_HOVER 
STATE_SELECTED 

◆ element_type_t

Enumerator
ELEMENT_VAL 
ELEMENT_FLT 
ELEMENT_BAR 
ELEMENT_BUTTON 
ELEMENT_OPTION 
ELEMENT_LIST 

Function Documentation

◆ MS_decrementValue()

void MS_decrementValue ( menu_element_t * element)

Decrements the value of a menu element and updates its display.

If decrementing would exceed min_value, wraps around to max_value. Updates display based on element type (float or integer value).

Parameters
elementPointer to the menu element to decrement
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MS_incrementValue()

void MS_incrementValue ( menu_element_t * element)

Increments the value of a menu element and updates its display.

If incrementing would exceed max_value, wraps around to min_value. Updates display based on element type (float or integer value).

Parameters
elementPointer to the menu element to increment
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MS_listGetSelected()

int8_t MS_listGetSelected ( const menu_page_t * page)

Gets the index of the selected element in a menu page.

Parameters
pagePointer to the menu page structure
Returns
Index of the selected element, -1 if no element is selected

◆ MS_moveDown()

void MS_moveDown ( menu_page_t * page)

Moves menu selection down or increments selected element value.

Parameters
pagePointer to the menu page structure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MS_moveUp()

void MS_moveUp ( menu_page_t * page)

Moves menu selection up or increments selected element value.

Parameters
pagePointer to the menu page structure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MS_refreshPage()

void MS_refreshPage ( menu_page_t * page)

Refreshes the menu page by resetting selection state and updating all elements.

Parameters
pagePointer to the menu page to refresh
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MS_select()

void MS_select ( menu_page_t * page)

Handles menu element selection and actions.

Parameters
pagePointer to the menu page
Here is the call graph for this function:
Here is the caller graph for this function: