The code from https://github.com/vpcola/Nucleo
Diff: Shell.h
- Revision:
- 0:5464d5e415e5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Shell.h Wed Oct 08 11:00:24 2014 +0000 @@ -0,0 +1,41 @@ +#ifndef _TINY_SHELL_H_ +#define _TINY_SHELL_H_ + +#include "mbed.h" +#include "cmsis_os.h" + +#define SHELL_MAX_LINE_LENGTH 64 +#define SHELL_MAX_ARGUMENTS 4 + +typedef void (*shellcmd_t) (Stream *, int , char **); + +typedef struct { + const char * sc_name; + shellcmd_t sc_func; +} ShellCommand; + +typedef struct { + Stream * sc_channel; + ShellCommand * sc_commands; +} ShellConfig; + +#ifdef __cplusplus +extern "C" { +#endif + +/* User commands */ +void cmd_ls(Stream * chp, int argc, char * argv[]); +void cmd_sensor(Stream * chp, int argc, char * argv[]); +void cmd_load(Stream * chp, int argc, char * argv[]); +void cmd_rollimages(Stream * chp, int argc, char * argv[]); + +void shellStart(const ShellConfig *); +bool shellGetLine(Stream * chp, char *line, unsigned size); +void shellUsage(Stream * chp, const char *p); + +#ifdef __cplusplus +} +#endif + +#endif +