Implementation
Configure the Shell
To configure the Shell, it is needed to firstly initialize a Standard Interface and a Standard IO from the iLLDs.
This is done by the functions
IfxAsclin_Asc_stdIfDPipeInit()
,
Ifx_Console_init()
and
Ifx_Assert_setStandardIo()
, that can be found respectively in the iLLDs headers
IfxAsclin_Asc.h
,
Ifx_Console.h
and
Assert.h
.
Furthermore, it is needed to define the macros
IFX_CFG_ASSERT_STDIO
,
IFX_CFG_ASSERT_VERBOSE_LEVEL_DEFAULT
and
IFX_CFG_ASSERT_INCLUDE
to configure the
Ifx_Assert.h
header.
This is done in the configuration header
Ifx_Cfg.h
.
The Shell is configured inside the function
initShellInterface()
by initializing an instance of the
Ifx_Shell_Config
structure with default values through the function
Ifx_Shell_initConfig()
. Then, the
following parameters are modified:
›
standardIo
– that allows to set the module used for serial communication
›
commandList
– that allows to set the list of commands supported by the shell
The command list is an array of structures of the type
Ifx_Shell_Command
, that contains:
–
commandLine
– the actual command which will be sent to the shell by the user
–
help
– a small description of the command that is shown when help command is given
–
data
– a link to the shell
–
call
– the function called when the command is given
The
Ifx_Shell_init()
function initializes the shell with the user configuration.
The functions
Ifx_Shell_initConfig()
and
Ifx_Shell_init()
can be found in the iLLD header
Ifx_Shell.h
, while
the function
initShellInterface()
is defined in the header
UART_ASCLIN_Shell.h
.
6
2019-10-17
Copyright © Infineon Technologies AG 2019. All rights reserved.