/**
 * @file  hv_drv_TypecSrcLiteApp.h
 * @brief  Power Delivery Source Lite Application Header file
 *       This header file contains user application specific functions and interfaces
 * @details This file provides the following functions: \n
 *          (1) \n
 *          (2) \n
 *          (3) \n
 *
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2022-08-25
 * @copyright Copyright(c),2022-8, Hiview Software. All rights reserved.
 * @par History:
 * <table>
 * <tr><th>Author                         <th>Date         <th>Change Description
 * <tr><td>Hiview SoC Software Team       <td>2022-08-25   <td>init
 * </table>
*/


#ifndef _HV_DRV_TYPECSRCLITEAPP_H_
#define _HV_DRV_TYPECSRCLITEAPP_H_

/* ************************************************************************** */
/* ************************************************************************** */
/* Section: Included Files                                                    */
/* ************************************************************************** */
/* ************************************************************************** */
#include <hv_drv_TypecApiHook.h>
#include "hv_drv_TypecStdInc.h"

/* ************************************************************************** */
/* ************************************************************************** */
/* Section: Defines and constants                                                   */
/* ************************************************************************** */
/* ************************************************************************** */

// *****************************************************************************
// *****************************************************************************
// Section: Interface Functions
// *****************************************************************************
// *****************************************************************************
/**
 * @brief Handle PSF's events.
 * @param[in] u8PortNum  Typec port numbuer.
 * @param[in] u8PDEvent  PSF events notification. 
 * @return void
 */
UINT8 App_HandlePSFEvents(UINT8 u8PortNum, eHV_PSF_NOTIFICATION u8PDEvent);

/**
 * @brief Initialize all the GPIO functionality pins in application layer.
 * @param[in] u8PortNum  Typec port numbuer.
 * @param[in] eGPIOFunc  GPIO Functionality enum. 
 * @return void
 */
void App_GPIOControl_Init(UINT8 u8PortNum, eHV_PSF_GPIO_FUNCTIONALITY eGPIOFunc);

/**
 * @brief Drive GPIOs assigned to GPIO functionality pins in application layer.
 * @param[in] u8PortNum  Typec port numbuer.
 * @param[in] eGPIOFunc  GPIO Functionality enum.
 * @param[in] eGPIODrive  GPIO  Drive enum.
 * @return void
 */
void App_GPIOControl_Drive(UINT8 u8PortNum, eHV_PSF_GPIO_FUNCTIONALITY eGPIOFunc,
                                    eHV_PSF_GPIO_DRIVE_VAL eGPIODrive);

/**
 * @brief Initializes all the hardware modules related to port power functionality.
 * @param[in] u8PortNum  Typec port numbuer.
 * @return HV_TRUE: succeed HV_FALSE: failed
 */
UINT8 App_PortPowerInit(UINT8 u8PortNum); 


/**
 * @brief Set DP Hot plug.
 * @param[in] u8PortNum  Typec port numbuer.
 * @param[in] bHpdEn  Set DP HPD high(true) or low(false). 
 * @return void
 */
void App_AMESetDpHpd(UINT8 u8PortNum, BOOL bHpdEn);

/**
 * @brief Set DP IRQ Hot plug.
 * @param[in] u8PortNum  Typec port numbuer.
 * @return void
 */
void App_AMESetDpIrqHpd(UINT8 u8PortNum);

/**
 * @brief Get status that if in DP ALT Mode.
 * @param[in] u8PortNum  Typec port numbuer.
 * @return HV_TRUE: entered DP ALT Mode HV_FALSE: exited DP ALT Mode
 */
BOOL App_AMEGetStatus(UINT8 u8PortNum);

/**
 * @brief Get Typec source capabilities.
 * @param[in] u8PortNum  Typec port numbuer.
 * @param[out] u8pSrcPDOCnt  return pointer that points to the counts of src PDOs.
 * @param[out] pu32DataObj  return pointer that points to data object of src PDOs.
 * @return VOID
 */
void App_GetSourceCapabilities(UINT8 u8PortNum, UINT8 *u8pSrcPDOCnt, UINT32 *pu32DataObj);

#endif /* _PSFSOURCELITE_APP_H */

/* *****************************************************************************
 End of File
 */
