1717 * GC2145 driver.
1818 */
1919#include " Wire.h"
20- #include " ov7670 .h"
20+ #include " ov767x .h"
2121
2222#define GAIN 0x00 /* AGC - Gain control gain setting */
2323#define BLUE 0x01 /* AWB - Blue channel gain setting */
@@ -537,8 +537,7 @@ static const uint8_t default_regs[][2] = {
537537 { 0xFF , 0xFF },
538538};
539539
540- #if (OMV_OV7670_VERSION == 75)
541- static const uint8_t rgb565_regs[][2 ] = {
540+ const uint8_t OV7675::rgb565_regs[][2 ] = {
542541 { COM7, COM7_RGB_FMT }, /* Selects RGB mode */
543542 { RGB444, 0x00 }, /* No RGB444 please */
544543 { COM1, 0x00 }, /* CCIR601 */
@@ -553,8 +552,8 @@ static const uint8_t rgb565_regs[][2] = {
553552 { COM13, COM13_GAMMA_EN | COM13_UVSAT_AUTO },
554553 { 0xFF , 0xFF }
555554};
556- # elif (OMV_OV7670_VERSION == 70)
557- static const uint8_t rgb565_regs[][2 ] = {
555+
556+ const uint8_t OV7670:: rgb565_regs[][2 ] = {
558557 { COM7, COM7_RGB_FMT }, /* Selects RGB mode */
559558 { RGB444, 0 }, /* No RGB444 please */
560559 { COM1, 0x0 }, /* CCIR601 */
@@ -570,9 +569,6 @@ static const uint8_t rgb565_regs[][2] = {
570569 { COM13, COM13_UVSAT_AUTO },
571570 { 0xFF , 0xFF }
572571};
573- #else
574- #error "OV767x sensor is Not defined."
575- #endif
576572
577573// TODO: These registers probably need to be fixed too.
578574static const uint8_t yuv422_regs[][2 ] = {
@@ -605,8 +601,7 @@ static const uint8_t vga_regs[][2] = {
605601 { 0xFF , 0xFF },
606602};
607603
608- #if (OMV_OV7670_VERSION == 75)
609- static const uint8_t qvga_regs[][2 ] = {
604+ const uint8_t OV7675::qvga_regs[][2 ] = {
610605 { COM3, COM3_DCW_EN },
611606 { COM14, 0x11 }, // Divide by 2
612607 { 0x72 , 0x22 }, // This has no effect on OV7675
@@ -619,8 +614,8 @@ static const uint8_t qvga_regs[][2] = {
619614 { VREF, 0xF0 },
620615 { 0xFF , 0xFF },
621616};
622- # else
623- static const uint8_t qvga_regs[][2 ] = {
617+
618+ const uint8_t OV7670:: qvga_regs[][2 ] = {
624619 { COM3, COM3_DCW_EN },
625620 { COM14, 0x19 },
626621 { 0x72 , 0x11 }, // downsample by 2
@@ -633,10 +628,8 @@ static const uint8_t qvga_regs[][2] = {
633628 { VREF, 0x0a },
634629 { 0XFF , 0XFF },
635630};
636- #endif
637631
638- #if (OMV_OV7670_VERSION == 75)
639- static const uint8_t qqvga_regs[][2 ] = {
632+ const uint8_t OV7675::qqvga_regs[][2 ] = {
640633 { COM3, COM3_DCW_EN },
641634 { COM14, 0x11 }, // Divide by 2
642635 { 0x72 , 0x22 }, // This has no effect on OV7675
@@ -649,8 +642,8 @@ static const uint8_t qqvga_regs[][2] = {
649642 { VREF, 0xfa },
650643 { 0xFF , 0xFF },
651644};
652- # else
653- static const uint8_t qqvga_regs[][2 ] = {
645+
646+ const uint8_t OV7670:: qqvga_regs[][2 ] = {
654647 { COM3, COM3_DCW_EN },
655648 { COM14, 0x1a },
656649 { 0x72 , 0x22 }, // downsample by 4
@@ -663,7 +656,6 @@ static const uint8_t qqvga_regs[][2] = {
663656 { VREF, 0x0a },
664657 { 0XFF , 0XFF },
665658};
666- #endif
667659
668660OV7670::OV7670 (arduino::MbedI2C &i2c) :
669661 _i2c(&i2c)
0 commit comments