ARCS SDK
LISTENAI Software Development Kit
Loading...
Searching...
No Matches
ov2640_regs.h
Go to the documentation of this file.
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 * OV2640 register definitions.
7 */
8#ifndef __REG_REGS_H__
9#define __REG_REGS_H__
10/* DSP register bank FF=0x00*/
11#define R_BYPASS 0x05
12#define QS 0x44
13#define CTRLI 0x50
14#define HSIZE 0x51
15#define VSIZE 0x52
16#define XOFFL 0x53
17#define YOFFL 0x54
18#define VHYX 0x55
19#define DPRP 0x56
20#define TEST 0x57
21#define ZMOW 0x5A
22#define ZMOH 0x5B
23#define ZMHH 0x5C
24#define BPADDR 0x7C
25#define BPDATA 0x7D
26#define CTRL2 0x86
27#define CTRL3 0x87
28#define SIZEL 0x8C
29#define HSIZE8 0xC0
30#define VSIZE8 0xC1
31#define CTRL0 0xC2
32#define CTRL1 0xC3
33#define R_DVP_SP 0xD3
34#define IMAGE_MODE 0xDA
35#define RESET 0xE0
36#define MS_SP 0xF0
37#define SS_ID 0xF7
38#define SS_CTRL 0xF7
39#define MC_BIST 0xF9
40#define MC_AL 0xFA
41#define MC_AH 0xFB
42#define MC_D 0xFC
43#define P_CMD 0xFD
44#define P_STATUS 0xFE
45#define BANK_SEL 0xFF
46
47#define CTRLI_LP_DP 0x80
48#define CTRLI_ROUND 0x40
49
50#define CTRL0_AEC_EN 0x80
51#define CTRL0_AEC_SEL 0x40
52#define CTRL0_STAT_SEL 0x20
53#define CTRL0_VFIRST 0x10
54#define CTRL0_YUV422 0x08
55#define CTRL0_YUV_EN 0x04
56#define CTRL0_RGB_EN 0x02
57#define CTRL0_RAW_EN 0x01
58
59#define CTRL2_DCW_EN 0x20
60#define CTRL2_SDE_EN 0x10
61#define CTRL2_UV_ADJ_EN 0x08
62#define CTRL2_UV_AVG_EN 0x04
63#define CTRL2_CMX_EN 0x01
64
65#define CTRL3_BPC_EN 0x80
66#define CTRL3_WPC_EN 0x40
67
68#define R_DVP_SP_AUTO_MODE 0x80
69
70#define R_BYPASS_DSP_EN 0x00
71#define R_BYPASS_DSP_BYPAS 0x01
72
73#define IMAGE_MODE_Y8_DVP_EN 0x40
74#define IMAGE_MODE_JPEG_EN 0x10
75#define IMAGE_MODE_YUV422 0x00
76#define IMAGE_MODE_RAW10 0x04
77#define IMAGE_MODE_RGB565 0x08
78#define IMAGE_MODE_HREF_VSYNC 0x02
79#define IMAGE_MODE_LBYTE_FIRST 0x01
80
81#define RESET_MICROC 0x40
82#define RESET_SCCB 0x20
83#define RESET_JPEG 0x10
84#define RESET_DVP 0x04
85#define RESET_IPU 0x02
86#define RESET_CIF 0x01
87
88#define MC_BIST_RESET 0x80
89#define MC_BIST_BOOT_ROM_SEL 0x40
90#define MC_BIST_12KB_SEL 0x20
91#define MC_BIST_12KB_MASK 0x30
92#define MC_BIST_512KB_SEL 0x08
93#define MC_BIST_512KB_MASK 0x0C
94#define MC_BIST_BUSY_BIT_R 0x02
95#define MC_BIST_MC_RES_ONE_SH_W 0x02
96#define MC_BIST_LAUNCH 0x01
97
98
102
103/* Sensor register bank FF=0x01*/
104#define GAIN 0x00
105#define COM1 0x03
106#define REG04 0x04
107#define REG08 0x08
108#define COM2 0x09
109#define REG_PID 0x0A
110#define REG_VER 0x0B
111#define COM3 0x0C
112#define COM4 0x0D
113#define AEC 0x10
114#define CLKRC 0x11
115#define COM7 0x12
116#define COM8 0x13
117#define COM9 0x14 /* AGC gain ceiling */
118#define COM10 0x15
119#define HSTART 0x17
120#define HSTOP 0x18
121#define VSTART 0x19
122#define VSTOP 0x1A
123#define REG_MIDH 0x1C
124#define REG_MIDL 0x1D
125#define AEW 0x24
126#define AEB 0x25
127#define VV 0x26
128#define REG2A 0x2A
129#define FRARL 0x2B
130#define ADDVSL 0x2D
131#define ADDVSH 0x2E
132#define YAVG 0x2F
133#define HSDY 0x30
134#define HEDY 0x31
135#define REG32 0x32
136#define ARCOM2 0x34
137#define REG45 0x45
138#define FLL 0x46
139#define FLH 0x47
140#define COM19 0x48
141#define ZOOMS 0x49
142#define COM22 0x4B
143#define COM25 0x4E
144#define BD50 0x4F
145#define BD60 0x50
146#define REG5D 0x5D
147#define REG5E 0x5E
148#define REG5F 0x5F
149#define REG60 0x60
150#define HISTO_LOW 0x61
151#define HISTO_HIGH 0x62
152
153#define REG04_DEFAULT 0x28
154#define REG04_HFLIP_IMG 0x80
155#define REG04_VFLIP_IMG 0x40
156#define REG04_VREF_EN 0x10
157#define REG04_HREF_EN 0x08
158#define REG04_SET(x) (REG04_DEFAULT|x)
159
160#define COM2_STDBY 0x10
161#define COM2_OUT_DRIVE_1x 0x00
162#define COM2_OUT_DRIVE_2x 0x01
163#define COM2_OUT_DRIVE_3x 0x02
164#define COM2_OUT_DRIVE_4x 0x03
165
166#define COM3_DEFAULT 0x38
167#define COM3_BAND_50Hz 0x04
168#define COM3_BAND_60Hz 0x00
169#define COM3_BAND_AUTO 0x02
170#define COM3_BAND_SET(x) (COM3_DEFAULT|x)
171
172#define COM7_SRST 0x80
173#define COM7_RES_UXGA 0x00 /* UXGA */
174#define COM7_RES_SVGA 0x40 /* SVGA */
175#define COM7_RES_CIF 0x20 /* CIF */
176#define COM7_ZOOM_EN 0x04 /* Enable Zoom */
177#define COM7_COLOR_BAR 0x02 /* Enable Color Bar Test */
178
179#define COM8_DEFAULT 0xC0
180#define COM8_BNDF_EN 0x20 /* Enable Banding filter */
181#define COM8_AGC_EN 0x04 /* AGC Auto/Manual control selection */
182#define COM8_AEC_EN 0x01 /* Auto/Manual Exposure control */
183#define COM8_SET(x) (COM8_DEFAULT|x)
184
185#define COM9_DEFAULT 0x08
186#define COM9_AGC_GAIN_2x 0x00 /* AGC: 2x */
187#define COM9_AGC_GAIN_4x 0x01 /* AGC: 4x */
188#define COM9_AGC_GAIN_8x 0x02 /* AGC: 8x */
189#define COM9_AGC_GAIN_16x 0x03 /* AGC: 16x */
190#define COM9_AGC_GAIN_32x 0x04 /* AGC: 32x */
191#define COM9_AGC_GAIN_64x 0x05 /* AGC: 64x */
192#define COM9_AGC_GAIN_128x 0x06 /* AGC: 128x */
193#define COM9_AGC_SET(x) (COM9_DEFAULT|(x<<5))
194
195#define COM10_HREF_EN 0x80 /* HSYNC changes to HREF */
196#define COM10_HSYNC_EN 0x40 /* HREF changes to HSYNC */
197#define COM10_PCLK_FREE 0x20 /* PCLK output option: free running PCLK */
198#define COM10_PCLK_EDGE 0x10 /* Data is updated at the rising edge of PCLK */
199#define COM10_HREF_NEG 0x08 /* HREF negative */
200#define COM10_VSYNC_NEG 0x02 /* VSYNC negative */
201#define COM10_HSYNC_NEG 0x01 /* HSYNC negative */
202
203#define CTRL1_AWB 0x08 /* Enable AWB */
204
205#define VV_AGC_TH_SET(h,l) ((h<<4)|(l&0x0F))
206
207#define REG32_UXGA 0x36
208#define REG32_SVGA 0x09
209#define REG32_CIF 0x89
210
211#define CLKRC_2X 0x80
212#define CLKRC_2X_UXGA (0x01 | CLKRC_2X)
213#define CLKRC_2X_SVGA CLKRC_2X
214#define CLKRC_2X_CIF CLKRC_2X
215
216#endif //__REG_REGS_H__
ov2640_bank_t
Definition ov2640_regs.h:99
@ BANK_SENSOR
Definition ov2640_regs.h:100
@ BANK_DSP
Definition ov2640_regs.h:100
@ BANK_MAX
Definition ov2640_regs.h:100