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 "colors.h"
#include "nextion.h"
#include <stdint.h>

Functions

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

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

◆ 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

◆ MS_listGetSelected()

int8_t MS_listGetSelected ( 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

◆ 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

◆ 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

◆ MS_select()

void MS_select ( menu_page_t * page)

Handles menu element selection and actions.

Parameters
pagePointer to the menu page

◆ 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

◆ 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

◆ 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