Mahesh Phalke / adi_console_menu
Embed: (wiki syntax)

« Back to documentation index

adi_console_menu.c File Reference

adi_console_menu.c File Reference

: A simple console menu manager handler More...

Go to the source code of this file.

Functions

static void adi_display_console_menu (const console_menu *menu)
 displays the text of a console menu
int32_t adi_do_console_menu (const console_menu *menu)
 Display a consoleMenu and handle User interaction.
int32_t adi_get_decimal_int (uint8_t input_len)
 Reads a decimal string from the user.
uint32_t adi_get_hex_integer (uint8_t input_len)
 Reads a hexadecimal number from the user.
float adi_get_decimal_float (uint8_t input_len)
 Reads a floating string from the user.
void adi_clear_console (void)
 Clears the console terminal.
void adi_press_any_key_to_continue (void)
 waits for any key to be pressed, and displays a prompt to the user

Detailed Description

: A simple console menu manager handler

: A way to define using arrays of structs a set of menus that can be displayed to a user, easily, with all user interaction handled by the library, leaving only the implementation of the menu actions to be done by the library user. ----------------------------------------------------------------------------- Copyright (c) 2019, 2020 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Definition in file adi_console_menu.c.


Function Documentation

void adi_clear_console ( void   )

Clears the console terminal.

Clears the console terminal using VT100 escape code, or can be changed to output blank lines if serial link doesn't support VT100.

Definition at line 274 of file adi_console_menu.c.

static void adi_display_console_menu ( const console_menu *  menu ) [static]

displays the text of a console menu

Definition at line 38 of file adi_console_menu.c.

int32_t adi_do_console_menu ( const console_menu *  menu )

Display a consoleMenu and handle User interaction.

This displays the menuItems defined by the console menu, and handles all user interaction for the menu.

Definition at line 90 of file adi_console_menu.c.

float adi_get_decimal_float ( uint8_t  input_len )

Reads a floating string from the user.

Parameters:
input_lenmax number of character to accept from the user
Returns:
The float value entered

Allows a user to type in number, echoing back to the user, up to input_len chars

Note:
Only positive floating point numbers are supported currently

Definition at line 236 of file adi_console_menu.c.

int32_t adi_get_decimal_int ( uint8_t  input_len )

Reads a decimal string from the user.

Parameters:
input_lenmax number of character to accept from the user
Returns:
The integer value entered

Allows a user to type in number, echoing back to the user, up to input_len chars

Note:
Only positive integer numbers are supported currently

Definition at line 151 of file adi_console_menu.c.

uint32_t adi_get_hex_integer ( uint8_t  input_len )

Reads a hexadecimal number from the user.

Parameters:
input_lenmax number of character to accept from the user
Returns:
The integer value entered

Allows a user to type in a hexnumber, echoing back to the user, up to input_len chars

Definition at line 192 of file adi_console_menu.c.

void adi_press_any_key_to_continue ( void   )

waits for any key to be pressed, and displays a prompt to the user

Definition at line 296 of file adi_console_menu.c.