|
DMCP interface 03.17_023
|
This functionality allows to extend and use default menu system for programs where this functionality is sufficient enough. More...
Topics | |
| System menus | |
| Menus defined in system. | |
| Menu item ids | |
| Menu item ids. | |
| Menu defines | |
| Aux menu item functions | |
| Functions for menu_line_str() formatting. | |
Data Structures | |
| struct | smenu_t |
| Single menu screen definition. More... | |
Functions | |
| int | handle_menu (const smenu_t *menu_id, int action, int cur_line) |
| Starts menu screen. | |
| int | run_menu_item_sys (uint8_t line_id) |
| Invoke particular sys menu function. | |
| int | run_menu_item (uint8_t line_id) |
| (Defined by user) Invoke functionality for selected menu item | |
| const char * | menu_line_str (uint8_t line_id, char *ln, const int ln_len) |
| (Defined by user) Should return string representation of given menu item | |
This functionality allows to extend and use default menu system for programs where this functionality is sufficient enough.
User has to define run_menu_item() and menu_line_str() functions and assign them to system variables
to extend default menu functionality.
| int handle_menu | ( | const smenu_t * | menu_id, |
| int | action, | ||
| int | cur_line ) |
Starts menu screen.
| menu_id | Menu definition structure |
| action | MENU_RESET for first menu screen, MENU_ADD for nested menu |
| cur_line | Line selected at start |
| const char * menu_line_str | ( | uint8_t | line_id, |
| char * | ln, | ||
| const int | ln_len ) |
(Defined by user) Should return string representation of given menu item
| line_id | Menu item id |
| ln | Buffer which can be used for line text |
| ln_len | Length of ln return Line item string |
This function is called by system when particular line is drawn only if this function is assigned to menu_line_str_app system variable.
| int run_menu_item | ( | uint8_t | line_id | ) |
(Defined by user) Invoke functionality for selected menu item
| line_id | Menu item id |
This function is called by system when particular menu item is selected only if this function is assigned to run_menu_item_app system variable.
| int run_menu_item_sys | ( | uint8_t | line_id | ) |
Invoke particular sys menu function.
| line_id | Sys menu line id |
It allows e.g. launching of USB disk mode from user program by running run_menu_item_sys(MI_MSC).