/**
  *****************************************************************************
  * @file    cli_cmd_usbpd.h
  * @author  Solution Team
  * @version V1.00
  * @date    28-February-2023
  * @brief   USBPD CLI command definitions
  *****************************************************************************
  * @attention 
  *  Copyright (c) 2017 - 2023 Unicmicro Co., Ltd. 
  *  All Rights Reserved. 
  *****************************************************************************
  */


#ifndef __CLI_CMD_USBPD_H_
#define __CLI_CMD_USBPD_H_

#if USB_PD_MODULE_ENABLED

#include "libc.h"
#include "sys_pd_config.h"
#include "usbpd.h"


/** \name  USB PD sub-commands definitions
 * \{ 
 */
#define CLI_INCLUDE_PDINFO          1     ///< included PD information
#define CLI_INCLUDE_PDCFG           1     ///< included PD config
#define CLI_INCLUDE_PRS             1     ///< included power role swap
#define CLI_INCLUDE_DRS             1     ///< included data role swap
#define CLI_INCLUDE_VCS             VCONN_ENABLED     ///< included vconn swap
#define CLI_INCLUDE_GETSRC          1     ///< included get source capability
#define CLI_INCLUDE_GETSNK          1     ///< included get sink capability
#define CLI_INCLUDE_GOTOMIN         1     ///< included goto min
#define CLI_INCLUDE_NEWPWR          1     ///< included new power level request
#define CLI_INCLUDE_HRST            1     ///< included hard reset
#define CLI_INCLUDE_CBL_RST         1     ///< included cable reset
#define CLI_INCLUDE_SRST            1     ///< included soft reset
#define CLI_INCLUDE_MSG             1     ///< included message send
#define CLI_INCLUDE_EXT             1     ///< included extended message send
/** \} */


/** Cable type definition */
extern const char * const g_cli_sys_cfg_cbl_type[CABLE_TYPE_END];

/** Product type definition */
extern const char * const g_cli_sys_cfg_prod_type[UPD_PRODUCT_END];
extern const char * const g_cli_sys_cfg_cbl_prod_type[UPD_CBL_PROD_END];
extern const char * const g_cli_sys_cfg_dfp_prod_type[UPD_DFP_PROD_END];

/** System role definition */
extern const char * const g_cli_sys_cfg_sys_role[PD_ROLE_END];

/** Default power role */
extern const char * const g_cli_sys_cfg_def_pr[POWER_ROLE_END];

/** Default data role */
extern const char * const g_cli_sys_cfg_def_dr[USB_DATA_ROLE_END];

/** QC Version */
extern const char * const g_cli_qc_ver_str[4];

/* Command definitions */
#if CLI_INCLUDE_PDINFO
void cli_cmd_pdinfo(void);
#else
#define cli_cmd_pdinfo()
#endif


#if CLI_INCLUDE_MSG
int cli_cmd_msg(int argc, char *argv[]);
#endif


/** \brief USB PD commands initialization
 *
 */
void cli_cmd_usbpd_init();

#endif

#endif /* #ifndef __CLI_CMD_USBPD_H_ */

