ov7725.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. /*
  2. * This file is part of the OpenMV project.
  3. * Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
  4. * This work is licensed under the MIT license, see the file LICENSE for details.
  5. *
  6. * OV7725 driver.
  7. *
  8. */
  9. #include <stdint.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <stdio.h>
  13. #include "sccb.h"
  14. #include "xclk.h"
  15. #include "ov7725.h"
  16. #include "ov7725_regs.h"
  17. #include "freertos/FreeRTOS.h"
  18. #include "freertos/task.h"
  19. #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
  20. #include "esp32-hal-log.h"
  21. #else
  22. #include "esp_log.h"
  23. static const char* TAG = "ov7725";
  24. #endif
  25. static const uint8_t default_regs[][2] = {
  26. {COM3, COM3_SWAP_YUV},
  27. {COM7, COM7_RES_QVGA | COM7_FMT_YUV},
  28. {COM4, 0x01 | 0x00}, /* bypass PLL (0x00:off, 0x40:4x, 0x80:6x, 0xC0:8x) */
  29. {CLKRC, 0x80 | 0x03}, /* Res/Bypass pre-scalar (0x40:bypass, 0x00-0x3F:prescaler PCLK=XCLK/(prescaler + 1)/2 ) */
  30. // QVGA Window Size
  31. {HSTART, 0x3F},
  32. {HSIZE, 0x50},
  33. {VSTART, 0x03},
  34. {VSIZE, 0x78},
  35. {HREF, 0x00},
  36. // Scale down to QVGA Resolution
  37. {HOUTSIZE, 0x50},
  38. {VOUTSIZE, 0x78},
  39. {EXHCH, 0x00},
  40. {COM12, 0x03},
  41. {TGT_B, 0x7F},
  42. {FIXGAIN, 0x09},
  43. {AWB_CTRL0, 0xE0},
  44. {DSP_CTRL1, 0xFF},
  45. {DSP_CTRL2, DSP_CTRL2_VDCW_EN | DSP_CTRL2_HDCW_EN | DSP_CTRL2_HZOOM_EN | DSP_CTRL2_VZOOM_EN},
  46. {DSP_CTRL3, 0x00},
  47. {DSP_CTRL4, 0x00},
  48. {DSPAUTO, 0xFF},
  49. {COM8, 0xF0},
  50. {COM6, 0xC5},
  51. {COM9, 0x11},
  52. {COM10, COM10_VSYNC_NEG | COM10_PCLK_FREE}, //Invert VSYNC and MASK PCLK
  53. {BDBASE, 0x7F},
  54. {DBSTEP, 0x03},
  55. {AEW, 0x75},
  56. {AEB, 0x64},
  57. {VPT, 0xA1},
  58. {EXHCL, 0x00},
  59. {AWB_CTRL3, 0xAA},
  60. {COM8, 0xFF},
  61. //Gamma
  62. {GAM1, 0x0C},
  63. {GAM2, 0x16},
  64. {GAM3, 0x2A},
  65. {GAM4, 0x4E},
  66. {GAM5, 0x61},
  67. {GAM6, 0x6F},
  68. {GAM7, 0x7B},
  69. {GAM8, 0x86},
  70. {GAM9, 0x8E},
  71. {GAM10, 0x97},
  72. {GAM11, 0xA4},
  73. {GAM12, 0xAF},
  74. {GAM13, 0xC5},
  75. {GAM14, 0xD7},
  76. {GAM15, 0xE8},
  77. {SLOP, 0x20},
  78. {EDGE1, 0x05},
  79. {EDGE2, 0x03},
  80. {EDGE3, 0x00},
  81. {DNSOFF, 0x01},
  82. {MTX1, 0xB0},
  83. {MTX2, 0x9D},
  84. {MTX3, 0x13},
  85. {MTX4, 0x16},
  86. {MTX5, 0x7B},
  87. {MTX6, 0x91},
  88. {MTX_CTRL, 0x1E},
  89. {BRIGHTNESS, 0x08},
  90. {CONTRAST, 0x30},
  91. {UVADJ0, 0x81},
  92. {SDE, (SDE_CONT_BRIGHT_EN | SDE_SATURATION_EN)},
  93. // For 30 fps/60Hz
  94. {DM_LNL, 0x00},
  95. {DM_LNH, 0x00},
  96. {BDBASE, 0x7F},
  97. {DBSTEP, 0x03},
  98. // Lens Correction, should be tuned with real camera module
  99. {LC_RADI, 0x10},
  100. {LC_COEF, 0x10},
  101. {LC_COEFB, 0x14},
  102. {LC_COEFR, 0x17},
  103. {LC_CTR, 0x05},
  104. {COM5, 0xF5}, //0x65
  105. {0x00, 0x00},
  106. };
  107. static int get_reg(sensor_t *sensor, int reg, int mask)
  108. {
  109. int ret = SCCB_Read(sensor->slv_addr, reg & 0xFF);
  110. if(ret > 0){
  111. ret &= mask;
  112. }
  113. return ret;
  114. }
  115. static int set_reg(sensor_t *sensor, int reg, int mask, int value)
  116. {
  117. int ret = 0;
  118. ret = SCCB_Read(sensor->slv_addr, reg & 0xFF);
  119. if(ret < 0){
  120. return ret;
  121. }
  122. value = (ret & ~mask) | (value & mask);
  123. ret = SCCB_Write(sensor->slv_addr, reg & 0xFF, value);
  124. return ret;
  125. }
  126. static int set_reg_bits(sensor_t *sensor, uint8_t reg, uint8_t offset, uint8_t length, uint8_t value)
  127. {
  128. int ret = 0;
  129. ret = SCCB_Read(sensor->slv_addr, reg);
  130. if(ret < 0){
  131. return ret;
  132. }
  133. uint8_t mask = ((1 << length) - 1) << offset;
  134. value = (ret & ~mask) | ((value << offset) & mask);
  135. ret = SCCB_Write(sensor->slv_addr, reg & 0xFF, value);
  136. return ret;
  137. }
  138. static int get_reg_bits(sensor_t *sensor, uint8_t reg, uint8_t offset, uint8_t length)
  139. {
  140. int ret = 0;
  141. ret = SCCB_Read(sensor->slv_addr, reg);
  142. if(ret < 0){
  143. return ret;
  144. }
  145. uint8_t mask = ((1 << length) - 1) << offset;
  146. return (ret & mask) >> offset;
  147. }
  148. static int reset(sensor_t *sensor)
  149. {
  150. int i=0;
  151. const uint8_t (*regs)[2];
  152. // Reset all registers
  153. SCCB_Write(sensor->slv_addr, COM7, COM7_RESET);
  154. // Delay 10 ms
  155. vTaskDelay(10 / portTICK_PERIOD_MS);
  156. // Write default regsiters
  157. for (i=0, regs = default_regs; regs[i][0]; i++) {
  158. SCCB_Write(sensor->slv_addr, regs[i][0], regs[i][1]);
  159. }
  160. // Delay
  161. vTaskDelay(30 / portTICK_PERIOD_MS);
  162. return 0;
  163. }
  164. static int set_pixformat(sensor_t *sensor, pixformat_t pixformat)
  165. {
  166. int ret=0;
  167. sensor->pixformat = pixformat;
  168. // Read register COM7
  169. uint8_t reg = SCCB_Read(sensor->slv_addr, COM7);
  170. switch (pixformat) {
  171. case PIXFORMAT_RGB565:
  172. reg = COM7_SET_RGB(reg, COM7_FMT_RGB565);
  173. break;
  174. case PIXFORMAT_YUV422:
  175. case PIXFORMAT_GRAYSCALE:
  176. reg = COM7_SET_FMT(reg, COM7_FMT_YUV);
  177. break;
  178. default:
  179. return -1;
  180. }
  181. // Write back register COM7
  182. ret = SCCB_Write(sensor->slv_addr, COM7, reg);
  183. // Delay
  184. vTaskDelay(30 / portTICK_PERIOD_MS);
  185. return ret;
  186. }
  187. static int set_framesize(sensor_t *sensor, framesize_t framesize)
  188. {
  189. int ret=0;
  190. if (framesize > FRAMESIZE_VGA) {
  191. return -1;
  192. }
  193. uint16_t w = resolution[framesize].width;
  194. uint16_t h = resolution[framesize].height;
  195. uint8_t reg = SCCB_Read(sensor->slv_addr, COM7);
  196. sensor->status.framesize = framesize;
  197. // Write MSBs
  198. ret |= SCCB_Write(sensor->slv_addr, HOUTSIZE, w>>2);
  199. ret |= SCCB_Write(sensor->slv_addr, VOUTSIZE, h>>1);
  200. ret |= SCCB_Write(sensor->slv_addr, HSIZE, w>>2);
  201. ret |= SCCB_Write(sensor->slv_addr, VSIZE, h>>1);
  202. // Write LSBs
  203. ret |= SCCB_Write(sensor->slv_addr, HREF, ((w&0x3) | ((h&0x1) << 2)));
  204. if (framesize < FRAMESIZE_VGA) {
  205. // Enable auto-scaling/zooming factors
  206. ret |= SCCB_Write(sensor->slv_addr, DSPAUTO, 0xFF);
  207. ret |= SCCB_Write(sensor->slv_addr, HSTART, 0x3F);
  208. ret |= SCCB_Write(sensor->slv_addr, VSTART, 0x03);
  209. ret |= SCCB_Write(sensor->slv_addr, COM7, reg | COM7_RES_QVGA);
  210. ret |= SCCB_Write(sensor->slv_addr, CLKRC, 0x80 | 0x01);
  211. } else {
  212. // Disable auto-scaling/zooming factors
  213. ret |= SCCB_Write(sensor->slv_addr, DSPAUTO, 0xF3);
  214. // Clear auto-scaling/zooming factors
  215. ret |= SCCB_Write(sensor->slv_addr, SCAL0, 0x00);
  216. ret |= SCCB_Write(sensor->slv_addr, SCAL1, 0x00);
  217. ret |= SCCB_Write(sensor->slv_addr, SCAL2, 0x00);
  218. ret |= SCCB_Write(sensor->slv_addr, HSTART, 0x23);
  219. ret |= SCCB_Write(sensor->slv_addr, VSTART, 0x07);
  220. ret |= SCCB_Write(sensor->slv_addr, COM7, reg & ~COM7_RES_QVGA);
  221. ret |= SCCB_Write(sensor->slv_addr, CLKRC, 0x80 | 0x03);
  222. }
  223. // Delay
  224. vTaskDelay(30 / portTICK_PERIOD_MS);
  225. return ret;
  226. }
  227. static int set_colorbar(sensor_t *sensor, int enable)
  228. {
  229. int ret=0;
  230. uint8_t reg;
  231. sensor->status.colorbar = enable;
  232. // Read reg COM3
  233. reg = SCCB_Read(sensor->slv_addr, COM3);
  234. // Enable colorbar test pattern output
  235. reg = COM3_SET_CBAR(reg, enable);
  236. // Write back COM3
  237. ret |= SCCB_Write(sensor->slv_addr, COM3, reg);
  238. // Read reg DSP_CTRL3
  239. reg = SCCB_Read(sensor->slv_addr, DSP_CTRL3);
  240. // Enable DSP colorbar output
  241. reg = DSP_CTRL3_SET_CBAR(reg, enable);
  242. // Write back DSP_CTRL3
  243. ret |= SCCB_Write(sensor->slv_addr, DSP_CTRL3, reg);
  244. return ret;
  245. }
  246. static int set_whitebal(sensor_t *sensor, int enable)
  247. {
  248. if(set_reg_bits(sensor, COM8, 1, 1, enable) >= 0){
  249. sensor->status.awb = !!enable;
  250. }
  251. return sensor->status.awb;
  252. }
  253. static int set_gain_ctrl(sensor_t *sensor, int enable)
  254. {
  255. if(set_reg_bits(sensor, COM8, 2, 1, enable) >= 0){
  256. sensor->status.agc = !!enable;
  257. }
  258. return sensor->status.agc;
  259. }
  260. static int set_exposure_ctrl(sensor_t *sensor, int enable)
  261. {
  262. if(set_reg_bits(sensor, COM8, 0, 1, enable) >= 0){
  263. sensor->status.aec = !!enable;
  264. }
  265. return sensor->status.aec;
  266. }
  267. static int set_hmirror(sensor_t *sensor, int enable)
  268. {
  269. if(set_reg_bits(sensor, COM3, 6, 1, enable) >= 0){
  270. sensor->status.hmirror = !!enable;
  271. }
  272. return sensor->status.hmirror;
  273. }
  274. static int set_vflip(sensor_t *sensor, int enable)
  275. {
  276. if(set_reg_bits(sensor, COM3, 7, 1, enable) >= 0){
  277. sensor->status.vflip = !!enable;
  278. }
  279. return sensor->status.vflip;
  280. }
  281. static int set_dcw_dsp(sensor_t *sensor, int enable)
  282. {
  283. int ret = 0;
  284. ret = set_reg_bits(sensor, 0x65, 2, 1, !enable);
  285. if (ret == 0) {
  286. ESP_LOGD(TAG, "Set dcw to: %d", enable);
  287. sensor->status.dcw = enable;
  288. }
  289. return ret;
  290. }
  291. static int set_aec2(sensor_t *sensor, int enable)
  292. {
  293. int ret = 0;
  294. ret = set_reg_bits(sensor, COM8, 7, 1, enable);
  295. if (ret == 0) {
  296. ESP_LOGD(TAG, "Set aec2 to: %d", enable);
  297. sensor->status.aec2 = enable;
  298. }
  299. return ret;
  300. }
  301. static int set_bpc_dsp(sensor_t *sensor, int enable)
  302. {
  303. int ret = 0;
  304. ret = set_reg_bits(sensor, 0x64, 1, 1, enable);
  305. if (ret == 0) {
  306. ESP_LOGD(TAG, "Set bpc to: %d", enable);
  307. sensor->status.bpc = enable;
  308. }
  309. return ret;
  310. }
  311. static int set_wpc_dsp(sensor_t *sensor, int enable)
  312. {
  313. int ret = 0;
  314. ret = set_reg_bits(sensor, 0x64, 0, 1, enable);
  315. if (ret == 0) {
  316. ESP_LOGD(TAG, "Set wpc to: %d", enable);
  317. sensor->status.wpc = enable;
  318. }
  319. return ret;
  320. }
  321. static int set_raw_gma_dsp(sensor_t *sensor, int enable)
  322. {
  323. int ret = 0;
  324. ret = set_reg_bits(sensor, 0x64, 2, 1, enable);
  325. if (ret == 0) {
  326. ESP_LOGD(TAG, "Set raw_gma to: %d", enable);
  327. sensor->status.raw_gma = enable;
  328. }
  329. return ret;
  330. }
  331. static int set_lenc_dsp(sensor_t *sensor, int enable)
  332. {
  333. int ret = 0;
  334. ret = set_reg_bits(sensor, LC_CTR, 0, 1, enable);
  335. if (ret == 0) {
  336. ESP_LOGD(TAG, "Set lenc to: %d", enable);
  337. sensor->status.lenc = enable;
  338. }
  339. return ret;
  340. }
  341. //real gain
  342. static int set_agc_gain(sensor_t *sensor, int gain)
  343. {
  344. int ret = 0;
  345. ret = set_reg_bits(sensor, COM9, 4, 3, gain % 5);
  346. if (ret == 0) {
  347. ESP_LOGD(TAG, "Set gain to: %d", gain);
  348. sensor->status.agc_gain = gain;
  349. }
  350. return ret;
  351. }
  352. static int set_aec_value(sensor_t *sensor, int value)
  353. {
  354. int ret = 0;
  355. ret = SCCB_Write(sensor->slv_addr, AEC, value & 0xff) | SCCB_Write(sensor->slv_addr, AECH, value >> 8);
  356. if (ret == 0) {
  357. ESP_LOGD(TAG, "Set aec_value to: %d", value);
  358. sensor->status.aec_value = value;
  359. }
  360. return ret;
  361. }
  362. static int set_awb_gain_dsp(sensor_t *sensor, int enable)
  363. {
  364. int ret = 0;
  365. ret = set_reg_bits(sensor, 0x63, 7, 1, enable);
  366. if (ret == 0) {
  367. ESP_LOGD(TAG, "Set awb_gain to: %d", enable);
  368. sensor->status.awb_gain = enable;
  369. }
  370. return ret;
  371. }
  372. static int set_brightness(sensor_t *sensor, int level)
  373. {
  374. int ret = 0;
  375. ret = SCCB_Write(sensor->slv_addr, 0x9B, level);
  376. if (ret == 0) {
  377. ESP_LOGD(TAG, "Set brightness to: %d", level);
  378. sensor->status.brightness = level;
  379. }
  380. return ret;
  381. }
  382. static int set_contrast(sensor_t *sensor, int level)
  383. {
  384. int ret = 0;
  385. ret = SCCB_Write(sensor->slv_addr, 0x9C, level);
  386. if (ret == 0) {
  387. ESP_LOGD(TAG, "Set contrast to: %d", level);
  388. sensor->status.contrast = level;
  389. }
  390. return ret;
  391. }
  392. static int init_status(sensor_t *sensor)
  393. {
  394. sensor->status.brightness = SCCB_Read(sensor->slv_addr, 0x9B);
  395. sensor->status.contrast = SCCB_Read(sensor->slv_addr, 0x9C);
  396. sensor->status.saturation = 0;
  397. sensor->status.ae_level = 0;
  398. sensor->status.special_effect = get_reg_bits(sensor, 0x64, 5, 1);
  399. sensor->status.wb_mode = get_reg_bits(sensor, 0x6B, 7, 1);
  400. sensor->status.agc_gain = get_reg_bits(sensor, COM9, 4, 3);
  401. sensor->status.aec_value = SCCB_Read(sensor->slv_addr, AEC) | (SCCB_Read(sensor->slv_addr, AECH) << 8);
  402. sensor->status.gainceiling = SCCB_Read(sensor->slv_addr, 0x00);
  403. sensor->status.awb = get_reg_bits(sensor, COM8, 1, 1);
  404. sensor->status.awb_gain = get_reg_bits(sensor, 0x63, 7, 1);
  405. sensor->status.aec = get_reg_bits(sensor, COM8, 0, 1);
  406. sensor->status.aec2 = get_reg_bits(sensor, COM8, 7, 1);
  407. sensor->status.agc = get_reg_bits(sensor, COM8, 2, 1);
  408. sensor->status.bpc = get_reg_bits(sensor, 0x64, 1, 1);
  409. sensor->status.wpc = get_reg_bits(sensor, 0x64, 0, 1);
  410. sensor->status.raw_gma = get_reg_bits(sensor, 0x64, 2, 1);
  411. sensor->status.lenc = get_reg_bits(sensor, LC_CTR, 0, 1);
  412. sensor->status.hmirror = get_reg_bits(sensor, COM3, 6, 1);
  413. sensor->status.vflip = get_reg_bits(sensor, COM3, 7, 1);
  414. sensor->status.dcw = get_reg_bits(sensor, 0x65, 2, 1);
  415. sensor->status.colorbar = get_reg_bits(sensor, COM3, 0, 1);
  416. sensor->status.sharpness = get_reg_bits(sensor, EDGE0, 0, 5);
  417. sensor->status.denoise = SCCB_Read(sensor->slv_addr, 0x8E);
  418. return 0;
  419. }
  420. static int set_dummy(sensor_t *sensor, int val){ return -1; }
  421. static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val){ return -1; }
  422. static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning){return -1;}
  423. static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div){return -1;}
  424. static int set_xclk(sensor_t *sensor, int timer, int xclk)
  425. {
  426. int ret = 0;
  427. sensor->xclk_freq_hz = xclk * 1000000U;
  428. ret = xclk_timer_conf(timer, sensor->xclk_freq_hz);
  429. return ret;
  430. }
  431. int ov7725_detect(int slv_addr, sensor_id_t *id)
  432. {
  433. if (OV7725_SCCB_ADDR == slv_addr) {
  434. SCCB_Write(slv_addr, 0xFF, 0x01);//bank sensor
  435. uint16_t PID = SCCB_Read(slv_addr, 0x0A);
  436. if (OV7725_PID == PID) {
  437. id->PID = PID;
  438. id->VER = SCCB_Read(slv_addr, REG_VER);
  439. id->MIDL = SCCB_Read(slv_addr, REG_MIDL);
  440. id->MIDH = SCCB_Read(slv_addr, REG_MIDH);
  441. return PID;
  442. } else {
  443. ESP_LOGI(TAG, "Mismatch PID=0x%x", PID);
  444. }
  445. }
  446. return 0;
  447. }
  448. int ov7725_init(sensor_t *sensor)
  449. {
  450. // Set function pointers
  451. sensor->reset = reset;
  452. sensor->init_status = init_status;
  453. sensor->set_pixformat = set_pixformat;
  454. sensor->set_framesize = set_framesize;
  455. sensor->set_colorbar = set_colorbar;
  456. sensor->set_whitebal = set_whitebal;
  457. sensor->set_gain_ctrl = set_gain_ctrl;
  458. sensor->set_exposure_ctrl = set_exposure_ctrl;
  459. sensor->set_hmirror = set_hmirror;
  460. sensor->set_vflip = set_vflip;
  461. sensor->set_brightness = set_brightness;
  462. sensor->set_contrast = set_contrast;
  463. sensor->set_aec2 = set_aec2;
  464. sensor->set_aec_value = set_aec_value;
  465. sensor->set_awb_gain = set_awb_gain_dsp;
  466. sensor->set_agc_gain = set_agc_gain;
  467. sensor->set_dcw = set_dcw_dsp;
  468. sensor->set_bpc = set_bpc_dsp;
  469. sensor->set_wpc = set_wpc_dsp;
  470. sensor->set_raw_gma = set_raw_gma_dsp;
  471. sensor->set_lenc = set_lenc_dsp;
  472. //not supported
  473. sensor->set_saturation= set_dummy;
  474. sensor->set_sharpness = set_dummy;
  475. sensor->set_denoise = set_dummy;
  476. sensor->set_quality = set_dummy;
  477. sensor->set_special_effect = set_dummy;
  478. sensor->set_wb_mode = set_dummy;
  479. sensor->set_ae_level = set_dummy;
  480. sensor->set_gainceiling = set_gainceiling_dummy;
  481. sensor->get_reg = get_reg;
  482. sensor->set_reg = set_reg;
  483. sensor->set_res_raw = set_res_raw;
  484. sensor->set_pll = _set_pll;
  485. sensor->set_xclk = set_xclk;
  486. // Retrieve sensor's signature
  487. sensor->id.MIDH = SCCB_Read(sensor->slv_addr, REG_MIDH);
  488. sensor->id.MIDL = SCCB_Read(sensor->slv_addr, REG_MIDL);
  489. sensor->id.PID = SCCB_Read(sensor->slv_addr, REG_PID);
  490. sensor->id.VER = SCCB_Read(sensor->slv_addr, REG_VER);
  491. ESP_LOGD(TAG, "OV7725 Attached");
  492. return 0;
  493. }