#include <sys/types.h>
Include dependency graph for menu.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | menuPoint_t |
| Struct for storing a menu point. More... | |
Defines | |
| #define | MENU_MAX_LEVEL 4 |
| Maximum level of menu depth. | |
| #define | MENU_MAX_MENU_ITEMS 255 |
| Maximum number of menu items on a level. | |
Typedefs | |
| typedef menuPoint_t | menuPoint_t |
Functions | |
| void | MENU_init (menuPoint_t *rootMenu) |
| Initialize menu system. | |
| void | MENU_showCurrentMenuItem () |
| Internally used function to print the actual menu item. | |
| uint8_t | MENU_getMenuSize (menuPoint_t *menu) |
| Internally used function to count the size of a menu. | |
| void | MENU_handler (uint8_t buttonPressed) |
| This function handles the events which comes from keyboard. | |
Variables | |
| menuPoint_t * | currentMenu |
| uint8_t | currentMenuNumber |
| number of selected menu item | |
| uint8_t | currentMenuSize |
| number of menu items in actual menu point | |
| int8_t | currentMenuLevel |
| menuPoint_t * | parentMenu [MENU_MAX_LEVEL] |
| uint8_t | parentMenuNumber [MENU_MAX_LEVEL] |
Definition in file menu.h.
| #define MENU_MAX_MENU_ITEMS 255 |
| typedef struct menuPoint_t menuPoint_t |
| uint8_t MENU_getMenuSize | ( | menuPoint_t * | menu | ) |
| void MENU_handler | ( | uint8_t | buttonPressed | ) |
This function handles the events which comes from keyboard.
Before using this function, you should initialize the menu system.
while (1)
{
buttonHandler ();
if (buttonPressed)
{
MENU_handler (buttonPressed);
}
// ...
}
| buttonPressed | The buttons which are pressed meanwhile. |
| void MENU_init | ( | menuPoint_t * | rootMenu | ) |
Initialize menu system.
After this you should call MENU_handler periodically. Example:
menuPoint_t rootMenu[] = { //1234567 sub-menu callback function {"NRFTEST", NULL, rf24lTest}, {"IR TEST", NULL, irTest}, {"SET CLK", setClockMenu, NULL}, {"SET ALM", setAlarmMenu, NULL}, {NULL, NULL, NULL} // end of menu };
int main ()
{
// ...
MENU_init (rootMenu);
}
| rootMenu | Pointer to root menu. |
| void MENU_showCurrentMenuItem | ( | ) |
| int8_t currentMenuLevel |
| uint8_t currentMenuNumber |
| uint8_t currentMenuSize |
| menuPoint_t* parentMenu[MENU_MAX_LEVEL] |
| uint8_t parentMenuNumber[MENU_MAX_LEVEL] |
1.5.1