Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "std.h"
#include "mt9v117.h"
#include "mt9v117_regs.h"
#include "peripherals/video_device.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
#include <linux/videodev2.h>
#include <linux/v4l2-mediabus.h>
#include "generated/airframe.h"
#include "boards/bebop.h"
Go to the source code of this file.
Data Structures | |
struct | mt9v117_patch_t |
Macros | |
#define | MT9V117_PATCH_LINE_NUM 13 |
Functions | |
static void | write_reg (struct mt9v117_t *mt, uint16_t addr, uint32_t val, uint16_t len) |
Write multiple bytes to a single register. More... | |
static uint32_t | read_reg (struct mt9v117_t *mt, uint16_t addr, uint16_t len) |
Read multiple bytes from a register. More... | |
static void | write_var (struct mt9v117_t *mt, uint16_t var, uint16_t offset, uint32_t val, uint16_t len) |
static uint32_t | read_var (struct mt9v117_t *mt, uint16_t var, uint16_t offset, uint16_t len) |
static void | mt9v117_write_patch (struct mt9v117_t *mt) |
static void | mt9v117_config (struct mt9v117_t *mt) |
void | mt9v117_init (struct mt9v117_t *mt) |
Initialisation of the Aptina MT9V117 CMOS sensor (1/6 inch VGA, bottom camera) More... | |
Variables | |
struct video_config_t | bottom_camera |
struct mt9v117_t | mt9v117 |
static uint8_t | patch_line1 [] |
static uint8_t | patch_line2 [] |
static uint8_t | patch_line3 [] |
static uint8_t | patch_line4 [] |
static uint8_t | patch_line5 [] |
static uint8_t | patch_line6 [] |
static uint8_t | patch_line7 [] |
static uint8_t | patch_line8 [] |
static uint8_t | patch_line9 [] |
static uint8_t | patch_line10 [] |
static uint8_t | patch_line11 [] |
static uint8_t | patch_line12 [] |
static uint8_t | patch_line13 [] |
static const struct mt9v117_patch_t | mt9v117_patch_lines [MT9V117_PATCH_LINE_NUM] |
Initialization of MT9V117 chip and options to change settings
Definition in file mt9v117.c.
struct mt9v117_patch_t |
|
inlinestatic |
Definition at line 334 of file mt9v117.c.
References MT9V117_AE_TRACK_JUMP_DIVISOR, MT9V117_CAM_AET_SKIP_FRAMES, MT9V117_CAM_CROP_MODE_OFFSET, MT9V117_CAM_CROP_WINDOW_HEIGHT_OFFSET, MT9V117_CAM_CROP_WINDOW_WIDTH_OFFSET, MT9V117_CAM_CROP_WINDOW_XOFFSET_OFFSET, MT9V117_CAM_CROP_WINDOW_YOFFSET_OFFSET, MT9V117_CAM_CTRL_VAR, MT9V117_CAM_LL_START_GAIN_METRIC_OFFSET, MT9V117_CAM_LL_STOP_GAIN_METRIC_OFFSET, MT9V117_CAM_OUTPUT_HEIGHT_OFFSET, MT9V117_CAM_OUTPUT_WIDTH_OFFSET, MT9V117_CAM_SENSOR_CFG_CPIPE_LAST_ROW_OFFSET, MT9V117_CAM_SENSOR_CFG_FRAME_LENGTH_LINES_OFFSET, MT9V117_CAM_SENSOR_CFG_MAX_FDZONE_60_OFFSET, MT9V117_CAM_SENSOR_CFG_TARGET_FDZONE_60_OFFSET, MT9V117_CAM_SENSOR_CFG_X_ADDR_END_OFFSET, MT9V117_CAM_SENSOR_CFG_X_ADDR_START_OFFSET, MT9V117_CAM_SENSOR_CFG_Y_ADDR_END_OFFSET, MT9V117_CAM_SENSOR_CFG_Y_ADDR_START_OFFSET, MT9V117_CAM_SENSOR_CONTROL_READ_MODE_OFFSET, MT9V117_CAM_SENSOR_CONTROL_Y_SKIP_EN, MT9V117_CAM_STAT_AE_INITIAL_WINDOW_XEND_OFFSET, MT9V117_CAM_STAT_AE_INITIAL_WINDOW_XSTART_OFFSET, MT9V117_CAM_STAT_AE_INITIAL_WINDOW_YEND_OFFSET, MT9V117_CAM_STAT_AE_INITIAL_WINDOW_YSTART_OFFSET, MT9V117_CAM_STAT_AWB_HG_WINDOW_XEND_OFFSET, MT9V117_CAM_STAT_AWB_HG_WINDOW_XSTART_OFFSET, MT9V117_CAM_STAT_AWB_HG_WINDOW_YEND_OFFSET, MT9V117_CAM_STAT_AWB_HG_WINDOW_YSTART_OFFSET, write_reg(), and write_var().
Referenced by mt9v117_init().
void mt9v117_init | ( | struct mt9v117_t * | mt | ) |
Initialisation of the Aptina MT9V117 CMOS sensor (1/6 inch VGA, bottom camera)
Definition at line 381 of file mt9v117.c.
References mt9v117_t::i2c_trans, I2CTransDone, MT9V117_AE_LUMA, MT9V117_AE_RULE_ALGO_AVERAGE, MT9V117_AE_RULE_ALGO_OFFSET, MT9V117_AE_RULE_VAR, MT9V117_AWB_PIXEL_THRESHOLD_COUNT_OFFSET, MT9V117_AWB_VAR, MT9V117_CAM_CTRL_VAR, MT9V117_CAM_OUTPUT_FORMAT_BT656_ENABLE, MT9V117_CAM_OUTPUT_FORMAT_OFFSET, MT9V117_CHIP_ID, MT9V117_CHIP_ID_RESP, MT9V117_COMMAND, MT9V117_COMMAND_OK, MT9V117_COMMAND_SET_STATE, mt9v117_config(), MT9V117_PAD_SLEW, MT9V117_RESET_MISC_CTRL, MT9V117_RESET_SOC_I2C, MT9V117_SYS_STATE_ENTER_CONFIG_CHANGE, MT9V117_SYSMGR_NEXT_STATE_OFFSET, MT9V117_SYSMGR_VAR, MT9V117_TARGET_LUMA, mt9v117_write_patch(), read_reg(), read_var(), i2c_transaction::status, write_reg(), and write_var().
|
inlinestatic |
Definition at line 271 of file mt9v117.c.
References i2c_transaction::buf, mt9v117_patch_t::data, i2c_blocking_transmit(), mt9v117_t::i2c_periph, mt9v117_t::i2c_trans, mt9v117_patch_t::len, MT9V117_ACCESS_CTL_STAT, MT9V117_AE_TRACK_VAR, MT9V117_CAM_CTRL_VAR, MT9V117_COMMAND, MT9V117_COMMAND_APPLY_PATCH, MT9V117_COMMAND_OK, MT9V117_LOGICAL_ADDRESS_ACCESS, MT9V117_LOW_LIGHT_VAR, MT9V117_PATCH_LINE_NUM, mt9v117_patch_lines, MT9V117_PATCHLDR_FIRMWARE_ID_OFFSET, MT9V117_PATCHLDR_LOADER_ADDRESS_OFFSET, MT9V117_PATCHLDR_PATCH_ID_OFFSET, MT9V117_PATCHLDR_VAR, MT9V117_PHYSICAL_ADDRESS_ACCESS, read_reg(), i2c_transaction::slave_addr, write_reg(), and write_var().
Referenced by mt9v117_init().
Read multiple bytes from a register.
Definition at line 241 of file mt9v117.c.
References i2c_transaction::buf, i2c_blocking_transceive(), mt9v117_t::i2c_periph, mt9v117_t::i2c_trans, mt9v117_patch_t::len, and MT9V117_ADDRESS.
Referenced by mt9v117_init(), mt9v117_write_patch(), and read_var().
|
static |
Definition at line 265 of file mt9v117.c.
References mt9v117_patch_t::len, offset, and read_reg().
Referenced by mt9v117_init().
Write multiple bytes to a single register.
Definition at line 214 of file mt9v117.c.
References i2c_transaction::buf, i2c_blocking_transmit(), mt9v117_t::i2c_periph, mt9v117_t::i2c_trans, mt9v117_patch_t::len, MT9V117_ADDRESS, and val.
Referenced by mt9v117_config(), mt9v117_init(), mt9v117_write_patch(), and write_var().
|
static |
Definition at line 258 of file mt9v117.c.
References mt9v117_patch_t::len, offset, val, and write_reg().
Referenced by mt9v117_config(), mt9v117_init(), and mt9v117_write_patch().
struct video_config_t bottom_camera |
struct mt9v117_t mt9v117 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |