bhp_api.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. /******************************************************************************/
  2. /** @addtogroup BIN_Header_Parser
  3. * @{
  4. ******************************************************************************/
  5. /******************************************************************************/
  6. /**
  7. *
  8. * @file bhp_api.h
  9. *
  10. * @brief This file specifies the APIs provided to BIN header Parser
  11. * related software components
  12. *
  13. * @note This design will use caller's thread to process all functions.
  14. * All APIS are blocking APIs.
  15. *
  16. * @note Copyright (c) 2010 Sunplus Technology Co., Ltd. \n
  17. * All rights reserved.
  18. *
  19. * @author
  20. *
  21. ******************************************************************************/
  22. #ifndef _BHP_API_H
  23. #define _BHP_API_H
  24. /*=======================================================================*/
  25. /* I N C L U D E S */
  26. /*=======================================================================*/
  27. /*=======================================================================*/
  28. /* G L O B A L D A T A D E C L A R A T I O N S */
  29. /*=======================================================================*/
  30. typedef enum
  31. {
  32. eBHP_READ_DIRECTLY, /*!< directly read from target address */
  33. eBHP_READ_BY_SPI, /*!< read from SPI driver API */
  34. eBHP_READ_MAX /*!< Max number*/
  35. } BHP_READ_MODE_t;
  36. typedef enum
  37. {
  38. eSUCCESS, /*!< successful outcome */
  39. eERR_FAILURE, /*!< operation failed */
  40. eERR_INVALID_PARAM, /*!< invalid parameter */
  41. eERR_INIT_FAIL, /*!< init fail, can't process other APIs */
  42. eERR_MEM_FREE_FAIL, /*!< fail to free memory */
  43. eERR_MEM_ALLOC_FAIL, /*!< fail to allocate memory */
  44. eWAR_NO_ACTION, /*!< the function completed successfully,*/
  45. eERR_MAX /*!< Max error number*/
  46. } BHP_Status_t;
  47. typedef enum
  48. {
  49. eBHP_PQFUNENABLE = 0x00, /*!< PQ function enable */
  50. eBHP_DEVBLOCKING = 0x01, /*!< DRV_ImgDeVBlocking_t */
  51. eBHP_DEHBLOCKING = 0x02, /*!< DRV_ImgDeHBlocking_t */
  52. eBHP_DERING = 0x03, /*!< DRV_ImgDeRing_t */
  53. eBHP_MOSQUITO = 0x04, /*!< DRV_ImgTNR_t */
  54. eBHP_TPI_SNR = 0x05, /*!< DRV_ImgTPISNR_t */
  55. eBHP_TNR = 0x06, /*!< DRV_ImgTNR_t */
  56. eBHP_SNR = 0x07, /*!< DRV_Img2DNR_t */
  57. eBHP_TPIOVERSHOOT = 0x08, /*!< DRV_ImgTNR_t */
  58. eBHP_TPI_SNR_REGION = 0x09, /*!< DRV_ImgTPISNRRegion_t*/
  59. eBHP_PREDCTI = 0x10, /*!< DRV_ImgDCTI_t */
  60. eBHP_POSTDCTI = 0x11, /*!< DRV_ImgDCTI_t */
  61. eBHP_DLTI = 0x12, /*!< DRV_ImgDLTI_t */
  62. eBHP_HPEAKING = 0x13, /*!< DRV_ImgHPeaking_t */
  63. eBHP_DEOVERSHOOT = 0x14, /*!< DRV_ImgVPeaking_t */
  64. eBHP_FCA_PARAM = 0x15, /*!< wTable //FCATable */
  65. eBHP_FCA = 0x16, /*!< DRV_ImgFCAParam_t */
  66. eBHP_FCA_COEF = 0x17, /*!< DRV_ImgFCACoef_t */
  67. eBHP_DLC = 0x20, /*!< DRV_ImgDLCM0_t */
  68. eBHP_DSC = 0x21, /*!< DRV_ImgDLCM0_t */
  69. eBHP_SOFT_CLIP = 0x22, /*!< DRV_ImgSoftClip_t */
  70. eBHP_UVOFFSET = 0x23, /*!< DRV_ImgUVOffset_t */
  71. eBHP_UVEXTENSION = 0x24, /*!< DRV_ImgUVExtension_t */
  72. eBHP_COLOR_MATRIX = 0x25, /*!< ColorMatrix_t */
  73. eBHP_COLOR_TEMP = 0x26, /*!< ColorTemp_t */
  74. eBHP_CSC = 0x27, /*!< DRV_ImgCSC_t */
  75. eBHP_GAMMA = 0x28, /*!< bTable //GammaTable */
  76. eBHP_Deint = 0x30, /*!< */
  77. eBHP_GAMUT = 0x41, /*!< Gamut Table */
  78. eBHP_TDDG_PARAM = 0x42, /*!< TDDG parameter */
  79. eBHP_TDDG_DEPTH = 0x43, /*!< TDDG depth */
  80. eBHP_TDR_TABLE = 0x44, /*!< TDR table //TDDG */
  81. eBHP_TDR_PARAM = 0x45, /*!< TDR parameter */
  82. eBHP_SRC_TYPE = 0x80, /*!< ImgSrcTypeForTool */
  83. eBHP_PQ_FUNC = 0x81, /*!< ImgPQFunctionTableForTool */
  84. eBHP_PANEL_FUNC = 0x82, /*!< ImgPanelFunctionTableForTool*/
  85. eBHP_PQ_FUNC_IDX = 0x83, /*!< gImgPQFuncIdxTable */
  86. eBHP_PQ_LEVEL_CNT = 0x84, /*!< gImgPQFuncLevelIdx */
  87. eBHP_PQ_BININFO = 0x85, /*!< gImgPanelFuncIdxTable */
  88. eBHP_BIN_HEADER = 0xFF /*!< BIN header */
  89. } BHP_PQTabId_t;
  90. //2011/03/30, Added by AnsonLiu, for New Panel Adjuster Tool, Begin
  91. typedef enum
  92. {
  93. eBHP_PANEL_DisplayType = 0x00, /*!< DisplayType */
  94. eBHP_PANEL_DisplayInfo = 0x01, /*!< DisplayInfo */
  95. eBHP_PANEL_PixelClock = 0x02, /*!< PixelClock */
  96. eBHP_PANEL_SyncSetting = 0x03, /*!< SyncSetting */
  97. eBHP_PANEL_LVDSSignal = 0x04, /*!< LVDSSignal */
  98. eBHP_PANEL_LVDSConverter = 0x05, /*!< LVDSConverter */
  99. eBHP_PANEL_PowerSequency = 0x06, /*!< PowerSequency */
  100. eBHP_PANEL_BackLight = 0x07, /*!< BackLight */
  101. eBHP_PANEL_BinInfo = 0x85, /*!< BinInfo */
  102. eBHP_PANEL_BIN_HEADER = 0xFF /*!< BIN header */
  103. } BHP_PanelTabId_t;
  104. //2011/03/30, Added by AnsonLiu, for New Panel Adjuster Tool, End
  105. //2011/11/08, Added by JasonLee, for Audio Tool, Begin
  106. typedef enum
  107. {
  108. eBHP_AQ_BassTable = 0x00,
  109. eBHP_AQ_TrebleTable = 0x01,
  110. eBHP_AQ_BalanceTable = 0x02,
  111. eBHP_AQ_MasterVolumeTable = 0x03,
  112. eBHP_AQ_AUX1VolumeTable = 0x04,
  113. eBHP_AQ_AUX2VolumeTable = 0x05,
  114. eBHP_AQ_SoundMode = 0x06,
  115. eBHP_AQ_SUNSUR = 0x07,
  116. eBHP_AQ_SRSTSHD = 0x08,
  117. eBHP_AQ_MasterVolumeOffset = 0x09,
  118. eBHP_AQ_AUX1VolumeOffset = 0x0a,
  119. eBHP_AQ_AUX2VolumeOffset = 0x0b,
  120. eBHP_AQ_TableScale = 0x0c,
  121. eBHP_AQ_AVLSetting = 0x0d,
  122. eBHP_AQ_ClipManagement = 0x0e,
  123. eBHP_AQ_SoundModeName = 0x0f,
  124. eBHP_AQ_SourceName = 0x10,
  125. eBHP_AQ_HPVolumeTable = 0x11,
  126. eBHP_AQ_BinVersion = 0xFE,
  127. eBHP_AQ_BIN_HEADER = 0xFF /*!< BIN header */
  128. } BHP_AudioTabId_t;
  129. //2011/11/08, Added by JasonLee, for Audio Tool, End
  130. typedef enum
  131. {
  132. eBHP_LOGO_PIC_BS = 0x00,
  133. eBHP_LOGO_PIC_BSSize = 0x01,
  134. eBHP_LOGO_BIN_HEADER = 0xFF /*!< BIN header */
  135. } BHP_LogoTabId_t;
  136. /*=======================================================================*/
  137. /* F U N C T I O N S */
  138. /*=======================================================================*/
  139. /*! @addtogroup BHP_global
  140. * @brief initial related
  141. * @{ */
  142. /*!
  143. * @brief config BIN header module
  144. * @param bMode : [in] eBHP_READ_DIRECTLY - directly read from target address
  145. * eBHP_READ_BY_SPI - read from SPI driver API
  146. * @retval eSUCCESS : successful
  147. * @note This API MUST be called before BHP_Init.
  148. */
  149. BHP_Status_t BHP_Config(BHP_READ_MODE_t bMode);
  150. /*!
  151. * @brief initial BIN header parser
  152. * @param BinId 0 for PQ, 1 for Panel
  153. * @param pbDefaultBinNum : [in] set up default BIN num. if this is NULL, then default Num is 0.
  154. * @param pbStringPattern : [in] set up search pattern, ex: 0xFE 'I' 'M' 'G'
  155. * @param pdwRomEndAddr : [in] end address of ROM code. if this is NULL, then pass it.
  156. * @retval eSUCCESS : successful
  157. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  158. * @retval eERR_FAILURE : can't find the target string pattern
  159. */
  160. BHP_Status_t BHP_Init(UINT8 bBinId, UINT8 *pbDefaultBinNum, UINT8 *pbStringPattern, UINT32 *pdwRomEndAddr);
  161. /*!
  162. * @brief un-initial BIN header parser
  163. * reserved API for internal memory release
  164. * @param BinId 0 for PQ, 1 for Panel
  165. * @retval eSUCCESS : successful
  166. * @note do nothing for current version
  167. */
  168. BHP_Status_t BHP_Uninit(UINT8 BinId);
  169. /*! @} end of addtogroup BHP_global */
  170. /*! @addtogroup BHP_Core
  171. * @brief initial related
  172. * @{ */
  173. /*! @} end of addtogroup BHP_Core */
  174. /*!
  175. * @brief Get total BIN count
  176. * @param BinId 0 for PQ, 1 for Panel
  177. * @param pbCnt total number of BIN
  178. * @retval eSUCCESS : successful
  179. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  180. * @retval eERR_FAILURE : can't find the target string pattern
  181. */
  182. BHP_Status_t BHP_GetTotalBinNum(UINT8 bBinId, UINT8 *pbCnt);
  183. /*!
  184. * @brief Set current BIN index
  185. * @param BinId 0 for PQ, 1 for Panel
  186. * @param bCnt index of BIN
  187. * @retval eSUCCESS : successful
  188. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  189. * @retval eERR_FAILURE : can't find the target string pattern
  190. */
  191. BHP_Status_t BHP_SetCurrentBinNum(UINT8 bBinId, UINT8 bCnt);
  192. /*!
  193. * @brief Get current BIN index
  194. * @param BinId 0 for PQ, 1 for Panel
  195. * @param pbCnt [out] index of BIN
  196. * @retval eSUCCESS : successful
  197. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  198. * @retval eERR_FAILURE : can't find the target string pattern
  199. */
  200. BHP_Status_t BHP_GetCurrentBinNum(UINT8 bBinId, UINT8 *pbCnt);
  201. /*!
  202. * @brief Get start address of target table by table ID
  203. * @param BinId 0 for PQ, 1 for Panel
  204. * @param bId table ID
  205. * @param pdwAddr [out] table address
  206. * @retval eSUCCESS : successful
  207. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  208. * @retval eERR_FAILURE : can't find the target string pattern
  209. */
  210. BHP_Status_t BHP_GetTabStartAddress(UINT8 bBinId, UINT8 bId, UINT32 *pdwAddr);
  211. /*!
  212. * @brief Get the current version of target table
  213. * @param BinId 0 for PQ, 1 for Panel
  214. * @param bId table ID
  215. * @param pwVersion [out] table version
  216. * @retval eSUCCESS : successful
  217. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  218. * @retval eERR_FAILURE : can't find the target string pattern
  219. */
  220. BHP_Status_t BHP_GetTabVersion(UINT8 bBinId, UINT8 bID, UINT16 *pwVersion);
  221. /*!
  222. * @brief Dump BIN internal information by UART
  223. * @param BinId 0 for PQ, 1 for Panel
  224. * @retval eSUCCESS : successful
  225. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  226. * @retval eERR_FAILURE : can't find the target string pattern
  227. */
  228. BHP_Status_t BHP_DumpInfo(UINT8 BinId);
  229. /*!
  230. * @brief get BIN information
  231. * @param bBinId : [in] BHP_PQTabId_t
  232. * @param StartAddr : [out] start address
  233. * @param BinSize : [out] size of BIN
  234. * @retval eSUCCESS : successful
  235. */
  236. BHP_Status_t BHPGetBinUpdateInfo(UINT8 bBinId, UINT32* StartAddr, UINT32* BinSize);
  237. BHP_Status_t BHP_GetCurrentBinSize(UINT8 bBinId, UINT32 *pdwSize);
  238. BHP_Status_t _BHPGetPQBinTab(BHP_PQTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr);
  239. BHP_Status_t _BHPGetTabLength(UINT8 bBinId, BHP_PQTabId_t bId, UINT32 *pdwLength);
  240. BHP_Status_t _BHPGtePQBinTab(BHP_PQTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr);
  241. BHP_Status_t _BHPGtePAENLBinTab(BHP_PanelTabId_t bId,UINT8 bIndex, void *pdwAddr);//2011/03/30, Added by AnsonLiu, for New Panel Adjuster Tool
  242. BHP_Status_t BHPGetPQBinUpdateInfo(UINT32* StartAddr, UINT32* BinSize);
  243. BHP_Status_t BHPGetPanelBinUpdateInfo(UINT32* StartAddr, UINT32* BinSize);
  244. BHP_Status_t _BHPGetAudioBinTab(BHP_AudioTabId_t bId,UINT8 bIndex,void *pdwAddr);
  245. BHP_Status_t BHP_InitMultipanel(UINT8 bBinId, UINT8 *pbDefaultBinNum, UINT8 *pbStringPattern, UINT32 *pdwRomEndAddr);
  246. BHP_Status_t BHP_GetTabStartAddressMultiPanel(UINT8 bBinId, UINT8 bId, UINT32 *pdwAddr);
  247. BHP_Status_t _BHPGtePQBinTabPQVersion(BHP_PQTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr,UINT32 *bLength);
  248. BHP_Status_t _BHPGtePAENLBinTabPanelName(BHP_PanelTabId_t bId,UINT8 bIndex,UINT8 bLevelCnt,UINT8 bLevel, void *pdwAddr,UINT32 *bLength);
  249. /*!
  250. * @brief GetBinStartAddr
  251. * @param BinId 0 for PQ, 1 for Panel
  252. * @param pbDefaultBinNum : [in] set up default BIN num. if this is NULL, then default Num is 0.
  253. * @param pbStringPattern : [in] set up search pattern, ex: 0xFE 'I' 'M' 'G'
  254. * @param pdwRomEndAddr : [in] end address of ROM code. if this is NULL, then pass it.
  255. * @retval eSUCCESS : successful
  256. * @retval eERR_INVALID_PARAM : interface or type is not recognized
  257. * @retval eERR_FAILURE : can't find the target string pattern
  258. */
  259. BHP_Status_t BHP_GetBinStartAddr(UINT8 bBinId, UINT8 *pbDefaultBinNum, UINT8 *pbStringPattern, UINT32 *pdwRomEndAddr);
  260. #endif /* _BHP_API_H */
  261. /*! @} end of addtogroup BIN_Header_Parser */