LibDriver OV2640
Loading...
Searching...
No Matches
driver_ov2640_basic.c
Go to the documentation of this file.
1
36
37#include "driver_ov2640_basic.h"
38
39static ov2640_handle_t gs_handle;
40
48uint8_t ov2640_basic_init(void)
49{
50 uint8_t res;
51
52 /* link interface function */
66
67 /* ov2640 init */
68 res = ov2640_init(&gs_handle);
69 if (res != 0)
70 {
71 ov2640_interface_debug_print("ov2640: init failed.\n");
72
73 return 1;
74 }
75
76 /* table init */
77 res = ov2640_table_init(&gs_handle);
78 if (res != 0)
79 {
80 ov2640_interface_debug_print("ov2640: table init failed.\n");
81 (void)ov2640_deinit(&gs_handle);
82
83 return 1;
84 }
85
86 /* set default clock rate double */
88 if (res != 0)
89 {
90 ov2640_interface_debug_print("ov2640: set clock rate double failed.\n");
91 (void)ov2640_deinit(&gs_handle);
92
93 return 1;
94 }
95
96 /* set default clock divider */
98 if (res != 0)
99 {
100 ov2640_interface_debug_print("ov2640: set clock divider failed.\n");
101 (void)ov2640_deinit(&gs_handle);
102
103 return 1;
104 }
105
106 /* set default mode */
108 if (res != 0)
109 {
110 ov2640_interface_debug_print("ov2640: set mode failed.\n");
111 (void)ov2640_deinit(&gs_handle);
112
113 return 1;
114 }
115
116 /* set default power reset pin remap */
118 if (res != 0)
119 {
120 ov2640_interface_debug_print("ov2640: set power reset pin remap failed.\n");
121 (void)ov2640_deinit(&gs_handle);
122
123 return 1;
124 }
125
126 /* set default output drive */
128 if (res != 0)
129 {
130 ov2640_interface_debug_print("ov2640: set output drive failed.\n");
131 (void)ov2640_deinit(&gs_handle);
132
133 return 1;
134 }
135
136 /* set default horizontal mirror */
138 if (res != 0)
139 {
140 ov2640_interface_debug_print("ov2640: set horizontal mirror failed.\n");
141 (void)ov2640_deinit(&gs_handle);
142
143 return 1;
144 }
145
146 /* set default vertical flip */
148 if (res != 0)
149 {
150 ov2640_interface_debug_print("ov2640: set vertical flip failed.\n");
151 (void)ov2640_deinit(&gs_handle);
152
153 return 1;
154 }
155
156 /* set default band filter */
158 if (res != 0)
159 {
160 ov2640_interface_debug_print("ov2640: set band filter failed.\n");
161 (void)ov2640_deinit(&gs_handle);
162
163 return 1;
164 }
165
166 /* set default agc control */
168 if (res != 0)
169 {
170 ov2640_interface_debug_print("ov2640: set agc control failed.\n");
171 (void)ov2640_deinit(&gs_handle);
172
173 return 1;
174 }
175
176 /* set default exposure control */
178 if (res != 0)
179 {
180 ov2640_interface_debug_print("ov2640: set exposure control failed.\n");
181 (void)ov2640_deinit(&gs_handle);
182
183 return 1;
184 }
185
186 /* set default agc gain ceiling */
188 if (res != 0)
189 {
190 ov2640_interface_debug_print("ov2640: set agc gain ceiling failed.\n");
191 (void)ov2640_deinit(&gs_handle);
192
193 return 1;
194 }
195
196 /* set default zoom window horizontal start point */
198 if (res != 0)
199 {
200 ov2640_interface_debug_print("ov2640: set zoom window horizontal start point failed.\n");
201 (void)ov2640_deinit(&gs_handle);
202
203 return 1;
204 }
205
206 /* set default clock output power down pin status */
208 if (res != 0)
209 {
210 ov2640_interface_debug_print("ov2640: set clock output power down pin status failed.\n");
211 (void)ov2640_deinit(&gs_handle);
212
213 return 1;
214 }
215
216 /* set default zoom mode vertical window start point */
218 if (res != 0)
219 {
220 ov2640_interface_debug_print("ov2640: set zoom mode vertical window start point failed.\n");
221 (void)ov2640_deinit(&gs_handle);
222
223 return 1;
224 }
225
226 /* set default luminance signal high range */
228 if (res != 0)
229 {
230 ov2640_interface_debug_print("ov2640: set luminance signal high range failed.\n");
231 (void)ov2640_deinit(&gs_handle);
232
233 return 1;
234 }
235
236 /* set default luminance signal low range */
238 if (res != 0)
239 {
240 ov2640_interface_debug_print("ov2640: set luminance signal low range failed.\n");
241 (void)ov2640_deinit(&gs_handle);
242
243 return 1;
244 }
245
246 /* set default fast mode large step range */
248 if (res != 0)
249 {
250 ov2640_interface_debug_print("ov2640: set fast mode large step range failed.\n");
251 (void)ov2640_deinit(&gs_handle);
252
253 return 1;
254 }
255
256 /* set default frame length adjustment */
258 if (res != 0)
259 {
260 ov2640_interface_debug_print("ov2640: set frame length adjustment failed.\n");
261 (void)ov2640_deinit(&gs_handle);
262
263 return 1;
264 }
265
266 /* set default band */
268 if (res != 0)
269 {
270 ov2640_interface_debug_print("ov2640: set band failed.\n");
271 (void)ov2640_deinit(&gs_handle);
272
273 return 1;
274 }
275
276 /* set default auto band */
278 if (res != 0)
279 {
280 ov2640_interface_debug_print("ov2640: set auto band failed.\n");
281 (void)ov2640_deinit(&gs_handle);
282
283 return 1;
284 }
285
286 /* set default live video after snapshot */
288 if (res != 0)
289 {
290 ov2640_interface_debug_print("ov2640: set live video after snapshot failed.\n");
291 (void)ov2640_deinit(&gs_handle);
292
293 return 1;
294 }
295
296 /* set default histogram algorithm low level */
298 if (res != 0)
299 {
300 ov2640_interface_debug_print("ov2640: set histogram algorithm low level failed.\n");
301 (void)ov2640_deinit(&gs_handle);
302
303 return 1;
304 }
305
306 /* set default histogram algorithm high level */
308 if (res != 0)
309 {
310 ov2640_interface_debug_print("ov2640: set histogram algorithm high level failed.\n");
311 (void)ov2640_deinit(&gs_handle);
312
313 return 1;
314 }
315
316 /* set default 50hz banding aec */
318 if (res != 0)
319 {
320 ov2640_interface_debug_print("ov2640: set 50hz banding aec failed.\n");
321 (void)ov2640_deinit(&gs_handle);
322
323 return 1;
324 }
325
326 /* set default 60hz banding aec */
328 if (res != 0)
329 {
330 ov2640_interface_debug_print("ov2640: set 60hz banding aec failed.\n");
331 (void)ov2640_deinit(&gs_handle);
332
333 return 1;
334 }
335
336 /* set default resolution */
338 if (res != 0)
339 {
340 ov2640_interface_debug_print("ov2640: set resolution failed.\n");
341 (void)ov2640_deinit(&gs_handle);
342
343 return 1;
344 }
345
346 /* set default zoom */
348 if (res != 0)
349 {
350 ov2640_interface_debug_print("ov2640: set zoom failed.\n");
351 (void)ov2640_deinit(&gs_handle);
352
353 return 1;
354 }
355
356 /* set default color bar test */
358 if (res != 0)
359 {
360 ov2640_interface_debug_print("ov2640: set color bar test failed.\n");
361 (void)ov2640_deinit(&gs_handle);
362
363 return 1;
364 }
365
366 /* set default pclk */
368 if (res != 0)
369 {
370 ov2640_interface_debug_print("ov2640: set pclk failed.\n");
371 (void)ov2640_deinit(&gs_handle);
372
373 return 1;
374 }
375
376 /* set default horizontal window start */
378 if (res != 0)
379 {
380 ov2640_interface_debug_print("ov2640: set horizontal window start failed.\n");
381 (void)ov2640_deinit(&gs_handle);
382
383 return 1;
384 }
385
386 /* set default horizontal window end */
388 if (res != 0)
389 {
390 ov2640_interface_debug_print("ov2640: set horizontal window end failed.\n");
391 (void)ov2640_deinit(&gs_handle);
392
393 return 1;
394 }
395
396 /* set default vertical window line start */
398 if (res != 0)
399 {
400 ov2640_interface_debug_print("ov2640: set vertical window line start failed.\n");
401 (void)ov2640_deinit(&gs_handle);
402
403 return 1;
404 }
405
406 /* set default vertical window line end */
408 if (res != 0)
409 {
410 ov2640_interface_debug_print("ov2640: set vertical window line end failed.\n");
411 (void)ov2640_deinit(&gs_handle);
412
413 return 1;
414 }
415
416 /* set default vsync pulse width */
418 if (res != 0)
419 {
420 ov2640_interface_debug_print("ov2640: set vsync pulse width failed.\n");
421 (void)ov2640_deinit(&gs_handle);
422
423 return 1;
424 }
425
426 /* set default agc gain */
428 if (res != 0)
429 {
430 ov2640_interface_debug_print("ov2640: set agc gain failed.\n");
431 (void)ov2640_deinit(&gs_handle);
432
433 return 1;
434 }
435
436 /* set default dummy frame */
438 if (res != 0)
439 {
440 ov2640_interface_debug_print("ov2640: set dummy frame failed.\n");
441 (void)ov2640_deinit(&gs_handle);
442
443 return 1;
444 }
445
446 /* set default aec */
447 res = ov2640_set_aec(&gs_handle, OV2640_BASIC_DEFAULT_AEC);
448 if (res != 0)
449 {
450 ov2640_interface_debug_print("ov2640: set aec failed.\n");
451 (void)ov2640_deinit(&gs_handle);
452
453 return 1;
454 }
455
456 /* set default frame exposure pre charge row number */
458 if (res != 0)
459 {
460 ov2640_interface_debug_print("ov2640: set frame exposure pre charge row number failed.\n");
461 (void)ov2640_deinit(&gs_handle);
462
463 return 1;
464 }
465
466 /* set default chsync href swap */
468 if (res != 0)
469 {
470 ov2640_interface_debug_print("ov2640: set chsync href swap failed.\n");
471 (void)ov2640_deinit(&gs_handle);
472
473 return 1;
474 }
475
476 /* set default href chsync swap */
478 if (res != 0)
479 {
480 ov2640_interface_debug_print("ov2640: set href chsync swap failed.\n");
481 (void)ov2640_deinit(&gs_handle);
482
483 return 1;
484 }
485
486 /* set default pclk output qualified by href */
488 if (res != 0)
489 {
490 ov2640_interface_debug_print("ov2640: set pclk output qualified by href failed.\n");
491 (void)ov2640_deinit(&gs_handle);
492
493 return 1;
494 }
495
496 /* set default pclk edge */
498 if (res != 0)
499 {
500 ov2640_interface_debug_print("ov2640: set pclk edge failed.\n");
501 (void)ov2640_deinit(&gs_handle);
502
503 return 1;
504 }
505
506 /* set default href polarity */
508 if (res != 0)
509 {
510 ov2640_interface_debug_print("ov2640: set href polarity failed.\n");
511 (void)ov2640_deinit(&gs_handle);
512
513 return 1;
514 }
515
516 /* set default vsync polarity */
518 if (res != 0)
519 {
520 ov2640_interface_debug_print("ov2640: set vsync polarity failed.\n");
521 (void)ov2640_deinit(&gs_handle);
522
523 return 1;
524 }
525
526 /* set default hsync polarity */
528 if (res != 0)
529 {
530 ov2640_interface_debug_print("ov2640: set hsync polarity failed.\n");
531 (void)ov2640_deinit(&gs_handle);
532
533 return 1;
534 }
535
536 /* set default line interval adjust */
538 if (res != 0)
539 {
540 ov2640_interface_debug_print("ov2640: set line interval adjust failed.\n");
541 (void)ov2640_deinit(&gs_handle);
542
543 return 1;
544 }
545
546 /* set default hsync position and width start point */
548 if (res != 0)
549 {
550 ov2640_interface_debug_print("ov2640: set hsync position and width start point failed.\n");
551 (void)ov2640_deinit(&gs_handle);
552
553 return 1;
554 }
555
556 /* set default hsync position and width end point */
558 if (res != 0)
559 {
560 ov2640_interface_debug_print("ov2640: set hsync position and width end point failed.\n");
561 (void)ov2640_deinit(&gs_handle);
562
563 return 1;
564 }
565
566 /* set default luminance average */
568 if (res != 0)
569 {
570 ov2640_interface_debug_print("ov2640: set luminance average failed.\n");
571 (void)ov2640_deinit(&gs_handle);
572
573 return 1;
574 }
575
576 /* set default flash light */
578 if (res != 0)
579 {
580 ov2640_interface_debug_print("ov2640: set flash light failed.\n");
581 (void)ov2640_deinit(&gs_handle);
582
583 return 1;
584 }
585
586 /* set default 16 zone average weight option */
588 if (res != 0)
589 {
590 ov2640_interface_debug_print("ov2640: set 16 zone average weight option failed.\n");
591 (void)ov2640_deinit(&gs_handle);
592
593 return 1;
594 }
595
596 /* enable dsp bypass */
597 res = ov2640_set_dsp_bypass(&gs_handle, OV2640_BOOL_TRUE);
598 if (res != 0)
599 {
600 ov2640_interface_debug_print("ov2640: set dsp bypass failed.\n");
601 (void)ov2640_deinit(&gs_handle);
602
603 return 1;
604 }
605
606 /* set default bpc */
608 if (res != 0)
609 {
610 ov2640_interface_debug_print("ov2640: set bpc failed.\n");
611 (void)ov2640_deinit(&gs_handle);
612
613 return 1;
614 }
615
616 /* set default wpc */
618 if (res != 0)
619 {
620 ov2640_interface_debug_print("ov2640: set wpc failed.\n");
621 (void)ov2640_deinit(&gs_handle);
622
623 return 1;
624 }
625
626 /* set default dvp pclk */
628 if (res != 0)
629 {
630 ov2640_interface_debug_print("ov2640: set dvp pclk failed.\n");
631 (void)ov2640_deinit(&gs_handle);
632
633 return 1;
634 }
635
636 /* set default cip */
638 if (res != 0)
639 {
640 ov2640_interface_debug_print("ov2640: set cip failed.\n");
641 (void)ov2640_deinit(&gs_handle);
642
643 return 1;
644 }
645
646 /* set default dmy */
648 if (res != 0)
649 {
650 ov2640_interface_debug_print("ov2640: set dmy failed.\n");
651 (void)ov2640_deinit(&gs_handle);
652
653 return 1;
654 }
655
656 /* set default raw gma */
658 if (res != 0)
659 {
660 ov2640_interface_debug_print("ov2640: set raw gma failed.\n");
661 (void)ov2640_deinit(&gs_handle);
662
663 return 1;
664 }
665
666 /* set default dg */
668 if (res != 0)
669 {
670 ov2640_interface_debug_print("ov2640: set dg failed.\n");
671 (void)ov2640_deinit(&gs_handle);
672
673 return 1;
674 }
675
676 /* set default awb */
678 if (res != 0)
679 {
680 ov2640_interface_debug_print("ov2640: set awb failed.\n");
681 (void)ov2640_deinit(&gs_handle);
682
683 return 1;
684 }
685
686 /* set default awb gain */
688 if (res != 0)
689 {
690 ov2640_interface_debug_print("ov2640: set awb gain failed.\n");
691 (void)ov2640_deinit(&gs_handle);
692
693 return 1;
694 }
695
696 /* set default pre */
698 if (res != 0)
699 {
700 ov2640_interface_debug_print("ov2640: set pre failed.\n");
701 (void)ov2640_deinit(&gs_handle);
702
703 return 1;
704 }
705
706 /* set default dvp y8 */
708 if (res != 0)
709 {
710 ov2640_interface_debug_print("ov2640: set dvp y8 failed.\n");
711 (void)ov2640_deinit(&gs_handle);
712
713 return 1;
714 }
715
716 /* set default jpeg output */
718 if (res != 0)
719 {
720 ov2640_interface_debug_print("ov2640: set jpeg output failed.\n");
721 (void)ov2640_deinit(&gs_handle);
722
723 return 1;
724 }
725
726 /* set default dvp output format */
728 if (res != 0)
729 {
730 ov2640_interface_debug_print("ov2640: set dvp output format failed.\n");
731 (void)ov2640_deinit(&gs_handle);
732
733 return 1;
734 }
735
736 /* set default dvp jpeg output href timing */
738 if (res != 0)
739 {
740 ov2640_interface_debug_print("ov2640: set dvp jpeg output href timing failed.\n");
741 (void)ov2640_deinit(&gs_handle);
742
743 return 1;
744 }
745
746 /* set default byte swap */
748 if (res != 0)
749 {
750 ov2640_interface_debug_print("ov2640: set byte swap failed.\n");
751 (void)ov2640_deinit(&gs_handle);
752
753 return 1;
754 }
755
756 /* set default image horizontal */
758 if (res != 0)
759 {
760 ov2640_interface_debug_print("ov2640: set image horizontal failed.\n");
761 (void)ov2640_deinit(&gs_handle);
762
763 return 1;
764 }
765
766 /* set default image vertical */
768 if (res != 0)
769 {
770 ov2640_interface_debug_print("ov2640: set image vertical failed.\n");
771 (void)ov2640_deinit(&gs_handle);
772
773 return 1;
774 }
775
776 /* set default dcw */
778 if (res != 0)
779 {
780 ov2640_interface_debug_print("ov2640: set dcw failed.\n");
781 (void)ov2640_deinit(&gs_handle);
782
783 return 1;
784 }
785
786 /* set default sde */
788 if (res != 0)
789 {
790 ov2640_interface_debug_print("ov2640: set sde failed.\n");
791 (void)ov2640_deinit(&gs_handle);
792
793 return 1;
794 }
795
796 /* set default uv adj */
798 if (res != 0)
799 {
800 ov2640_interface_debug_print("ov2640: set uv adj failed.\n");
801 (void)ov2640_deinit(&gs_handle);
802
803 return 1;
804 }
805
806 /* set default uv avg */
808 if (res != 0)
809 {
810 ov2640_interface_debug_print("ov2640: set uv avg failed.\n");
811 (void)ov2640_deinit(&gs_handle);
812
813 return 1;
814 }
815
816 /* set default cmx */
818 if (res != 0)
819 {
820 ov2640_interface_debug_print("ov2640: set cmx failed.\n");
821 (void)ov2640_deinit(&gs_handle);
822
823 return 1;
824 }
825
826 /* set default lp dp */
828 if (res != 0)
829 {
830 ov2640_interface_debug_print("ov2640: set lp dp failed.\n");
831 (void)ov2640_deinit(&gs_handle);
832
833 return 1;
834 }
835
836 /* set default round */
838 if (res != 0)
839 {
840 ov2640_interface_debug_print("ov2640: set round failed.\n");
841 (void)ov2640_deinit(&gs_handle);
842
843 return 1;
844 }
845
846 /* set default vertical divider */
848 if (res != 0)
849 {
850 ov2640_interface_debug_print("ov2640: set vertical divider failed.\n");
851 (void)ov2640_deinit(&gs_handle);
852
853 return 1;
854 }
855
856 /* set default horizontal divider */
858 if (res != 0)
859 {
860 ov2640_interface_debug_print("ov2640: set horizontal divider failed.\n");
861 (void)ov2640_deinit(&gs_handle);
862
863 return 1;
864 }
865
866 /* set default horizontal size */
868 if (res != 0)
869 {
870 ov2640_interface_debug_print("ov2640: set horizontal size failed.\n");
871 (void)ov2640_deinit(&gs_handle);
872
873 return 1;
874 }
875
876 /* set default vertical size */
878 if (res != 0)
879 {
880 ov2640_interface_debug_print("ov2640: set vertical size failed.\n");
881 (void)ov2640_deinit(&gs_handle);
882
883 return 1;
884 }
885
886 /* set default offset x */
888 if (res != 0)
889 {
890 ov2640_interface_debug_print("ov2640: set offset x failed.\n");
891 (void)ov2640_deinit(&gs_handle);
892
893 return 1;
894 }
895
896 /* set default offset y */
898 if (res != 0)
899 {
900 ov2640_interface_debug_print("ov2640: set offset y failed.\n");
901 (void)ov2640_deinit(&gs_handle);
902
903 return 1;
904 }
905
906 /* set default output width */
908 if (res != 0)
909 {
910 ov2640_interface_debug_print("ov2640: set output width failed.\n");
911 (void)ov2640_deinit(&gs_handle);
912
913 return 1;
914 }
915
916 /* set default output height */
918 if (res != 0)
919 {
920 ov2640_interface_debug_print("ov2640: set output height failed.\n");
921 (void)ov2640_deinit(&gs_handle);
922
923 return 1;
924 }
925
926 /* set default zoom speed */
928 if (res != 0)
929 {
930 ov2640_interface_debug_print("ov2640: set zoom speed failed.\n");
931 (void)ov2640_deinit(&gs_handle);
932
933 return 1;
934 }
935
936 /* set default quantization scale factor */
938 if (res != 0)
939 {
940 ov2640_interface_debug_print("ov2640: set quantization scale factor failed.\n");
941 (void)ov2640_deinit(&gs_handle);
942
943 return 1;
944 }
945
946 /* set default sccb master speed */
948 if (res != 0)
949 {
950 ov2640_interface_debug_print("ov2640: set sccb master speed failed.\n");
951 (void)ov2640_deinit(&gs_handle);
952
953 return 1;
954 }
955
956 /* set default address auto increase */
958 if (res != 0)
959 {
960 ov2640_interface_debug_print("ov2640: set address auto increase failed.\n");
961 (void)ov2640_deinit(&gs_handle);
962
963 return 1;
964 }
965
966 /* set default sccb */
968 if (res != 0)
969 {
970 ov2640_interface_debug_print("ov2640: set sccb failed.\n");
971 (void)ov2640_deinit(&gs_handle);
972
973 return 1;
974 }
975
976 /* set default sccb master clock delay */
978 if (res != 0)
979 {
980 ov2640_interface_debug_print("ov2640: set sccb master clock delay failed.\n");
981 (void)ov2640_deinit(&gs_handle);
982
983 return 1;
984 }
985
986 /* set default sccb master access */
988 if (res != 0)
989 {
990 ov2640_interface_debug_print("ov2640: set sccb master access failed.\n");
991 (void)ov2640_deinit(&gs_handle);
992
993 return 1;
994 }
995
996 /* set default sensor pass through access */
998 if (res != 0)
999 {
1000 ov2640_interface_debug_print("ov2640: set sensor pass through access failed.\n");
1001 (void)ov2640_deinit(&gs_handle);
1002
1003 return 1;
1004 }
1005
1006 /* set default aec enable */
1008 if (res != 0)
1009 {
1010 ov2640_interface_debug_print("ov2640: set aec enable failed.\n");
1011 (void)ov2640_deinit(&gs_handle);
1012
1013 return 1;
1014 }
1015
1016 /* set default aec sel */
1018 if (res != 0)
1019 {
1020 ov2640_interface_debug_print("ov2640: set aec sel failed.\n");
1021 (void)ov2640_deinit(&gs_handle);
1022
1023 return 1;
1024 }
1025
1026 /* set default stat sel */
1028 if (res != 0)
1029 {
1030 ov2640_interface_debug_print("ov2640: set stat sel failed.\n");
1031 (void)ov2640_deinit(&gs_handle);
1032
1033 return 1;
1034 }
1035
1036 /* set default vfirst */
1038 if (res != 0)
1039 {
1040 ov2640_interface_debug_print("ov2640: set vfirst failed.\n");
1041 (void)ov2640_deinit(&gs_handle);
1042
1043 return 1;
1044 }
1045
1046 /* set default yuv422 */
1048 if (res != 0)
1049 {
1050 ov2640_interface_debug_print("ov2640: set yuv422 failed.\n");
1051 (void)ov2640_deinit(&gs_handle);
1052
1053 return 1;
1054 }
1055
1056 /* set default yuv */
1058 if (res != 0)
1059 {
1060 ov2640_interface_debug_print("ov2640: set yuv failed.\n");
1061 (void)ov2640_deinit(&gs_handle);
1062
1063 return 1;
1064 }
1065
1066 /* set default rgb */
1068 if (res != 0)
1069 {
1070 ov2640_interface_debug_print("ov2640: set rgb failed.\n");
1071 (void)ov2640_deinit(&gs_handle);
1072
1073 return 1;
1074 }
1075
1076 /* set default raw */
1078 if (res != 0)
1079 {
1080 ov2640_interface_debug_print("ov2640: set raw failed.\n");
1081 (void)ov2640_deinit(&gs_handle);
1082
1083 return 1;
1084 }
1085
1086 /* set default dp selx */
1088 if (res != 0)
1089 {
1090 ov2640_interface_debug_print("ov2640: set dp selx failed.\n");
1091 (void)ov2640_deinit(&gs_handle);
1092
1093 return 1;
1094 }
1095
1096 /* set default dp sely */
1098 if (res != 0)
1099 {
1100 ov2640_interface_debug_print("ov2640: set dp sely failed.\n");
1101 (void)ov2640_deinit(&gs_handle);
1102
1103 return 1;
1104 }
1105
1106 /* disable dsp bypass */
1107 res = ov2640_set_dsp_bypass(&gs_handle, OV2640_BOOL_FALSE);
1108 if (res != 0)
1109 {
1110 ov2640_interface_debug_print("ov2640: set dsp bypass failed.\n");
1111 (void)ov2640_deinit(&gs_handle);
1112
1113 return 1;
1114 }
1115
1116 return 0;
1117}
1118
1127{
1128 /* close ov2640 */
1129 if (ov2640_deinit(&gs_handle) != 0)
1130 {
1131 return 1;
1132 }
1133
1134 return 0;
1135}
1136
1145{
1146 /* enter to jpeg mode */
1147 if (ov2640_table_jpeg_init(&gs_handle) != 0)
1148 {
1149 return 1;
1150 }
1151
1152 return 0;
1153}
1154
1163{
1164 /* enter to rgb565 mode */
1165 if (ov2640_table_rgb565_init(&gs_handle) != 0)
1166 {
1167 return 1;
1168 }
1169
1170 return 0;
1171}
1172
1182{
1183 /* set light mode */
1184 if (ov2640_set_light_mode(&gs_handle, mode) != 0)
1185 {
1186 return 1;
1187 }
1188
1189 return 0;
1190}
1191
1201{
1202 /* set color saturation */
1203 if (ov2640_set_color_saturation(&gs_handle, color) != 0)
1204 {
1205 return 1;
1206 }
1207
1208 return 0;
1209}
1210
1220{
1221 /* set brightness */
1222 if (ov2640_set_brightness(&gs_handle, brightness) != 0)
1223 {
1224 return 1;
1225 }
1226
1227 return 0;
1228}
1229
1239{
1240 /* set contrast */
1241 if (ov2640_set_contrast(&gs_handle, contrast) != 0)
1242 {
1243 return 1;
1244 }
1245
1246 return 0;
1247}
1248
1258{
1259 /* set special effect */
1260 if (ov2640_set_special_effect(&gs_handle, effect) != 0)
1261 {
1262 return 1;
1263 }
1264
1265 return 0;
1266}
1267
1277{
1278 uint8_t res;
1279
1280 switch (resolution)
1281 {
1283 {
1284 /* 160 x 120 */
1285 res = ov2640_set_output_width(&gs_handle, 160 / 4);
1286 if (res != 0)
1287 {
1288 break;
1289 }
1290 res = ov2640_set_output_height(&gs_handle, 120 / 4);
1291 if (res != 0)
1292 {
1293 break;
1294 }
1295
1296 break;
1297 }
1299 {
1300 /* 176 x 144 */
1301 res = ov2640_set_output_width(&gs_handle, 176 / 4);
1302 if (res != 0)
1303 {
1304 break;
1305 }
1306 res = ov2640_set_output_height(&gs_handle, 144 / 4);
1307 if (res != 0)
1308 {
1309 break;
1310 }
1311
1312 break;
1313 }
1315 {
1316 /* 320 x 240 */
1317 res = ov2640_set_output_width(&gs_handle, 320 / 4);
1318 if (res != 0)
1319 {
1320 break;
1321 }
1322 res = ov2640_set_output_height(&gs_handle, 240 / 4);
1323 if (res != 0)
1324 {
1325 break;
1326 }
1327
1328 break;
1329 }
1331 {
1332 /* 400 x 240 */
1333 res = ov2640_set_output_width(&gs_handle, 400 / 4);
1334 if (res != 0)
1335 {
1336 break;
1337 }
1338 res = ov2640_set_output_height(&gs_handle, 240 / 4);
1339 if (res != 0)
1340 {
1341 break;
1342 }
1343
1344 break;
1345 }
1347 {
1348 /* 352 x 288 */
1349 res = ov2640_set_output_width(&gs_handle, 352 / 4);
1350 if (res != 0)
1351 {
1352 break;
1353 }
1354 res = ov2640_set_output_height(&gs_handle, 288 / 4);
1355 if (res != 0)
1356 {
1357 break;
1358 }
1359
1360 break;
1361 }
1363 {
1364 /* 640 x 480 */
1365 res = ov2640_set_output_width(&gs_handle, 640 / 4);
1366 if (res != 0)
1367 {
1368 break;
1369 }
1370 res = ov2640_set_output_height(&gs_handle, 480 / 4);
1371 if (res != 0)
1372 {
1373 break;
1374 }
1375
1376 break;
1377 }
1379 {
1380 /* 800 x 600 */
1381 res = ov2640_set_output_width(&gs_handle, 800 / 4);
1382 if (res != 0)
1383 {
1384 break;
1385 }
1386 res = ov2640_set_output_height(&gs_handle, 600 / 4);
1387 if (res != 0)
1388 {
1389 break;
1390 }
1391
1392 break;
1393 }
1395 {
1396 /* 1024 x 768 */
1397 res = ov2640_set_output_width(&gs_handle, 1024 / 4);
1398 if (res != 0)
1399 {
1400 break;
1401 }
1402 res = ov2640_set_output_height(&gs_handle, 768 / 4);
1403 if (res != 0)
1404 {
1405 break;
1406 }
1407
1408 break;
1409 }
1411 {
1412 /* 1280 x 800 */
1413 res = ov2640_set_output_width(&gs_handle, 1280 / 4);
1414 if (res != 0)
1415 {
1416 break;
1417 }
1418 res = ov2640_set_output_height(&gs_handle, 800 / 4);
1419 if (res != 0)
1420 {
1421 break;
1422 }
1423
1424 break;
1425 }
1427 {
1428 /* 1280 x 960 */
1429 res = ov2640_set_output_width(&gs_handle, 1280 / 4);
1430 if (res != 0)
1431 {
1432 break;
1433 }
1434 res = ov2640_set_output_height(&gs_handle, 960 / 4);
1435 if (res != 0)
1436 {
1437 break;
1438 }
1439
1440 break;
1441 }
1443 {
1444 /* 1440 x 900 */
1445 res = ov2640_set_output_width(&gs_handle, 1440 / 4);
1446 if (res != 0)
1447 {
1448 break;
1449 }
1450 res = ov2640_set_output_height(&gs_handle, 900 / 4);
1451 if (res != 0)
1452 {
1453 break;
1454 }
1455
1456 break;
1457 }
1459 {
1460 /* 1280 x 1024 */
1461 res = ov2640_set_output_width(&gs_handle, 1280 / 4);
1462 if (res != 0)
1463 {
1464 break;
1465 }
1466 res = ov2640_set_output_height(&gs_handle, 1024 / 4);
1467 if (res != 0)
1468 {
1469 break;
1470 }
1471
1472 break;
1473 }
1475 {
1476 /* 1600 x 1200 */
1477 res = ov2640_set_output_width(&gs_handle, 1600 / 4);
1478 if (res != 0)
1479 {
1480 break;
1481 }
1482 res = ov2640_set_output_height(&gs_handle, 1200 / 4);
1483 if (res != 0)
1484 {
1485 break;
1486 }
1487
1488 break;
1489 }
1490 default :
1491 {
1492 res = 1;
1493
1494 break;
1495 }
1496 }
1497
1498 return res;
1499}
driver ov2640 basic header file
uint8_t ov2640_set_offset_y(ov2640_handle_t *handle, uint16_t size)
set offset y
uint8_t ov2640_set_aec_enable(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable aec enable
uint8_t ov2640_set_vertical_size(ov2640_handle_t *handle, uint16_t size)
set vertical size
uint8_t ov2640_set_awb_gain(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable awb gain
uint8_t ov2640_set_cip(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable cip
uint8_t ov2640_set_vfirst(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable vfirst
uint8_t ov2640_set_output_width(ov2640_handle_t *handle, uint16_t size)
set output width
uint8_t ov2640_set_rgb(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable rgb
uint8_t ov2640_set_pre(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable pre
uint8_t ov2640_set_dg(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable dg
uint8_t ov2640_set_uv_avg(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable uv avg
uint8_t ov2640_set_dvp_y8(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable dvp y8
uint8_t ov2640_set_sde(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable sde
uint8_t ov2640_set_sccb_master_access(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable sccb master access
uint8_t ov2640_set_address_auto_increase(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable address auto increase
uint8_t ov2640_set_round(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable round
uint8_t ov2640_set_sccb_master_clock_delay(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable sccb master clock delay
uint8_t ov2640_set_sccb(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable sccb
uint8_t ov2640_set_lp_dp(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable lp dp
uint8_t ov2640_set_horizontal_divider(ov2640_handle_t *handle, uint8_t divider)
set horizontal divider
uint8_t ov2640_set_dvp_pclk(ov2640_handle_t *handle, uint8_t pclk)
set dvp pclk
uint8_t ov2640_set_raw(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable raw
uint8_t ov2640_set_yuv422(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable yuv422
uint8_t ov2640_set_uv_adj(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable uv adj
uint8_t ov2640_set_dp_selx(ov2640_handle_t *handle, uint8_t size)
set dp selx
uint8_t ov2640_set_quantization_scale_factor(ov2640_handle_t *handle, uint8_t factor)
set quantization scale factor
uint8_t ov2640_set_horizontal_size(ov2640_handle_t *handle, uint16_t size)
set horizontal size
uint8_t ov2640_set_vertical_divider(ov2640_handle_t *handle, uint8_t divider)
set vertical divider
uint8_t ov2640_set_raw_gma(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable raw gma
uint8_t ov2640_set_stat_sel(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable stat sel
uint8_t ov2640_set_sensor_pass_through_access(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable sensor pass through access
uint8_t ov2640_set_output_height(ov2640_handle_t *handle, uint16_t size)
set output height
uint8_t ov2640_set_image_horizontal(ov2640_handle_t *handle, uint16_t size)
set image horizontal
uint8_t ov2640_set_cmx(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable cmx
uint8_t ov2640_set_bpc(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable bpc
uint8_t ov2640_set_byte_swap(ov2640_handle_t *handle, ov2640_byte_swap_t byte_swap)
set byte swap
uint8_t ov2640_set_zoom_speed(ov2640_handle_t *handle, uint8_t speed)
set zoom speed
uint8_t ov2640_set_dvp_jpeg_output_href_timing(ov2640_handle_t *handle, ov2640_href_timing_t timing)
set dvp jpeg output href timing
uint8_t ov2640_set_aec_sel(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable aec sel
uint8_t ov2640_set_awb(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable awb
uint8_t ov2640_set_offset_x(ov2640_handle_t *handle, uint16_t size)
set offset x
uint8_t ov2640_set_jpeg_output(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable jpeg output
uint8_t ov2640_set_image_vertical(ov2640_handle_t *handle, uint16_t size)
set image vertical
uint8_t ov2640_set_dsp_bypass(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable dsp bypass
uint8_t ov2640_set_wpc(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable wpc
uint8_t ov2640_set_yuv(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable yuv
uint8_t ov2640_set_sccb_master_speed(ov2640_handle_t *handle, uint8_t speed)
set sccb master speed
uint8_t ov2640_set_dmy(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable dmy
uint8_t ov2640_set_dcw(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable dcw
uint8_t ov2640_set_dvp_output_format(ov2640_handle_t *handle, ov2640_dvp_output_format_t format)
set dvp output format
uint8_t ov2640_set_dp_sely(ov2640_handle_t *handle, uint8_t size)
set dp sely
#define OV2640_BASIC_DEFAULT_DSP_RGB
ov2640_image_resolution_t
ov2640 image resolution enumeration definition
#define OV2640_BASIC_DEFAULT_LUMINANCE_LOW
#define OV2640_BASIC_DEFAULT_AGC_GAIN_CEILING
#define OV2640_BASIC_DEFAULT_COLOR_BAR_TEST
#define OV2640_BASIC_DEFAULT_DSP_SCCB_CLOCK_DELAY
#define OV2640_BASIC_DEFAULT_ZOOM_WINDOW_V_START
#define OV2640_BASIC_DEFAULT_VERTICAL_FLIP
#define OV2640_BASIC_DEFAULT_HREF_POLARITY
#define OV2640_BASIC_DEFAULT_DSP_CMX
#define OV2640_BASIC_DEFAULT_ZOOM
#define OV2640_BASIC_DEFAULT_DSP_SENSOR_PASS_ACCESS
#define OV2640_BASIC_DEFAULT_DSP_YUV
#define OV2640_BASIC_DEFAULT_DSP_UV_AVG
#define OV2640_BASIC_DEFAULT_DSP_BPC
uint8_t ov2640_basic_set_contrast(ov2640_contrast_t contrast)
basic example set contrast
#define OV2640_BASIC_DEFAULT_DSP_ZOOM_SPEED
#define OV2640_BASIC_DEFAULT_V_WINDOW_START
#define OV2640_BASIC_DEFAULT_MODE
#define OV2640_BASIC_DEFAULT_DSP_IMAGE_VERTICAL
uint8_t ov2640_basic_set_jpeg_mode(void)
basic example set jpeg mode
#define OV2640_BASIC_DEFAULT_DSP_DVP_PCLK
#define OV2640_BASIC_DEFAULT_DSP_IMAGE_HORIZONTAL
#define OV2640_BASIC_DEFAULT_DSP_DVP_OUTPUT_FORMAT
#define OV2640_BASIC_DEFAULT_DSP_YUV422
#define OV2640_BASIC_DEFAULT_BD60_AEC
#define OV2640_BASIC_DEFAULT_CHSYNC_HREF_SWAP
#define OV2640_BASIC_DEFAULT_DSP_RAW_GMA
#define OV2640_BASIC_DEFAULT_ZOOM_WINDOW_H_START
uint8_t ov2640_basic_deinit(void)
basic example deinit
#define OV2640_BASIC_DEFAULT_DSP_SCCB_MASTER_SPEED
#define OV2640_BASIC_DEFAULT_DSP_HORIZONTAL_SIZE
#define OV2640_BASIC_DEFAULT_FRAME_LENGTH_ADJ
#define OV2640_BASIC_DEFAULT_VSYNC_POLARITY
#define OV2640_BASIC_DEFAULT_DSP_BYTE_SWAP
#define OV2640_BASIC_DEFAULT_OUTPUT_DRIVE
#define OV2640_BASIC_DEFAULT_EXPOSURE_CONTROL
#define OV2640_BASIC_DEFAULT_DSP_DMY
#define OV2640_BASIC_DEFAULT_FLASH_LIGHT
#define OV2640_BASIC_DEFAULT_DSP_JPEG_OUTPUT
#define OV2640_BASIC_DEFAULT_RESOLUTION
#define OV2640_BASIC_DEFAULT_DSP_SDE
#define OV2640_BASIC_DEFAULT_H_WINDOW_START
#define OV2640_BASIC_DEFAULT_AGC_CONTROL
#define OV2640_BASIC_DEFAULT_DSP_AWB_GAIN
#define OV2640_BASIC_DEFAULT_16_ZONE_AVG_WEIGHT
#define OV2640_BASIC_DEFAULT_DSP_HORIZONTAL_DIV
#define OV2640_BASIC_DEFAULT_DSP_SCCB_ACCESS
#define OV2640_BASIC_DEFAULT_AUTO_BAND
#define OV2640_BASIC_DEFAULT_DSP_QSF
#define OV2640_BASIC_DEFAULT_CLOCK_RATE_DOUBLE
ov2640 basic example default definition
#define OV2640_BASIC_DEFAULT_DSP_DP_SELX
#define OV2640_BASIC_DEFAULT_HISTO_LOW
#define OV2640_BASIC_DEFAULT_DSP_PRE
#define OV2640_BASIC_DEFAULT_PIN_STATUS
#define OV2640_BASIC_DEFAULT_HREF_CHSYNC_SWAP
#define OV2640_BASIC_DEFAULT_SNAPSHOT
#define OV2640_BASIC_DEFAULT_DUMMY_FRAME
#define OV2640_BASIC_DEFAULT_HISTO_HIGH
#define OV2640_BASIC_DEFAULT_DSP_VFIRST
#define OV2640_BASIC_DEFAULT_DSP_SCCB
#define OV2640_BASIC_DEFAULT_DSP_DG
#define OV2640_BASIC_DEFAULT_DSP_WPC
#define OV2640_BASIC_DEFAULT_DSP_CIP
#define OV2640_BASIC_DEFAULT_FRAME_EXPOSURE_PRE_ROW
#define OV2640_BASIC_DEFAULT_DSP_DCW
#define OV2640_BASIC_DEFAULT_DSP_OUTPUT_HEIGHT
#define OV2640_BASIC_DEFAULT_POWER_RESET_PIN_REMAP
#define OV2640_BASIC_DEFAULT_CLOCK_DIVIDER
uint8_t ov2640_basic_set_special_effect(ov2640_special_effect_t effect)
basic example set special effect
#define OV2640_BASIC_DEFAULT_BD50_AEC
#define OV2640_BASIC_DEFAULT_FAST_MODE_HIGH
#define OV2640_BASIC_DEFAULT_BAND
#define OV2640_BASIC_DEFAULT_DSP_VERTICAL_SIZE
#define OV2640_BASIC_DEFAULT_DSP_DP_SELY
#define OV2640_BASIC_DEFAULT_DSP_JPEG_OUTPUT_HREF_TIMING
uint8_t ov2640_basic_init(void)
basic example init
#define OV2640_BASIC_DEFAULT_DSP_AWB
#define OV2640_BASIC_DEFAULT_PCLK_EDGE
#define OV2640_BASIC_DEFAULT_DSP_OFFSET_Y
uint8_t ov2640_basic_set_brightness(ov2640_brightness_t brightness)
basic example set brightness
#define OV2640_BASIC_DEFAULT_PCLK
#define OV2640_BASIC_DEFAULT_DSP_OFFSET_X
#define OV2640_BASIC_DEFAULT_DSP_RAW
uint8_t ov2640_basic_set_rgb565_mode(void)
basic example set rgb565 mode
#define OV2640_BASIC_DEFAULT_PCLK_OUTPUT_BY_HREF
#define OV2640_BASIC_DEFAULT_DSP_ADDRESS_AUTO_INC
uint8_t ov2640_basic_set_light_mode(ov2640_light_mode_t mode)
basic example set light mode
#define OV2640_BASIC_DEFAULT_V_WINDOW_END
#define OV2640_BASIC_DEFAULT_DSP_STAT_SEL
#define OV2640_BASIC_DEFAULT_DSP_VERTICAL_DIV
#define OV2640_BASIC_DEFAULT_HORIZONTAL_MIRROR
#define OV2640_BASIC_DEFAULT_DSP_DVP_Y8
#define OV2640_BASIC_DEFAULT_LUMINANCE_HIGH
#define OV2640_BASIC_DEFAULT_HSYNC_START_POINT
#define OV2640_BASIC_DEFAULT_DSP_LP_DP
#define OV2640_BASIC_DEFAULT_LUMINANCE_AVG
#define OV2640_BASIC_DEFAULT_H_WINDOW_END
#define OV2640_BASIC_DEFAULT_AGC_GAIN
#define OV2640_BASIC_DEFAULT_AEC
uint8_t ov2640_basic_set_image_resolution(ov2640_image_resolution_t resolution)
basic example set image resolution
#define OV2640_BASIC_DEFAULT_DSP_AEC_ENABLE
#define OV2640_BASIC_DEFAULT_DSP_OUTPUT_WIDTH
#define OV2640_BASIC_DEFAULT_FAST_MODE_LOW
#define OV2640_BASIC_DEFAULT_DSP_UV_ADJ
#define OV2640_BASIC_DEFAULT_BAND_FILTER
#define OV2640_BASIC_DEFAULT_VSYNC_PULSE_WIDTH
#define OV2640_BASIC_DEFAULT_LINE_INTERVAL_ADJUST
uint8_t ov2640_basic_set_color_saturation(ov2640_color_saturation_t color)
basic example set color saturation
#define OV2640_BASIC_DEFAULT_DSP_ROUND
#define OV2640_BASIC_DEFAULT_HSYNC_END_POINT
#define OV2640_BASIC_DEFAULT_DSP_AEC_SEL
#define OV2640_BASIC_DEFAULT_HSYNC_POLARITY
@ OV2640_IMAGE_RESOLUTION_WQVGA
@ OV2640_IMAGE_RESOLUTION_SXGA
@ OV2640_IMAGE_RESOLUTION_WXGA
@ OV2640_IMAGE_RESOLUTION_SVGA
@ OV2640_IMAGE_RESOLUTION_UXGA
@ OV2640_IMAGE_RESOLUTION_VGA
@ OV2640_IMAGE_RESOLUTION_XVGA
@ OV2640_IMAGE_RESOLUTION_QVGA
@ OV2640_IMAGE_RESOLUTION_WXGA_PLUS
@ OV2640_IMAGE_RESOLUTION_XGA
@ OV2640_IMAGE_RESOLUTION_CIF
@ OV2640_IMAGE_RESOLUTION_QQVGA
@ OV2640_IMAGE_RESOLUTION_QCIF
uint8_t ov2640_set_special_effect(ov2640_handle_t *handle, ov2640_special_effect_t effect)
set special effect
ov2640_special_effect_t
ov2640 special effect enumeration definition
uint8_t ov2640_set_light_mode(ov2640_handle_t *handle, ov2640_light_mode_t mode)
set light mode
ov2640_contrast_t
ov2640 contrast enumeration definition
ov2640_brightness_t
ov2640 brightness enumeration definition
ov2640_color_saturation_t
ov2640 color saturation enumeration definition
uint8_t ov2640_set_color_saturation(ov2640_handle_t *handle, ov2640_color_saturation_t color)
set color saturation
uint8_t ov2640_set_contrast(ov2640_handle_t *handle, ov2640_contrast_t contrast)
set contrast
ov2640_light_mode_t
ov2640 light mode enumeration definition
uint8_t ov2640_set_brightness(ov2640_handle_t *handle, ov2640_brightness_t brightness)
set brightness
uint8_t ov2640_interface_sccb_deinit(void)
interface sccb bus deinit
uint8_t ov2640_interface_reset_init(void)
interface reset init
uint8_t ov2640_interface_power_down_deinit(void)
interface power down deinit
void ov2640_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t ov2640_interface_power_down_write(uint8_t level)
interface power down write
uint8_t ov2640_interface_power_down_init(void)
interface power down init
void ov2640_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t ov2640_interface_sccb_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface sccb bus read
uint8_t ov2640_interface_reset_deinit(void)
interface reset deinit
uint8_t ov2640_interface_sccb_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface sccb bus write
uint8_t ov2640_interface_sccb_init(void)
interface sccb bus init
uint8_t ov2640_interface_reset_write(uint8_t level)
interface reset write
uint8_t ov2640_table_jpeg_init(ov2640_handle_t *handle)
table jpeg init
uint8_t ov2640_table_rgb565_init(ov2640_handle_t *handle)
table rgb565 init
uint8_t ov2640_set_vertical_flip(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable vertical flip
uint8_t ov2640_set_hsync_polarity(ov2640_handle_t *handle, ov2640_polarity_t polarity)
set hsync polarity
uint8_t ov2640_set_60hz_banding_aec(ov2640_handle_t *handle, uint16_t aec)
set 60hz banding aec
uint8_t ov2640_set_horizontal_window_end(ov2640_handle_t *handle, uint16_t end)
set horizontal window end
uint8_t ov2640_set_mode(ov2640_handle_t *handle, ov2640_mode_t mode)
set mode
uint8_t ov2640_set_frame_length_adjustment(ov2640_handle_t *handle, uint16_t frame)
set frame length adjustment
uint8_t ov2640_set_hsync_position_and_width_end_point(ov2640_handle_t *handle, uint16_t position)
set hsync position and width end point
uint8_t ov2640_set_clock_rate_double(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable double clock rate
uint8_t ov2640_set_href_chsync_swap(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable href chsync swap
uint8_t ov2640_table_init(ov2640_handle_t *handle)
table init
uint8_t ov2640_set_pclk(ov2640_handle_t *handle, ov2640_pclk_t pclk)
set pclk
uint8_t ov2640_deinit(ov2640_handle_t *handle)
close the chip
uint8_t ov2640_set_output_drive(ov2640_handle_t *handle, ov2640_output_drive_t select)
set output drive
uint8_t ov2640_set_flash_light(ov2640_handle_t *handle, uint8_t control)
set flash light
uint8_t ov2640_set_vertical_window_line_start(ov2640_handle_t *handle, uint16_t start)
set vertical window line start
uint8_t ov2640_set_zoom(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable zoom
uint8_t ov2640_set_vertical_window_line_end(ov2640_handle_t *handle, uint16_t end)
set vertical window line end
uint8_t ov2640_set_live_video_after_snapshot(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable live video after snapshot
uint8_t ov2640_set_pclk_edge(ov2640_handle_t *handle, ov2640_edge_t edge)
set pclk edge
uint8_t ov2640_set_band(ov2640_handle_t *handle, ov2640_band_t band)
set band
uint8_t ov2640_set_aec(ov2640_handle_t *handle, uint16_t aec)
set aec
uint8_t ov2640_set_clock_output_power_down_pin_status(ov2640_handle_t *handle, ov2640_pin_status_t status)
set clock output power down pin status
uint8_t ov2640_set_line_interval_adjust(ov2640_handle_t *handle, uint16_t adjust)
set line interval adjust
uint8_t ov2640_set_pclk_output_qualified_by_href(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable pclk output qualified by href
uint8_t ov2640_set_auto_band(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable auto band
uint8_t ov2640_set_zoom_mode_vertical_window_start_point(ov2640_handle_t *handle, uint16_t point)
set zoom mode vertical window start point
uint8_t ov2640_set_exposure_control(ov2640_handle_t *handle, ov2640_control_t control)
set exposure control
uint8_t ov2640_set_luminance_signal_low_range(ov2640_handle_t *handle, uint8_t range)
set luminance signal low range
uint8_t ov2640_set_dummy_frame(ov2640_handle_t *handle, ov2640_dummy_frame_t frame)
set dummy frame
uint8_t ov2640_set_16_zone_average_weight_option(ov2640_handle_t *handle, uint32_t avg)
set 16 zone average weight option
uint8_t ov2640_set_color_bar_test(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable color bar test
uint8_t ov2640_set_chsync_href_swap(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable chsync href swap
struct ov2640_handle_s ov2640_handle_t
ov2640 handle structure definition
uint8_t ov2640_set_frame_exposure_pre_charge_row_number(ov2640_handle_t *handle, uint8_t num)
set frame exposure pre charge row number
uint8_t ov2640_set_50hz_banding_aec(ov2640_handle_t *handle, uint16_t aec)
set 50hz banding aec
uint8_t ov2640_set_resolution(ov2640_handle_t *handle, ov2640_resolution_t resolution)
set resolution
uint8_t ov2640_init(ov2640_handle_t *handle)
initialize the chip
uint8_t ov2640_set_clock_divider(ov2640_handle_t *handle, uint8_t divider)
set clock divider
uint8_t ov2640_set_fast_mode_large_step_range(ov2640_handle_t *handle, uint8_t high_threshold, uint8_t low_threshold)
set fast mode large step range
uint8_t ov2640_set_agc_gain_ceiling(ov2640_handle_t *handle, ov2640_agc_gain_t agc)
set agc
uint8_t ov2640_set_horizontal_mirror(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable horizontal mirror
uint8_t ov2640_set_vsync_polarity(ov2640_handle_t *handle, ov2640_polarity_t polarity)
set vsync polarity
uint8_t ov2640_set_agc_control(ov2640_handle_t *handle, ov2640_control_t control)
set agc control
uint8_t ov2640_set_histogram_algorithm_high_level(ov2640_handle_t *handle, uint8_t level)
set histogram algorithm high level
uint8_t ov2640_set_band_filter(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable band filter
uint8_t ov2640_set_luminance_signal_high_range(ov2640_handle_t *handle, uint8_t range)
set luminance signal high range
uint8_t ov2640_set_luminance_average(ov2640_handle_t *handle, uint8_t average)
set luminance average
uint8_t ov2640_set_horizontal_window_start(ov2640_handle_t *handle, uint16_t start)
set horizontal window start
uint8_t ov2640_set_hsync_position_and_width_start_point(ov2640_handle_t *handle, uint16_t position)
set hsync position and width start point
uint8_t ov2640_set_href_polarity(ov2640_handle_t *handle, ov2640_polarity_t polarity)
set href polarity
uint8_t ov2640_set_zoom_window_horizontal_start_point(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable zoom window horizontal start point
uint8_t ov2640_set_power_reset_pin_remap(ov2640_handle_t *handle, ov2640_bool_t enable)
enable or disable power reset pin remap
uint8_t ov2640_set_agc_gain(ov2640_handle_t *handle, uint16_t gain)
set agc gain
uint8_t ov2640_set_histogram_algorithm_low_level(ov2640_handle_t *handle, uint8_t level)
set histogram algorithm low level
uint8_t ov2640_set_vsync_pulse_width(ov2640_handle_t *handle, uint16_t width)
set vsync pulse width
@ OV2640_BOOL_FALSE
@ OV2640_BOOL_TRUE