/**
 * @file hv_drv_EdpTx.h
 * @brief Header file of CAL EdpTx sturct.
 * 
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 * 
 * 
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2022-10-12
 */

#ifndef _HV_DRV_EDP_TX_H_
#define _HV_DRV_EDP_TX_H_

#include "Common/hv_comm_DataType.h"
#include "hv_comm_Define.h"
#include "hv_cal_KtxCommon.h"
#include "hv_comm_Define.h"

typedef struct _HvEdpTxAuxTransactionInfo
{
    UINT32      uwAuxAddr;
    UCHAR8      ucMsgFlag;
    UCHAR8      ucStrmFlag;
    UCHAR8      ucWrRdFlag;
    UCHAR8      ucDataLen;
    UCHAR8      ucData[16];
}HvEdpTxAuxTransactionInfo;

/**
 * @brief EdpTx fuction Enable.
 * @param[in] bEn TURE: open HV_FALSE: Closed.
 */
VOID Hv_Drv_EdpTx_Enable(BOOL bEn);

/**
 * @brief EdpTx training fuction.
 * @param[in] bEn TURE: open HV_FALSE: Closed.
 */
VOID Hv_Drv_EdpTx_Training(BOOL bEn);

/**
 * @brief EdpTx full training status.
 */
Status Hv_Drv_EdpTx_ReturnFullTrainingStatus(VOID);

/**
 * @brief EdpTx init for Middle to recall.
 */
VOID Hv_Drv_EdpTx_Init(const PanelParam *pstPanelParam);

/**
 * @brief EdpTx init for Middle to recall.
 */
static UINT32 EdpTxPreInit(const PanelParam *pstPanelParam);

/**
 * @brief set pwm frequence.
 */
VOID Hv_Drv_EdpTx_SetBackLightCLK(UINT32 uiClk);

/**
 * @brief Dimmer output pwm.
 */
VOID Hv_Drv_EdpTx_PullDimmer9(VOID);

/**
 * @brief EDP00 IRQ
 */
Status Hv_Drv_EdpTx_HpdIrqProc(EdpTxInterruptDefine *pstEdpTXInterruptDefine);

/**
 * @brief panel init.
 */
VOID HV_Drv_Panel_Init(PanelControl* pstPanelControl);

/**
 * @brief calc mvid and tu size.
 */
VOID Hv_Drv_EdpTx_SetEdpTxMvidTuSize(UINT32 uiEdpTuDataSize, UINT32 uiMvid);

/**
 * @brief CheckPanelExist.
 */
BOOL Hv_Drv_EdpTx_CheckPanelExist(VOID);

/**
 * @brief enable edp hpd irq.
 */
VOID Hv_Drv_EdpTx_SetEdpHpqIrqEnable(EdpHpdPortIndex enHpdPort);

/**
 * @brief disable edp hpd irq.
 */
VOID Hv_Drv_EdpTx_SetEdpHpqIrqDisable(EdpHpdPortIndex enHpdPort);

/**
 * @brief edp hpd irq init.
 */
VOID Hv_Drv_EdpTx_HpqIrqInit(VOID);

/**
 * @brief start send idle pattern.
 */
VOID Hv_Drv_EdpTx_SendIdlePatternEn(EdpTxPortIndex enEdpTxPort, BOOL bEn);

/**
 * @brief edp tx aux pn swap.
 */
VOID Hv_Drv_EdpTx_SetAuxPnSwap(EdpTxPortIndex enPort, BOOL bEn);

/**
 * @brief set edp tx tps1 done.
 */
VOID Hv_Drv_EdpTx_SetTps1Done(BOOL bDone);

/**
 * @brief set edp tx eq done
 */
VOID Hv_Drv_EdpTx_SetEqDone(BOOL bDone);
#endif
