21#define DEFINE_PROGRAM_HANDLE(progName, execFunction) \
22 static ShellProgramHandle_t __attribute__((section(".shell_" progName), unused)) \
23 *progHandle = &(ShellProgramHandle_t){ \
25 .exec = execFunction \
29#define SHELL_PROGRAM_NAME_LENGTH 20
32#define CMD_CLEAR "\033[3J\033[H\033[2J"
66 char name[SHELL_PROGRAM_NAME_LENGTH];
bool(* clear)(struct Shell *)
void(* run)(struct Shell *, uint8_t *)
TaskHandle_t taskHandle
Handle of currently active program in shell thread.
char name[SHELL_PROGRAM_NAME_LENGTH]
Program name as referenced by the shell.
void(* help)(struct Shell *)
void(* runTask)(struct Shell *, uint8_t *)
UART_t usb
UART interface to connect shell I/O.
void(* exec)(struct Shell *, uint8_t *)
Program entry point function pointer.
int Shell_init(Shell *)
Initializes the shell, registering programs from shell vector.
void Shell_help(Shell *)
Displays available shell commands.
bool Shell_clear(Shell *)
Send clear sequence to host terminal.
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.
Struct definition for shell interface.
Struct definition for shell program handle.
Struct definition for parameters passed to shell task.
Struct definition for UART interface.