RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
|
宏定义 | |
#define | FINSH_FUNCTION_EXPORT(name, desc) |
#define | FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc) |
#define | MSH_CMD_EXPORT(...) |
#define | MSH_CMD_EXPORT_ALIAS(...) |
函数 | |
rt_uint32_t | finsh_get_prompt_mode (void) |
void | finsh_set_prompt_mode (rt_uint32_t prompt_mode) |
void | finsh_set_device (const char *device_name) |
const char * | finsh_get_device () |
void | finsh_set_echo (rt_uint32_t echo) |
rt_uint32_t | finsh_get_echo () |
void | finsh_thread_entry_sethook (void(*hook)(void)) |
finsh shell is a user command shell in RT-Thread RTOS.
finsh shell is a user command shell in RT-Thread RTOS, which is a shell can accept C-expression like syntax in command. From finsh shell, user can access system area, such as memory, variables and function by input C-expression in command.
There is a shell thread, which named as "tshell", in the finsh shell, it read user command from console device, and then invokes system function or access system variable to output result (by rt_kprintf).
#define FINSH_FUNCTION_EXPORT | ( | name, | |
desc ) |
This macro exports a system function to finsh shell.
name | the name of function. |
desc | the description of function, which will show in help. |
在文件 components/finsh/finsh.h 第 119 行定义.
#define FINSH_FUNCTION_EXPORT_ALIAS | ( | name, | |
alias, | |||
desc ) |
This macro exports a system function with an alias name to finsh shell.
name | the name of function. |
alias | the alias name of function. |
desc | the description of function, which will show in help. |
在文件 components/finsh/finsh.h 第 130 行定义.
#define MSH_CMD_EXPORT | ( | ... | ) |
This macro exports a command to module shell.
param command is the name of the command. param desc is the description of the command, which will show in help list. param opt This is an option, enter any content to enable option completion
在文件 components/finsh/finsh.h 第 142 行定义.
#define MSH_CMD_EXPORT_ALIAS | ( | ... | ) |
This macro exports a command with alias to module shell.
param command is the name of the command. param alias is the alias of the command. param desc is the description of the command, which will show in help list. param opt This is an option, enter any content to enable option completion
在文件 components/finsh/finsh.h 第 160 行定义.
rt_uint32_t finsh_get_prompt_mode | ( | void | ) |
This function get the prompt mode of finsh shell.
void finsh_set_prompt_mode | ( | rt_uint32_t | prompt_mode | ) |
void finsh_set_device | ( | const char * | device_name | ) |
This function sets the input device of finsh shell.
device_name | the name of new input device. |
引用了 RT_ASSERT, rt_device_close(), rt_device_find(), RT_DEVICE_FLAG_INT_RX, RT_DEVICE_FLAG_STREAM, RT_DEVICE_OFLAG_RDWR, rt_device_open(), rt_device_set_rx_indicate(), rt_kprintf, RT_NULL , 以及 shell.
const char * finsh_get_device | ( | void | ) |
void finsh_set_echo | ( | rt_uint32_t | echo | ) |
This function set the echo mode of finsh shell.
FINSH_OPTION_ECHO=0x01 is echo mode, other values are none-echo mode.
echo | the echo mode |
rt_uint32_t finsh_get_echo | ( | void | ) |