@@ -832,6 +832,24 @@ static struct regval_list ov7670_qqvga_regs[] = {
832
832
833
833
};
834
834
835
+ /*
836
+ * To center the QQVGA window on the OV7675 the REG_VSTART value was increased
837
+ */
838
+ static struct regval_list ov7675_qqvga_regs [] = {
839
+ { REG_COM3 , COM3_DCWEN },
840
+ { REG_COM14 , 0x1a },
841
+ { 0x72 , 0x22 }, // downsample by 4
842
+ { 0x73 , 0xf2 }, // divide by 4
843
+ { REG_HSTART , 0x16 },
844
+ { REG_HSTOP , 0x04 },
845
+ { REG_HREF , 0xa4 },
846
+ { REG_VSTART , 0x22 }, //Different from OV7670
847
+ { REG_VSTOP , 0x7a },
848
+ { REG_VREF , 0x0a },
849
+ { 0xff , 0xff }, /* END MARKER */
850
+
851
+ };
852
+
835
853
static struct ov7670_win_size ov7670_win_sizes [] = {
836
854
/* VGA */
837
855
{
@@ -893,9 +911,8 @@ static struct ov7670_win_size ov7670_win_sizes[] = {
893
911
894
912
static struct ov7670_win_size ov7675_win_sizes [] = {
895
913
/*
896
- * Currently, only VGA is supported. Theoretically it could be possible
897
- * to support CIF, QVGA and QCIF too. Taking values for ov7670 as a
898
- * base and tweak them empirically could be required.
914
+ * Values copied from ov7670_win_sizes and verified to work.
915
+ * The QCIF and QQVGA values were changed to center the cropped window.
899
916
*/
900
917
{
901
918
.width = VGA_WIDTH ,
@@ -906,6 +923,50 @@ static struct ov7670_win_size ov7675_win_sizes[] = {
906
923
.vstart = 14 , /* Empirically determined */
907
924
.vstop = 494 ,
908
925
.regs = NULL ,
926
+ },
927
+ /* CIF */
928
+ {
929
+ .width = CIF_WIDTH ,
930
+ .height = CIF_HEIGHT ,
931
+ .com7_bit = COM7_FMT_CIF ,
932
+ .hstart = 170 , /* Copied from ov7670 and verified*/
933
+ .hstop = 90 ,
934
+ .vstart = 14 ,
935
+ .vstop = 494 ,
936
+ .regs = NULL ,
937
+ },
938
+ /* QVGA */
939
+ {
940
+ .width = QVGA_WIDTH ,
941
+ .height = QVGA_HEIGHT ,
942
+ .com7_bit = COM7_FMT_QVGA ,
943
+ .hstart = 168 , /* Copied from ov7670 and verified*/
944
+ .hstop = 24 ,
945
+ .vstart = 12 ,
946
+ .vstop = 492 ,
947
+ .regs = NULL ,
948
+ },
949
+ /* QCIF */
950
+ {
951
+ .width = QCIF_WIDTH ,
952
+ .height = QCIF_HEIGHT ,
953
+ .com7_bit = COM7_FMT_VGA , /* see comment above */
954
+ .hstart = 250 , /* Empirically determined and different from ov7670*/
955
+ .hstop = 24 ,
956
+ .vstart = 120 ,
957
+ .vstop = 180 ,
958
+ .regs = ov7670_qcif_regs ,
959
+ },
960
+ /* QQVGA */
961
+ {
962
+ .width = QQVGA_WIDTH ,
963
+ .height = QQVGA_HEIGHT ,
964
+ .com7_bit = COM7_FMT_VGA , /* see comment above */
965
+ .hstart = 0x16 , /* Empirically determined and different from ov7670*/
966
+ .hstop = 0x04 ,
967
+ .vstart = 0x22 , /* These values seem to be overridden by the regs */
968
+ .vstop = 0x7a ,
969
+ .regs = ov7675_qqvga_regs ,/* changed to better center on OV7675 */
909
970
}
910
971
};
911
972
0 commit comments