资源简介

linux ov5640驱动源码 driver

资源截图

代码片段和文件信息

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include “ov5640.h“

#define ov5640_CHIP_ID_H (0x56)
#define ov5640_CHIP_ID_L (0x40)

#define SXGA_WIDTH 1280
#define SXGA_HEIGHT 960
#define MAX_WIDTH 2560
#define MAX_HEIGHT 1920
#define MAX_PREVIEW_WIDTH SXGA_WIDTH
#define MAX_PREVIEW_HEIGHT  SXGA_HEIGHT

#define OV5640_REG_END 0xffff
#define OV5640_REG_DELAY 0xfffe

#define OV5640_REG_VAL_PREVIEW  0xff
#define OV5640_REG_VAL_SNAPSHOT 0xfe

struct ov5640_format_struct;
struct ov5640_info {
struct v4l2_subdev sd;
struct ov5640_format_struct *fmt;
struct ov5640_win_size *win;
unsigned short vts_address1;
unsigned short vts_address2;
int frame_rate;
int binning;
};

struct regval_list {
unsigned short reg_num;
unsigned char value;
};

struct otp_struct {
unsigned int customer_id;
unsigned int module_integrator_id;
unsigned int lens_id;
unsigned int rg_ratio;
unsigned int bg_ratio;
unsigned int user_data[5];
};

static struct regval_list ov5640_init_regs[] = {
{0x3103 0x11}//SCCB system control
{0x3008 0x82}//software reset
{0x3008 0x42}//software power down
{0x3103 0x03}//SCCB system control
{0x3017 0x00}//set Frex Vsync Href PCLK D[9:6] input
{0x3018 0x00}//set d[5:0] GPIO[1:0] input
{0x3034 0x1a}//MIPI 10-bit mode
{0x3035 0x12}//System clock dividerScale divider for MIPI
{0x3036 0x69}//PLL multiplier(4~252)
{0x3037 0x13}//PLL root divider
{0x3108 0x01}//system divider
{0x3630 0x36}
{0x3631 0x0e}
{0x3632 0xe2}
{0x3633 0x12}
{0x3621 0xe0}
{0x3704 0xa0}
{0x3703 0x5a}
{0x3715 0x78}
{0x3717 0x01}
{0x370b 0x60}
{0x3705 0x1a}
{0x3905 0x02}
{0x3906 0x10}
{0x3901 0x0a}
{0x3731 0x12}
{0x3600 0x08}//VCM debug mode
{0x3601 0x33}//VCM debug mode
{0x302d 0x60}//system control
{0x3620 0x52}
{0x371b 0x20}
{0x471c 0x50}
{0x3a13 0x43}//AGC pre-gain0x40=1x
{0x3a18 0x00}//gain ceiling
{0x3a19 0xf8}//gain ceiling
{0x3635 0x13}
{0x3636 0x03}
{0x3634 0x40}
{0x3622 0x01}
{0x3c01 0x34}//50/60Hz
{0x3c04 0x28}// threshold for low sum
{0x3c05 0x98}// threshold for high sum
{0x3c06 0x00}// light meter 1 threshold high
{0x3c07 0x07}// light meter 1 threshold
{0x3c08 0x00}// light meter 2 threshold high
{0x3c09 0x1c}// light meter 2 threshold low
{0x3c0a 0x9c}// sample number high
{0x3c0b 0x40}// sample number low
{0x3820 0x40}//ISP flip off sensor flip off
{0x3821 0x00}//mirror

{0x3814 0x11}//timing: X inc
{0x3815 0x11}//Y inc
{0x3800 0x00}//image windowing configuration: HS
{0x3801 0x00}//HS
{0x3802 0x00}//VS
{0x3803 0x00}//VS
{0x3804 0x0a}//X Address End: HW:2623
{0x3805 0x3f}//HW
{0x3806 0x07}//Y Address End: VH:1951
{

评论

共有 条评论