Felipe Neves
/
TEN_mbedos_simple_shell
TEN MBED OS Course shell utility
shell.h@0:1e8461adc480, 2017-01-29 (annotated)
- Committer:
- uLipe
- Date:
- Sun Jan 29 20:57:17 2017 +0000
- Revision:
- 0:1e8461adc480
first;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uLipe | 0:1e8461adc480 | 1 | /** |
uLipe | 0:1e8461adc480 | 2 | * @brief simple shel utility |
uLipe | 0:1e8461adc480 | 3 | */ |
uLipe | 0:1e8461adc480 | 4 | #ifndef __SHELL_H |
uLipe | 0:1e8461adc480 | 5 | #define __SHELL_H |
uLipe | 0:1e8461adc480 | 6 | |
uLipe | 0:1e8461adc480 | 7 | #define SHELL_TXD USBTX |
uLipe | 0:1e8461adc480 | 8 | #define SHELL_RXD USBRX |
uLipe | 0:1e8461adc480 | 9 | |
uLipe | 0:1e8461adc480 | 10 | |
uLipe | 0:1e8461adc480 | 11 | /* define the shell command handler callback */ |
uLipe | 0:1e8461adc480 | 12 | typedef int (*shell_callback_t) (char *cmd, int argc, char **argv, void *outchar); |
uLipe | 0:1e8461adc480 | 13 | typedef void (*shell_usage_t) (void *outchar); |
uLipe | 0:1e8461adc480 | 14 | |
uLipe | 0:1e8461adc480 | 15 | /** |
uLipe | 0:1e8461adc480 | 16 | * @brief set custom shell command handler |
uLipe | 0:1e8461adc480 | 17 | */ |
uLipe | 0:1e8461adc480 | 18 | void shell_set_command_handler(shell_callback_t sh); |
uLipe | 0:1e8461adc480 | 19 | |
uLipe | 0:1e8461adc480 | 20 | |
uLipe | 0:1e8461adc480 | 21 | /** |
uLipe | 0:1e8461adc480 | 22 | * @brief set the command list |
uLipe | 0:1e8461adc480 | 23 | */ |
uLipe | 0:1e8461adc480 | 24 | void shell_set_cmd_list(shell_usage_t sh); |
uLipe | 0:1e8461adc480 | 25 | |
uLipe | 0:1e8461adc480 | 26 | |
uLipe | 0:1e8461adc480 | 27 | /** |
uLipe | 0:1e8461adc480 | 28 | * @brief start the shell character capturer |
uLipe | 0:1e8461adc480 | 29 | */ |
uLipe | 0:1e8461adc480 | 30 | void shell_start(void); |
uLipe | 0:1e8461adc480 | 31 | |
uLipe | 0:1e8461adc480 | 32 | #endif |