资源简介
可以选择设置qsxga: 2592*1936,qxga: 2048*1536,UXGA: 1600*1200,1080P : 1920*1080,SXGA: 1280*960,//XGA: 1024*768
代码片段和文件信息
/*
* A V4L2 driver for ov5640 cameras.
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “camera.h“
MODULE_AUTHOR(“raymonxiu“);
MODULE_DEscriptION(“A low-level driver for ov5640 sensors“);
MODULE_LICENSE(“GPL“);
#define AF_WIN_NEW_COORD
//for internel driver debug
#define DEV_DBG_EN 0
#if(DEV_DBG_EN == 1)
#define vfe_dev_dbg(xarg...) printk(“[OV5640]“x##arg)
#else
#define vfe_dev_dbg(xarg...)
#endif
#define vfe_dev_err(xarg...) printk(“[OV5640]“x##arg)
#define vfe_dev_print(xarg...) printk(“[OV5640]“x##arg)
#define CAP_BDG 0
#if(CAP_BDG == 1)
#define vfe_dev_cap_dbg(xarg...) printk(“[OV5640_CAP_DBG]“x##arg)
#else
#define vfe_dev_cap_dbg(xarg...)
#endif
#define LOG_ERR_RET(x) { \
int ret; \
ret = x; \
if(ret < 0) {\
vfe_dev_err(“error at %s\n“__func__); \
return ret; \
} \
}
//define module timing
#define MCLK (24*1000*1000)
static int MCLK_DIV = 1;
#ifdef CONFIG_ARCH_SUN9IW1P1
static int A80_VERSION = 0 ;
#endif
//#define FPGA_VER
#define VREF_POL V4L2_MBUS_VSYNC_ACTIVE_HIGH
#define HREF_POL V4L2_MBUS_HSYNC_ACTIVE_HIGH
#define CLK_POL V4L2_MBUS_PCLK_SAMPLE_RISING
#define V4L2_IDENT_SENSOR 0x5640
//define the voltage level of control signal
#define CSI_STBY_ON 1
#define CSI_STBY_OFF 0
#define CSI_RST_ON 0
#define CSI_RST_OFF 1
#define CSI_PWR_ON 1
#define CSI_PWR_OFF 0
#define CSI_AF_PWR_ON 1
#define CSI_AF_PWR_OFF 0
#define SENSOR_NAME “ov5640“
#define regval_list reg_list_a16_d8
#define REG_TERM 0xfffe
#define VAL_TERM 0xfe
#define REG_DLY 0xffff
#define FLASH_EN_POL 1
#define FLASH_MODE_POL 1
#ifdef _FLASH_FUNC_
#include “../flash_light/flash.h“
static struct flash_dev_info fl_info;
static unsigned int to_flash=0;
static unsigned int flash_auto_level=0x1c;
#endif
#define CONTINUEOUS_AF
//#define AUTO_FPS
#define DENOISE_LV_AUTO
#define SHARPNESS 0x18
#ifdef AUTO_FPS
//#define AF_FAST
#endif
#ifndef DENOISE_LV_AUTO
#define DENOISE_LV 0x8
#endif
#define AE_CW 1
unsigned int night_mode=0;
unsigned int Nfrms=1;
unsigned int cap_manual_gain=0x10;
#define CAP_GAIN_CAL 0//0--auto limit frames;1--manual fixed gain
#define CAP_MULTI_frameS
#ifdef CAP_MULTI_frameS
#define MAX_FRM_CAP 4
#else
#define MAX_FRM_CAP 1
#endif
/*
* Our nominal (default) frame rate.
*/
#define SENSOR_frame_RATE 30
/*
* The ov5640 sits on i2c with ID 0x78
*/
#define I2C_ADDR 0x78
//static struct delayed_work sensor_s_ae_ratio_work;
static struct v4l2_subdev *glb_sd;
/*
* Information we maintain about a known sensor.
*/
st
- 上一篇:LCD12864仿真
- 下一篇:晨间日记软件
评论
共有 条评论