Fixed regression in 624x i420 decoder
[microdia.git] / ov7670.h
blobe5747bde22d7f851860d9f7a032016e877f148fa
1 /**
2 * @file ov7670.h
3 * @author Tiago Madeira
4 * @date 2008-03-24
5 * @version v0.0.0
7 * @brief Common functions and data for the Omnivision OV7670 sensor.
9 * @note Copyright (C) Tiago Madeira
11 * @par Licences
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef OV7670_H
29 #define OV7670_H
31 #include "microdia.h"
33 #define OV7670_CTL_GAIN 0x00
34 #define OV7670_CTL_BLUE 0x01
35 #define OV7670_CTL_RED 0x02
36 #define OV7670_CTL_VREF 0x03
37 #define OV7670_CTL_COM1 0x04
38 #define OV7670_CTL_BAVE 0x05
39 #define OV7670_CTL_GbAVE 0x06
40 #define OV7670_CTL_AECHH 0x07
41 #define OV7670_CTL_RAVE 0x08
42 #define OV7670_CTL_COM2 0x09
43 #define OV7670_CTL_PID 0x0a
44 #define OV7670_CTL_VER 0x0b
45 #define OV7670_CTL_COM3 0x0c
46 #define OV7670_CTL_COM4 0x0d
47 #define OV7670_CTL_COM5 0x0e
48 #define OV7670_CTL_COM6 0x0f
49 #define OV7670_CTL_AECH 0x10
50 #define OV7670_CTL_CLKRC 0x11
51 #define OV7670_CTL_COM7 0x12
52 #define OV7670_CTL_COM8 0x13
53 #define OV7670_CTL_COM9 0x14
54 #define OV7670_CTL_COM10 0x15
55 #define OV7670_CTL_HSTART 0x17
56 #define OV7670_CTL_HSTOP 0x18
57 #define OV7670_CTL_VSTRT 0x19
58 #define OV7670_CTL_VSTOP 0x1a
59 #define OV7670_CTL_PSHFT 0x1b
60 #define OV7670_CTL_MIDH 0x1c
61 #define OV7670_CTL_MIDL 0x1d
62 #define OV7670_CTL_MVFP 0x1e
63 #define OV7670_VFLIP_BIT 0x10
64 #define OV7670_CTL_LAEC 0x1f
65 #define OV7670_CTL_ADCCTR0 0x20
66 #define OV7670_CTL_ADCCTR1 0x21
67 #define OV7670_CTL_ADCCTR2 0x22
68 #define OV7670_CTL_ADCCTR3 0x23
69 #define OV7670_CTL_AEW 0x24
70 #define OV7670_CTL_AEB 0x25
71 #define OV7670_CTL_VPT 0x26
72 #define OV7670_CTL_BBIAS 0x27
73 #define OV7670_CTL_GbBIAS 0x28
74 #define OV7670_CTL_EXHCH 0x2a
75 #define OV7670_CTL_EXHCL 0x2b
76 #define OV7670_CTL_RBIAS 0x2c
77 #define OV7670_CTL_ADVFL 0x2d
78 #define OV7670_CTL_ADVFH 0x2e
79 #define OV7670_CTL_YAVE 0x2f
80 #define OV7670_CTL_HSYST 0x30
81 #define OV7670_CTL_HSYEN 0x31
82 #define OV7670_CTL_HREF 0x32
83 #define OV7670_CTL_CHLF 0x33
84 #define OV7670_CTL_ARBLM 0x34
85 #define OV7670_CTL_ADC 0x37
86 #define OV7670_CTL_ACOM 0x38
87 #define OV7670_CTL_OFON 0x39
88 #define OV7670_CTL_TSLB 0x3a
89 #define OV7670_CTL_COM11 0x3b
90 #define OV7670_CTL_COM12 0x3c
91 #define OV7670_CTL_COM13 0x3d
92 #define OV7670_CTL_COM14 0x3e
93 #define OV7670_CTL_EDGE 0x3f
94 #define OV7670_CTL_COM15 0x40
95 #define OV7670_CTL_COM16 0x41
96 #define OV7670_CTL_COM17 0x42
97 #define OV7670_CTL_AWBC1 0x43
98 #define OV7670_CTL_AWBC2 0x44
99 #define OV7670_CTL_AWBC3 0x45
100 #define OV7670_CTL_AWBC4 0x46
101 #define OV7670_CTL_AWBC5 0x47
102 #define OV7670_CTL_AWBC6 0x48
103 #define OV7670_CTL_REG4B 0x4b
104 #define OV7670_CTL_DNSTH 0x4c
105 #define OV7670_CTL_MTX1 0x4f
106 #define OV7670_CTL_MTX2 0x50
107 #define OV7670_CTL_MTX3 0x51
108 #define OV7670_CTL_MTX4 0x52
109 #define OV7670_CTL_MTX5 0x53
110 #define OV7670_CTL_MTX6 0x54
111 #define OV7670_CTL_BRIGHT 0x55
112 #define OV7670_CTL_CONTRAS 0x56
113 #define OV7670_CTL_CONTRAS_CENTER 0x57
114 #define OV7670_CTL_MTXS 0x58
115 #define OV7670_CTL_LCC1 0x62
116 #define OV7670_CTL_LCC2 0x63
117 #define OV7670_CTL_LCC3 0x64
118 #define OV7670_CTL_LCC4 0x65
119 #define OV7670_CTL_LCC5 0x66
120 #define OV7670_CTL_MANU 0x67
121 #define OV7670_CTL_MANV 0x68
122 #define OV7670_CTL_GFIX 0x69
123 #define OV7670_CTL_GGAIN 0x6a
124 #define OV7670_CTL_DBLV 0x6b
125 #define OV7670_CTL_AWBCTR3 0x6c
126 #define OV7670_CTL_AWBCTR2 0x6d
127 #define OV7670_CTL_AWBCTR1 0x6e
128 #define OV7670_CTL_AWBCTR0 0x6f
129 #define OV7670_CTL_SCALING_XSC 0x70
130 #define OV7670_CTL_SCALING_YSC 0x71
131 #define OV7670_CTL_SCALING_DCWCTR 0x72
132 #define OV7670_CTL_SCALING_PCLK_DIV 0x73
133 #define OV7670_CTL_REG74 0x74
134 #define OV7670_CTL_REG75 0x75
135 #define OV7670_CTL_REG76 0x76
136 #define OV7670_CTL_REG77 0x77
137 #define OV7670_CTL_SLOP 0x7a
138 #define OV7670_CTL_GAM1 0x7b
139 #define OV7670_CTL_GAM2 0x7c
140 #define OV7670_CTL_GAM3 0x7d
141 #define OV7670_CTL_GAM4 0x7e
142 #define OV7670_CTL_GAM5 0x7f
143 #define OV7670_CTL_GAM6 0x80
144 #define OV7670_CTL_GAM7 0x81
145 #define OV7670_CTL_GAM8 0x82
146 #define OV7670_CTL_GAM9 0x83
147 #define OV7670_CTL_GAM10 0x84
148 #define OV7670_CTL_GAM11 0x85
149 #define OV7670_CTL_GAM12 0x86
150 #define OV7670_CTL_GAM13 0x87
151 #define OV7670_CTL_GAM14 0x88
152 #define OV7670_CTL_GAM15 0x89
153 #define OV7670_CTL_RGB444 0x8c
154 #define OV7670_CTL_DM_LNL 0x92
155 #define OV7670_CTL_DM_LNH 0x93
156 #define OV7670_CTL_LCC6 0x94
157 #define OV7670_CTL_LCC7 0x95
158 #define OV7670_CTL_BD50ST 0x9d
159 #define OV7670_CTL_BD60ST 0x9e
160 #define OV7670_CTL_HAECC1 0x9f
161 #define OV7670_CTL_HAECC2 0xa0
162 #define OV7670_CTL_SCALING_PCLK_DELAY 0xa2
163 #define OV7670_CTL_NT_CTRL 0xa4
164 #define OV7670_CTL_BD50MAX 0xa5
165 #define OV7670_CTL_HAECC3 0xa6
166 #define OV7670_CTL_HAECC4 0xa7
167 #define OV7670_CTL_HAECC5 0xa8
168 #define OV7670_CTL_HAECC6 0xa9
169 #define OV7670_CTL_HAECC7 0xaa
170 #define OV7670_CTL_BD60MAX 0xab
171 #define OV7670_CTL_STR_OPT 0xac
172 #define OV7670_CTL_STR_R 0xad
173 #define OV7670_CTL_STR_G 0xae
174 #define OV7670_CTL_STR_B 0xaf
175 #define OV7670_CTL_ABLC1 0xb1
176 #define OV7670_CTL_THL_ST 0xb3
177 #define OV7670_CTL_THL_DLT 0xb5
178 #define OV7670_CTL_AD_CHB 0xbe
179 #define OV7670_CTL_AH_CHR 0xbf
180 #define OV7670_CTL_AD_CHGb 0xc0
181 #define OV7670_CTL_AD_CHGr 0xc1
182 #define OV7670_CTL_SATCTR 0xc9
184 int ov7670_auto_flip(struct usb_microdia *, __u8);
185 int ov7670_initialise(struct usb_microdia *);
186 #endif