#include "fs_com.h"
Macros | |
Specific ASCII Values | |
#define | ASCII_CR '\r' |
#define | ASCII_LF '\n' |
#define | ASCII_BKSPACE '\b' |
#define | ASCII_ESCAPE 0x1B |
#define | ASCII_CTRL_Q 0x11 |
#define | ASCII_CTRL_C 0x03 |
Shell Commands | |
#define | CMD_NONE 0x00 |
#define | CMD_NB_DRIVE 0x01 |
#define | CMD_DF 0x02 |
#define | CMD_FORMAT 0x03 |
#define | CMD_MOUNT 0x04 |
#define | CMD_SPACE 0x05 |
#define | CMD_LS 0x06 |
#define | CMD_LS_MORE 0x07 |
#define | CMD_CD 0x08 |
#define | CMD_UP 0x09 |
#define | CMD_CAT 0x0A |
#define | CMD_CAT_MORE 0x0B |
#define | CMD_HELP 0x0C |
#define | CMD_MKDIR 0x0D |
#define | CMD_TOUCH 0x0E |
#define | CMD_RM 0x0F |
#define | CMD_APPEND 0x10 |
#define | CMD_SET_ID 0x11 |
#define | CMD_GOTO_ID 0x12 |
#define | CMD_CP 0x13 |
#define | CMD_MV 0x14 |
#define | CMD_SYNC 0x15 |
#define | CMD_PERFORM 0x16 |
#define | CMD_LS_USB 0x18 |
#define | CMD_USB_SUSPEND 0x19 |
#define | CMD_USB_RESUME 0x1A |
String Values for Commands | |
#define | STR_DISK "disk" |
#define | STR_DF "df" |
#define | STR_FORMAT "format" |
#define | STR_MOUNT "mount" |
#define | STR_SPACE "space" |
#define | STR_LS "ls" |
#define | STR_LS_MORE "ls|more" |
#define | STR_CD "cd" |
#define | STR_UP "cd.." |
#define | STR_CAT "cat" |
#define | STR_CAT_MORE "cat|more" |
#define | STR_HELP "help" |
#define | STR_MKDIR "mkdir" |
#define | STR_TOUCH "touch" |
#define | STR_RM "rm" |
#define | STR_APPEND "append" |
#define | STR_MARK "mark" |
#define | STR_GOTO "goto" |
#define | STR_CP "cp" |
#define | STR_MV "mv" |
#define | STR_SYNC "sync" |
#define | STR_PERFORM "perf" |
#define | STR_LS_USB "lsusb" |
#define | STR_USB_SUSPEND "suspend" |
#define | STR_USB_RESUME "resume" |
String Messages | |
#define | MSG_PROMPT "$>" |
#define | MSG_WELCOME |
#define | MSG_EXIT |
#define | MSG_ER_CMD_NOT_FOUND "Command not found\r\n" |
#define | MSG_ER_MOUNT "Unable to mount drive\r\n" |
#define | MSG_ER_DRIVE "Drive does not exist\r\n" |
#define | MSG_ER_RM "Can not erase, if the name is a directory, check it is empty\r\n" |
#define | MSG_ER_UNKNOWN_FILE "Unknown file\r\n" |
#define | MSG_ER_FORMAT "Format fails\r\n" |
#define | MSG_APPEND_WELCOME "\r\nSimple text editor, enter char to append, ^q to exit and save\r\n" |
#define | MSG_HELP |
#define | MSG_NO_DEVICE "Not currently applicable to supported connected device(s) if any\r\n" |
#define | MSG_REMOTE_WAKEUP_OK "Device supports remote wake-up\r\n" |
#define | MSG_REMOTE_WAKEUP_KO "Device does not support remote wake-up\r\n" |
#define | MSG_SELF_POWERED "Device is self-powered\r\n" |
#define | MSG_BUS_POWERED "Device is bus-powered\r\n" |
#define | MSG_USB_SUSPENDED "USB is suspended!\r\n" |
#define | MSG_OK "ok\r\n" |
#define | MSG_KO "FAIL\r\n" |
#define | MSG_DEVICE_FULL_SPEED "Device is full-speed\r\n" |
#define | MSG_DEVICE_LOW_SPEED "Device is low-speed\r\n" |
#define | MSG_DEVICE_HIGH_SPEED "Device is high-speed\r\n" |
#define | MSG_ER_PASTE "Paste Fail\r\n" |
Functions | |
void | ushell_task (void *pvParameters) |
Entry point of the explorer task management. More... | |
void | ushell_task_init (uint32_t pba_hz) |
This function initializes the hardware/software resources required for ushell task. More... | |
#define ASCII_BKSPACE '\b' |
Referenced by ushell_clean_cmd_line(), and ushell_cmd_scan().
#define ASCII_CR '\r' |
Referenced by ushell_cmd_append_file(), ushell_cmd_cat(), and ushell_cmd_scan().
#define ASCII_CTRL_C 0x03 |
#define ASCII_CTRL_Q 0x11 |
Referenced by ushell_cmd_append_file().
#define ASCII_ESCAPE 0x1B |
Referenced by ushell_cmd_scan().
#define ASCII_LF '\n' |
Referenced by ushell_cmd_append_file(), ushell_cmd_cat(), and ushell_cmd_scan().
#define CMD_APPEND 0x10 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_CAT 0x0A |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_CAT_MORE 0x0B |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_CD 0x08 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_CP 0x13 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_DF 0x02 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_FORMAT 0x03 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_GOTO_ID 0x12 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_HELP 0x0C |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_LS 0x06 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_LS_MORE 0x07 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_LS_USB 0x18 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_MKDIR 0x0D |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_MOUNT 0x04 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_MV 0x14 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_NB_DRIVE 0x01 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_NONE 0x00 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_PERFORM 0x16 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_RM 0x0F |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_SET_ID 0x11 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_SPACE 0x05 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_SYNC 0x15 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_TOUCH 0x0E |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_UP 0x09 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_USB_RESUME 0x1A |
Referenced by ushell_cmd_decode(), and ushell_task().
#define CMD_USB_SUSPEND 0x19 |
Referenced by ushell_cmd_decode(), and ushell_task().
#define MSG_APPEND_WELCOME "\r\nSimple text editor, enter char to append, ^q to exit and save\r\n" |
Referenced by ushell_cmd_append_file().
#define MSG_BUS_POWERED "Device is bus-powered\r\n" |
#define MSG_DEVICE_FULL_SPEED "Device is full-speed\r\n" |
#define MSG_DEVICE_HIGH_SPEED "Device is high-speed\r\n" |
#define MSG_DEVICE_LOW_SPEED "Device is low-speed\r\n" |
#define MSG_ER_CMD_NOT_FOUND "Command not found\r\n" |
Referenced by ushell_cmd_decode(), and ushell_task().
#define MSG_ER_DRIVE "Drive does not exist\r\n" |
Referenced by ushell_cmd_mount().
#define MSG_ER_FORMAT "Format fails\r\n" |
Referenced by ushell_cmd_format().
#define MSG_ER_MOUNT "Unable to mount drive\r\n" |
Referenced by ushell_cmd_mount().
#define MSG_ER_PASTE "Paste Fail\r\n" |
Referenced by ushell_cmd_copy().
#define MSG_ER_RM "Can not erase, if the name is a directory, check it is empty\r\n" |
#define MSG_ER_UNKNOWN_FILE "Unknown file\r\n" |
Referenced by ushell_cmd_append_file(), ushell_cmd_cat(), ushell_cmd_cd(), ushell_cmd_copy(), and ushell_cmd_rename().
#define MSG_EXIT |
Referenced by ushell_task(), and ushell_task_init().
#define MSG_HELP |
Referenced by ushell_cmd_help().
#define MSG_KO "FAIL\r\n" |
Referenced by ushell_cmd_append_file(), ushell_cmd_copy(), ushell_cmd_mkdir(), ushell_cmd_rename(), and ushell_cmd_rm().
#define MSG_NO_DEVICE "Not currently applicable to supported connected device(s) if any\r\n" |
Referenced by ushell_cmdusb_resume(), and ushell_cmdusb_suspend().
#define MSG_OK "ok\r\n" |
#define MSG_PROMPT "$>" |
Referenced by ushell_task().
#define MSG_REMOTE_WAKEUP_KO "Device does not support remote wake-up\r\n" |
#define MSG_REMOTE_WAKEUP_OK "Device supports remote wake-up\r\n" |
#define MSG_SELF_POWERED "Device is self-powered\r\n" |
#define MSG_USB_SUSPENDED "USB is suspended!\r\n" |
#define MSG_WELCOME |
Referenced by ushell_task().
#define STR_APPEND "append" |
Referenced by ushell_cmd_decode().
#define STR_CAT "cat" |
Referenced by ushell_cmd_decode().
#define STR_CAT_MORE "cat|more" |
Referenced by ushell_cmd_decode().
#define STR_CD "cd" |
Referenced by ushell_cmd_decode().
#define STR_CP "cp" |
Referenced by ushell_cmd_decode().
#define STR_DF "df" |
Referenced by ushell_cmd_decode().
#define STR_DISK "disk" |
Referenced by ushell_cmd_decode().
#define STR_FORMAT "format" |
Referenced by ushell_cmd_decode().
#define STR_GOTO "goto" |
Referenced by ushell_cmd_decode().
#define STR_HELP "help" |
Referenced by ushell_cmd_decode().
#define STR_LS "ls" |
Referenced by ushell_cmd_decode().
#define STR_LS_MORE "ls|more" |
Referenced by ushell_cmd_decode().
#define STR_LS_USB "lsusb" |
Referenced by ushell_cmd_decode().
#define STR_MARK "mark" |
Referenced by ushell_cmd_decode().
#define STR_MKDIR "mkdir" |
Referenced by ushell_cmd_decode().
#define STR_MOUNT "mount" |
Referenced by ushell_cmd_decode().
#define STR_MV "mv" |
Referenced by ushell_cmd_decode().
#define STR_PERFORM "perf" |
Referenced by ushell_cmd_decode().
#define STR_RM "rm" |
Referenced by ushell_cmd_decode().
#define STR_SPACE "space" |
Referenced by ushell_cmd_decode().
#define STR_SYNC "sync" |
Referenced by ushell_cmd_decode().
#define STR_TOUCH "touch" |
Referenced by ushell_cmd_decode().
#define STR_UP "cd.." |
Referenced by ushell_cmd_decode().
#define STR_USB_RESUME "resume" |
Referenced by ushell_cmd_decode().
#define STR_USB_SUSPEND "suspend" |
Referenced by ushell_cmd_decode().
void ushell_task | ( | void * | pvParameters | ) |
Entry point of the explorer task management.
This function performs uShell decoding to access file-system functions.
pvParameters | Unused. |
References CMD_APPEND, CMD_CAT, CMD_CAT_MORE, CMD_CD, CMD_CP, CMD_DF, CMD_FORMAT, CMD_GOTO_ID, CMD_HELP, CMD_LS, CMD_LS_MORE, CMD_LS_USB, CMD_MKDIR, CMD_MOUNT, CMD_MV, CMD_NB_DRIVE, CMD_NONE, CMD_PERFORM, CMD_RM, CMD_SET_ID, CMD_SPACE, CMD_SYNC, CMD_TOUCH, CMD_UP, CMD_USB_RESUME, CMD_USB_SUSPEND, configTSK_USHELL_PERIOD, FS_NAV_ID_USHELL_CMD, g_b_ushell_task_run, Is_usb_id_device, MSG_ER_CMD_NOT_FOUND, MSG_EXIT, MSG_PROMPT, MSG_WELCOME, nav_drive_set(), nav_exit(), nav_getindex(), nav_gotoindex(), nav_reset(), nav_select(), ushell_cmd_append_file(), ushell_cmd_cat(), ushell_cmd_cd(), ushell_cmd_copy(), ushell_cmd_decode(), ushell_cmd_format(), ushell_cmd_free_space(), ushell_cmd_gotoparent(), ushell_cmd_help(), ushell_cmd_ls(), ushell_cmd_mkdir(), ushell_cmd_mount(), ushell_cmd_nb_drive(), ushell_cmd_perform(), ushell_cmd_rename(), ushell_cmd_rm(), ushell_cmd_scan(), ushell_cmd_space(), ushell_cmd_sync(), ushell_cmd_touch(), ushell_cmdusb_ls(), ushell_cmdusb_resume(), ushell_cmdusb_suspend(), vTaskDelayUntil(), and xTaskGetTickCount().
Referenced by main(), and ushell_task_init().
void ushell_task_init | ( | uint32_t | pba_hz | ) |
This function initializes the hardware/software resources required for ushell task.
References usart_options_t::baudrate, configTSK_USHELL_NAME, configTSK_USHELL_PRIORITY, configTSK_USHELL_STACK_SIZE, g_b_ushell_task_run, g_s_cmd_his, g_u32_ushell_pba_hz, gpio_enable_module(), MSG_EXIT, set_usart_base(), SHL_USART, SHL_USART_BAUDRATE, SHL_USART_RX_FUNCTION, SHL_USART_RX_PIN, SHL_USART_TX_FUNCTION, SHL_USART_TX_PIN, USART_1_STOPBIT, usart_init(), usart_init_rs232(), USART_NO_PARITY, USART_NORMAL_CHMODE, USHELL_HISTORY, ushell_task(), and xTaskCreate.
Referenced by main().