iLLD_TC27xD  1.0
Ifx_Shell.c File Reference
#include "Ifx_Shell.h"
#include "_Utilities/Ifx_Assert.h"
#include "Cpu/Std/IfxCpu_Intrinsics.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define IFX_SHELL_LLD   "%lld "
 
#define IFX_SHELL_LLX   "%llx "
 
#define IFX_SHELL_LLU   "%llu "
 
#define IFX_SHELL_MAX_MESSAGE_SIZE   255
 
#define ISSPACE(c)   (((c) == ' ') || ((c) == '\t'))
 
#define IFX_SHELL_IF_ECHO(X)   {if (shell->control.echo) {X; }}
 
#define IFX_SHELL_WRITE_SPACES(X)   {int ii; for (ii = 0; ii < (X); ii++) {IfxStdIf_DPipe_print(shell->io, " "); }}
 
#define IFX_SHELL_WRITE_BACKSPACES(X)   {int ii; for (ii = 0; ii < (X); ii++) {IfxStdIf_DPipe_print(shell->io, "\b"); }}
 

Functions

void Ifx_Shell_execute (Ifx_Shell *shell, pchar commandLine)
 
void Ifx_Shell_cmdEscapeProcess (Ifx_Shell *shell, char EscapeChar1, char EscapeChar2)
 
IFX_INLINE boolean Ifx_Shell_isEndOfLine (pchar args)
 Check whether the args is already at the end. More...
 
boolean Ifx_Shell_showHelpSingle (pchar prefix, const void *commandList, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Show the help menu from single command list. More...
 
boolean Ifx_Shell_showHelp (pchar args, void *shellPtr, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Show the help menu and list of commands. More...
 
boolean Ifx_Shell_protocolStart (pchar args, void *data, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Start the ShellBb protocol. More...
 
boolean Ifx_Shell_bbProtocolStart (pchar args, void *data, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Start the ShellBb protocol. More...
 
void Ifx_Shell_initConfig (Ifx_Shell_Config *config)
 
boolean Ifx_Shell_init (Ifx_Shell *shell, const Ifx_Shell_Config *config)
 Initialize the shell. More...
 
void Ifx_Shell_process (Ifx_Shell *shell)
 Process the shell. More...
 
void Ifx_Shell_deinit (Ifx_Shell *shell)
 Deinitialise the shell. More...
 
pchar Ifx_Shell_skipWhitespace (pchar args)
 Within the context of Shell.call, skip the whitespaces of the args string. More...
 
boolean Ifx_Shell_matchToken (pchar *argsPtr, pchar token)
 Match string pointed by the *argsPtr with a given token. More...
 
boolean Ifx_Shell_parseToken (pchar *argsPtr, char *tokenBuffer, int bufferLength)
 Parse a token. More...
 
boolean Ifx_Shell_parseAddress (pchar *argsPtr, void **address)
 Parse an address. More...
 
boolean Ifx_Shell_parseSInt32 (pchar *argsPtr, sint32 *value)
 Parse a signed 32-bit integer value. More...
 
boolean Ifx_Shell_parseUInt32 (pchar *argsPtr, uint32 *value, boolean hex)
 Parse an unsigned 32-bit integer value. More...
 
boolean Ifx_Shell_parseSInt64 (pchar *argsPtr, sint64 *value)
 Parse a signed 64-bit integer value. More...
 
boolean Ifx_Shell_parseUInt64 (pchar *argsPtr, uint64 *value, boolean hex)
 Parse an unsigned 64-bit integer value. More...
 
boolean Ifx_Shell_parseFloat64 (pchar *argsPtr, float64 *value)
 Parse a 64-bit (double precision) floating-point value. More...
 
boolean Ifx_Shell_parseFloat32 (pchar *argsPtr, float32 *value)
 Parse a 32-bit (single precision) floating-point value. More...
 
const Ifx_Shell_CommandIfx_Shell_commandFind (const Ifx_Shell_Command *commandList, pchar commandLine, pchar *args)
 Find command in commandList. More...
 
const Ifx_Shell_CommandIfx_Shell_commandListFind (Ifx_Shell *shell, pchar commandLine, pchar *args)
 
void Ifx_Shell_enable (Ifx_Shell *shell)
 Clear the receive buffer and enable the shell. More...
 
void Ifx_Shell_disable (Ifx_Shell *shell)
 Disable the shell. More...
 
void Ifx_Shell_printSyntax (const Ifx_Shell_Syntax *syntaxList, IfxStdIf_DPipe *io)
 

Variables

char Ifx_Shell_cmdBuffer [IFX_SHELL_CMD_LINE_SIZE *IFX_SHELL_CMD_HISTORY_SIZE]
 

Macro Definition Documentation

#define IFX_SHELL_IF_ECHO (   X)    {if (shell->control.echo) {X; }}

Definition at line 46 of file Ifx_Shell.c.

Referenced by Ifx_Shell_cmdEscapeProcess(), and Ifx_Shell_process().

#define IFX_SHELL_LLD   "%lld "

Definition at line 34 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseSInt64().

#define IFX_SHELL_LLU   "%llu "

Definition at line 36 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseUInt64().

#define IFX_SHELL_LLX   "%llx "

Definition at line 35 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseUInt64().

#define IFX_SHELL_MAX_MESSAGE_SIZE   255

Definition at line 39 of file Ifx_Shell.c.

#define IFX_SHELL_WRITE_BACKSPACES (   X)    {int ii; for (ii = 0; ii < (X); ii++) {IfxStdIf_DPipe_print(shell->io, "\b"); }}

Definition at line 53 of file Ifx_Shell.c.

Referenced by Ifx_Shell_cmdEscapeProcess(), and Ifx_Shell_process().

#define IFX_SHELL_WRITE_SPACES (   X)    {int ii; for (ii = 0; ii < (X); ii++) {IfxStdIf_DPipe_print(shell->io, " "); }}

Definition at line 49 of file Ifx_Shell.c.

Referenced by Ifx_Shell_cmdEscapeProcess().

#define ISSPACE (   c)    (((c) == ' ') || ((c) == '\t'))

Definition at line 43 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseToken(), and Ifx_Shell_skipWhitespace().

Function Documentation

void Ifx_Shell_cmdEscapeProcess ( Ifx_Shell shell,
char  EscapeChar1,
char  EscapeChar2 
)

Definition at line 928 of file Ifx_Shell.c.

Referenced by Ifx_Shell_process().

const Ifx_Shell_Command* Ifx_Shell_commandListFind ( Ifx_Shell shell,
pchar  commandLine,
pchar args 
)

Definition at line 848 of file Ifx_Shell.c.

Referenced by Ifx_Shell_execute().

void Ifx_Shell_execute ( Ifx_Shell shell,
pchar  commandLine 
)

Definition at line 870 of file Ifx_Shell.c.

Referenced by Ifx_Shell_process().

IFX_INLINE boolean Ifx_Shell_isEndOfLine ( pchar  args)

Check whether the args is already at the end.

Parameters
argsThe argument null-terminated string

Definition at line 67 of file Ifx_Shell.c.

Variable Documentation

Definition at line 57 of file Ifx_Shell.c.

Referenced by Ifx_Shell_init().