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