/**
 * @file hv_cal_KtxCommon.h
 * @brief Header file of CAL KtxCommon sturct.
 * 
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 * 
 * 
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2022-08-29
 */

#ifndef _HV_CAL_KTX_COMMON_H_
#define _HV_CAL_KTX_COMMON_H_
#include "hv_comm_DataType.h"

/**
 * @brief KTX Post Param.
 * @details 设置E1 - KTX_POST_TOP页寄存器所用到的参数
 * 
 */
typedef struct _HvKtxPostTopCfgParam
{
    UCHAR8       ucPortNum;
    UCHAR8       ucPairNum;
    UCHAR8       ucDoublescanEn;
    UCHAR8       ucDegenUseInPreDe;
    UCHAR8       ucDualgateEn;
    UCHAR8       ucTrigateEn;
    UCHAR8       ucDegenUse1stLine;
    UCHAR8       ucDePreNum;
    UCHAR8       ucDeOutDly;
    UCHAR8       ucMppHBackPorch;
    UCHAR8       ucDePreDummyMode;
    UCHAR8       ucDePostDummyMode;
    UCHAR8       ucDePreDummyNum;
    USHORT16     usDePostDummyNum;
    UCHAR8       ucRamEnable;
    USHORT16     usMppHAct;
    USHORT16     usMppVAct;
    USHORT16     usWram1stStartAddr;
    USHORT16     usWram2ndStartAddr;
    USHORT16     usWram3rdStartAddr;
    UCHAR8       ucDsMapEn;
    UINT32       uiLnPixelSwap;
    USHORT16     usInVAct;
    USHORT16     usRRamAddrShift[32];
    UCHAR8       ucLaneIndex[32];
    UCHAR8       ucRamReverse[32];
    UCHAR8       ucOutDataMode;
    USHORT16     usHsFilter;
}HvKtxPostTopCfgParam;

/**
 * @brief KTX PIF Param.
 * @details 设置E0 - PIF_TX_TOP页寄存器所用到的参数
 * 
 */
typedef struct _HvKtxPIFCfgParam
{
    USHORT16         usPacketLen;
    USHORT16         usPacketVld;
    UINT32           uiMinSta;
    UINT32           uiPixPerLane;
    USHORT16         usTxMinHTotal;

    UINT32           uiPtgHsDly;
    UCHAR8           ucPifInAfifoSizeMode;
    UCHAR8           ucTxgrp0PhyModeSel;
    USHORT16         usPifTg0PacketDhDenSta;
    USHORT16         usPifTg0PacketDhDenEnd;
    USHORT16         usPifTg0PacketDvDenSta;
    USHORT16         usPifTg0PacketDvDenEnd;
    UCHAR8           ucTxgrp00PifConvMode;
    UCHAR8           ucTxgrp00PifTxW2rDly;

    UINT32           uiPifTg0PktDoubleBufferTimer;
    UCHAR8           ucTxgrp00DclkDivNum;
}HvKtxPIFCfgParam;

/**
 * @brief KTX PLL Param.
 * @details 设置F0 - COMBOTX_PHY_0页寄存器所用到的参数
 * 
 */
typedef struct _HvKtxPllCfgParam
{
    UCHAR8          ucTxPllPreDiv;
    USHORT16        usTxPllFbdivInt;
    USHORT16        usTxPllFbdivFrac;
    USHORT16        usTxPllPostDiv0;
    USHORT16        usTxPllPostDiv1;
    USHORT16        usTxPllPostDiv2;
    UCHAR8          ucTxPllPostDiv0Div2;
    UCHAR8          ucTxPllPifDiv;
    UCHAR8          ucTxPllRdDiv;
    UCHAR8          ucTxPllPostDivLvds;
    UCHAR8          ucTxPllClklvdsEn;
}HvKtxPllCfgParam;

#endif
