GFX Menu System

This module provides a simple menu system for monochrome graphical displays.

Typical flow of an application using the menu system:

  1. Define menu structure.
  2. Call gfx_mono_menu_init.
  3. Get user input.
  4. Update menu with user input using function gfx_mono_menu_process_key.
  5. Interpret gfx_mono_menu_process_key return value.
  6. Go to 3.

The menu is declared using the Menu system for monochrome graphical displays struct. To start the menu system, call the gfx_mono_menu_init function. This function will clear the display and draw the menu. Before the menu can be updated, you need input from the user. Methods for getting input is not part of the menu module. As soon as input is received, inform the menu system using the gfx_mono_menu_process_key function. This function will then return a status code and act depending on the given key-code:

The value of the key-codes used are defined in conf_menu.h. These values can be changed if needed. The graphical indicator used to indicate menu selection is defined in conf_menu.h. This indicator can be changed if needed.

The menu system functions are listed below, implemented in gfx_mono_menu.h/c.

Table 1. GFX Menu System Functions
Functions Description
gfx_mono_menu_init() Initialize the menu handling. Clear screen and draw menu.
gfx_mono_menu_process_key() Update menu depending on input