gc032a_settings.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. #ifndef _GC032A_SETTINGS_H_
  2. #define _GC032A_SETTINGS_H_
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "esp_attr.h"
  6. #include "gc032a_regs.h"
  7. #define REG_DLY 0xffff
  8. #define REGLIST_TAIL 0x0000
  9. /*
  10. * The default register settings, as obtained from OmniVision. There
  11. * is really no making sense of most of these - lots of "reserved" values
  12. * and such.
  13. *
  14. */
  15. static const uint16_t gc032a_default_regs[][2] = {
  16. /*System*/
  17. {0xf3, 0xff},
  18. {0xf5, 0x06},
  19. {0xf7, 0x01},
  20. {0xf8, 0x03},
  21. {0xf9, 0xce},
  22. {0xfa, 0x00},
  23. {0xfc, 0x02},
  24. {0xfe, 0x02},
  25. {0x81, 0x03},
  26. {0xfe, 0x00},
  27. {0x77, 0x64},
  28. {0x78, 0x40},
  29. {0x79, 0x60},
  30. /*ANALOG & CISCTL*/
  31. {0xfe, 0x00},
  32. {0x03, 0x01},
  33. {0x04, 0xce},
  34. {0x05, 0x01},
  35. {0x06, 0xad},
  36. {0x07, 0x00},
  37. {0x08, 0x10},
  38. {0x0a, 0x00},
  39. {0x0c, 0x00},
  40. {0x0d, 0x01},
  41. {0x0e, 0xe8}, // height 488
  42. {0x0f, 0x02},
  43. {0x10, 0x88}, // width 648
  44. {0x17, 0x54},
  45. {0x19, 0x08},
  46. {0x1a, 0x0a},
  47. {0x1f, 0x40},
  48. {0x20, 0x30},
  49. {0x2e, 0x80},
  50. {0x2f, 0x2b},
  51. {0x30, 0x1a},
  52. {0xfe, 0x02},
  53. {0x03, 0x02},
  54. {0x05, 0xd7},
  55. {0x06, 0x60},
  56. {0x08, 0x80},
  57. {0x12, 0x89},
  58. /*blk*/
  59. {0xfe, 0x00},
  60. {0x18, 0x02},
  61. {0xfe, 0x02},
  62. {0x40, 0x22},
  63. {0x45, 0x00},
  64. {0x46, 0x00},
  65. {0x49, 0x20},
  66. {0x4b, 0x3c},
  67. {0x50, 0x20},
  68. {0x42, 0x10},
  69. /*isp*/
  70. {0xfe, 0x01},
  71. {0x0a, 0xc5},
  72. {0x45, 0x00},
  73. {0xfe, 0x00},
  74. {0x40, 0xff},
  75. {0x41, 0x25},
  76. {0x42, 0xcf},
  77. {0x43, 0x10},
  78. {0x44, 0x83},
  79. {0x46, 0x23},
  80. {0x49, 0x03},
  81. {0x52, 0x02},
  82. {0x54, 0x00},
  83. {0xfe, 0x02},
  84. {0x22, 0xf6},
  85. /*Shading*/
  86. {0xfe, 0x01},
  87. {0xc1, 0x38},
  88. {0xc2, 0x4c},
  89. {0xc3, 0x00},
  90. {0xc4, 0x32},
  91. {0xc5, 0x24},
  92. {0xc6, 0x16},
  93. {0xc7, 0x08},
  94. {0xc8, 0x08},
  95. {0xc9, 0x00},
  96. {0xca, 0x20},
  97. {0xdc, 0x8a},
  98. {0xdd, 0xa0},
  99. {0xde, 0xa6},
  100. {0xdf, 0x75},
  101. /*AWB*/
  102. {0xfe, 0x01},
  103. {0x7c, 0x09},
  104. {0x65, 0x06},
  105. {0x7c, 0x08},
  106. {0x56, 0xf4},
  107. {0x66, 0x0f},
  108. {0x67, 0x84},
  109. {0x6b, 0x80},
  110. {0x6d, 0x12},
  111. {0x6e, 0xb0},
  112. {0x86, 0x00},
  113. {0x87, 0x00},
  114. {0x88, 0x00},
  115. {0x89, 0x00},
  116. {0x8a, 0x00},
  117. {0x8b, 0x00},
  118. {0x8c, 0x00},
  119. {0x8d, 0x00},
  120. {0x8e, 0x00},
  121. {0x8f, 0x00},
  122. {0x90, 0x00},
  123. {0x91, 0x00},
  124. {0x92, 0xf4},
  125. {0x93, 0xd5},
  126. {0x94, 0x50},
  127. {0x95, 0x0f},
  128. {0x96, 0xf4},
  129. {0x97, 0x2d},
  130. {0x98, 0x0f},
  131. {0x99, 0xa6},
  132. {0x9a, 0x2d},
  133. {0x9b, 0x0f},
  134. {0x9c, 0x59},
  135. {0x9d, 0x2d},
  136. {0x9e, 0xaa},
  137. {0x9f, 0x67},
  138. {0xa0, 0x59},
  139. {0xa1, 0x00},
  140. {0xa2, 0x00},
  141. {0xa3, 0x0a},
  142. {0xa4, 0x00},
  143. {0xa5, 0x00},
  144. {0xa6, 0xd4},
  145. {0xa7, 0x9f},
  146. {0xa8, 0x55},
  147. {0xa9, 0xd4},
  148. {0xaa, 0x9f},
  149. {0xab, 0xac},
  150. {0xac, 0x9f},
  151. {0xad, 0x55},
  152. {0xae, 0xd4},
  153. {0xaf, 0xac},
  154. {0xb0, 0xd4},
  155. {0xb1, 0xa3},
  156. {0xb2, 0x55},
  157. {0xb3, 0xd4},
  158. {0xb4, 0xac},
  159. {0xb5, 0x00},
  160. {0xb6, 0x00},
  161. {0xb7, 0x05},
  162. {0xb8, 0xd6},
  163. {0xb9, 0x8c},
  164. /*CC*/
  165. {0xfe, 0x01},
  166. {0xd0, 0x40},
  167. {0xd1, 0xf8},
  168. {0xd2, 0x00},
  169. {0xd3, 0xfa},
  170. {0xd4, 0x45},
  171. {0xd5, 0x02},
  172. {0xd6, 0x30},
  173. {0xd7, 0xfa},
  174. {0xd8, 0x08},
  175. {0xd9, 0x08},
  176. {0xda, 0x58},
  177. {0xdb, 0x02},
  178. {0xfe, 0x00},
  179. /*Gamma*/
  180. {0xfe, 0x00},
  181. {0xba, 0x00},
  182. {0xbb, 0x04},
  183. {0xbc, 0x0a},
  184. {0xbd, 0x0e},
  185. {0xbe, 0x22},
  186. {0xbf, 0x30},
  187. {0xc0, 0x3d},
  188. {0xc1, 0x4a},
  189. {0xc2, 0x5d},
  190. {0xc3, 0x6b},
  191. {0xc4, 0x7a},
  192. {0xc5, 0x85},
  193. {0xc6, 0x90},
  194. {0xc7, 0xa5},
  195. {0xc8, 0xb5},
  196. {0xc9, 0xc2},
  197. {0xca, 0xcc},
  198. {0xcb, 0xd5},
  199. {0xcc, 0xde},
  200. {0xcd, 0xea},
  201. {0xce, 0xf5},
  202. {0xcf, 0xff},
  203. /*Auto Gamma*/
  204. {0xfe, 0x00},
  205. {0x5a, 0x08},
  206. {0x5b, 0x0f},
  207. {0x5c, 0x15},
  208. {0x5d, 0x1c},
  209. {0x5e, 0x28},
  210. {0x5f, 0x36},
  211. {0x60, 0x45},
  212. {0x61, 0x51},
  213. {0x62, 0x6a},
  214. {0x63, 0x7d},
  215. {0x64, 0x8d},
  216. {0x65, 0x98},
  217. {0x66, 0xa2},
  218. {0x67, 0xb5},
  219. {0x68, 0xc3},
  220. {0x69, 0xcd},
  221. {0x6a, 0xd4},
  222. {0x6b, 0xdc},
  223. {0x6c, 0xe3},
  224. {0x6d, 0xf0},
  225. {0x6e, 0xf9},
  226. {0x6f, 0xff},
  227. /*Gain*/
  228. {0xfe, 0x00},
  229. {0x70, 0x50},
  230. /*AEC*/
  231. {0xfe, 0x00},
  232. {0x4f, 0x01},
  233. {0xfe, 0x01},
  234. {0x0d, 0x00},
  235. {0x12, 0xa0},
  236. {0x13, 0x3a},
  237. {0x44, 0x04},
  238. {0x1f, 0x30},
  239. {0x20, 0x40},
  240. {0x26, 0x9a},
  241. {0x3e, 0x20},
  242. {0x3f, 0x2d},
  243. {0x40, 0x40},
  244. {0x41, 0x5b},
  245. {0x42, 0x82},
  246. {0x43, 0xb7},
  247. {0x04, 0x0a},
  248. {0x02, 0x79},
  249. {0x03, 0xc0},
  250. /*measure window*/
  251. {0xfe, 0x01},
  252. {0xcc, 0x08},
  253. {0xcd, 0x08},
  254. {0xce, 0xa4},
  255. {0xcf, 0xec},
  256. /*DNDD*/
  257. {0xfe, 0x00},
  258. {0x81, 0xb8},
  259. {0x82, 0x12},
  260. {0x83, 0x0a},
  261. {0x84, 0x01},
  262. {0x86, 0x50},
  263. {0x87, 0x18},
  264. {0x88, 0x10},
  265. {0x89, 0x70},
  266. {0x8a, 0x20},
  267. {0x8b, 0x10},
  268. {0x8c, 0x08},
  269. {0x8d, 0x0a},
  270. /*Intpee*/
  271. {0xfe, 0x00},
  272. {0x8f, 0xaa},
  273. {0x90, 0x9c},
  274. {0x91, 0x52},
  275. {0x92, 0x03},
  276. {0x93, 0x03},
  277. {0x94, 0x08},
  278. {0x95, 0x44},
  279. {0x97, 0x00},
  280. {0x98, 0x00},
  281. /*ASDE*/
  282. {0xfe, 0x00},
  283. {0xa1, 0x30},
  284. {0xa2, 0x41},
  285. {0xa4, 0x30},
  286. {0xa5, 0x20},
  287. {0xaa, 0x30},
  288. {0xac, 0x32},
  289. /*YCP*/
  290. {0xfe, 0x00},
  291. {0xd1, 0x3c},
  292. {0xd2, 0x3c},
  293. {0xd3, 0x38},
  294. {0xd6, 0xf4},
  295. {0xd7, 0x1d},
  296. {0xdd, 0x73},
  297. {0xde, 0x84},
  298. /*Banding*/
  299. {0xfe, 0x00},
  300. {0x05, 0x01},
  301. {0x06, 0xad},
  302. {0x07, 0x00},
  303. {0x08, 0x10},
  304. {0xfe, 0x01},
  305. {0x25, 0x00},
  306. {0x26, 0x9a},
  307. {0x27, 0x01},
  308. {0x28, 0xce},
  309. {0x29, 0x02},
  310. {0x2a, 0x68},
  311. {0x2b, 0x02},
  312. {0x2c, 0x68},
  313. {0x2d, 0x07},
  314. {0x2e, 0xd2},
  315. {0x2f, 0x0b},
  316. {0x30, 0x6e},
  317. {0x31, 0x0e},
  318. {0x32, 0x70},
  319. {0x33, 0x12},
  320. {0x34, 0x0c},
  321. {0x3c, 0x30},
  322. /*Analog&Cisctl*/
  323. {0xfe, 0x00},
  324. {0x05, 0x01},
  325. {0x06, 0xa0},
  326. {0x07, 0x00},
  327. {0x08, 0x20},
  328. {0x0a, 0x78},
  329. {0x0c, 0xa0},
  330. {0x0d, 0x00}, //window_height [8]
  331. {0x0e, 0xf8}, //window_height [7:0] 248
  332. {0x0f, 0x01}, //window_width [9:8]
  333. {0x10, 0x48}, //window_width [7:0] 328
  334. {0x55, 0x00},
  335. {0x56, 0xf0}, // 240
  336. {0x57, 0x01},
  337. {0x58, 0x40}, // 320
  338. /*SPI*/
  339. {0xfe, 0x03},
  340. {0x5b, 0x40},
  341. {0x5c, 0x01},
  342. {0x5d, 0xf0},
  343. {0x5e, 0x00},
  344. /*AEC*/
  345. {0xfe, 0x01},
  346. {0x25, 0x00}, //step
  347. {0x26, 0x63},
  348. {0x27, 0x01},
  349. {0x28, 0x29},
  350. {0x29, 0x01},
  351. {0x2a, 0x29},
  352. {0x2b, 0x01},
  353. {0x2c, 0x29},
  354. {0x2d, 0x01},
  355. {0x2e, 0x29},
  356. {0x2f, 0x01},
  357. {0x30, 0x29},
  358. {0x31, 0x01},
  359. {0x32, 0x29},
  360. {0x33, 0x01},
  361. {0x34, 0x29},
  362. {0x3c, 0x00},
  363. /*measure window*/
  364. {0xfe, 0x01},
  365. {0xcc, 0x04},
  366. {0xcd, 0x04},
  367. {0xce, 0x72},
  368. {0xcf, 0x52},
  369. {REGLIST_TAIL, 0x00},
  370. };
  371. #endif