2023-07-13 11:27:03 +08:00
|
|
|
#ifndef __OSP_SHELL_H__
|
|
|
|
#define __OSP_SHELL_H__
|
|
|
|
|
|
|
|
#include "spu_sw_queue.h"
|
|
|
|
|
|
|
|
#define NAME_LEN 12
|
|
|
|
|
|
|
|
|
|
|
|
#define UCP4008_OSP_SHELL_REG 0x16
|
|
|
|
#define SHELL_NELEMENTS(x) ((sizeof(x)/sizeof((x)[0])))
|
|
|
|
#define UCP4008_OSP_SHELL 12 /* Shell消息 */
|
|
|
|
#define MAX_CMD_LEN (48) /* the max length of a shell command */
|
|
|
|
#define MAX_EXT_CMD_NUM 30
|
|
|
|
#define STDOUT_FILENO 0
|
|
|
|
#define KEY_BACKSPACE '\b' // back space
|
|
|
|
#define KEY_ENTER 13 // enter
|
|
|
|
#define MAX_CMD_HISTORY 8
|
|
|
|
#define SHELL_MAX_LEN_OF_PKG 512
|
|
|
|
|
|
|
|
|
|
|
|
typedef int (*shell_cmd_routine)(int argc ,char **argv);
|
|
|
|
typedef unsigned long (*OSP_FUNCPTR)();
|
|
|
|
|
|
|
|
typedef struct tagOspCmdRtn
|
|
|
|
{
|
2023-12-04 19:46:37 +08:00
|
|
|
char cmd[12];
|
2023-07-13 11:27:03 +08:00
|
|
|
OSP_FUNCPTR wrapper;
|
|
|
|
OSP_FUNCPTR routine;
|
2023-11-22 15:34:19 +08:00
|
|
|
/*char descption[128];*/
|
2023-07-13 11:27:03 +08:00
|
|
|
uint32_t argnum;
|
|
|
|
}OSP_CMD_RTN;
|
|
|
|
|
|
|
|
typedef struct tagOspCmdExt
|
|
|
|
{
|
2023-12-04 19:46:37 +08:00
|
|
|
char cmd[12];
|
2023-07-13 11:27:03 +08:00
|
|
|
uint32_t argnum;
|
|
|
|
uint32_t num;
|
|
|
|
}OSP_CMD_EXT;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
WKS_WAIT,
|
|
|
|
WKS_RECV1B,
|
|
|
|
WKS_UDLR,
|
|
|
|
WKS_DEL,
|
|
|
|
}T_WaitKeyState;
|
|
|
|
|
|
|
|
|
|
|
|
void spu_shell_task(void);
|
|
|
|
void spu_shellinfo_to_arm(char* pbuf, int ulLen, uint8_t u8PktType);
|
|
|
|
void spu_insert_cmd_ext(char *name, OSP_FUNCPTR pfunc, char *desc, uint32_t argnum);
|
|
|
|
void spu_shell_task(void);
|
|
|
|
void spu_shell_proc(spu_sw_msg_info_t *pMsg);
|
|
|
|
void spu_set_log_level(uint8_t ucLevel);
|
|
|
|
void spu_csu_int_cnt(void);
|
|
|
|
void spu_csu_stop_cfg(uint8_t ucstop, uint8_t ucadvance);
|
|
|
|
int spu_shell_init(void);
|
|
|
|
int spu_shell_wrapper(char **arg, int len, OSP_FUNCPTR func);
|
|
|
|
void spu_reget_cmd();
|
|
|
|
|
|
|
|
|
|
|
|
extern int32_t get_core_id();
|
|
|
|
extern void osp_show_task_info(void);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|