00001
00016 #ifndef _USHELL_TASK_H_
00017 #define _USHELL_TASK_H_
00018
00019
00020
00021 #include "config.h"
00022
00023
00024
00025
00026
00027 #define CMD_NONE 0x00
00028 #define CMD_HELP 0x01
00029 #define CMD_RUN 0x02
00030 #define CMD_STOP 0x03
00031 #define CMD_FORWARD 0x04
00032 #define CMD_BACKWARD 0x05
00033 #define CMD_SET_SPEED 0x06
00034 #define CMD_GET_ID 0x07
00035 #define CMD_GET_STATUS0 0x08
00036 #define CMD_GET_STATUS1 0x09
00037
00038
00039
00040 #define CR 0x0D
00041 #define LF 0x0A
00042 #define CTRL_Q 0x11
00043 #define CTRL_C 0x03
00044 #define BKSPACE_CHAR 0x08
00045 #define ABORT_CHAR CTRL_C
00046 #define QUIT_APPEND CTRL_Q
00047
00048
00049 #define STR_RUN "ru"
00050 #define STR_STOP "st"
00051 #define STR_HELP "help"
00052 #define STR_FORWARD "fw"
00053 #define STR_BACKWARD "bw"
00054 #define STR_SET_SPEED "ss"
00055 #define STR_GET_ID "gi"
00056 #define STR_GET_STATUS0 "g0"
00057 #define STR_GET_STATUS1 "g1"
00058
00059
00060 #define MSG_PROMPT "\r>"
00061 #define MSG_WELCOME "\rATMEL Motor Control Interface"
00062 #define MSG_ER_CMD_NOT_FOUND "Unknown Command"
00063 #define MSG_HELP "\r\
00064 ru : run\r\
00065 st : stop\r\
00066 fw : forward\r\
00067 bw : backward\r\
00068 ss : set speed\r\
00069 gi : get id\
00070 "
00071
00072
00073
00074 void build_cmd(void);
00075 void parse_cmd(void);
00076 U8 mystrncmp(U8 *str1,U8 code *str2,U8 i);
00077 void print_msg(U8 code *str);
00078 void ushell_task_init(void);
00079 void ushell_task(void);
00080
00081 #endif
00082