📄 command_shell.h
字号:
/****************************************Copyright (c)**************************************************
** Unversity of electronic technology and science of China
** school of electronic engineer
**
**--------------File Info-------------------------------------------------------------------------------
** File name: command_shell.h
** Last modified Date: 2006.11.02
** Last Version: v1.0
** Descriptions: head file ,for config the command shell
**
**------------------------------------------------------------------------------------------------------
** Created by: wang zheng
** Created date: 2006.10.29
** Version: v1.0
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by: wang zheng
** Modified date:
** Version:
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#include <at8Xc51snd1.h>
#define cmd_shell_version 100
#ifdef __MASTER_FILE__
#define CS_EXT
#else
#define CS_EXT extern
#endif
/************************************************************************************************
* all defination
************************************************************************************************/
#define MAX_CMD_LENGTH 20 /* maxim length of command ,exclude parameters,
can be changed by user */
#define CMD_NUM 6 /* maxim number of command supported, can be
changed by user refer to application */
/************************************************************************************************
* variable type defination
************************************************************************************************/
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef struct
{
uint8 length; /*cmd length */
int8 cmd_line[ MAX_CMD_LENGTH ];
}cmd; /*cmd ,for save the input command */
typedef struct
{
uint8 length;
int8 cmd_line[ MAX_CMD_LENGTH];
uint8 (*pfun) ( );
}cmd_tabel; /*cmd table ,for save the cmd shell's command*/
/* all flags of the command shell */
#define normal_char 0X01
#define control_char 0X02
#define func_exe 0X03
#define cr 0X04
#define backspace 0x05
#define notfind -1 /*flag of did't find the matched command */
/************************************************************************************************
* System Function Declare
************************************************************************************************/
void Cmd_Shell_FSM( void ); /* core of command shell ,
is a finite state machine*/
void Cmd_Shell_Init( void );
void Uart_Init( void ); /*uart part related function*/
void Uart_Put_Char( int8 );
void Uart_Write( int8* ptdata );
/************************************************************************************************
* User Function Declare
************************************************************************************************/
uint8 help( void ); /* here are just some simple example for daemon */
uint8 ipconfig( void );
uint8 login( void );
uint8 exit ( void );
uint8 gettime( void );
uint8 sucess ( void );
/**********************************Global variable ********************************************/
CS_EXT uint8 curr_stat; // cuurrent state of FSM
CS_EXT uint8 curr_sig; // the signal which will cause state change
CS_EXT uint8 sig_renew; // renew signal
CS_EXT uint8 rec; // recieve buff
CS_EXT cmd cmd_buf; // structure cmd_buf;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -