/**
 * @file hv_cal_Bcon_Driver.h
 * @brief Header file of bcon cal module.
 * 
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 * 
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2023-04-17
 */

#ifndef __HV_CAL_BCON__
#define __HV_CAL_BCON__

#include "hv_vos_Comm.h"

#define BCON_RAM_START_ADDR          0x80000000
#define REG_BCON_RAM_DATA_OFFSET     0x1104FF00
#define REG_BCON_RAM_DATA_ENTRY      0x1104FF04
#define MAX_LANE_NUM                 (24)

VOID Hv_Cal_Bcon_SetClkRst(VOID);

VOID Hv_Cal_Bcon_SetLaneEn(UINT32 uiLane);

VOID Hv_Cal_Bcon_SetLaneTxInitEn(UINT32 uiLane);

VOID Hv_Cal_Bcon_LaneSwRst(UINT32 uiLane);

VOID Hv_Cal_Bcon_SetFreq(UINT32 uiFreq);
VOID Hv_Cal_Bcon_SetFreqT1(UINT32 uiFreq1);
VOID Hv_Cal_Bcon_SetFreqT2(UINT32 uiFreq2);
VOID Hv_Cal_Bcon_SetFreqT3(UINT32 uiFreq3);

VOID Hv_Cal_Bcon_SwStart(UINT32 uiLane);
VOID Hv_Cal_Bcon_StartSel(UINT32 uiLane);
VOID Hv_Cal_Bcon_VsyncSel(UINT32 uiSel);
VOID Hv_Cal_Bcon_SetEncode(UINT32 uiLane);
VOID Hv_Cal_Bcon_SetVendor(UINT32 uiVendor);
VOID Hv_Cal_Bcon_SetHYEncode(UINT32 uiEncode);


VOID Hv_Cal_Bcon_OeEnable(UINT32 uiLane);

UCHAR8 Hv_Cal_Bcon_GetBusy(VOID);

VOID Hv_Cal_Bcon_SetXXMsb(UINT32 uiMsb);
VOID Hv_Cal_Bcon_SetXXPackLen(UINT32 uiLen);
VOID Hv_Cal_Bcon_XXSetSinMux(UINT32 uiMux);
VOID Hv_Cal_Bcon_SetXSinEnable(UINT32 uiLane);
VOID Hv_Cal_Bcon_SetOeEnable(UINT32 uiLane);
VOID Hv_Cal_Bcon_SetXXResetMode(UINT32 uiMode);
VOID Hv_Cal_Bcon_SetXXWaitNum(UINT32 uiWait);
VOID Hv_Cal_Bcon_SetTxSinEn(UINT32 uiEn);
VOID Hv_Cal_Bcon_SetSinEn(UINT32 uiEn);

VOID Hv_Cal_Bcon_SetLut(UINT32 uiLut);

UCHAR8 Hv_Cal_Bcon_GetSramIndex(VOID);

VOID Hv_Cal_Bcon_SetSramIndex(UINT32 uiIndex);

VOID Hv_Cal_Bcon_SetSramAddr(UINT32 uiAddr);

VOID Hv_Cal_Bcon_SramWrite(UINT32 uiData);

UINT32 Hv_Cal_Bcon_ReadSram(VOID);

VOID Hv_Cal_Bcon_SetLane0SingleCmDWidth(UINT32 uiVal);

VOID Hv_Cal_Bcon_SetLane0SingleCmDLength(UINT32 uiLength);

VOID Hv_Cal_Bcon_SetLane0SingleCmDMode(UINT32 uiMode);

VOID Hv_Cal_Bcon_SetLane0SingleDataLength(UINT32 uiLength);
VOID Hv_Cal_Bcon_SetLane0SingleDataWidth(UINT32 uiVal);


VOID Hv_Cal_Bcon_SetLaneRamOffset(UCHAR8 uiLaneIndex, UINT32 offset);
VOID Hv_Cal_Bcon_SetLaneStride(UCHAR8 uiLaneIndex, UINT32 stride);
VOID Hv_Cal_Bcon_SetBufSize(UINT32 uiLane, UINT32 uiSize);

#endif
