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

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

#include "menu_system.h"
#include <stdint.h>
#include "colors.h"
#include "common/nextion/nextion.h"
Include dependency graph for menu_system.c:

Functions

static void MS_renderValueElement (const menu_element_t *element)
 
void MS_setStyleNormal (menu_element_t *element)
 Applies normal (default) styling to a menu element.
 
void MS_setStyleHover (menu_element_t *element)
 Applies hover styling effect to a menu element.
 
void MS_setStyleSelected (menu_element_t *element)
 Applies selected state styling to a menu element.
 
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.
 

Variables

static constexpr uint16_t HOVER_BORDER_WIDTH = 3
 
static constexpr uint16_t NO_BORDER_WIDTH = 0
 

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)

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_renderValueElement()

static void MS_renderValueElement ( const menu_element_t * element)
static
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:

◆ MS_setStyleHover()

void MS_setStyleHover ( menu_element_t * element)

Applies hover styling effect to a menu element.

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

◆ MS_setStyleNormal()

void MS_setStyleNormal ( menu_element_t * element)

Applies normal (default) styling to a menu element.

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

◆ MS_setStyleSelected()

void MS_setStyleSelected ( menu_element_t * element)

Applies selected state styling to a menu element.

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

Variable Documentation

◆ HOVER_BORDER_WIDTH

uint16_t HOVER_BORDER_WIDTH = 3
staticconstexpr

◆ NO_BORDER_WIDTH

uint16_t NO_BORDER_WIDTH = 0
staticconstexpr