17
17
* GC2145 driver.
18
18
*/
19
19
#include " Wire.h"
20
- #include " ov7670 .h"
20
+ #include " ov767x .h"
21
21
22
22
#define GAIN 0x00 /* AGC - Gain control gain setting */
23
23
#define BLUE 0x01 /* AWB - Blue channel gain setting */
@@ -537,8 +537,7 @@ static const uint8_t default_regs[][2] = {
537
537
{ 0xFF , 0xFF },
538
538
};
539
539
540
- #if (OMV_OV7670_VERSION == 75)
541
- static const uint8_t rgb565_regs[][2 ] = {
540
+ const uint8_t OV7675::rgb565_regs[][2 ] = {
542
541
{ COM7, COM7_RGB_FMT }, /* Selects RGB mode */
543
542
{ RGB444, 0x00 }, /* No RGB444 please */
544
543
{ COM1, 0x00 }, /* CCIR601 */
@@ -553,8 +552,8 @@ static const uint8_t rgb565_regs[][2] = {
553
552
{ COM13, COM13_GAMMA_EN | COM13_UVSAT_AUTO },
554
553
{ 0xFF , 0xFF }
555
554
};
556
- # elif (OMV_OV7670_VERSION == 70)
557
- static const uint8_t rgb565_regs[][2 ] = {
555
+
556
+ const uint8_t OV7670:: rgb565_regs[][2 ] = {
558
557
{ COM7, COM7_RGB_FMT }, /* Selects RGB mode */
559
558
{ RGB444, 0 }, /* No RGB444 please */
560
559
{ COM1, 0x0 }, /* CCIR601 */
@@ -570,9 +569,6 @@ static const uint8_t rgb565_regs[][2] = {
570
569
{ COM13, COM13_UVSAT_AUTO },
571
570
{ 0xFF , 0xFF }
572
571
};
573
- #else
574
- #error "OV767x sensor is Not defined."
575
- #endif
576
572
577
573
// TODO: These registers probably need to be fixed too.
578
574
static const uint8_t yuv422_regs[][2 ] = {
@@ -605,8 +601,7 @@ static const uint8_t vga_regs[][2] = {
605
601
{ 0xFF , 0xFF },
606
602
};
607
603
608
- #if (OMV_OV7670_VERSION == 75)
609
- static const uint8_t qvga_regs[][2 ] = {
604
+ const uint8_t OV7675::qvga_regs[][2 ] = {
610
605
{ COM3, COM3_DCW_EN },
611
606
{ COM14, 0x11 }, // Divide by 2
612
607
{ 0x72 , 0x22 }, // This has no effect on OV7675
@@ -619,8 +614,8 @@ static const uint8_t qvga_regs[][2] = {
619
614
{ VREF, 0xF0 },
620
615
{ 0xFF , 0xFF },
621
616
};
622
- # else
623
- static const uint8_t qvga_regs[][2 ] = {
617
+
618
+ const uint8_t OV7670:: qvga_regs[][2 ] = {
624
619
{ COM3, COM3_DCW_EN },
625
620
{ COM14, 0x19 },
626
621
{ 0x72 , 0x11 }, // downsample by 2
@@ -633,10 +628,8 @@ static const uint8_t qvga_regs[][2] = {
633
628
{ VREF, 0x0a },
634
629
{ 0XFF , 0XFF },
635
630
};
636
- #endif
637
631
638
- #if (OMV_OV7670_VERSION == 75)
639
- static const uint8_t qqvga_regs[][2 ] = {
632
+ const uint8_t OV7675::qqvga_regs[][2 ] = {
640
633
{ COM3, COM3_DCW_EN },
641
634
{ COM14, 0x11 }, // Divide by 2
642
635
{ 0x72 , 0x22 }, // This has no effect on OV7675
@@ -649,8 +642,8 @@ static const uint8_t qqvga_regs[][2] = {
649
642
{ VREF, 0xfa },
650
643
{ 0xFF , 0xFF },
651
644
};
652
- # else
653
- static const uint8_t qqvga_regs[][2 ] = {
645
+
646
+ const uint8_t OV7670:: qqvga_regs[][2 ] = {
654
647
{ COM3, COM3_DCW_EN },
655
648
{ COM14, 0x1a },
656
649
{ 0x72 , 0x22 }, // downsample by 4
@@ -663,7 +656,6 @@ static const uint8_t qqvga_regs[][2] = {
663
656
{ VREF, 0x0a },
664
657
{ 0XFF , 0XFF },
665
658
};
666
- #endif
667
659
668
660
OV7670::OV7670 (arduino::MbedI2C &i2c) :
669
661
_i2c(&i2c)
0 commit comments