Australis shell interface for user interaction with the system via terminal command line. More...
Data Structures | |
struct | Shell |
Struct definition for shell interface. More... | |
struct | ShellProgramHandle_t |
Struct definition for shell program handle. More... | |
struct | ShellTaskParams |
Struct definition for parameters passed to shell task. More... | |
Functions | |
int | Shell_init (Shell *) |
Initializes the shell, registering programs from shell vector. | |
void | Shell_help (Shell *) |
Displays available shell commands. | |
void | Shell_runTask (Shell *, uint8_t *) |
Creates a task to run a shell program. | |
void | Shell_run (Shell *, uint8_t *) |
Executes a shell program by name. | |
bool | Shell_clear (Shell *) |
Send clear sequence to host terminal. | |
Australis shell interface for user interaction with the system via terminal command line.
struct Shell |
Data Fields | ||
---|---|---|
UART_t | usb | UART interface to connect shell I/O. |
void(*)(struct Shell *) | help |
|
void(*)(struct Shell *, uint8_t *) | run |
|
void(*)(struct Shell *, uint8_t *) | runTask |
|
bool(*)(struct Shell *) | clear |
|
TaskHandle_t | taskHandle | Handle of currently active program in shell thread. |
struct ShellProgramHandle_t |
Struct definition for shell program handle.
Provides the interface for shell programs.
All handles must have a name (case-sensitive) that represents the program as it will be called from the shell interface.
Additionally, the handle must initialise the exec function pointer. This defines the program's entry point and is called by the shell.
Data Fields | ||
---|---|---|
char | name[SHELL_PROGRAM_NAME_LENGTH] | Program name as referenced by the shell. |
void(*)(struct Shell *, uint8_t *) | exec | Program entry point function pointer. |
struct ShellTaskParams |
int Shell_init | ( | Shell * | shell | ) |
Initializes the shell, registering programs from shell vector.
Configures shell structure, sets up functions, and registers available shell programs. Returns an error code if the number of programs exceeds the maximum.
shell | Pointer to the Shell structure to initialize. |
void Shell_help | ( | Shell * | shell | ) |
void Shell_runTask | ( | Shell * | shell, |
uint8_t * | str ) |
Creates a task to run a shell program.
Initializes task parameters and spawns a new RTOS task to parse and execute the shell program.
shell | Pointer to the Shell structure containing the program details. |
str | Command string to parse and execute. |
void Shell_run | ( | Shell * | shell, |
uint8_t * | programName ) |
Executes a shell program by name.
Parses the program name and flags, then finds and runs the corresponding shell program.
shell | Pointer to the Shell structure containing registered programs. |
programName | Name of the program to execute, with optional flags. |