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

#ifndef _HV_DRV_GAMMA_H_
#define _HV_DRV_GAMMA_H_

#include "hv_comm_DataType.h"


/**
 * @brief GAMMA LUT表的访问模式
 */
typedef enum _GammaMode
{
    GAMMA_RGB   = 0,
    GAMMA_SYNC  = 1,
    GAMMA_MODE_MAX
} GammaMode;


/**
 * @brief GAMMA base Configuration Structure definition
 */
typedef struct _HvDrvGammaParams
{
    GammaMode       enGammaMod;
    GammaMode       enGammaVrrMod;
    BOOL            bGammaVrrEn;
    UINT32          *puiGammaLutAddr;
    const UINT32    *puiGammaVrrLutAddr;
}HvDrvGammaInitParams;


/**
 * @brief 写Gamma LUT.
 * @param[in] puiData lut数据
 * @param[in] u8Mode 访问lut的模式，0-单独的RGB访问，1-SYNC模式
 * @return None
 */
VOID Hv_Drv_Gamma_WriteLut(const UINT32 *puiData, GammaMode enMode);

/**
 * @brief 写Gamma VRR LUT.
 * @param[in] puiData lut数据
 * @param[in] enMode 访问lut的模式，0-单独的RGB访问，1-SYNC模式
 * @return None
 */
VOID Hv_Drv_GammaVrr_WriteLut(const UINT32 *puiData, GammaMode enMode);

/**
 * @brief Gamma使能控制.
 * @param[in] bGammaEn 控制标志，HV_TRUE-enable gamma，HV_FALSE-disable gamma
 * @return None
 */
VOID Hv_Drv_Gamma_Enable(BOOL bGammaEn);

/**
 * @brief Gamma VRR使能控制.
 * @param[in] bGammaEn 控制标志，HV_TRUE-enable gamma vrr，HV_FALSE-disable gamma vrr
 * @return None
 */
VOID Hv_Drv_GammaVrr_Enable(BOOL bGammaVrrEn);

/**
 * @brief Gamma 初始化，包括寄存器设定和lut表载入.
 * @param[in] pstGammaPara point to gamma init params structure
 * @return None
 */
VOID Hv_Drv_Gamma_Init(HvDrvGammaInitParams *pstGammaPara);

VOID Hv_Drv_Gamma_SetLevel(UCHAR8 level);
VOID Hv_Drv_GammaDeCompress(UCHAR8 *aucInput, UINT32 *auiGammaOut);

VOID Hv_Drv_Gamma_WriteUnit(UINT32 uiRow, UINT32 uiCol, UINT32 uiCellData);


VOID Hv_Drv_Gamma_ReadLut(UINT32 *puiData, GammaMode enMode);

#endif
