00001
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef _USHELL_TASK_H_
00047 #define _USHELL_TASK_H_
00048
00049
00050
00051
00052 #include "fs_com.h"
00053
00054
00055
00056
00059
00060 #define ASCII_CR '\r'
00061 #define ASCII_LF '\n'
00062 #define ASCII_BKSPACE '\b'
00063 #define ASCII_ESCAPE 0x1B
00064 #define ASCII_CTRL_Q 0x11
00065 #define ASCII_CTRL_C 0x03
00067
00068
00071
00072 #define CMD_NONE 0x00
00073 #define CMD_NB_DRIVE 0x01
00074 #define CMD_DF 0x02
00075 #define CMD_FORMAT 0x03
00076 #define CMD_MOUNT 0x04
00077 #define CMD_SPACE 0x05
00078 #define CMD_LS 0x06
00079 #define CMD_LS_MORE 0x07
00080 #define CMD_CD 0x08
00081 #define CMD_UP 0x09
00082 #define CMD_CAT 0x0A
00083 #define CMD_CAT_MORE 0x0B
00084 #define CMD_HELP 0x0C
00085 #define CMD_MKDIR 0x0D
00086 #define CMD_TOUCH 0x0E
00087 #define CMD_RM 0x0F
00088 #define CMD_APPEND 0x10
00089 #define CMD_SET_ID 0x11
00090 #define CMD_GOTO_ID 0x12
00091 #define CMD_CP 0x13
00092 #define CMD_MV 0x14
00093 #define CMD_SYNC 0x15
00094 #define CMD_PERFORM 0x16
00095
00096 #define CMD_LS_USB 0x18
00097 #define CMD_USB_SUSPEND 0x19
00098 #define CMD_USB_RESUME 0x1A
00100
00101
00102
00105
00106 #define STR_DISK "disk"
00107 #define STR_DF "df"
00108 #define STR_FORMAT "format"
00109 #define STR_MOUNT "mount"
00110 #define STR_SPACE "space"
00111 #define STR_LS "ls"
00112 #define STR_LS_MORE "ls|more"
00113 #define STR_CD "cd"
00114 #define STR_UP "cd.."
00115 #define STR_CAT "cat"
00116 #define STR_CAT_MORE "cat|more"
00117 #define STR_HELP "help"
00118 #define STR_MKDIR "mkdir"
00119 #define STR_TOUCH "touch"
00120 #define STR_RM "rm"
00121 #define STR_APPEND "append"
00122 #define STR_MARK "mark"
00123 #define STR_GOTO "goto"
00124 #define STR_CP "cp"
00125 #define STR_MV "mv"
00126 #define STR_SYNC "sync"
00127 #define STR_PERFORM "perf"
00128
00129 #define STR_LS_USB "lsusb"
00130 #define STR_USB_SUSPEND "suspend"
00131 #define STR_USB_RESUME "resume"
00133
00134
00137
00138 #define MSG_PROMPT "$>"
00139 #define MSG_WELCOME "\x0C" \
00140 "--------------------------\r\n" \
00141 " ATMEL AVR32 uShell\r\n" \
00142 "--------------------------\r\n"
00143 #define MSG_EXIT "\x0C" \
00144 "------------------------\r\n" \
00145 "uShell not available\r\n" \
00146 "------------------------\r\n"
00147 #define MSG_ER_CMD_NOT_FOUND "Command not found\r\n"
00148 #define MSG_ER_MOUNT "Unable to mount drive\r\n"
00149 #define MSG_ER_DRIVE "Drive does not exist\r\n"
00150 #define MSG_ER_RM "Can not erase, if the name is a directory, check it is empty\r\n"
00151 #define MSG_ER_UNKNOWN_FILE "Unknown file\r\n"
00152 #define MSG_ER_FORMAT "Format fails\r\n"
00153 #define MSG_APPEND_WELCOME "\r\nSimple text editor, enter char to append, ^q to exit and save\r\n"
00154 #define MSG_HELP "\r\n---- Ushell Commands:\r\n" \
00155 " HELP Provides Help information for Ushell commands.\r\n" \
00156 " ! Previous command (history).\r\n" \
00157 " $ Next command (history).\r\n" \
00158 "\r\n---- File Systems Commands:\r\n" \
00159 " DISK Displays the number of drives.\r\n" \
00160 " DF Displays free space of all connected drives.\r\n" \
00161 " FORMAT [/A:] Formats drive, /A drive letter (a, b, etc.).\r\n" \
00162 " MOUNT [/A:] Mounts drive, /A drive letter (a, b, etc.).\r\n" \
00163 " [/A:] Mounts drive, /A drive letter (a, b, etc.).\r\n" \
00164 " SPACE Displays drive capacity.\r\n" \
00165 " LS [|MORE] Displays a list of files and subdirectories in a directory.\r\n" \
00166 " CD [..][path] Changes the current directory.\r\n" \
00167 " CAT [file name] Displays file contents.\r\n" \
00168 " MKDIR [dir name] Creates a directory.\r\n" \
00169 " TOUCH [file name] Creates a file.\r\n" \
00170 " RM [*][file name] Deletes one or more files or directories.\r\n" \
00171 " APPEND [file name] Appends file from terminal input\r\n" \
00172 " MARK Record the current directory in bookmark\r\n" \
00173 " GOTO Go to bookmarked directory\r\n" \
00174 " CP [file name][path\\] Copys file to bookmarked directory or to path argument.\r\n" \
00175 " MV [path] [new name] Renames file from path with new name.\r\n" \
00176 " SYNC [src_path] [dest_path] Synchronizes a folder content with other folder.\r\n" \
00177 " PERF [/A:] [/A:] Evaluates the transfer rate between two devices.\r\n" \
00178 "\r\n---- USB Host Commands:\r\n" \
00179 " LSUSB Displays USB information.\r\n" \
00180 " SUSPEND Suspends USB bus activity.\r\n" \
00181 " RESUME Resumes USB bus activity.\r\n" \
00182
00183 #define MSG_NO_DEVICE "Not currently applicable to supported connected device(s) if any\r\n"
00184 #define MSG_REMOTE_WAKEUP_OK "Device supports remote wake-up\r\n"
00185 #define MSG_REMOTE_WAKEUP_KO "Device does not support remote wake-up\r\n"
00186 #define MSG_SELF_POWERED "Device is self-powered\r\n"
00187 #define MSG_BUS_POWERED "Device is bus-powered\r\n"
00188 #define MSG_USB_SUSPENDED "USB is suspended!\r\n"
00189 #define MSG_OK "ok\r\n"
00190 #define MSG_KO "FAIL\r\n"
00191 #define MSG_DEVICE_FULL_SPEED "Device is full-speed\r\n"
00192 #define MSG_DEVICE_LOW_SPEED "Device is low-speed\r\n"
00193 #define MSG_DEVICE_HIGH_SPEED "Device is high-speed\r\n"
00194 #define MSG_ER_PASTE "Paste Fail\r\n"
00196
00197
00198
00199
00200 extern void ushell_task_init(U32 pba_hz);
00201 #ifdef FREERTOS_USED
00202 extern void ushell_task(void *pvParameters);
00203 #else
00204 extern void ushell_task(void);
00205 #endif
00206
00207 #endif // _USHELL_TASK_H_