RT-Thread RTOS
1.2.0
An open source embedded real-time operating system
|
Macros | |
#define | FINSH_FUNCTION_EXPORT(name, desc) |
#define | FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc) |
#define | MSH_CMD_EXPORT(...) |
#define | MSH_CMD_EXPORT_ALIAS(...) |
Functions | |
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. |
#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. |
#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
#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
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 | ) |
This function set the prompt mode of finsh shell.
The parameter 0 disable prompt mode, other values enable prompt mode.
prompt_mode | the 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. |
const char* finsh_get_device | ( | void | ) |
This function returns current finsh shell input device.
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 | ) |
This function gets the echo mode of finsh shell.
void finsh_thread_entry_sethook | ( | void(*)(void) | hook | ) |
This function set a hook function at the entry of finsh thread.
hook | the function point to be called |