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