/**
 * \file    sys_pd_config.h
 * \brief   PD configuration header file
 *
 * \par     Copyright (c) 2018 UWE Technologies Corp., Ltd. All Rights Reserved.
 * \author  James
 * \date    2018-07-30
 * \version 
 * 
 * \history 
 *  Date        Note
 *  2018-07-30  Original Creation
 * 
 */
 
#ifndef __SYS_PD_CONFIG_H_
#define __SYS_PD_CONFIG_H_

#include "arch.h"
#include "libc.h"
#include "usbpd.h"
#include "sys_defs.h"
#include "sys_config.h"
#include "usbpd_config.h"

/** \brief Loading PD configuration from flash, need to be called in system init
 *
 */
void sys_pd_cfg_load(void);


/**
 * Configure source power profile and vendor defined USB informaiton
 *
 * \param index         Source fixed supply power profile index
 */
void sys_pd_cfg_src_power_profile_set(u32_t index);

/**
 * Configure sink power profile and vendor defined USB informaiton
 *
 * \param index         Sink operating power profile index
 */
void sys_pd_cfg_snk_operating_power_profile_set(u32_t index);

/**
 * Get source fixed power index by voltage
 *
 * \param voltage       Input voltage, unit is mV
 */
u32_t sys_pd_cfg_src_fixed_power_profile_index_get(u32_t voltage);

/**
 * On system debug level change hook
 *
 * \param level       Input debug level, see SYS_DEBUG_LEVEL_t
 */
void sys_cfg_dbg_onchange(u32_t level);
/**
 * Configure sink power profile and vendor defined USB informaiton
 *
 * \param index         Sink operating epr power profile index
 */
void sys_pd_cfg_snk_epr_operating_power_profile_set(u32_t index);


#endif /* #ifndef __SYS_PD_CONFIG_H_ */

