Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
video.c File Reference

Initialization of the video specific parts of the Bebop. More...

#include "video.h"
#include "std.h"
#include "mt9f002.h"
#include <stdio.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <mcu_periph/i2c.h>
#include <linux/i2c-dev.h>
#include <linux/types.h>
#include "boards/bebop.h"
+ Include dependency graph for video.c:

Go to the source code of this file.

Functions

static bool_t write_reg (int fd, char *addr_val, uint8_t cnt)
 
static bool_t _write (int fd, char *data, uint8_t cnt)
 
void mt9v117_init (void)
 Initialisation of the Aptina MT9V117 CMOS sensor (1/6 inch VGA, bottom camera) More...
 
void mt9f002_open (void)
 
void mt9f002_close (void)
 
void mt9f002_set_address (uint8_t address)
 
void mt9f002_write_reg8 (uint16_t reg, uint8_t value)
 
void mt9f002_write_reg16 (uint16_t reg, uint16_t value)
 
uint8_t mt9f002_read_reg8 (uint16_t reg)
 
uint16_t mt9f002_read_reg16 (uint16_t reg)
 
void mt9f002_init (void)
 Initialisation of the Aptina MT9F002 CMOS sensor (1/2.3 inch 14Mp, front camera) More...
 

Variables

struct video_config_t bottom_camera
 
struct video_config_t front_camera
 
int mt9f002_i2c_port
 

Detailed Description

Initialization of the video specific parts of the Bebop.

Definition in file video.c.

Function Documentation

static bool_t _write ( int  fd,
char *  data,
uint8_t  cnt 
)
static

Definition at line 85 of file video.c.

References TRUE.

Referenced by mt9v117_init().

+ Here is the caller graph for this function:

void mt9f002_close ( void  )

Definition at line 292 of file video.c.

References mt9f002_i2c_port.

Referenced by mt9f002_read_reg16(), mt9f002_read_reg8(), mt9f002_write_reg16(), and mt9f002_write_reg8().

+ Here is the caller graph for this function:

void mt9f002_init ( void  )

Initialisation of the Aptina MT9F002 CMOS sensor (1/2.3 inch 14Mp, front camera)

Definition at line 384 of file video.c.

References MT9F002_ANALOG_GAIN_CODE_BLUE, MT9F002_ANALOG_GAIN_CODE_GLOBAL, MT9F002_ANALOG_GAIN_CODE_GREENB, MT9F002_ANALOG_GAIN_CODE_GREENR, MT9F002_ANALOG_GAIN_CODE_RED, MT9F002_BLUE_GAIN, MT9F002_CALIB_BLUE, MT9F002_CALIB_BLUE_ASC1, MT9F002_CALIB_GREEN1, MT9F002_CALIB_GREEN1_ASC1, MT9F002_CALIB_GREEN2, MT9F002_CALIB_GREEN2_ASC1, MT9F002_CALIB_RED, MT9F002_CALIB_RED_ASC1, MT9F002_DAC_ID_FBIAS, MT9F002_FRAME_LENGTH_LINES, MT9F002_GLOBAL_GAIN, MT9F002_GREEN1_GAIN, MT9F002_GREEN2_GAIN, MT9F002_HISPI_TIMING, MT9F002_LINE_LENGTH_PCK, MT9F002_MIPI_TIMING_2, MT9F002_MODE_SELECT, MT9F002_OP_PIX_CLK_DIV, MT9F002_P_BL_P0Q0, MT9F002_P_BL_P0Q1, MT9F002_P_BL_P0Q2, MT9F002_P_BL_P0Q3, MT9F002_P_BL_P0Q4, MT9F002_P_BL_P1Q0, MT9F002_P_BL_P1Q1, MT9F002_P_BL_P1Q2, MT9F002_P_BL_P1Q3, MT9F002_P_BL_P1Q4, MT9F002_P_BL_P2Q0, MT9F002_P_BL_P2Q1, MT9F002_P_BL_P2Q2, MT9F002_P_BL_P2Q3, MT9F002_P_BL_P2Q4, MT9F002_P_BL_P3Q0, MT9F002_P_BL_P3Q1, MT9F002_P_BL_P3Q2, MT9F002_P_BL_P3Q3, MT9F002_P_BL_P3Q4, MT9F002_P_BL_P4Q0, MT9F002_P_BL_P4Q1, MT9F002_P_BL_P4Q2, MT9F002_P_BL_P4Q3, MT9F002_P_BL_P4Q4, MT9F002_P_BL_Q5, MT9F002_P_GB_P0Q0, MT9F002_P_GB_P0Q1, MT9F002_P_GB_P0Q2, MT9F002_P_GB_P0Q3, MT9F002_P_GB_P0Q4, MT9F002_P_GB_P1Q0, MT9F002_P_GB_P1Q1, MT9F002_P_GB_P1Q2, MT9F002_P_GB_P1Q3, MT9F002_P_GB_P1Q4, MT9F002_P_GB_P2Q0, MT9F002_P_GB_P2Q1, MT9F002_P_GB_P2Q2, MT9F002_P_GB_P2Q3, MT9F002_P_GB_P2Q4, MT9F002_P_GB_P3Q0, MT9F002_P_GB_P3Q1, MT9F002_P_GB_P3Q2, MT9F002_P_GB_P3Q3, MT9F002_P_GB_P3Q4, MT9F002_P_GB_P4Q0, MT9F002_P_GB_P4Q1, MT9F002_P_GB_P4Q2, MT9F002_P_GB_P4Q3, MT9F002_P_GB_P4Q4, MT9F002_P_GB_Q5, MT9F002_P_GR_P0Q0, MT9F002_P_GR_P0Q2, MT9F002_P_GR_P0Q3, MT9F002_P_GR_P0Q4, MT9F002_P_GR_P1Q0, MT9F002_P_GR_P1Q1, MT9F002_P_GR_P1Q2, MT9F002_P_GR_P1Q3, MT9F002_P_GR_P1Q4, MT9F002_P_GR_P2Q0, MT9F002_P_GR_P2Q1, MT9F002_P_GR_P2Q2, MT9F002_P_GR_P2Q3, MT9F002_P_GR_P2Q4, MT9F002_P_GR_P3Q0, MT9F002_P_GR_P3Q1, MT9F002_P_GR_P3Q2, MT9F002_P_GR_P3Q3, MT9F002_P_GR_P3Q4, MT9F002_P_GR_P4Q0, MT9F002_P_GR_P4Q1, MT9F002_P_GR_P4Q2, MT9F002_P_GR_P4Q3, MT9F002_P_GR_P4Q4, MT9F002_P_GR_Q5, MT9F002_P_RD_P0Q0, MT9F002_P_RD_P0Q1, MT9F002_P_RD_P0Q2, MT9F002_P_RD_P0Q3, MT9F002_P_RD_P0Q4, MT9F002_P_RD_P1Q0, MT9F002_P_RD_P1Q1, MT9F002_P_RD_P1Q2, MT9F002_P_RD_P1Q3, MT9F002_P_RD_P1Q4, MT9F002_P_RD_P2Q0, MT9F002_P_RD_P2Q1, MT9F002_P_RD_P2Q2, MT9F002_P_RD_P2Q3, MT9F002_P_RD_P2Q4, MT9F002_P_RD_P3Q0, MT9F002_P_RD_P3Q1, MT9F002_P_RD_P3Q2, MT9F002_P_RD_P3Q3, MT9F002_P_RD_P3Q4, MT9F002_P_RD_P4Q0, MT9F002_P_RD_P4Q1, MT9F002_P_RD_P4Q2, MT9F002_P_RD_P4Q3, MT9F002_P_RD_P4Q4, MT9F002_P_RD_Q5, MT9F002_PLL_MULTIPLIER, MT9F002_POLY_ORIGIN_C, MT9F002_POLY_ORIGIN_R, MT9F002_PRE_PLL_CLK_DIV, MT9F002_READ_MODE, MT9F002_RED_GAIN, MT9F002_ROW_SPEED, MT9F002_SCALE_M, MT9F002_SCALING_MODE, MT9F002_VT_PIX_CLK_DIV, mt9f002_write_reg16(), mt9f002_write_reg8(), MT9F002_X_ADDR_END_, MT9F002_X_ADDR_START_, MT9F002_X_ODD_INC, MT9F002_Y_ADDR_END_, MT9F002_Y_ADDR_START_, and MT9F002_Y_ODD_INC.

Referenced by board_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mt9f002_open ( void  )

Definition at line 283 of file video.c.

References mt9f002_i2c_port.

Referenced by mt9f002_read_reg16(), mt9f002_read_reg8(), mt9f002_write_reg16(), and mt9f002_write_reg8().

+ Here is the caller graph for this function:

uint16_t mt9f002_read_reg16 ( uint16_t  reg)

Definition at line 363 of file video.c.

References mt9f002_close(), mt9f002_i2c_port, mt9f002_open(), and mt9f002_set_address().

+ Here is the call graph for this function:

uint8_t mt9f002_read_reg8 ( uint16_t  reg)

Definition at line 345 of file video.c.

References mt9f002_close(), mt9f002_i2c_port, mt9f002_open(), and mt9f002_set_address().

+ Here is the call graph for this function:

void mt9f002_set_address ( uint8_t  address)

Definition at line 297 of file video.c.

References I2C_SLAVE_FORCE, and mt9f002_i2c_port.

Referenced by mt9f002_read_reg16(), mt9f002_read_reg8(), mt9f002_write_reg16(), and mt9f002_write_reg8().

+ Here is the caller graph for this function:

void mt9f002_write_reg16 ( uint16_t  reg,
uint16_t  value 
)

Definition at line 325 of file video.c.

References mt9f002_close(), mt9f002_i2c_port, mt9f002_open(), and mt9f002_set_address().

Referenced by mt9f002_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mt9f002_write_reg8 ( uint16_t  reg,
uint8_t  value 
)

Definition at line 305 of file video.c.

References mt9f002_close(), mt9f002_i2c_port, mt9f002_open(), mt9f002_set_address(), and value.

Referenced by mt9f002_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mt9v117_init ( void  )

Initialisation of the Aptina MT9V117 CMOS sensor (1/6 inch VGA, bottom camera)

Definition at line 100 of file video.c.

References _write(), and write_reg().

Referenced by board_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool_t write_reg ( int  fd,
char *  addr_val,
uint8_t  cnt 
)
static

Definition at line 62 of file video.c.

References FALSE, and TRUE.

Referenced by mt9v117_init().

+ Here is the caller graph for this function:

Variable Documentation

struct video_config_t bottom_camera
Initial value:
= {
.w = 640,
.h = 480,
.dev_name = "/dev/video0",
.subdev_name = NULL,
.format = V4L2_PIX_FMT_UYVY,
.buf_cnt = 60,
.filters = 0
}

Definition at line 42 of file video.c.

struct video_config_t front_camera
Initial value:
= {
.w = 1408,
.h = 2112,
.dev_name = "/dev/video1",
.subdev_name = "/dev/v4l-subdev1",
.format = V4L2_PIX_FMT_SGBRG10,
.buf_cnt = 10,
}
#define VIDEO_FILTER_DEBAYER
Definition: video_device.h:34

Definition at line 52 of file video.c.