Source code for the Trusted Boot Module.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tbm-mcu/include/shell.h

30 lines
796 B

#pragma once
struct cmd {
const char *cmd;
const char *desc;
void (* exec)(FILE *out, const char **argv, size_t argc);
};
struct shell {
char line[128];
struct cmd *cmds;
const char *prompt;
struct usart_console *con;
FILE *fp;
};
size_t count_args(const char *line);
char **parse_args(const char *line, size_t *argc);
void cmd_exec(struct cmd *cmds, FILE *out, const char **argv, size_t argc);
void cmd_parse(struct cmd *cmds, FILE *out, const char *line);
int shell_init(struct shell *shell, struct cmd *cmds,
struct usart_console *con, const char *prompt);
int shell_parse(struct shell *shell);
void do_flash_cmd(FILE *out, const char **argv, size_t argc);
void do_ftl_cmd(FILE *out, const char **argv, size_t argc);
void do_mufs_cmd(FILE *out, const char **argv, size_t argc);