WIZlib Library API  ver 1.0
WIZlib Library API User Menual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Enumerations | Functions

Usermenu Module. More...

Collaboration diagram for Usermenu:

Macros

#define MAX_MENU_COUNT   10
 Maximum number of User Menu Definition. More...
 
#define CMD_BUF_SIZE   100
 Maximum Terminal Input Buffer Size. More...
 

Typedefs

typedef int8(* menu_func )(menu_ctrl mctrl, int8 *mbuf)
 User Menu Callback Function Definition. More...
 

Enumerations

enum  menu_ctrl { MC_START, MC_END, MC_DATA }
 Menu Control Signal. More...
 

Functions

void menu_init (void)
 Initialize Usermenu Module.
 
int8 menu_add (int8 *desc, int8 parent, menu_func mfunc)
 Add Usermenu. More...
 
void menu_print_tree (void)
 Print Current Registered Menu. More...
 
void menu_run (void)
 Usermenu Handler. More...
 

Detailed Description

Usermenu Module.

You can easily add a menu that can be selected using
the Usermenu module can be used in the terminal.

Macro Definition Documentation

#define CMD_BUF_SIZE   100

Maximum Terminal Input Buffer Size.

  • If not set in the wizconfig.h, default value is 100 Byte.
  • The more size, the more memory use.
  • If there is not enough size, user cannot input all they want

Definition at line 37 of file usermenu.h.

#define MAX_MENU_COUNT   10

Maximum number of User Menu Definition.

  • If not set in the wizconfig.h, default value is 10.
  • The more number, the more memory use.
  • If there is not enough number, menu_add will fail

Definition at line 26 of file usermenu.h.

Typedef Documentation

typedef int8(* menu_func)(menu_ctrl mctrl, int8 *mbuf)

User Menu Callback Function Definition.

The function form with which a user menu function will be added to the menu

Parameters
mctrlWith this signal, Callback function can determine user action (menu_ctrl)
mbufThe string buffer which user input
Returns
RET_OK: Return to parent menu
RET_NOK: Stay current menu

Definition at line 61 of file usermenu.h.

Enumeration Type Documentation

enum menu_ctrl

Menu Control Signal.

With this signal, Callback function can determine user action

See Also
menu_func
Enumerator
MC_START 

When user entered into a menu.

MC_END 

When user exited out of a menu.

MC_DATA 

While user is in a menu.

Definition at line 46 of file usermenu.h.

Function Documentation

int8 menu_add ( int8 *  desc,
int8  parent,
menu_func  mfunc 
)

Add Usermenu.

Parameters
descBrief which will be displayed
parentParent menu index.
- Root index is 0
- A return value of this function can be used
mfuncThe Callback function which will be called when user input enter key
Returns
>0: Registered menu index (this can be used as parent number)
RET_NOK: Error

Definition at line 54 of file usermenu.c.

void menu_print_tree ( void  )

Print Current Registered Menu.

This is for Debug or Check

Definition at line 93 of file usermenu.c.

void menu_run ( void  )

Usermenu Handler.

This function should be run under main loop.

Definition at line 112 of file usermenu.c.