/******************************************************************************/ /** @addtogroup BIN_Header_Parser * @{ ******************************************************************************/ /******************************************************************************/ /** * * @file bhp_api.h * * @brief This file specifies the APIs provided to BIN header Parser * related software components * * @note This design will use caller's thread to process all functions. * All APIS are blocking APIs. * * @note Copyright (c) 2010 Sunplus Technology Co., Ltd. \n * All rights reserved. * * @author * ******************************************************************************/ #ifndef _BHP_API_H #define _BHP_API_H /*=======================================================================*/ /* I N C L U D E S */ /*=======================================================================*/ /*=======================================================================*/ /* G L O B A L D A T A D E C L A R A T I O N S */ /*=======================================================================*/ typedef enum { eBHP_READ_DIRECTLY, /*!< directly read from target address */ eBHP_READ_BY_SPI, /*!< read from SPI driver API */ eBHP_READ_MAX /*!< Max number*/ } BHP_READ_MODE_t; typedef enum { eSUCCESS, /*!< successful outcome */ eERR_FAILURE, /*!< operation failed */ eERR_INVALID_PARAM, /*!< invalid parameter */ eERR_INIT_FAIL, /*!< init fail, can't process other APIs */ eERR_MEM_FREE_FAIL, /*!< fail to free memory */ eERR_MEM_ALLOC_FAIL, /*!< fail to allocate memory */ eWAR_NO_ACTION, /*!< the function completed successfully,*/ eERR_MAX /*!< Max error number*/ } BHP_Status_t; typedef enum { eBHP_PQFUNENABLE = 0x00, /*!< PQ function enable */ eBHP_DEVBLOCKING = 0x01, /*!< DRV_ImgDeVBlocking_t */ eBHP_DEHBLOCKING = 0x02, /*!< DRV_ImgDeHBlocking_t */ eBHP_DERING = 0x03, /*!< DRV_ImgDeRing_t */ eBHP_MOSQUITO = 0x04, /*!< DRV_ImgTNR_t */ eBHP_TPI_SNR = 0x05, /*!< DRV_ImgTPISNR_t */ eBHP_TNR = 0x06, /*!< DRV_ImgTNR_t */ eBHP_SNR = 0x07, /*!< DRV_Img2DNR_t */ eBHP_TPIOVERSHOOT = 0x08, /*!< DRV_ImgTNR_t */ eBHP_TPI_SNR_REGION = 0x09, /*!< DRV_ImgTPISNRRegion_t*/ eBHP_PREDCTI = 0x10, /*!< DRV_ImgDCTI_t */ eBHP_POSTDCTI = 0x11, /*!< DRV_ImgDCTI_t */ eBHP_DLTI = 0x12, /*!< DRV_ImgDLTI_t */ eBHP_HPEAKING = 0x13, /*!< DRV_ImgHPeaking_t */ eBHP_DEOVERSHOOT = 0x14, /*!< DRV_ImgVPeaking_t */ eBHP_FCA_PARAM = 0x15, /*!< wTable //FCATable */ eBHP_FCA = 0x16, /*!< DRV_ImgFCAParam_t */ eBHP_FCA_COEF = 0x17, /*!< DRV_ImgFCACoef_t */ eBHP_DLC = 0x20, /*!< DRV_ImgDLCM0_t */ eBHP_DSC = 0x21, /*!< DRV_ImgDLCM0_t */ eBHP_SOFT_CLIP = 0x22, /*!< DRV_ImgSoftClip_t */ eBHP_UVOFFSET = 0x23, /*!< DRV_ImgUVOffset_t */ eBHP_UVEXTENSION = 0x24, /*!< DRV_ImgUVExtension_t */ eBHP_COLOR_MATRIX = 0x25, /*!< ColorMatrix_t */ eBHP_COLOR_TEMP = 0x26, /*!< ColorTemp_t */ eBHP_CSC = 0x27, /*!< DRV_ImgCSC_t */ eBHP_GAMMA = 0x28, /*!< bTable //GammaTable */ eBHP_Deint = 0x30, /*!< */ eBHP_GAMUT = 0x41, /*!< Gamut Table */ eBHP_TDDG_PARAM = 0x42, /*!< TDDG parameter */ eBHP_TDDG_DEPTH = 0x43, /*!< TDDG depth */ eBHP_TDR_TABLE = 0x44, /*!< TDR table //TDDG */ eBHP_TDR_PARAM = 0x45, /*!< TDR parameter */ eBHP_SRC_TYPE = 0x80, /*!< ImgSrcTypeForTool */ eBHP_PQ_FUNC = 0x81, /*!< ImgPQFunctionTableForTool */ eBHP_PANEL_FUNC = 0x82, /*!< ImgPanelFunctionTableForTool*/ eBHP_PQ_FUNC_IDX = 0x83, /*!< gImgPQFuncIdxTable */ eBHP_PQ_LEVEL_CNT = 0x84, /*!< gImgPQFuncLevelIdx */ eBHP_PQ_BININFO = 0x85, /*!< gImgPanelFuncIdxTable */ eBHP_BIN_HEADER = 0xFF /*!< BIN header */ } BHP_PQTabId_t; //2011/03/30, Added by AnsonLiu, for New Panel Adjuster Tool, Begin typedef enum { eBHP_PANEL_DisplayType = 0x00, /*!< DisplayType */ eBHP_PANEL_DisplayInfo = 0x01, /*!< DisplayInfo */ eBHP_PANEL_PixelClock = 0x02, /*!< PixelClock */ eBHP_PANEL_SyncSetting = 0x03, /*!< SyncSetting */ eBHP_PANEL_LVDSSignal = 0x04, /*!< LVDSSignal */ eBHP_PANEL_LVDSConverter = 0x05, /*!< LVDSConverter */ eBHP_PANEL_PowerSequency = 0x06, /*!< PowerSequency */ eBHP_PANEL_BackLight = 0x07, /*!< BackLight */ eBHP_PANEL_BinInfo = 0x85, /*!< BinInfo */ eBHP_PANEL_BIN_HEADER = 0xFF /*!< BIN header */ } BHP_PanelTabId_t; //2011/03/30, Added by AnsonLiu, for New Panel Adjuster Tool, End //2011/11/08, Added by JasonLee, for Audio Tool, Begin typedef enum { eBHP_AQ_BassTable = 0x00, eBHP_AQ_TrebleTable = 0x01, eBHP_AQ_BalanceTable = 0x02, eBHP_AQ_MasterVolumeTable = 0x03, eBHP_AQ_AUX1VolumeTable = 0x04, eBHP_AQ_AUX2VolumeTable = 0x05, eBHP_AQ_SoundMode = 0x06, eBHP_AQ_SUNSUR = 0x07, eBHP_AQ_SRSTSHD = 0x08, eBHP_AQ_MasterVolumeOffset = 0x09, eBHP_AQ_AUX1VolumeOffset = 0x0a, eBHP_AQ_AUX2VolumeOffset = 0x0b, eBHP_AQ_TableScale = 0x0c, eBHP_AQ_AVLSetting = 0x0d, eBHP_AQ_ClipManagement = 0x0e, eBHP_AQ_SoundModeName = 0x0f, eBHP_AQ_SourceName = 0x10, eBHP_AQ_HPVolumeTable = 0x11, eBHP_AQ_BinVersion = 0xFE, eBHP_AQ_BIN_HEADER = 0xFF /*!< BIN header */ } BHP_AudioTabId_t; //2011/11/08, Added by JasonLee, for Audio Tool, End typedef enum { eBHP_LOGO_PIC_BS = 0x00, eBHP_LOGO_PIC_BSSize = 0x01, eBHP_LOGO_BIN_HEADER = 0xFF /*!< BIN header */ } BHP_LogoTabId_t; /*=======================================================================*/ /* F U N C T I O N S */ /*=======================================================================*/ /*! @addtogroup BHP_global * @brief initial related * @{ */ /*! * @brief config BIN header module * @param bMode : [in] eBHP_READ_DIRECTLY - directly read from target address * eBHP_READ_BY_SPI - read from SPI driver API * @retval eSUCCESS : successful * @note This API MUST be called before BHP_Init. */ BHP_Status_t BHP_Config(BHP_READ_MODE_t bMode); /*! * @brief initial BIN header parser * @param BinId 0 for PQ, 1 for Panel * @param pbDefaultBinNum : [in] set up default BIN num. if this is NULL, then default Num is 0. * @param pbStringPattern : [in] set up search pattern, ex: 0xFE 'I' 'M' 'G' * @param pdwRomEndAddr : [in] end address of ROM code. if this is NULL, then pass it. * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_Init(UINT8 bBinId, UINT8 *pbDefaultBinNum, UINT8 *pbStringPattern, UINT32 *pdwRomEndAddr); /*! * @brief un-initial BIN header parser * reserved API for internal memory release * @param BinId 0 for PQ, 1 for Panel * @retval eSUCCESS : successful * @note do nothing for current version */ BHP_Status_t BHP_Uninit(UINT8 BinId); /*! @} end of addtogroup BHP_global */ /*! @addtogroup BHP_Core * @brief initial related * @{ */ /*! @} end of addtogroup BHP_Core */ /*! * @brief Get total BIN count * @param BinId 0 for PQ, 1 for Panel * @param pbCnt total number of BIN * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_GetTotalBinNum(UINT8 bBinId, UINT8 *pbCnt); /*! * @brief Set current BIN index * @param BinId 0 for PQ, 1 for Panel * @param bCnt index of BIN * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_SetCurrentBinNum(UINT8 bBinId, UINT8 bCnt); /*! * @brief Get current BIN index * @param BinId 0 for PQ, 1 for Panel * @param pbCnt [out] index of BIN * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_GetCurrentBinNum(UINT8 bBinId, UINT8 *pbCnt); /*! * @brief Get start address of target table by table ID * @param BinId 0 for PQ, 1 for Panel * @param bId table ID * @param pdwAddr [out] table address * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_GetTabStartAddress(UINT8 bBinId, UINT8 bId, UINT32 *pdwAddr); /*! * @brief Get the current version of target table * @param BinId 0 for PQ, 1 for Panel * @param bId table ID * @param pwVersion [out] table version * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_GetTabVersion(UINT8 bBinId, UINT8 bID, UINT16 *pwVersion); /*! * @brief Dump BIN internal information by UART * @param BinId 0 for PQ, 1 for Panel * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_DumpInfo(UINT8 BinId); /*! * @brief get BIN information * @param bBinId : [in] BHP_PQTabId_t * @param StartAddr : [out] start address * @param BinSize : [out] size of BIN * @retval eSUCCESS : successful */ BHP_Status_t BHPGetBinUpdateInfo(UINT8 bBinId, UINT32* StartAddr, UINT32* BinSize); BHP_Status_t BHP_GetCurrentBinSize(UINT8 bBinId, UINT32 *pdwSize); BHP_Status_t _BHPGetPQBinTab(BHP_PQTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr); BHP_Status_t _BHPGetTabLength(UINT8 bBinId, BHP_PQTabId_t bId, UINT32 *pdwLength); BHP_Status_t _BHPGtePQBinTab(BHP_PQTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr); BHP_Status_t _BHPGtePAENLBinTab(BHP_PanelTabId_t bId,UINT8 bIndex, void *pdwAddr);//2011/03/30, Added by AnsonLiu, for New Panel Adjuster Tool BHP_Status_t BHPGetPQBinUpdateInfo(UINT32* StartAddr, UINT32* BinSize); BHP_Status_t BHPGetPanelBinUpdateInfo(UINT32* StartAddr, UINT32* BinSize); BHP_Status_t _BHPGetAudioBinTab(BHP_AudioTabId_t bId,UINT8 bIndex,void *pdwAddr); BHP_Status_t BHP_InitMultipanel(UINT8 bBinId, UINT8 *pbDefaultBinNum, UINT8 *pbStringPattern, UINT32 *pdwRomEndAddr); BHP_Status_t BHP_GetTabStartAddressMultiPanel(UINT8 bBinId, UINT8 bId, UINT32 *pdwAddr); BHP_Status_t _BHPGtePQBinTabPQVersion(BHP_PQTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr,UINT32 *bLength); BHP_Status_t _BHPGtePAENLBinTabPanelName(BHP_PanelTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr,UINT32 *bLength); /*! * @brief GetBinStartAddr * @param BinId 0 for PQ, 1 for Panel * @param pbDefaultBinNum : [in] set up default BIN num. if this is NULL, then default Num is 0. * @param pbStringPattern : [in] set up search pattern, ex: 0xFE 'I' 'M' 'G' * @param pdwRomEndAddr : [in] end address of ROM code. if this is NULL, then pass it. * @retval eSUCCESS : successful * @retval eERR_INVALID_PARAM : interface or type is not recognized * @retval eERR_FAILURE : can't find the target string pattern */ BHP_Status_t BHP_GetBinStartAddr(UINT8 bBinId, UINT8 *pbDefaultBinNum, UINT8 *pbStringPattern, UINT32 *pdwRomEndAddr); #endif /* _BHP_API_H */ /*! @} end of addtogroup BIN_Header_Parser */