1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
#ifndef OV2643_H
#define OV2643_H
// Scene Mode
uint8_t ov2643_scene_mode_auto[] = {
0x03,0x10,
0x41,0x00,
0x03,0x20,
0xb2,0x80,
0xff,0xff,
};
uint8_t ov2643_scene_mode_night[] = {
0x03,0x10,
0x41,0x15,
0x03,0x20,
0xb2,0xf0,
0xff,0xff,
};
// White Balance
uint8_t ov2643_wb_auto [] = {
};
uint8_t ov2643_wb_incandescent [] = {
};
uint8_t ov2643_wb_fluorescent [] = {
};
uint8_t ov2643_wb_daylight [] = {
};
uint8_t ov2643_wb_cloudy [] = {
};
// Exposure
uint8_t ov2643_exposure_neg6[] = {
};
uint8_t ov2643_exposure_neg3[] = {
};
uint8_t ov2643_exposure_zero[] = {
};
uint8_t ov2643_exposure_pos3[] = {
};
uint8_t ov2643_exposure_pos6[] = {
};
// Resolution
uint8_t ov2643_1600_1200_regs[]={
//;pclk=72mhz,30fps/pclk=36mhz,15fps
//0x12,0x80,
0xc3,0x1f,
0xc4,0xff,
0x3d,0x48,
0xdd,0xa5,
//;windows setup
0x20,0x01,
0x21,0x25,
0x22,0x00,
0x23,0x0c,
0x24,0x64,//;0x640=1600
0x25,0x08,
0x26,0x4b,//;0x4b0=1200
0x27,0x06,
0x28,0x42,
//;format setting
0x12,0x08,//+MIRROR*0x20+FLIP*0x10,//mirror and flip
0x39,0x10,
0xcd,0x12,
0x3d,0x08,
//;frame setting
0x0e,0x10,//clock 48Mhz PCLK
0x0f,0x14,
0x10,0x0a,
0x11,0x00,
0x29,0x07,//;dummy pixels
0x2a,0x9a,
0x2b,0x04,//;dummy lines//0x04
0x2c,0xd4,// //0xd4
//for 12.5fps 0x4d4*1.2=0x5cb
0x2d,0x00,
0x2e,0x00,
0x1c,0x25,//vsync width
0x1d,0x06,//;banding
0x1e,0x00,
0x1f,0xb9,//0xba,//0x5d,
0xde,0xc4,//added 2011-9-2 9:21:54
//0x75,0x6a,//advanced AWB for 2M
};
uint8_t ov2643_1280_720_regs[]={
//;pclk=72mhz,30fps/pclk=36mhz,15fps
//0x12,0x80,
0xc3,0x1f,
0xc4,0xff,
0x3d,0x48,
0xdd,0xa5,
//;windows setup
0x20,0x01,//0x01,//
0x21,0x25,//0x60,//
0x22,0x00,
0x23,0x0c,
0x24,0x50,//;0x500=1280
0x25,0x04,
0x26,0x2d,//;0x2d0=720
0x27,0x04,
0x28,0x42,
//format
0x12,0x48,//+MIRROR*0x20+FLIP*0x10,//mirror and flip
0x39,0x10,
0xcd,0x12,
//;frame setting
0x0e,0x10,//0x10,//0xb4,//clock 48Mhz PCLK
0x0f,0x14,
0x10,0x0a,
0x11,0x00,
0x29,0x06,//;dummy pixels //24.75M 0x29,0x06//24M 0x29,0x06,//
0x2a,0x40, //24.75M 0x2a,0x72//24M 0x2a,0x40,//
0x2b,0x02,//;dummy lines //24.75M 0x2b,0x02//24M 0x2b,0x02,//
0x2c,0xee, //24.75M 0x2c,0xee//24M 0x2c,0xee,//
//for 25fps 0x2ee*1.2=0x384
0x1c,0x25,//vsync width
0x1d,0x02,//0x04,//0x02,
0x1e,0x00,
0x1f,0xe1,
0xde,0x7c,
0x3d,0x08,
};
uint8_t ov2643_640_480_regs[]={
//;pclk=72mhz,30fps/pclk=36mhz,15fps
//0x12,0x80,
0xc3,0x1f,
0xc4,0xff,
0x3d,0x48,
0xdd,0xa5,
//;windows setup
0x20,0x01,
0x21,0x98,
0x22,0x00,
0x23,0x06,
0x24,0x28,//;0x280=640
0x25,0x04,
0x26,0x1e,//;0x1e0=480
0x27,0x04,
0x28,0x40,
//format
0x12,0x09,
0x39,0xd0,
0xcd,0x13,
0x3d,0x08,
//;frame setting
0x0e,0x10,//clock 48Mhz PCLK
0x0f,0x14,
0x10,0x0a,
0x11,0x00,
0x29,0x07,//;dummy pixels//24.75M 0x29,0x07//24M 0x29,0x07,//->ov setting
0x2a,0x93, //24.75M 0x2a,0xd0//24M 0x2a,0x93,//->ov setting
0x2b,0x02,//;dummy lines //24.75M 0x2b,0x02//24M 0x2b,0x02,//->ov setting
0x2c,0x6a, //24.75M 0x2c,0x6a//24M 0x2c,0x6a,//->ov setting
//for 25fps 0x26a*1.2=0x2e6
0x1c,0x25,//vsync width
0x1d,0x02,
0x1e,0x00,
0x1f,0xb9,
0xde,0x7c,
0x3d,0x08,
};
uint8_t ov2643_default_regs_init[]={
0x12,0x80, //reset
0x13,0xff,
//;pclk=72mhz,30fps/pclk=36mhz,15fps
0xc3,0x1f,
0xc4,0xff,
0x3d,0x48,
0xdd,0xa5,
//;windows setup
0x20,0x01,
0x21,0x98,
0x22,0x00,
0x23,0x06,
0x24,0x28,//;0x280=640
0x25,0x04,
0x26,0x1e,//;0x1e0=480
0x27,0x04,
0x28,0x40,
//;format setting
0x12,0x09,
0x39,0xd0,
0xcd,0x13,
0x3d,0x08,
//;frame setting
0x0e,0x10,//clock 48Mhz PCLK
0x0f,0x14,
0x10,0x0a,
0x11,0x00,
0x29,0x07,//;dummy pixels//24.75M 0x29,0x07//24M 0x29,0x07,//->ov setting
0x2a,0x93, //24.75M 0x2a,0xd0//24M 0x2a,0x93,//->ov setting
0x2b,0x02,//;dummy lines //24.75M 0x2b,0x02//24M 0x2b,0x02,//->ov setting
0x2c,0x6a, //24.75M 0x2c,0x6a//24M 0x2c,0x6a,//->ov setting
//for 25fps 0x26a*1.2=0x2e6
0x1c,0x25,//vsync width
0x1d,0x02,
0x1e,0x00,
0x1f,0xb9,
//common part except 0x3d,0xde
0x14,0x87, //band filter bit7: 1:50Hz 0:60Hz bit4:
0x15,0x42,
0x3c,0xa4,
0x18,0x78,//set to default then set to csi_ae value to wake up quickly
0x19,0x68,//
0x1a,0x71,
0x37,0xe8,
0x16,0x90,
0x43,0x00,
0x40,0xfb,
0xa9,0x44,
0x2f,0xec,
0x35,0x10,
0x36,0x10,
0x0c,0x00,
0x0d,0x00,
0xd0,0x93,
0xdc,0x2b,
0xd9,0x41,
0xd3,0x02,
0xde,0x7c,
0x3d,0x08,
0x0c,0x00,
0x9b,0x69,
0x9c,0x7d,
0x9d,0x7d,
0x9e,0x69,
0x35,0x04,
0x36,0x04,
//;gamma
//normal ////enhanced////zqh3 ////zqh2 ////zqh1 ////reset //
0x65,0x04,//0x65,0x12,//0x65,0x04,//0x65,0x04,//0x65,0x07,//0x65,0x05,//
0x66,0x07,//0x66,0x20,//0x66,0x07,//0x66,0x07,//0x66,0x12,//0x66,0x0c,//
0x67,0x19,//0x67,0x39,//0x67,0x19,//0x67,0x19,//0x67,0x1f,//0x67,0x1c,//
0x68,0x34,//0x68,0x4e,//0x68,0x34,//0x68,0x34,//0x68,0x35,//0x68,0x2a,//
0x69,0x4a,//0x69,0x62,//0x69,0x4a,//0x69,0x4a,//0x69,0x4a,//0x69,0x39,//
0x6a,0x5a,//0x6a,0x74,//0x6a,0x5a,//0x6a,0x5a,//0x6a,0x5d,//0x6a,0x45,//
0x6b,0x67,//0x6b,0x85,//0x6b,0x67,//0x6b,0x6b,//0x6b,0x6f,//0x6b,0x52,//
0x6c,0x71,//0x6c,0x92,//0x6c,0x71,//0x6c,0x78,//0x6c,0x7d,//0x6c,0x5d,//
0x6d,0x7c,//0x6d,0x9e,//0x6d,0x7c,//0x6d,0x84,//0x6d,0x8a,//0x6d,0x68,//
0x6e,0x8c,//0x6e,0xb2,//0x6e,0x8c,//0x6e,0x98,//0x6e,0x9f,//0x6e,0x7f,//
0x6f,0x9b,//0x6f,0xc0,//0x6f,0x9b,//0x6f,0xa6,//0x6f,0xae,//0x6f,0x91,//
0x70,0xa9,//0x70,0xcc,//0x70,0xa9,//0x70,0xb2,//0x70,0xbb,//0x70,0xa5,//
0x71,0xc0,//0x71,0xe0,//0x71,0xc0,//0x71,0xc6,//0x71,0xd0,//0x71,0xc6,//
0x72,0xd5,//0x72,0xee,//0x72,0xd5,//0x72,0xd5,//0x72,0xdf,//0x72,0xde,//
0x73,0xe8,//0x73,0xf6,//0x73,0xe8,//0x73,0xe8,//0x73,0xe8,//0x73,0xef,//
0x74,0x20,//0x74,0x11,//0x74,0x20,//0x74,0x20,//0x74,0x20,//0x74,0x16,//
//;color matrix
//ttune //ov seeting //
0xab,0x20,//0xab,0x28,//
0xac,0x5b,//0xac,0x48,//
0xad,0x05,//0xad,0x10,//
0xae,0x1b,//0xae,0x18,//
0xaf,0x76,//0xaf,0x75,//
0xb0,0x90,//0xb0,0x8c,//
0xb1,0x90,//0xb1,0x8d,//
0xb2,0x8c,//0xb2,0x8c,//
0xb3,0x04,//0xb3,0x00,//
0xb4,0x98,//0xb4,0x98,//
0xb5,0x00,//0xb5,0x00,//
//;lens shading
0x40,0xFB,//0x40,0x08,//
0x4c,0x03,//0x4c,0x03,//
0x4d,0x30,//0x4d,0xd0,//
0x4e,0x02,//0x4e,0x02,//
0x4f,0x5c,//0x4f,0x5c,//
0x50,0x3e,//0x50,0x3e,//
0x51,0x00,//0x51,0x00,//
0x52,0x66,//0x52,0x66,//
0x53,0x03,//0x53,0x03,//
0x54,0x30,//0x54,0xd0,//
0x55,0x02,//0x55,0x02,//
0x56,0x5c,//0x56,0x5c,//
0x57,0x47,//0x57,0x47,//
0x58,0x00,//0x58,0x00,//
0x59,0x66,//0x59,0x66,//
0x5a,0x03,//0x5a,0x03,//
0x5b,0x20,//0x5b,0xd0,//
0x5c,0x02,//0x5c,0x02,//
0x5d,0x5c,//0x5d,0x5c,/
0x5e,0x3e,//0x5e,0x3e,//
0x5f,0x00,//0x5f,0x00,//
0x60,0x66,//0x60,0x66,//
0x41,0x1f,
0xb5,0x01,
0xb6,0x07,
0xb9,0x3c,
0xba,0x28,
0xb7,0x90,
0xb8,0x08,
0xbf,0x0c,
0xc0,0x3e,
0xa3,0x0a,
0xa4,0x0f,
0xa5,0x09,//denoise threshold
0xa6,0x16,
0x9f,0x0a,
0xa0,0x0f,
0xa7,0x0a,
0xa8,0x0f,
0xa1,0x18,//0xa1,0x10,
0xa2,0x10,//0xa2,0x04,
0xa9,0x00,//0xa9,0x04,
0xaa,0xa6,
//;awb
0x75,0x68,//0x75,0x6a,//
0x76,0x11,//0x76,0x11,//
0x77,0x92,//0x77,0x92,//
0x78,0xa1,//0x78,0xa1,//
0x79,0xe1,//0x79,0xe1,//
0x7a,0x02,//0x7a,0x02,//
0x7c,0x0e,//0x7c,0x05,//
0x7d,0x12,//0x7d,0x08,//
0x7e,0x12,//0x7e,0x08,//
0x7f,0x54,//0x7f,0x7c,//
0x80,0x78,//0x80,0x58,//
0x81,0xa2,//0x81,0x2a,//
0x82,0x80,//0x82,0xc5,//
0x83,0x4e,//0x83,0x46,//
0x84,0x40,//0x84,0x3a,//
0x85,0x4c,//0x85,0x54,//
0x86,0x43,//0x86,0x44,//
0x87,0xf8,//0x87,0xf8,//
0x88,0x08,//0x88,0x08,//
0x89,0x70,//0x89,0x70,//
0x8a,0xf0,//0x8a,0xf0,//
0x8b,0xf0,//0x8b,0xf0,//
0x90,0xe3,
0x93,0x10,
0x94,0x20,
0x95,0x10,
0x96,0x18,
0xff,0xff,//delay 255ms
0xff,0xff,//delay 255ms
};
;
#endif
|