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
|
#include "constants.hpp"
#define OV534_REG_ADDRESS 0xf1 /* sensor address */
// init
const uint8_t ov534_reg_initdata[47][2] = {
{ 0xe7, 0x3a },
{ OV534_REG_ADDRESS, 0x42 }, /* select OV772x sensor */
{ 0x92, 0x01 },
{ 0x93, 0x18 },
{ 0x94, 0x10 },
{ 0x95, 0x10 },
{ 0xE2, 0x00 },
{ 0xE7, 0x3E },
{ 0x96, 0x00 },
{ 0x97, 0x20 },
{ 0x97, 0x20 },
{ 0x97, 0x20 },
{ 0x97, 0x0A },
{ 0x97, 0x3F },
{ 0x97, 0x4A },
{ 0x97, 0x20 },
{ 0x97, 0x15 },
{ 0x97, 0x0B },
{ 0x8E, 0x40 },
{ 0x1F, 0x81 },
{ 0xC0, 0x50 },
{ 0xC1, 0x3C },
{ 0xC2, 0x01 },
{ 0xC3, 0x01 },
{ 0x50, 0x89 },
{ 0x88, 0x08 },
{ 0x8D, 0x00 },
{ 0x8E, 0x00 },
{ 0x1C, 0x00 }, /* video data start (V_FMT) */
{ 0x1D, 0x00 }, /* RAW8 mode */
{ 0x1D, 0x02 }, /* payload size 0x0200 * 4 = 2048 bytes */
{ 0x1D, 0x00 }, /* payload size */
{ 0x1D, 0x01 }, /* frame size = 0x012C00 * 4 = 307200 bytes (640 * 480 @ 8bpp) */
{ 0x1D, 0x2C }, /* frame size */
{ 0x1D, 0x00 }, /* frame size */
{ 0x1C, 0x0A }, /* video data start (V_CNTL0) */
{ 0x1D, 0x08 }, /* turn on UVC header */
{ 0x1D, 0x0E },
{ 0x34, 0x05 },
{ 0xE3, 0x04 },
{ 0x89, 0x00 },
{ 0x76, 0x00 },
{ 0xE7, 0x2E },
{ 0x31, 0xF9 },
{ 0x25, 0x42 },
{ 0x21, 0xF0 },
{ 0xE5, 0x04 }
};
const uint8_t ov772x_reg_initdata[35][2] = {
{ 0x12, 0x80 }, /* reset */
{ 0x3D, 0x00 },
{ 0x12, 0x01 }, /* Processed Bayer RAW (8bit) */
{ 0x11, 0x01 },
{ 0x14, 0x40 },
{ 0x15, 0x00 },
{ 0x63, 0xAA }, // AWB
{ 0x64, 0x87 },
{ 0x66, 0x00 },
{ 0x67, 0x02 },
{ 0x17, 0x26 },
{ 0x18, 0xA0 },
{ 0x19, 0x07 },
{ 0x1A, 0xF0 },
{ 0x29, 0xA0 },
{ 0x2A, 0x00 },
{ 0x2C, 0xF0 },
{ 0x20, 0x10 },
{ 0x4E, 0x0F },
{ 0x3E, 0xF3 },
{ 0x0D, 0x41 },
{ 0x32, 0x00 },
{ 0x13, 0xF0 }, // COM8 - jfrancois 0xf0 orig x0f7
{ 0x22, 0x7F },
{ 0x23, 0x03 },
{ 0x24, 0x40 },
{ 0x25, 0x30 },
{ 0x26, 0xA1 },
{ 0x2A, 0x00 },
{ 0x2B, 0x00 },
{ 0x13, 0xF7 },
{ 0x0C, 0xC0 },
{ 0x11, 0x00 },
{ 0x0D, 0x41 },
{ 0x8E, 0x00 }, // De-noise threshold - jfrancois 0x00 - orig 0x04
};
const uint8_t bridge_start_vga[9][2] = {
{0x1c, 0x00},
{0x1d, 0x00},
{0x1d, 0x02},
{0x1d, 0x00},
{0x1d, 0x01}, /* frame size = 0x012C00 * 4 = 307200 bytes (640 * 480 @ 8bpp) */
{0x1d, 0x2C}, /* frame size */
{0x1d, 0x00}, /* frame size */
{0xc0, 0x50},
{0xc1, 0x3c},
};
const uint8_t sensor_start_vga[8][2] = {
{0x12, 0x01},
{0x17, 0x26},
{0x18, 0xa0},
{0x19, 0x07},
{0x1a, 0xf0},
{0x29, 0xa0},
{0x2c, 0xf0},
{0x65, 0x20},
};
const uint8_t bridge_start_qvga[9][2] = {
{0x1c, 0x00},
{0x1d, 0x00},
{0x1d, 0x02},
{0x1d, 0x00},
{0x1d, 0x00}, /* frame size = 0x004B00 * 4 = 76800 bytes (320 * 240 @ 8bpp) */
{0x1d, 0x4b}, /* frame size */
{0x1d, 0x00}, /* frame size */
{0xc0, 0x28},
{0xc1, 0x1e},
};
const uint8_t sensor_start_qvga[8][2] = {
{0x12, 0x41},
{0x17, 0x3f},
{0x18, 0x50},
{0x19, 0x03},
{0x1a, 0x78},
{0x29, 0x50},
{0x2c, 0x78},
{0x65, 0x2f},
};
// framerate selection
const struct rate_s rate_0[14] =
{
/* 640x480 */
{83, 0x01, 0xc1, 0x02}, /* 83 FPS: video is partly corrupt */
{75, 0x01, 0x81, 0x02}, /* 75 FPS or below: video is valid */
{60, 0x00, 0x41, 0x04},
{50, 0x01, 0x41, 0x02},
{40, 0x02, 0xc1, 0x04},
{30, 0x04, 0x81, 0x02},
{25, 0x00, 0x01, 0x02},
{20, 0x04, 0x41, 0x02},
{15, 0x09, 0x81, 0x02},
{10, 0x09, 0x41, 0x02},
{8, 0x02, 0x01, 0x02},
{5, 0x04, 0x01, 0x02},
{3, 0x06, 0x01, 0x02},
{2, 0x09, 0x01, 0x02},
};
const struct rate_s rate_1[22] =
{
/* 320x240 */
{290, 0x00, 0xc1, 0x04},
{205, 0x01, 0xc1, 0x02}, /* 205 FPS or above: video is partly corrupt */
{187, 0x01, 0x81, 0x02}, /* 187 FPS or below: video is valid */
{150, 0x00, 0x41, 0x04},
{137, 0x02, 0xc1, 0x02},
{125, 0x01, 0x41, 0x02},
{100, 0x02, 0xc1, 0x04},
{90, 0x03, 0x81, 0x02},
{75, 0x04, 0x81, 0x02},
{60, 0x04, 0xc1, 0x04},
{50, 0x04, 0x41, 0x02},
{40, 0x06, 0x81, 0x03},
{37, 0x00, 0x01, 0x04},
{30, 0x04, 0x41, 0x04},
{17, 0x18, 0xc1, 0x02},
{15, 0x18, 0x81, 0x02},
{12, 0x02, 0x01, 0x04},
{10, 0x18, 0x41, 0x02},
{7, 0x04, 0x01, 0x04},
{5, 0x06, 0x01, 0x04},
{3, 0x09, 0x01, 0x04},
{2, 0x18, 0x01, 0x02},
};
|