/**
 * @file hv_drv_Demura.h
 * @brief Header file of TX-demura module.
 *
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 *
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.0
 * @date 2022-04-17
 */

#ifndef _HV_DRV_DEMURA_H_
#define _HV_DRV_DEMURA_H_

#include "hv_comm_DataType.h"

typedef struct _DemuraInitParams
{
    UCHAR8          ucColorMode;        /*0-mono, 1-rgb*/
    UCHAR8          ucLayerNum;         /*Layer number*/
    UCHAR8          ucBlkXBit;          /*HblockSize bit num*/
    UCHAR8          ucBlkYBit;          /*VblockSize bit num*/
    USHORT16        usHact;             /*Hactive from panel*/
    USHORT16        usVact;             /*Vactive from panel*/
    USHORT16        usBlackLimit;       /*Low gray level limit*/
    USHORT16        usWhiteLimit;       /*High gray level limit*/
    USHORT16        ausBound[9];        /*9-gray level div maxnum*/
    USHORT16        ausStrengthGain[3]; /*low/middle/high strength gain*/
    UINT32          uiDDRAddr;
    const UINT32    *puiDemuraLut;
    UINT32          uiLutLen;
} DemuraInitParams;

/**
 * @brief Demura module init
 * @param[in] pstDemuraInitParam Pointer to demura init params structure.
 * @return None
 */
VOID Hv_Drv_Demura_Init(DemuraInitParams *pstDemuraInitParam);

/**
 * @brief Demura function enable control.
 * @param[in] bEn HV_TRUE-Enable, HV_FALSE-Disable
 * @return None
 */
VOID Hv_Drv_Demura_Enable(BOOL bEn);


/**
 * @brief Demura使能CRC控制
 * @param[in] bEn 控制标志：HV_TRUE-Enable, HV_FALSE-Disable
 * @return None
 */

VOID Hv_Drv_Demura_EnableCRC(BOOL bEn);

/**
 * @brief Get demura crc flag
 * @return crc fail flag
 */
UCHAR8 Hv_Drv_Demura_GetCRCFlag(VOID);

/**
 * @brief set demura strengh gain low/high threold
 * @param[in] uiLowGain-low strenth gain thr, uiHighGain-high strenth gain thr
 * @return None
 */
VOID Hv_Drv_Demura_SetStrengthGainThr(UINT32 uiLowGain, UINT32 uiHighGain);

/**
 * @brief Set demura strengh gain size
 * @param[in] uiStrGain Value of gain
 * @return None
 */
VOID Hv_Drv_Demura_SetStrengthGain(UINT32 uiStrGain);

/**
 * @brief Get demura strengh gain size
 * @return strengh gain
 */
UINT32 Hv_Drv_Demura_GetStrengthGain(VOID);
#endif
