添加注释

This commit is contained in:
hqm 2021-09-12 22:01:20 +08:00
parent 7514b4f3d0
commit 33e413572c
1 changed files with 123 additions and 7 deletions

View File

@ -125,26 +125,142 @@ typedef struct
uint8_t _initOK; uint8_t _initOK;
} xcmder_t; } xcmder_t;
/**
* @description: 641016
* @param {p_func}getchar
* @param {p_func}putchar:
* @return
*/
#define xcmd_create_default(getchar, putchar) xcmd_create(getchar, putchar, 64, 10, 16); #define xcmd_create_default(getchar, putchar) xcmd_create(getchar, putchar, 64, 10, 16);
/**
* @description:
* @param {p_func}getchar
* @param {p_func}putchar:
* @param {uint16_t} cmd_len
* @param {uint16_t} history_len
* @param {uint16_t} param_len
* @return
*/
xcmder_t *xcmd_create( int (*get_c)(uint8_t*), int (*put_c)(uint8_t), uint16_t cmd_len, uint16_t history_len, uint16_t param_len); xcmder_t *xcmd_create( int (*get_c)(uint8_t*), int (*put_c)(uint8_t), uint16_t cmd_len, uint16_t history_len, uint16_t param_len);
/**
* @description:
* @param {xcmder_t*} cmder
* @return
*/
void xcmd_destory(xcmder_t* cmder); void xcmd_destory(xcmder_t* cmder);
/**
* @description:
* @param {xcmder_t*} cmder
* @return {*}
*/
void xcmd_task(xcmder_t* cmder); void xcmd_task(xcmder_t* cmder);
/**
* @description:
* @param {xcmder_t*} cmder
* @param {xcmd_t*} cmds
* @param {uint16_t} number
* @return {int}
*/
int xcmd_register(xcmder_t* cmder, xcmd_t* cmds, uint16_t number); int xcmd_register(xcmder_t* cmder, xcmd_t* cmds, uint16_t number);
/**
* @description:
* @param {xcmder_t*} cmder
* @param {xcmd_key_t*} keys
* @param {uint16_t} number
* @return {int}
*/
int xcmd_key_register(xcmder_t* cmder, xcmd_key_t* keys, uint16_t number); int xcmd_key_register(xcmder_t* cmder, xcmd_key_t* keys, uint16_t number);
/**
* @description:
* @param {xcmder_t} cmder
* @param {char* } str
* @return {uint8_t}
*/
uint8_t xcmd_exec(xcmder_t *cmder, char *str); uint8_t xcmd_exec(xcmder_t *cmder, char *str);
/**
* @description:
* @param {xcmder_t *} cmder
* @param {char*} str
* @return
*/
void xcmd_print_str(xcmder_t * cmder, char* str); void xcmd_print_str(xcmder_t * cmder, char* str);
/**
* @description:
* @param {xcmder_t} *cmder
* @param {char} c
* @return
*/
void xcmd_display_insert_char(xcmder_t *cmder, char c); void xcmd_display_insert_char(xcmder_t *cmder, char c);
/**
* @description:
* @param {xcmder_t} *cmder
* @return
*/
void xcmd_display_delete_char(xcmder_t *cmder); void xcmd_display_delete_char(xcmder_t *cmder);
/**
* @description:
* @param {xcmder_t} *cmder
* @return
*/
void xcmd_display_clear(xcmder_t *cmder); void xcmd_display_clear(xcmder_t *cmder);
/**
* @description:
* @param {xcmder_t} *cmder
* @return {char*} *
*/
char* xcmd_display_get(xcmder_t *cmder); char* xcmd_display_get(xcmder_t *cmder);
/**
* @description:
* @param {xcmder_t} *cmder
* @return {uint16_t}
*/
uint16_t xcmd_history_len(xcmder_t *cmder); uint16_t xcmd_history_len(xcmder_t *cmder);
/**
* @description:
* @param {xcmder_t} *cmder
* @param {char*} str
* @return
*/
void xcmd_history_insert(xcmder_t *cmder, char* str); void xcmd_history_insert(xcmder_t *cmder, char* str);
/**
* @description:
* @param {xcmder_t*} cmder
* @return
*/
char *xcmd_history_next(xcmder_t* cmder); char *xcmd_history_next(xcmder_t* cmder);
/**
* @description:
* @param {xcmder_t*} cmder
* @return
*/
char *xcmd_history_prev(xcmder_t *cmder); char *xcmd_history_prev(xcmder_t *cmder);
/**
* @description:
* @param {xcmder_t*} cmder
* @return
*/
char *xcmd_history_current(xcmder_t *cmder); char *xcmd_history_current(xcmder_t *cmder);
/**
* @description:
* @param {xcmder_t*} cmder
* @return
*/
void xcmd_history_reset(xcmder_t *cmder); void xcmd_history_reset(xcmder_t *cmder);
#endif /*XCMD_H*/ #endif /*XCMD_H*/