stf_isp_obc_rdma.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. ******************************************************************************
  3. * @file stf_isp_obc_rdma.h
  4. * @author StarFive Isp Team
  5. * @version V1.0
  6. * @date 12/14/2019
  7. * @brief
  8. ******************************************************************************
  9. * @copy
  10. *
  11. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  12. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  13. * TIME. AS A RESULT, STARFIVE SHALL NOT BE HELD LIABLE FOR ANY
  14. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  15. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  16. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  17. *
  18. * Copyright (C) 2019 - 2022 StarFive Technology Co., Ltd.
  19. */
  20. #ifndef __STF_ISP_OBC_RDMA_H__
  21. #define __STF_ISP_OBC_RDMA_H__
  22. #include "registers/stf_isp_rdma.h"
  23. /* add optical black compensation registers structure */
  24. typedef struct _ST_OBC_CFG_REG {
  25. REG_OBC_CFG Region; // 0x0034, OBC(Optical Black Compensation) window height(2^HEIGHT)/OBC window width(2^WIDTH),
  26. } ST_OBC_CFG_REG, *PST_OBC_CFG_REG;
  27. #define ST_OBC_CFG_REG_SIZE (sizeof(ST_OBC_CFG_REG))
  28. #define ST_OBC_CFG_REG_LEN (ST_OBC_CFG_REG_SIZE / sizeof(STF_U32))
  29. typedef struct _ST_OBC_GAIN_REG {
  30. REG_OBCG_CFG_0 RGain; // 0x02E0, each symbol has four points, each point has one 8bit [0.2.6] gain register.
  31. REG_OBCG_CFG_1 GrGain; // 0x02E4, each symbol has four points, each point has one 8bit [0.2.6] gain register.
  32. REG_OBCG_CFG_2 GbGain; // 0x02E8, each symbol has four points, each point has one 8bit [0.2.6] gain register.
  33. REG_OBCG_CFG_3 BGain; // 0x02EC, each symbol has four points, each point has one 8bit [0.2.6] gain register.
  34. } ST_OBC_GAIN_REG, *PST_OBC_GAIN_REG;
  35. #define ST_OBC_GAIN_REG_SIZE (sizeof(ST_OBC_GAIN_REG))
  36. #define ST_OBC_GAIN_REG_LEN (ST_OBC_GAIN_REG_SIZE / sizeof(STF_U32))
  37. typedef struct _ST_OBC_OFST_REG {
  38. REG_OBCO_CFG_0 ROffset; // 0x02F0, each symbol has four points, each point has one 8bit offset register.
  39. REG_OBCO_CFG_1 GrOffset; // 0x02F4, each symbol has four points, each point has one 8bit offset register.
  40. REG_OBCO_CFG_2 GbOffset; // 0x02F8, each symbol has four points, each point has one 8bit offset register.
  41. REG_OBCO_CFG_3 BOffset; // 0x02FC, each symbol has four points, each point has one 8bit offset register.
  42. } ST_OBC_OFST_REG, *PST_OBC_OFST_REG;
  43. #define ST_OBC_OFST_REG_SIZE (sizeof(ST_OBC_OFST_REG))
  44. #define ST_OBC_OFST_REG_LEN (ST_OBC_OFST_REG_SIZE / sizeof(STF_U32))
  45. typedef struct _ST_OBC_REG {
  46. REG_OBC_CFG Region; // 0x0034, OBC(Optical Black Compensation) window height(2^HEIGHT)/OBC window width(2^WIDTH),
  47. //STF_U32 u32Reserved[?]; // Added reserved variables to let ST_OBC_REG address is contiguous.
  48. //-------------------------------------------------------------------------
  49. ST_OBC_GAIN_REG stGain; // 0x02E0 - 0x02EF, each symbol has four point, each point has one 8bit [0.2.6] gain register.
  50. ST_OBC_OFST_REG stOffset; // 0x02F0 - 0x02FF, each symbol has four points, each point has one 8bit offset register.
  51. } ST_OBC_REG, *PST_OBC_REG;
  52. #define ST_OBC_REG_SIZE (sizeof(ST_OBC_REG))
  53. #define ST_OBC_REG_LEN (ST_OBC_REG_SIZE / sizeof(STF_U32))
  54. #pragma pack(push, 8)
  55. typedef struct _ST_OBC_RDMA {
  56. #if defined(SUPPORT_RDMA_FEATURE)
  57. ST_RDMA_CMD stRdmaStartCmd __attribute__ ((aligned (8)));
  58. #endif //SUPPORT_RDMA_FEATURE
  59. ST_OBC_CFG_REG stObcCfgReg __attribute__ ((aligned (8)));
  60. #if defined(SUPPORT_RDMA_FEATURE)
  61. ST_RDMA_CMD stRdmaGainCmd __attribute__ ((aligned (8)));
  62. #endif //SUPPORT_RDMA_FEATURE
  63. ST_OBC_GAIN_REG stObcGainReg __attribute__ ((aligned (8)));
  64. #if defined(SUPPORT_RDMA_FEATURE)
  65. ST_RDMA_CMD stRdmaOfstCmd __attribute__ ((aligned (8)));
  66. #endif //SUPPORT_RDMA_FEATURE
  67. ST_OBC_OFST_REG stObcOfstReg __attribute__ ((aligned (8)));
  68. #if defined(SUPPORT_RDMA_FEATURE)
  69. ST_RDMA_CMD stRdmaEndCmd __attribute__ ((aligned (8)));
  70. #endif //SUPPORT_RDMA_FEATURE
  71. } ST_OBC_RDMA, *PST_OBC_RDMA;
  72. #define ST_OBC_RDMA_SIZE (sizeof(ST_OBC_RDMA))
  73. #define ST_OBC_RDMA_LEN (ST_OBC_RDMA_SIZE / (sizeof(STF_U32) * 2))
  74. #define ST_OBC_CFG_RDMA_SIZE (sizeof(ST_RDMA_CMD) + (((sizeof(ST_OBC_CFG_REG) + 7) / 8) * 8))
  75. #define ST_OBC_CFG_RDMA_LEN (ST_OBC_CFG_RDMA_SIZE / (sizeof(STF_U32) * 2))
  76. #define ST_OBC_GAIN_RDMA_SIZE (sizeof(ST_RDMA_CMD) + (((sizeof(ST_OBC_GAIN_REG) + 7) / 8) * 8))
  77. #define ST_OBC_GAIN_RDMA_LEN (ST_OBC_GAIN_RDMA_SIZE / (sizeof(STF_U32) * 2))
  78. #define ST_OBC_OFST_RDMA_SIZE (sizeof(ST_RDMA_CMD) + (((sizeof(ST_OBC_OFST_REG) + 7) / 8) * 8))
  79. #define ST_OBC_OFST_RDMA_LEN (ST_OBC_OFST_RDMA_SIZE / (sizeof(STF_U32) * 2))
  80. typedef struct _ST_ISP_OBC_RDMA {
  81. STF_U8 u8IspIdx;
  82. ST_OBC_RDMA stObcRdma __attribute__ ((aligned (8)));
  83. } ST_ISP_OBC_RDMA, *PST_ISP_OBC_RDMA;
  84. #pragma pack(pop)
  85. ///* optical black compensation registers interface */
  86. ////-----------------------------------------------------------------------------
  87. //extern
  88. //STF_VOID STFHAL_ISP_OBC_SetReg(
  89. // STF_U8 u8IspIdx,
  90. // ST_OBC_RDMA *pstObcRdma
  91. // );
  92. ////-----------------------------------------------------------------------------
  93. //extern
  94. //STF_VOID STFHAL_ISP_OBC_SetRegion(
  95. // STF_U8 u8IspIdx,
  96. // ST_OBC_RDMA *pstObcRdma
  97. // );
  98. //extern
  99. //STF_VOID STFHAL_ISP_OBC_SetGain(
  100. // STF_U8 u8IspIdx,
  101. // ST_OBC_RDMA *pstObcRdma
  102. // );
  103. //extern
  104. //STF_VOID STFHAL_ISP_OBC_SetOffset(
  105. // STF_U8 u8IspIdx,
  106. // ST_OBC_RDMA *pstObcRdma
  107. // );
  108. ////-----------------------------------------------------------------------------
  109. //
  110. //
  111. #endif //__STF_ISP_OBC_RDMA_H__