PicoCamera 0.2.0
Camera library for RP2040 with an esp32-camera compatible API
GitHub
Loading...
Searching...
No Matches
gc0308_settings.h
1/*
2 * This file is part of the PicoCamera project.
3 * https://github.com/umeiko/PicoCamera
4 *
5 * Author: umeko <umeko@stu.xmu.edu.cn>
6 * License: MIT
7 */
8
9/*
10 * GC0308 default initialization register table.
11 * Ported verbatim from esp32-camera's private_include/gc0308_settings.h
12 * (Apache-2.0), comments preserved as-is.
13 *
14 * The table is terminated by {REGLIST_TAIL, 0x00}; REG_DLY as the register
15 * field marks a delay in milliseconds (not used by this table today).
16 */
17#ifndef __GC0308_SETTINGS_H__
18#define __GC0308_SETTINGS_H__
19
20#include <stdint.h>
21
22#define REG_DLY 0xffff
23#define REGLIST_TAIL 0x0000 /* Array end token */
24
25static const uint16_t gc0308_default_init_regs[][2] = {
26 {0xfe, 0x00},
27 {0xec, 0x20},
28 {0x05, 0x00},
29 {0x06, 0x00},
30 {0x07, 0x00},
31 {0x08, 0x00},
32 {0x09, 0x01},
33 {0x0a, 0xe8},
34 {0x0b, 0x02},
35 {0x0c, 0x88},
36 {0x0d, 0x02},
37 {0x0e, 0x02},
38 {0x10, 0x26},
39 {0x11, 0x0d},
40 {0x12, 0x2a},
41 {0x13, 0x00},
42 {0x14, 0x10}, // Linux kernel: CISCTL_MODE1 = 0x10 (no mirror/flip by default)
43 {0x15, 0x0a},
44 {0x16, 0x05},
45 {0x17, 0x01},
46 {0x18, 0x44},
47 {0x19, 0x44},
48 {0x1a, 0x2a},
49 {0x1b, 0x00},
50 {0x1c, 0x49},
51 {0x1d, 0x9a},
52 {0x1e, 0x61},
53 {0x1f, 0x00}, //pad drv <=24MHz, use 0x00 is ok
54 {0x20, 0x7f},
55 {0x21, 0xfa},
56 {0x22, 0x57},
57 {0x24, 0xa2}, //YCbYCr
58 {0x25, 0x0f},
59 {0x26, 0x03}, // 0x01
60 {0x28, 0x00},
61 {0x2d, 0x0a},
62 {0x2f, 0x01},
63 {0x30, 0xf7},
64 {0x31, 0x50},
65 {0x32, 0x00},
66 {0x33, 0x28},
67 {0x34, 0x2a},
68 {0x35, 0x28},
69 {0x39, 0x04},
70 {0x3a, 0x20},
71 {0x3b, 0x20},
72 {0x3c, 0x00},
73 {0x3d, 0x00},
74 {0x3e, 0x00},
75 {0x3f, 0x00},
76 {0x50, 0x14}, // GLOBAL_GAIN = 0x14 (default gain)
77 {0x52, 0x41},
78 {0x53, 0x80},
79 {0x54, 0x80},
80 {0x55, 0x80},
81 {0x56, 0x80},
82 // AWB Gain initialization (from Linux kernel driver)
83 {0x5a, 0x56}, // AWB_R_GAIN: Red gain for auto white balance
84 {0x5b, 0x40}, // AWB_G_GAIN: Green gain for auto white balance
85 {0x5c, 0x4a}, // AWB_B_GAIN: Blue gain for auto white balance
86 {0x8b, 0x20},
87 {0x8c, 0x20},
88 {0x8d, 0x20},
89 {0x8e, 0x14},
90 {0x8f, 0x10},
91 {0x90, 0x14},
92 {0x91, 0x3c},
93 {0x92, 0x50},
94//{0x8b,0x10},
95//{0x8c,0x10},
96//{0x8d,0x10},
97//{0x8e,0x10},
98//{0x8f,0x10},
99//{0x90,0x10},
100//{0x91,0x3c},
101//{0x92,0x50},
102 {0x5d, 0x12},
103 {0x5e, 0x1a},
104 {0x5f, 0x24},
105 {0x60, 0x07},
106 {0x61, 0x15},
107 {0x62, 0x08}, // 0x08
108 {0x64, 0x03}, // 0x03
109 {0x66, 0xe8},
110 {0x67, 0x86},
111 {0x68, 0x82},
112 {0x69, 0x18},
113 {0x6a, 0x0f},
114 {0x6b, 0x00},
115 {0x6c, 0x5f},
116 {0x6d, 0x8f},
117 {0x6e, 0x55},
118 {0x6f, 0x38},
119 {0x70, 0x15},
120 {0x71, 0x33},
121 {0x72, 0xdc},
122 {0x73, 0x00},
123 {0x74, 0x02},
124 {0x75, 0x3f},
125 {0x76, 0x02},
126 {0x77, 0x38}, // 0x47
127 {0x78, 0x88},
128 {0x79, 0x81},
129 {0x7a, 0x81},
130 {0x7b, 0x22},
131 {0x7c, 0xff},
132 {0x93, 0x48}, //color matrix default
133 {0x94, 0x02},
134 {0x95, 0x07},
135 {0x96, 0xe0},
136 {0x97, 0x40},
137 {0x98, 0xf0},
138 {0xb1, 0x40},
139 {0xb2, 0x40},
140 {0xb3, 0x40}, //0x40
141 {0xb6, 0xe0},
142 {0xbd, 0x38},
143 {0xbe, 0x36},
144 {0xd0, 0xCB},
145 {0xd1, 0x10},
146 {0xd2, 0x90},
147 {0xd3, 0x48},
148 {0xd5, 0xF2},
149 {0xd6, 0x16},
150 {0xdb, 0x92},
151 {0xdc, 0xA5},
152 {0xdf, 0x23},
153 {0xd9, 0x00},
154 {0xda, 0x00},
155 {0xe0, 0x09},
156 {0xed, 0x04},
157 {0xee, 0xa0},
158 {0xef, 0x40},
159 {0x80, 0x03},
160
161 {0x9F, 0x10},
162 {0xA0, 0x20},
163 {0xA1, 0x38},
164 {0xA2, 0x4e},
165 {0xA3, 0x63},
166 {0xA4, 0x76},
167 {0xA5, 0x87},
168 {0xA6, 0xa2},
169 {0xA7, 0xb8},
170 {0xA8, 0xca},
171 {0xA9, 0xd8},
172 {0xAA, 0xe3},
173 {0xAB, 0xeb},
174 {0xAC, 0xf0},
175 {0xAD, 0xF8},
176 {0xAE, 0xFd},
177 {0xAF, 0xFF},
178
179 {0xc0, 0x00},
180 {0xc1, 0x10},
181 {0xc2, 0x1c},
182 {0xc3, 0x30},
183 {0xc4, 0x43},
184 {0xc5, 0x54},
185 {0xc6, 0x65},
186 {0xc7, 0x75},
187 {0xc8, 0x93},
188 {0xc9, 0xB0},
189 {0xca, 0xCB},
190 {0xcb, 0xE6},
191 {0xcc, 0xFF},
192 {0xf0, 0x02},
193 {0xf1, 0x01},
194 {0xf2, 0x02},
195 {0xf3, 0x30},
196 {0xf7, 0x04},
197 {0xf8, 0x02},
198 {0xf9, 0x9f},
199 {0xfa, 0x78},
200 {0xfe, 0x01},
201 {0x00, 0xf5},
202 {0x02, 0x20},
203 {0x04, 0x10},
204 {0x05, 0x08},
205 {0x06, 0x20},
206 {0x08, 0x0a},
207 {0x0a, 0xa0},
208 {0x0b, 0x60},
209 {0x0c, 0x08},
210 {0x0e, 0x44},
211 {0x0f, 0x32},
212 {0x10, 0x41},
213 {0x11, 0x37},
214 {0x12, 0x22},
215 {0x13, 0x19},
216 {0x14, 0x44},
217 {0x15, 0x44},
218 {0x16, 0xc2},
219 {0x17, 0xA8},
220 {0x18, 0x18},
221 {0x19, 0x50},
222 {0x1a, 0xd8},
223 {0x1b, 0xf5},
224 {0x70, 0x40},
225 {0x71, 0x58},
226 {0x72, 0x30},
227 {0x73, 0x48},
228 {0x74, 0x20},
229 {0x75, 0x60},
230 {0x77, 0x20},
231 {0x78, 0x32},
232 {0x30, 0x03},
233 {0x31, 0x40},
234 {0x32, 0x10},
235 {0x33, 0xe0},
236 {0x34, 0xe0},
237 {0x35, 0x00},
238 {0x36, 0x80},
239 {0x37, 0x00},
240 {0x38, 0x04},
241 {0x39, 0x09},
242 {0x3a, 0x12},
243 {0x3b, 0x1C},
244 {0x3c, 0x28},
245 {0x3d, 0x31},
246 {0x3e, 0x44},
247 {0x3f, 0x57},
248 {0x40, 0x6C},
249 {0x41, 0x81},
250 {0x42, 0x94},
251 {0x43, 0xA7},
252 {0x44, 0xB8},
253 {0x45, 0xD6},
254 {0x46, 0xEE},
255 {0x47, 0x0d},
256 {0x62, 0xf7},
257 {0x63, 0x68},
258 {0x64, 0xd3},
259 {0x65, 0xd3},
260 {0x66, 0x60},
261 {0xfe, 0x00},
262
263 {0x01, 0x32}, //frame setting
264 {0x02, 0x0c},
265 {0x0f, 0x01},
266 {0xe2, 0x00},
267 {0xe3, 0x78},
268 {0xe4, 0x00},
269 {0xe5, 0xfe},
270 {0xe6, 0x01},
271 {0xe7, 0xe0},
272 {0xe8, 0x01},
273 {0xe9, 0xe0},
274 {0xea, 0x01},
275 {0xeb, 0xe0},
276 {0xfe, 0x00},
277
278 {REGLIST_TAIL, 0x00},
279};
280
281#endif // __GC0308_SETTINGS_H__
中文文档