nt99141_regs.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * NT99141 register definitions.
  3. */
  4. #ifndef __NT99141_REG_REGS_H__
  5. #define __NT99141_REG_REGS_H__
  6. /* system control registers */
  7. #define SYSTEM_CTROL0 0x3021 // Bit[7]: Software reset
  8. // Bit[6]: Software power down
  9. // Bit[5]: Reserved
  10. // Bit[4]: SRB clock SYNC enable
  11. // Bit[3]: Isolation suspend select
  12. // Bit[2:0]: Not used
  13. /* output format control registers */
  14. #define FORMAT_CTRL 0x501F // Format select
  15. // Bit[2:0]:
  16. // 000: YUV422
  17. // 001: RGB
  18. // 010: Dither
  19. // 011: RAW after DPC
  20. // 101: RAW after CIP
  21. /* format control registers */
  22. #define FORMAT_CTRL00 0x4300
  23. /* frame control registers */
  24. #define FRAME_CTRL01 0x4201 // Control Passed Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode
  25. // Bit[7:4]: Not used
  26. // Bit[3:0]: Frame ON number
  27. #define FRAME_CTRL02 0x4202 // Control Masked Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode
  28. // Bit[7:4]: Not used
  29. // BIT[3:0]: Frame OFF number
  30. /* ISP top control registers */
  31. #define PRE_ISP_TEST_SETTING_1 0x3025 // Bit[7]: Test enable
  32. // 0: Test disable
  33. // 1: Color bar enable
  34. // Bit[6]: Rolling
  35. // Bit[5]: Transparent
  36. // Bit[4]: Square black and white
  37. // Bit[3:2]: Color bar style
  38. // 00: Standard 8 color bar
  39. // 01: Gradual change at vertical mode 1
  40. // 10: Gradual change at horizontal
  41. // 11: Gradual change at vertical mode 2
  42. // Bit[1:0]: Test select
  43. // 00: Color bar
  44. // 01: Random data
  45. // 10: Square data
  46. // 11: Black image
  47. //exposure = {0x3500[3:0], 0x3501[7:0], 0x3502[7:0]} / 16 × tROW
  48. /* AEC/AGC control functions */
  49. #define AEC_PK_MANUAL 0x3201 // AEC Manual Mode Control
  50. // Bit[7:6]: Reserved
  51. // Bit[5]: Gain delay option
  52. // Valid when 0x3503[4]=1’b0
  53. // 0: Delay one frame latch
  54. // 1: One frame latch
  55. // Bit[4:2]: Reserved
  56. // Bit[1]: AGC manual
  57. // 0: Auto enable
  58. // 1: Manual enable
  59. // Bit[0]: AEC manual
  60. // 0: Auto enable
  61. // 1: Manual enable
  62. //gain = {0x350A[1:0], 0x350B[7:0]} / 16
  63. /* mirror and flip registers */
  64. #define TIMING_TC_REG20 0x3022 // Timing Control Register
  65. // Bit[2:1]: Vertical flip enable
  66. // 00: Normal
  67. // 11: Vertical flip
  68. // Bit[0]: Vertical binning enable
  69. #define TIMING_TC_REG21 0x3022 // Timing Control Register
  70. // Bit[5]: Compression Enable
  71. // Bit[2:1]: Horizontal mirror enable
  72. // 00: Normal
  73. // 11: Horizontal mirror
  74. // Bit[0]: Horizontal binning enable
  75. #define CLOCK_POL_CONTROL 0x3024// Bit[5]: PCLK polarity 0: active low
  76. // 1: active high
  77. // Bit[3]: Gate PCLK under VSYNC
  78. // Bit[2]: Gate PCLK under HREF
  79. // Bit[1]: HREF polarity
  80. // 0: active low
  81. // 1: active high
  82. // Bit[0] VSYNC polarity
  83. // 0: active low
  84. // 1: active high
  85. #define DRIVE_CAPABILITY 0x306a // Bit[7:6]:
  86. // 00: 1x
  87. // 01: 2x
  88. // 10: 3x
  89. // 11: 4x
  90. #define X_ADDR_ST_H 0x3800 //Bit[3:0]: X address start[11:8]
  91. #define X_ADDR_ST_L 0x3801 //Bit[7:0]: X address start[7:0]
  92. #define Y_ADDR_ST_H 0x3802 //Bit[2:0]: Y address start[10:8]
  93. #define Y_ADDR_ST_L 0x3803 //Bit[7:0]: Y address start[7:0]
  94. #define X_ADDR_END_H 0x3804 //Bit[3:0]: X address end[11:8]
  95. #define X_ADDR_END_L 0x3805 //Bit[7:0]:
  96. #define Y_ADDR_END_H 0x3806 //Bit[2:0]: Y address end[10:8]
  97. #define Y_ADDR_END_L 0x3807 //Bit[7:0]:
  98. // Size after scaling
  99. #define X_OUTPUT_SIZE_H 0x3808 //Bit[3:0]: DVP output horizontal width[11:8]
  100. #define X_OUTPUT_SIZE_L 0x3809 //Bit[7:0]:
  101. #define Y_OUTPUT_SIZE_H 0x380a //Bit[2:0]: DVP output vertical height[10:8]
  102. #define Y_OUTPUT_SIZE_L 0x380b //Bit[7:0]:
  103. #define X_TOTAL_SIZE_H 0x380c //Bit[3:0]: Total horizontal size[11:8]
  104. #define X_TOTAL_SIZE_L 0x380d //Bit[7:0]:
  105. #define Y_TOTAL_SIZE_H 0x380e //Bit[7:0]: Total vertical size[15:8]
  106. #define Y_TOTAL_SIZE_L 0x380f //Bit[7:0]:
  107. #define X_OFFSET_H 0x3810 //Bit[3:0]: ISP horizontal offset[11:8]
  108. #define X_OFFSET_L 0x3811 //Bit[7:0]:
  109. #define Y_OFFSET_H 0x3812 //Bit[2:0]: ISP vertical offset[10:8]
  110. #define Y_OFFSET_L 0x3813 //Bit[7:0]:
  111. #define X_INCREMENT 0x3814 //Bit[7:4]: Horizontal odd subsample increment
  112. //Bit[3:0]: Horizontal even subsample increment
  113. #define Y_INCREMENT 0x3815 //Bit[7:4]: Vertical odd subsample increment
  114. //Bit[3:0]: Vertical even subsample increment
  115. // Size before scaling
  116. //#define X_INPUT_SIZE (X_ADDR_END - X_ADDR_ST + 1 - (2 * X_OFFSET))
  117. //#define Y_INPUT_SIZE (Y_ADDR_END - Y_ADDR_ST + 1 - (2 * Y_OFFSET))
  118. #define ISP_CONTROL_01 0x3021 // Bit[5]: Scale enable
  119. // 0: Disable
  120. // 1: Enable
  121. #define SCALE_CTRL_1 0x5601 // Bit[6:4]: HDIV RW
  122. // DCW scale times
  123. // 000: DCW 1 time
  124. // 001: DCW 2 times
  125. // 010: DCW 4 times
  126. // 100: DCW 8 times
  127. // 101: DCW 16 times
  128. // Others: DCW 16 times
  129. // Bit[2:0]: VDIV RW
  130. // DCW scale times
  131. // 000: DCW 1 time
  132. // 001: DCW 2 times
  133. // 010: DCW 4 times
  134. // 100: DCW 8 times
  135. // 101: DCW 16 times
  136. // Others: DCW 16 times
  137. #define SCALE_CTRL_2 0x5602 // X_SCALE High Bits
  138. #define SCALE_CTRL_3 0x5603 // X_SCALE Low Bits
  139. #define SCALE_CTRL_4 0x5604 // Y_SCALE High Bits
  140. #define SCALE_CTRL_5 0x5605 // Y_SCALE Low Bits
  141. #define SCALE_CTRL_6 0x5606 // Bit[3:0]: V Offset
  142. #define PCLK_RATIO 0x3824 // Bit[4:0]: PCLK ratio manual
  143. #define VFIFO_CTRL0C 0x460C // Bit[1]: PCLK manual enable
  144. // 0: Auto
  145. // 1: Manual by PCLK_RATIO
  146. #define VFIFO_X_SIZE_H 0x4602
  147. #define VFIFO_X_SIZE_L 0x4603
  148. #define VFIFO_Y_SIZE_H 0x4604
  149. #define VFIFO_Y_SIZE_L 0x4605
  150. #define SC_PLLS_CTRL0 0x303a // Bit[7]: PLLS bypass
  151. #define SC_PLLS_CTRL1 0x303b // Bit[4:0]: PLLS multiplier
  152. #define SC_PLLS_CTRL2 0x303c // Bit[6:4]: PLLS charge pump control
  153. // Bit[3:0]: PLLS system divider
  154. #define SC_PLLS_CTRL3 0x303d // Bit[5:4]: PLLS pre-divider
  155. // 00: 1
  156. // 01: 1.5
  157. // 10: 2
  158. // 11: 3
  159. // Bit[2]: PLLS root-divider - 1
  160. // Bit[1:0]: PLLS seld5
  161. // 00: 1
  162. // 01: 1
  163. // 10: 2
  164. // 11: 2.5
  165. #define COMPRESSION_CTRL00 0x4400 //
  166. #define COMPRESSION_CTRL01 0x4401 //
  167. #define COMPRESSION_CTRL02 0x4402 //
  168. #define COMPRESSION_CTRL03 0x4403 //
  169. #define COMPRESSION_CTRL04 0x4404 //
  170. #define COMPRESSION_CTRL05 0x4405 //
  171. #define COMPRESSION_CTRL06 0x4406 //
  172. #define COMPRESSION_CTRL07 0x3401 // Bit[5:0]: QS
  173. #define COMPRESSION_ISI_CTRL 0x4408 //
  174. #define COMPRESSION_CTRL09 0x4409 //
  175. #define COMPRESSION_CTRL0a 0x440a //
  176. #define COMPRESSION_CTRL0b 0x440b //
  177. #define COMPRESSION_CTRL0c 0x440c //
  178. #define COMPRESSION_CTRL0d 0x440d //
  179. #define COMPRESSION_CTRL0E 0x440e //
  180. /**
  181. * @brief register value
  182. */
  183. #define TEST_COLOR_BAR 0x02 /* Enable Color Bar roling Test */
  184. #define AEC_PK_MANUAL_AGC_MANUALEN 0x02 /* Enable AGC Manual enable */
  185. #define AEC_PK_MANUAL_AEC_MANUALEN 0x01 /* Enable AEC Manual enable */
  186. #define TIMING_TC_REG20_VFLIP 0x01 /* Vertical flip enable */
  187. #define TIMING_TC_REG21_HMIRROR 0x02 /* Horizontal mirror enable */
  188. #endif // __NT99141_REG_REGS_H__