source: azure_iot_hub_f767zi/trunk/asp_baseplatform/gdic/sipeed_ov2640/ov2640_regs.h@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

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