📄 3xa_sensor.h
字号:
1
2 #ifndef _SAMSUNG_SXGA_H_
3 #define _SAMSUNG_SXGA_H_
4
5 /*******************************************************************************************
6 # Display resolution standards #
7
8 QCIF: 176 x 144
9 CIF: 352 x 288
10 QVGA: 320 x 240
11 VGA: 640 x 480
12 SVGA: 800 x 600
13 XGA: 1024 x 768
14 WXGA: 1280 x 800
15 QVGA: 1280 x 960
16 SXGA: 1280 x 1024
17 SXGA+: 1400 x 1050
18 WSXGA+: 1680 x 1050
19 UXGA: 1600 x 1200
20 WUXGA: 1920 x 1200
21 QXGA: 2048 x 1536
22 ********************************************************************************************/
23
24 //#include "../bits.h"
25
26 /* Camera information
27 * FPC Label : Samsung MEGA Pixel Camera : V4220 REV06
28 * Modified by charles -Initial function of '3AA' test routine
29 * Modified and tested by YongHwui.Kim <yonghwui.kim@samsung.com> for S5K3AAEX Camera
30 */
31
32 #define CHIP_DELAY 0xFF
33
34 typedef struct samsung_t{
35 unsigned char subaddr;
36 unsigned char value;
37 unsigned char page;
38 } s5k3xa_t;
39
40 #ifdef CONFIG_CPU_S3C24A0A
41 #define TRY_HIGH_CLOCK 1
42 #endif
43
44 //***************************************************
45 // name: S5K3AAEX EVT2 setfile
46 // ver: v2.61
47 // history:
48 // v0.0 start from 040908 setfile
49 // v1.0 arange register
50 // v1.01 change MCLK(25Mhz) and Frame rate(7fps)
51 // v2.0 adjust register setting for 3AA EVT2
52 // - color correction, RGB shding off, hsync start position, Mirror, fps
53 // - Color Tuning, YGRPDLY
54 // v2.1 change Frame rate(7.5fps) and Total gain to x4
55 // (because of reducing visual noise at low illumination)
56 // - change BPRM AGC Max and FrameAE start
57 // improve AE speed
58 // v2.2 modify AWB G gain and solve 50hz flicker detection fail in 25MHz 7.5fps
59 // v2.3 Adjust gamma, Dark Slice, white point, Hue gain,
60 // White Balance B control, Y gain On, Digital Clamp On
61 // lower AWB G gain
62 // v2.4 Adjust AE window weight, Y Gamma, WhitePoint, Shading and BPR Max Thres.
63 // v2.41 Adjust AE/AWB window and AWB internal window boundary to decrease skin color tracking
64 // v2.411 special version for PSCDS
65 // v2.412 RGB shading off
66 // v2.5 Lens change STW to Sekonix
67 // adjust White point and Y shading Coef (RGB shading off)
68 // v2.6 New Tuning because of Full YC off and YCbCr Coef change
69 // Gamma, Dark Slice, color matrix (not use), Color suppress
70 // R Gain and DBPR agc MIN/MAX
71 // v2.61 VCK inversion(data rising)
72 //***************************************************
73 ///////////////////////////////////////////////////
74
75 #if defined(CONFIG_VIDEO_SAMSUNG_S5K3AA) // page 0
76 // VGA : 640 x 480
77 s5k3xa_t s5k3aa_reg[] =
78 {
79 #if 0
80 {0xec,0x00},
81 {0x02,0x01}, /* 0x0 : SXGA, 0x01 : VGA, 0x02:QVGA */
82 {0x72,0xF0}, //MCLK is 48MHz
83 {0x74,0x08}, //50Hz Flicker avoidance
84 {0x76,0xb0}, //brightness
85 {0x77,0xd0}, //color
86 {0x79,0x05}, //brightness
87 {0x7a,0x03}, //color
88
89 {0xec,0x01},
90 {0x8b,0x03},
91 #else // Mirror
92 {0xec,0x00},
93 {0x23,0x52}, // RV/H Control
94 {0xec,0x06},
95 {0x8c,0x0b}, // in case of wrp wcp control for mirror
96 {0x8d,0x0c},
97 {0x8e,0x0b},
98 {0x8f,0x0c},
99
100 {0xec,0x00},
101 {0x34,0x0e}, // AWB Tracking Boundary Constant R_Limit High
102 /////////////////////////////
103 // Color Tunning
104
105 //White Point
106 {0x40,0x18}, //1c //18
107 {0x41,0x4b}, //4a //41 //4a
108 {0x42,0x1e}, //23 //1e
109 {0x43,0x3c}, //39 //33 //3b
110 {0x44,0x2a}, //29 //2a //2e //2b
111 {0x45,0x2e}, //2b //2c //2b //25 //2d
112
113 //Hue, Gain control
114 {0x48,0xf8}, //f0 //c0 //fe
115 {0x49,0xfe},
116 {0x4a,0x32}, //28 //03 //01
117 {0x4b,0x40},
118 {0x4c,0xfe},
119 {0x4d,0xfe},
120 {0x4e,0x50}, //0e
121 {0x4f,0x08}, //10 //d0 //10 //02
122
123 {0x50,0xf0}, //e0 //a4 //aa //e0
124 {0x51,0xfe}, //fe
125 {0x52,0x42}, //40 //28 //01
126 {0x53,0x40}, //3e
127 {0x54,0xfe},
128 {0x55,0xfe}, //fc //fe
129 {0x56,0x2a}, //6a //2e
130 {0x57,0x20}, //18 //30 //1a //32
131
132 {0x58,0xda}, //ea //ca //a4 //aa //c6
133 {0x59,0xfe}, //ec //fa
134 {0x5a,0x54}, //44 //4a //20 //30 //35 //30
135 {0x5b,0x28}, //38 //20 //1a //32
136 {0x5c,0xfe},
137 {0x5d,0xfe},
138 {0x5e,0x4a}, //7e //7a
139 {0x5f,0x20}, //40 //18 //08 //20 //30 //3a //2a //42
140
141 {0x6c,0x10}, // AE Target
142 {0x77,0xea}, // Color Gain
143 {0x79,0xfe}, // White balance R control
144 {0x7a,0x01}, // White balance B control
145 {0x83,0xc0}, // Color suppress
146 //s8a04 // unstable diff
147
148 ///////////////////////////////////////////////////
149 // page 1
150 {0xec,0x01},
151 {0x8b,0x21}, //V Output Sync inversion, Full_YC off,SCK656_INV_R
152 {0x6a,0x07}, //Y,Cr first ITU R-601 format
153
154 {0xec,0x03},
155 {0x06,0x07},
156
157 {0xec,0x04},
158 {0x06,0x07},
159
160 {0xec,0x01},
161 {0x2d,0x15}, //Adjust YGRPDLY 3clk->0clk
162
163 /// Color Matrix
164 //s107e
165 //s12fe
166 //s187e //a0
167
168 {0x1c,0xd0}, // Highlight Suppress Reference
169 /////////////////////////////
170 // gamma : 1.800000
171 //Y Gamma
172 {0x2e,0x08},
173 {0x2f,0x18},
174 {0x30,0x26},
175 {0x31,0x70}, //60
176 {0x32,0xf0}, //e0
177 {0x33,0x94}, //90
178 {0x34,0x70}, //b0
179 {0x35,0xbc}, //80
180 {0x36,0x00},
181 {0x37,0x1b},
182
183 // Dark Slice
184 //s4018 // Black Balance Red
185 //s4118 //fe // Black Balance Blue
186 //s4211 //fa // Black Balance Green
187
188 {0x41,0xfe}, // Black Balance Blue
189 {0x42,0xfa}, // Black Balance Green
190
191 {0x48,0xee}, // YCrCb Coef
192 {0x49,0xf7},
193
194 //C Gamma
195 {0x55,0x08}, //08
196 {0x56,0x18}, //18
197 {0x57,0x26}, //26
198 {0x58,0x60}, //70 //60
199 {0x59,0xf0}, //e0
200 {0x5a,0xa9}, //94 //90
201 {0x5b,0x60}, //3b //70 //7b //b0
202 {0x5c,0x50}, //96 //bc //5a //80
203 {0x5d,0x00}, //00
204 {0x5e,0x1b}, //1b
205
206 {0x69,0x0f}, // VCK inversion(data rising)
207 {0xec,0x03},
208 {0x05,0x0f},
209 {0xec,0x04},
210 {0x05,0x0f},
211
212 {0xec,0x01},
213 //adjust AE window
214 {0x97,0x18},
215 {0x9a,0xe0},
216 {0x9c,0x20},
217 {0x9e,0xe8},
218
219 {0xec,0x06},
220 {0x00,0x18},
221 {0x02,0xe0},
222 {0x04,0x20},
223 {0x06,0xe8},
224
225 //adjust AWB window
226 {0xec,0x01},
227 {0xa0,0x5a},
228 {0xa2,0xd8},
229 {0xa4,0x33},
230 {0xa6,0xba},
231
232 {0xec,0x06},
233 {0x08,0x5a},
234 {0x0a,0xd8},
235 {0x0c,0x33},
236 {0x0e,0xba},
237
238 {0xec,0x01},
239 {0xaa,0xe0}, // For AWB, High Threshold Value of Y signal
240 {0xab,0x30}, // For AWB, Low Threshold Value of Y signal
241
242 /// Pixel Filter
243 {0xac,0x80}, // AWB B-G Low Threshold
244 {0xad,0x80}, // AWB B-G High Threshold
245 {0xae,0x80}, // AWB R-G Low Threshold
246 {0xaf,0x80}, // AWB R-G Low Threshold
247 {0xb0,0x60}, // AWB R-G,B-G High Threshold
248 {0xb1,0x80}, // AWB R-G,B-G Low Threshold
249
250 ///////////////////////////////////////////////////
251 //// page 2
252 {0xec,0x02},
253 {0x05,0x0b},
254 {0x07,0x0b},
255 //s1f13 //Adjust Global Gain for 20Mhz
256 {0x26,0x86}, //ADLC Set
257 {0x2d,0x00}, //APS Bias Current 6uA ---> 1uA for SHBN & HN reduce
258 {0x2e,0x50}, //Ramp Gain
259 {0x2f,0x30}, //Ramp Bias Current for SHBN reduce
260 {0x30,0x05}, //for reducing noise... switch cap
261
262 ///////////////////////////////////////////////////
263 //// page 5
264 // Shading
265 {0xec,0x05},
266 {0x00,0x0d}, // Shading Old(Y shading) ON & Shading New(RGB Shading) OFF
267 //s000f // Shading Old(Y shading) & Shading New(RGB Shading)
268
269 ///RGB Shading
270 {0x05,0x05}, // R Shading of RGB Shading
271 {0x06,0x05},
272 {0x07,0x05},
273 {0x08,0x05},
274 {0x09,0x00}, // GR Shading of RGB Shading
275 {0x0a,0x00},
276 {0x0b,0x00},
277 {0x0c,0x00},
278 {0x0d,0x00}, // GB Shading of RGB Shading
279 {0x0e,0x00},
280 {0x0f,0x00},
281 {0x10,0x00},
282 {0x11,0x00}, // B Shading of RGB Shading
283 {0x12,0x00},
284 {0x13,0x00},
285 {0x14,0x00},
286
287 /// Y Shading
288 {0x2d,0xd0}, //e0 //d6 //e0
289 {0x2e,0xb0}, //c0 //aa //c0
290 {0x2f,0xa0}, //95 //a0
291 {0x30,0x88}, //86 //88 //80
292 {0x31,0x88}, //86 //88 //80
293 {0x32,0xa0}, //95 //a0
294 {0x33,0xb0}, //c0 //aa //c0
295 {0x34,0xd0}, //e0 //d6 //e0
296
297 {0x35,0xd0}, //e0
298 {0x36,0xb0}, //ba //a6
299 {0x37,0x98}, //94 //90
300 {0x38,0x88}, //80
301 {0x39,0x88}, //80
302 {0x3a,0x98}, //94 //90
303 {0x3b,0xb0}, //ba //a6
304 {0x3c,0xd0}, //e0
305
306 ////////////////////////////////////////////////
307 // page 7
308 {0xec,0x07},
309 {0x11,0xfe}, // GGain_Offset
310 {0x17,0x40}, // lower AWB Ggain because G is stronger than R/B
311 //s1742 // modify AWB Ggain to make <1.46> =0x40(x1)
312
313 {0x3c,0x00}, //adjust AWB internal window boundary to decrease skin color tracking
314
315 // to dectect 50Hz flicker in 25Mhz 7.5fps
316 {0x60,0x10}, // adjust flicker thres
317 {0x62,0x11}, // adjust edge detection boundary
318 {0x63,0x04},
319
320 {0x69,0x10}, // for mirror
321 {0x70,0x80}, // BLC Off
322
323 // AE weight
324 {0x80,0x10}, //40
325 {0x81,0x00}, //10
326 {0x82,0x01}, //10
327 {0x83,0x02}, //10
328 {0x84,0x02}, //30
329
330 ///////////////////////////////
331 // control start position(hsync hblank )
332 // to remove broken pixel width on left side
333 {0xec,0x01},
334 {0x78,0x3d}, // HBLK START
335 {0x82,0x3d}, // HS656 START
336
337 {0xec,0x03},
338 {0x0e,0x3d},
339 {0x18,0x3d},
340
341 {0xec,0x04},
342 {0x0e,0x3d},
343 {0x18,0x3d},
344
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -