Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
mt9v117.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Freek van Tienen <freek.v.tienen@gmail.com>
3 *
4 * This file is part of Paparazzi.
5 *
6 * Paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * Paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
27#include "std.h"
28#include "mt9v117.h"
29#include "mt9v117_regs.h"
31
32#include <stdio.h>
33#include <unistd.h>
34#include <fcntl.h>
35#include <sys/ioctl.h>
36#include <linux/i2c-dev.h>
37#include <linux/videodev2.h>
38#include <linux/v4l2-mediabus.h>
39
40#ifdef BOARD_DISCO
41#include "boards/disco.h"
42#else
43#include "boards/bebop.h"
44#endif
45
46
47#ifndef MS9v117_CROP_WIDTH
48#define MS9v117_CROP_WIDTH 240
49#endif
50
51#ifndef MS9v117_CROP_HEIGHT
52#define MS9v117_CROP_HEIGHT 240
53#endif
54
55#if MS9v117_CROP_WIDTH > 320 || MS9v117_CROP_HEIGHT > 240
56#error "MT9V117 crop size too large: set up the sensor for higher resolution"
57#endif
58
59
60/* Camera structure */
62 .output_size = {
65 },
66 .sensor_size = {
67 .w = 320,
68 .h = 240,
69 },
70 .crop = {
71 .x = ((320 - MS9v117_CROP_WIDTH) / 2),
72 .y = 0,
75 },
76 .dev_name = "/dev/video0",
77 .subdev_name = "/dev/v4l-subdev0",
78 .format = V4L2_PIX_FMT_UYVY,
79 .subdev_format = V4L2_MBUS_FMT_UYVY8_2X8,
80 .buf_cnt = 5,
81 .filters = 0,
82 .cv_listener = NULL,
83 .fps = MT9V117_TARGET_FPS,
84 .camera_intrinsics = {
85 .focal_x = MT9V117_FOCAL_X,
86 .focal_y = MT9V117_FOCAL_Y,
87 .center_x = MT9V117_CENTER_X,
88 .center_y = MT9V117_CENTER_Y,
89 .Dhane_k = MT9V117_DHANE_K
90 }
91};
92
95};
96
97/* Patch lines */
98//I2C_BUF_LEN must be higher then size of these patch lines
99#define MT9V117_PATCH_LINE_NUM 13
101 0xf0, 0x00, 0x72, 0xcf, 0xff, 0x00, 0x3e, 0xd0, 0x92, 0x00,
102 0x71, 0xcf, 0xff, 0xff, 0xf2, 0x18, 0xb1, 0x10, 0x92, 0x05,
103 0xb1, 0x11, 0x92, 0x04, 0xb1, 0x12, 0x70, 0xcf, 0xff, 0x00,
104 0x30, 0xc0, 0x90, 0x00, 0x7f, 0xe0, 0xb1, 0x13, 0x70, 0xcf,
105 0xff, 0xff, 0xe7, 0x1c, 0x88, 0x36, 0x09, 0x0f, 0x00, 0xb3
106};
107
109 0xf0, 0x30, 0x69, 0x13, 0xe1, 0x80, 0xd8, 0x08, 0x20, 0xca,
110 0x03, 0x22, 0x71, 0xcf, 0xff, 0xff, 0xe5, 0x68, 0x91, 0x35,
111 0x22, 0x0a, 0x1f, 0x80, 0xff, 0xff, 0xf2, 0x18, 0x29, 0x05,
112 0x00, 0x3e, 0x12, 0x22, 0x11, 0x01, 0x21, 0x04, 0x0f, 0x81,
113 0x00, 0x00, 0xff, 0xf0, 0x21, 0x8c, 0xf0, 0x10, 0x1a, 0x22
114};
115
117 0xf0, 0x60, 0x10, 0x44, 0x12, 0x20, 0x11, 0x02, 0xf7, 0x87,
118 0x22, 0x4f, 0x03, 0x83, 0x1a, 0x20, 0x10, 0xc4, 0xf0, 0x09,
119 0xba, 0xae, 0x7b, 0x50, 0x1a, 0x20, 0x10, 0x84, 0x21, 0x45,
120 0x01, 0xc1, 0x1a, 0x22, 0x10, 0x44, 0x70, 0xcf, 0xff, 0x00,
121 0x3e, 0xd0, 0xb0, 0x60, 0xb0, 0x25, 0x7e, 0xe0, 0x78, 0xe0
122};
123
125 0xf0, 0x90, 0x71, 0xcf, 0xff, 0xff, 0xf2, 0x18, 0x91, 0x12,
126 0x72, 0xcf, 0xff, 0xff, 0xe7, 0x1c, 0x8a, 0x57, 0x20, 0x04,
127 0x0f, 0x80, 0x00, 0x00, 0xff, 0xf0, 0xe2, 0x80, 0x20, 0xc5,
128 0x01, 0x61, 0x20, 0xc5, 0x03, 0x22, 0xb1, 0x12, 0x71, 0xcf,
129 0xff, 0x00, 0x3e, 0xd0, 0xb1, 0x04, 0x7e, 0xe0, 0x78, 0xe0
130};
131
133 0xf0, 0xc0, 0x70, 0xcf, 0xff, 0xff, 0xe7, 0x1c, 0x88, 0x57,
134 0x71, 0xcf, 0xff, 0xff, 0xf2, 0x18, 0x91, 0x13, 0xea, 0x84,
135 0xb8, 0xa9, 0x78, 0x10, 0xf0, 0x03, 0xb8, 0x89, 0xb8, 0x8c,
136 0xb1, 0x13, 0x71, 0xcf, 0xff, 0x00, 0x30, 0xc0, 0xb1, 0x00,
137 0x7e, 0xe0, 0xc0, 0xf1, 0x09, 0x1e, 0x03, 0xc0, 0xc1, 0xa1
138};
139
141 0xf0, 0xf0, 0x75, 0x08, 0x76, 0x28, 0x77, 0x48, 0xc2, 0x40,
142 0xd8, 0x20, 0x71, 0xcf, 0x00, 0x03, 0x20, 0x67, 0xda, 0x02,
143 0x08, 0xae, 0x03, 0xa0, 0x73, 0xc9, 0x0e, 0x25, 0x13, 0xc0,
144 0x0b, 0x5e, 0x01, 0x60, 0xd8, 0x06, 0xff, 0xbc, 0x0c, 0xce,
145 0x01, 0x00, 0xd8, 0x00, 0xb8, 0x9e, 0x0e, 0x5a, 0x03, 0x20
146};
147
149 0xf1, 0x20, 0xd9, 0x01, 0xd8, 0x00, 0xb8, 0x9e, 0x0e, 0xb6,
150 0x03, 0x20, 0xd9, 0x01, 0x8d, 0x14, 0x08, 0x17, 0x01, 0x91,
151 0x8d, 0x16, 0xe8, 0x07, 0x0b, 0x36, 0x01, 0x60, 0xd8, 0x07,
152 0x0b, 0x52, 0x01, 0x60, 0xd8, 0x11, 0x8d, 0x14, 0xe0, 0x87,
153 0xd8, 0x00, 0x20, 0xca, 0x02, 0x62, 0x00, 0xc9, 0x03, 0xe0
154};
155
157 0xf1, 0x50, 0xc0, 0xa1, 0x78, 0xe0, 0xc0, 0xf1, 0x08, 0xb2,
158 0x03, 0xc0, 0x76, 0xcf, 0xff, 0xff, 0xe5, 0x40, 0x75, 0xcf,
159 0xff, 0xff, 0xe5, 0x68, 0x95, 0x17, 0x96, 0x40, 0x77, 0xcf,
160 0xff, 0xff, 0xe5, 0x42, 0x95, 0x38, 0x0a, 0x0d, 0x00, 0x01,
161 0x97, 0x40, 0x0a, 0x11, 0x00, 0x40, 0x0b, 0x0a, 0x01, 0x00
162};
163
165 0xf1, 0x80, 0x95, 0x17, 0xb6, 0x00, 0x95, 0x18, 0xb7, 0x00,
166 0x76, 0xcf, 0xff, 0xff, 0xe5, 0x44, 0x96, 0x20, 0x95, 0x15,
167 0x08, 0x13, 0x00, 0x40, 0x0e, 0x1e, 0x01, 0x20, 0xd9, 0x00,
168 0x95, 0x15, 0xb6, 0x00, 0xff, 0xa1, 0x75, 0xcf, 0xff, 0xff,
169 0xe7, 0x1c, 0x77, 0xcf, 0xff, 0xff, 0xe5, 0x46, 0x97, 0x40
170};
171
173 0xf1, 0xb0, 0x8d, 0x16, 0x76, 0xcf, 0xff, 0xff, 0xe5, 0x48,
174 0x8d, 0x37, 0x08, 0x0d, 0x00, 0x81, 0x96, 0x40, 0x09, 0x15,
175 0x00, 0x80, 0x0f, 0xd6, 0x01, 0x00, 0x8d, 0x16, 0xb7, 0x00,
176 0x8d, 0x17, 0xb6, 0x00, 0xff, 0xb0, 0xff, 0xbc, 0x00, 0x41,
177 0x03, 0xc0, 0xc0, 0xf1, 0x0d, 0x9e, 0x01, 0x00, 0xe8, 0x04
178};
179
181 0xf1, 0xe0, 0xff, 0x88, 0xf0, 0x0a, 0x0d, 0x6a, 0x01, 0x00,
182 0x0d, 0x8e, 0x01, 0x00, 0xe8, 0x7e, 0xff, 0x85, 0x0d, 0x72,
183 0x01, 0x00, 0xff, 0x8c, 0xff, 0xa7, 0xff, 0xb2, 0xd8, 0x00,
184 0x73, 0xcf, 0xff, 0xff, 0xf2, 0x40, 0x23, 0x15, 0x00, 0x01,
185 0x81, 0x41, 0xe0, 0x02, 0x81, 0x20, 0x08, 0xf7, 0x81, 0x34
186};
187
189 0xf2, 0x10, 0xa1, 0x40, 0xd8, 0x00, 0xc0, 0xd1, 0x7e, 0xe0,
190 0x53, 0x51, 0x30, 0x34, 0x20, 0x6f, 0x6e, 0x5f, 0x73, 0x74,
191 0x61, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
192 0x69, 0x6e, 0x67, 0x20, 0x25, 0x64, 0x20, 0x25, 0x64, 0x0a,
193 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
194};
195
197 0xf2, 0x40, 0xff, 0xff, 0xe8, 0x28, 0xff, 0xff, 0xf0, 0xe8,
198 0xff, 0xff, 0xe8, 0x08, 0xff, 0xff, 0xf1, 0x54
199};
200
201/* Patch lines structure */
206
208 {patch_line1, sizeof(patch_line1)},
209 {patch_line2, sizeof(patch_line2)},
210 {patch_line3, sizeof(patch_line3)},
211 {patch_line4, sizeof(patch_line4)},
212 {patch_line5, sizeof(patch_line5)},
213 {patch_line6, sizeof(patch_line6)},
214 {patch_line7, sizeof(patch_line7)},
215 {patch_line8, sizeof(patch_line8)},
216 {patch_line9, sizeof(patch_line9)},
217 {patch_line10, sizeof(patch_line10)},
218 {patch_line11, sizeof(patch_line11)},
219 {patch_line12, sizeof(patch_line12)},
220 {patch_line13, sizeof(patch_line13)}
221};
222
226static void write_reg(struct mt9v117_t *mt, uint16_t addr, uint32_t val, uint16_t len)
227{
228 mt->i2c_trans.buf[0] = addr >> 8;
229 mt->i2c_trans.buf[1] = addr & 0xFF;
230
231 // Fix sigdness based on length
232 if (len == 1) {
233 mt->i2c_trans.buf[2] = val & 0xFF;
234 } else if (len == 2) {
235 mt->i2c_trans.buf[2] = (val >> 8) & 0xFF;
236 mt->i2c_trans.buf[3] = val & 0xFF;
237 } else if (len == 4) {
238 mt->i2c_trans.buf[2] = (val >> 24) & 0xFF;
239 mt->i2c_trans.buf[3] = (val >> 16) & 0xFF;
240 mt->i2c_trans.buf[4] = (val >> 8) & 0xFF;
241 mt->i2c_trans.buf[5] = val & 0xFF;
242 } else {
243 printf("[MT9V117] write_reg with incorrect length %d\r\n", len);
244 }
245
246 // Transmit the buffer
247 i2c_blocking_transmit(mt->i2c_periph, &mt->i2c_trans, MT9V117_ADDRESS, len + 2, 0.5);
248}
249
254{
255 uint32_t ret = 0;
256 mt->i2c_trans.buf[0] = addr >> 8;
257 mt->i2c_trans.buf[1] = addr & 0xFF;
258
259 // Transmit the buffer and receive back
260 i2c_blocking_transceive(mt->i2c_periph, &mt->i2c_trans, MT9V117_ADDRESS, 2, len, 0.5);
261
262 /* Fix sigdness */
263 for (uint8_t i = 0; i < len; i++) {
264 ret |= mt->i2c_trans.buf[len - i - 1] << (8 * i);
265 }
266 return ret;
267}
268
269/* Write a byte to a var */
271{
272 uint16_t addr = 0x8000 | (var << 10) | offset;
273 write_reg(mt, addr, val, len);
274}
275
276/* Read a byte from a var */
278{
279 uint16_t addr = 0x8000 | (var << 10) | offset;
280 return read_reg(mt, addr, len);
281}
282
283static inline void mt9v117_write_patch(struct mt9v117_t *mt)
284{
285 /* Errata item 2 */
286 write_reg(mt, 0x301a, 0x10d0, 2);
287 write_reg(mt, 0x31c0, 0x1404, 2);
288 write_reg(mt, 0x3ed8, 0x879c, 2);
289 write_reg(mt, 0x3042, 0x20e1, 2);
290 write_reg(mt, 0x30d4, 0x8020, 2);
291 write_reg(mt, 0x30c0, 0x0026, 2);
292 write_reg(mt, 0x301a, 0x10d4, 2);
293
294 /* Errata item 6 */
295 write_var(mt, MT9V117_AE_TRACK_VAR, 0x0002, 0x00d3, 2);
296 write_var(mt, MT9V117_CAM_CTRL_VAR, 0x0078, 0x00a0, 2);
297 write_var(mt, MT9V117_CAM_CTRL_VAR, 0x0076, 0x0140, 2);
298
299 /* Errata item 8 */
300 write_var(mt, MT9V117_LOW_LIGHT_VAR, 0x0004, 0x00fc, 2);
301 write_var(mt, MT9V117_LOW_LIGHT_VAR, 0x0038, 0x007f, 2);
302 write_var(mt, MT9V117_LOW_LIGHT_VAR, 0x003a, 0x007f, 2);
303 write_var(mt, MT9V117_LOW_LIGHT_VAR, 0x003c, 0x007f, 2);
304 write_var(mt, MT9V117_LOW_LIGHT_VAR, 0x0004, 0x00f4, 2);
305
306 /* Patch 0403; Critical; Sensor optimization */
309
310 /* Write patch */
311 for (uint8_t i = 0; i < MT9V117_PATCH_LINE_NUM; ++i) {
312 // Copy buffer
313 for (uint8_t j = 0; j < mt9v117_patch_lines[i].len; ++j) {
314 mt->i2c_trans.buf[j] = mt9v117_patch_lines[i].data[j];
315 }
316
317 // Transmit the buffer
318 i2c_blocking_transmit(mt->i2c_periph, &mt->i2c_trans, mt->i2c_trans.slave_addr, mt9v117_patch_lines[i].len, 0.5);
319 }
320
326
327 /* Wait for command OK */
328 for (uint8_t retries = 100; retries > 0; retries--) {
329 /* Wait 10ms */
330 usleep(10000);
331
332 /* Check the command */
334 if ((cmd & MT9V117_COMMAND_APPLY_PATCH) == 0) {
335 if ((cmd & MT9V117_COMMAND_OK) == 0) {
336 printf("[MT9V117] Applying patch failed (No OK)\r\n");
337 }
338 return;
339 }
340 }
341
342 printf("[MT9V117] Applying patch failed after 10 retries\r\n");
343}
344
345/* Configure the sensor */
346static inline void mt9v117_config(struct mt9v117_t *mt)
347{
358
361
364
365 /* Set gain metric for 111.2 fps
366 * The final fps depends on the input clock
367 * (89.2fps on bebop) so a modification may be needed here */
370
371 /* set crop window */
377
378 /* Enable auto-stats mode */
387}
388
394{
395 /* bytes written to gpios/pwm */
396 int wc = 0;
397 /* Reset the device */
398 int gpio129 = open("/sys/class/gpio/gpio129/value", O_WRONLY | O_CREAT | O_TRUNC, 0666);
399 wc += write(gpio129, "0", 1);
400 wc += write(gpio129, "1", 1);
401 close(gpio129);
402
403 if (wc != 2) {
404 printf("[MT9V117] Couldn't write to GPIO 129\n");
405 }
406
407 /* Start PWM 9 (Which probably is the clock of the MT9V117) */
408 //#define BEBOP_CAMV_PWM_FREQ 43333333
409 int pwm9 = open("/sys/class/pwm/pwm_9/run", O_WRONLY | O_CREAT | O_TRUNC, 0666);
410 wc = 0;
411 wc += write(pwm9, "0", 1);
412 wc += write(pwm9, "1", 1);
413 close(pwm9);
414
415 if (wc != 2) {
416 printf("[MT9V117] Couldn't write to PWM\n");
417 }
418
419 //TODO: Make PWM and GPIO generic
420
421 /* Wait 50ms */
422 usleep(50000);
423
424 /* Setup i2c transaction */
425 mt->i2c_trans.status = I2CTransDone;
426
427 /* See if the device is there and correct */
430 printf("[MT9V117] Didn't get correct response from CHIP_ID (expected: 0x%04X, got: 0x%04X)\r\n", MT9V117_CHIP_ID_RESP,
431 chip_id);
432 return;
433 }
434
435 /* Reset the device with software */
438
439 /* Wait 50ms */
440 usleep(50000);
441
442 /* Apply MT9V117 software patch */
444
445 /* Set basic settings */
448
449 /* Set pixclk pad slew to 6 and data out pad slew to 1 */
450 write_reg(mt, MT9V117_PAD_SLEW, read_reg(mt, MT9V117_PAD_SLEW, 2) | 0x0600 | 0x0001, 2);
451
452 /* Configure the MT9V117 sensor */
454
455 /* Enable ITU656 */
459
460 /* Set autoexposure luma */
462
463 /* Apply the configuration */
466
467 /* Wait for command OK */
468 for (uint8_t retries = 100; retries > 0; retries--) {
469 /* Wait 10ms */
470 usleep(10000);
471
472 /* Check the command */
474 if ((cmd & MT9V117_COMMAND_SET_STATE) == 0) {
475 if ((cmd & MT9V117_COMMAND_OK) == 0) {
476 printf("[MT9V117] Switching config failed (No OK)\r\n");
477 }
478
479 // Successfully configured!
480 //printf("[MT9V117] Switching config OK\r\n");
481 return;
482 }
483 }
484
485 printf("[MT9V117] Could not switch to new config\r\n");
486}
static const float offset[]
enum I2CTransactionStatus i2c_blocking_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len, float timeout)
Submit a write only transaction and wait for it to complete.
Definition i2c.c:245
enum I2CTransactionStatus i2c_blocking_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r, float timeout)
Submit a write/read transaction and wait for it to complete.
Definition i2c.c:265
@ I2CTransDone
transaction set to done by user level
Definition i2c.h:60
uint16_t w
The width.
Definition image.h:87
uint16_t foo
Definition main_demo5.c:58
static uint8_t patch_line3[]
Definition mt9v117.c:116
uint8_t * data
Definition mt9v117.c:203
static uint8_t patch_line8[]
Definition mt9v117.c:156
static uint8_t patch_line9[]
Definition mt9v117.c:164
static const struct mt9v117_patch_t mt9v117_patch_lines[MT9V117_PATCH_LINE_NUM]
Definition mt9v117.c:207
static uint8_t patch_line10[]
Definition mt9v117.c:172
static uint8_t patch_line2[]
Definition mt9v117.c:108
static uint8_t patch_line6[]
Definition mt9v117.c:140
static uint8_t patch_line7[]
Definition mt9v117.c:148
static uint8_t patch_line4[]
Definition mt9v117.c:124
uint16_t len
Definition mt9v117.c:204
static uint8_t patch_line13[]
Definition mt9v117.c:196
static void write_reg(struct mt9v117_t *mt, uint16_t addr, uint32_t val, uint16_t len)
Write multiple bytes to a single register.
Definition mt9v117.c:226
#define MS9v117_CROP_WIDTH
Definition mt9v117.c:48
static uint32_t read_reg(struct mt9v117_t *mt, uint16_t addr, uint16_t len)
Read multiple bytes from a register.
Definition mt9v117.c:253
#define MS9v117_CROP_HEIGHT
Definition mt9v117.c:52
static uint8_t patch_line12[]
Definition mt9v117.c:188
void mt9v117_init(struct mt9v117_t *mt)
Initialisation of the Aptina MT9V117 CMOS sensor (1/6 inch VGA, bottom camera)
Definition mt9v117.c:393
static void mt9v117_config(struct mt9v117_t *mt)
Definition mt9v117.c:346
static uint8_t patch_line5[]
Definition mt9v117.c:132
static uint8_t patch_line11[]
Definition mt9v117.c:180
static void write_var(struct mt9v117_t *mt, uint16_t var, uint16_t offset, uint32_t val, uint16_t len)
Definition mt9v117.c:270
static uint8_t patch_line1[]
Definition mt9v117.c:100
struct video_config_t bottom_camera
Definition mt9v117.c:61
static void mt9v117_write_patch(struct mt9v117_t *mt)
Definition mt9v117.c:283
struct mt9v117_t mt9v117
Definition mt9v117.c:93
#define MT9V117_PATCH_LINE_NUM
Definition mt9v117.c:99
static uint32_t read_var(struct mt9v117_t *mt, uint16_t var, uint16_t offset, uint16_t len)
Definition mt9v117.c:277
Initialization and configuration of the MT9V117 CMOS Chip.
#define MT9V117_CENTER_Y
Definition mt9v117.h:50
#define MT9V117_TARGET_FPS
Definition mt9v117.h:36
#define MT9V117_DHANE_K
Definition mt9v117.h:53
#define MT9V117_FOCAL_X
Definition mt9v117.h:41
#define MT9V117_CENTER_X
Definition mt9v117.h:47
#define MT9V117_TARGET_LUMA
Definition mt9v117.h:56
struct i2c_periph * i2c_periph
I2C peripheral used to communicate over.
Definition mt9v117.h:60
#define MT9V117_FOCAL_Y
Definition mt9v117.h:44
#define MT9V117_LOW_LIGHT_VAR
#define MT9V117_CAM_SENSOR_CONTROL_READ_MODE_OFFSET
#define MT9V117_COMMAND_APPLY_PATCH
#define MT9V117_CAM_SENSOR_CFG_X_ADDR_END_OFFSET
#define MT9V117_PATCHLDR_PATCH_ID_OFFSET
#define MT9V117_AE_TRACK_JUMP_DIVISOR
#define MT9V117_CAM_OUTPUT_HEIGHT_OFFSET
#define MT9V117_AE_TRACK_VAR
#define MT9V117_PATCHLDR_LOADER_ADDRESS_OFFSET
#define MT9V117_CAM_STAT_AE_INITIAL_WINDOW_XEND_OFFSET
#define MT9V117_CAM_SENSOR_CFG_TARGET_FDZONE_60_OFFSET
#define MT9V117_CAM_OUTPUT_FORMAT_OFFSET
#define MT9V117_CAM_SENSOR_CFG_Y_ADDR_END_OFFSET
#define MT9V117_CAM_STAT_AE_INITIAL_WINDOW_YEND_OFFSET
#define MT9V117_LOGICAL_ADDRESS_ACCESS
#define MT9V117_COMMAND_SET_STATE
#define MT9V117_PATCHLDR_FIRMWARE_ID_OFFSET
#define MT9V117_CAM_STAT_AE_INITIAL_WINDOW_XSTART_OFFSET
#define MT9V117_CAM_LL_STOP_GAIN_METRIC_OFFSET
#define MT9V117_RESET_SOC_I2C
#define MT9V117_CAM_SENSOR_CFG_Y_ADDR_START_OFFSET
#define MT9V117_PATCHLDR_VAR
#define MT9V117_AE_LUMA
#define MT9V117_CHIP_ID
Request the chip ID.
Definition mt9v117_regs.h:7
#define MT9V117_CAM_AET_SKIP_FRAMES
#define MT9V117_CAM_SENSOR_CFG_X_ADDR_START_OFFSET
#define MT9V117_CAM_STAT_AE_INITIAL_WINDOW_YSTART_OFFSET
#define MT9V117_AWB_VAR
#define MT9V117_CAM_STAT_AWB_HG_WINDOW_YSTART_OFFSET
#define MT9V117_CHIP_ID_RESP
Should be the response to CHIP_ID.
Definition mt9v117_regs.h:8
#define MT9V117_ADDRESS
The i2c address of the chip.
Definition mt9v117_regs.h:4
#define MT9V117_CAM_CROP_WINDOW_YOFFSET_OFFSET
#define MT9V117_CAM_CROP_MODE_OFFSET
#define MT9V117_CAM_SENSOR_CFG_FRAME_LENGTH_LINES_OFFSET
#define MT9V117_PAD_SLEW
#define MT9V117_AE_RULE_ALGO_AVERAGE
#define MT9V117_CAM_SENSOR_CFG_MAX_FDZONE_60_OFFSET
#define MT9V117_COMMAND_OK
#define MT9V117_CAM_STAT_AWB_HG_WINDOW_XEND_OFFSET
#define MT9V117_CAM_SENSOR_CONTROL_Y_SKIP_EN
#define MT9V117_AE_RULE_VAR
#define MT9V117_CAM_OUTPUT_FORMAT_BT656_ENABLE
#define MT9V117_PHYSICAL_ADDRESS_ACCESS
#define MT9V117_COMMAND
#define MT9V117_CAM_STAT_AWB_HG_WINDOW_YEND_OFFSET
#define MT9V117_CAM_LL_START_GAIN_METRIC_OFFSET
#define MT9V117_AWB_PIXEL_THRESHOLD_COUNT_OFFSET
#define MT9V117_SYSMGR_VAR
#define MT9V117_CAM_CROP_WINDOW_WIDTH_OFFSET
#define MT9V117_CAM_CROP_WINDOW_XOFFSET_OFFSET
#define MT9V117_AE_RULE_ALGO_OFFSET
#define MT9V117_RESET_MISC_CTRL
Definition mt9v117_regs.h:9
#define MT9V117_CAM_CTRL_VAR
#define MT9V117_ACCESS_CTL_STAT
#define MT9V117_CAM_OUTPUT_WIDTH_OFFSET
#define MT9V117_SYS_STATE_ENTER_CONFIG_CHANGE
#define MT9V117_SYSMGR_NEXT_STATE_OFFSET
#define MT9V117_CAM_STAT_AWB_HG_WINDOW_XSTART_OFFSET
#define MT9V117_CAM_SENSOR_CFG_CPIPE_LAST_ROW_OFFSET
#define MT9V117_CAM_CROP_WINDOW_HEIGHT_OFFSET
uint16_t val[TCOUPLE_NB]
struct img_size_t output_size
Output image size.
V4L2 device settings.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.