📄 sensor_mega_ov9650.c
字号:
/* ------------------------------------------------------------------------------
File name : sensor_OV9750.c
Sensor controler : OV9650
MV300 sensor Driver file.
(C) Copyright MtekVision, Inc. 2001~2002 All right reserved.
Confidential Information
All parts of the MtekVision Program Source are protected by copyright law and all rights are reserved.
This documentation may not, in whole or in part, be copied, photocopied, reproduced, translated,
or reduced to any electronic medium or machine readable form without prior consent, in writing,
from the MtekVision.
--------------------------------------------------------------------------------*/
#include "hw_include.h"
#if ROCK_CAMERA
#if ( SENSOR_TYPE == SENSOR_OV_9650 )
#define I2C_Check 0
#define I2C_Sensor_Speed 400
//#define FPS20
UINT8 sensorData[][2] =
{
#if 1
//form OV Mr zhong 20fps
{0x12,0x80},
#ifdef FPS20
{0x11,0x80},
//{0x11,0x81},
{0x6b,0x0a},
{0x92,0xfa},
{0x93,0x00},
{0x6a,0x96},
//{0x6a,0x4b},
#else //10FPS
{0x11, 0x82},
{0x6b, 0x0a},
{0x6a, 0x32},
#endif
{0x3b,0x09}, // night mode
//{0x3b,0xc9},
{0x13,0xe0},
{0x01,0x80},
{0x02,0x80},
{0x00,0x00},
{0x10,0x00},
{0x13,0xe5},
{0x39,0x50},
{0x38,0x92},
{0x37,0x00},
{0x35,0x81},
{0x0e,0x20},
{0x1e,0x04},//34
{0xA8,0x80},
{0x12,0x10},
{0x04,0x00},
{0x0c,0x04},
{0x0d,0x80},
//{0x18,0xc6},
//{0x17,0x26},
{0x18,0xc7},
{0x17,0x27},
{0x32,0xad},
{0x03,0x00},
{0x1a,0x3d},
{0x19,0x01},
{0x3f,0xa6},
//{0x14,0x2e},//p
{0x14,0x1e},//降低增益,减小躁声
{0x15,0x00},//0x02
{0x41,0x02},
{0x42,0x08},
{0x1b,0x00},
{0x16,0x06},
{0x33,0xe2},
{0x34,0xbf},
{0x96,0x04},
{0x3a,0x00},
{0x8e,0x00},
{0x3c,0x77},
{0x8B,0x06},
{0x94,0x88},
{0x95,0x88},
{0x40,0xc1},
{0x29,0x3f},
{0x0f,0x42},
{0x3d,0x92},
{0x69,0x40},
{0x5C,0xb9},
{0x5D,0x96},
{0x5E,0x10},
{0x59,0xc0},
{0x5A,0xaf},
{0x5B,0x55},
{0x43,0xf0},
{0x44,0x10},
{0x45,0x68},
{0x46,0x96},
{0x47,0x60},
{0x48,0x80},
{0x5F,0xe0},
{0x60,0x8c},
{0x61,0x20},
{0xa5,0xd9},
{0xa4,0x74},
{0x8d,0x02},
{0x13,0xe7},
{0x4f,0x3f},//0x3a}, //色彩饱和度K=1.1
{0x50,0x43},//0x3d}, //色彩饱和度K=1.1
{0x51,0x03},//0x03}, //色彩饱和度K=1.1
{0x52,0x13},//0x12}, //色彩饱和度K=1.1
{0x53,0x29},//0x26}, //色彩饱和度K=1.1
{0x54,0x3d},//0x38}, //色彩饱和度K=1.1
{0x55,0x40},
{0x56,0x40},
{0x57,0x40},
{0x58,0x0d},
{0x8C,0x23},
{0x3E,0x02},
{0xa9,0xb8},
{0xaa,0x92},
{0xab,0x0a},
{0x8f,0xdf},
{0x90,0x00},
{0x91,0x00},
{0x9f,0x00},
{0xa0,0x00},
{0x3A,0x0D},
{0x24,0x70},
{0x25,0x64},
{0x26,0xc3},
{0x2a,0x00},
{0x2b,0x00},
{0x6c,0x40},
{0x6d,0x30},
{0x6e,0x4b},
{0x6f,0x60},
{0x70,0x70},
{0x71,0x70},
{0x72,0x70},
{0x73,0x70},
{0x74,0x60},
{0x75,0x60},
{0x76,0x50},
{0x77,0x48},
{0x78,0x3a},
{0x79,0x2e},
{0x7a,0x28},
{0x7b,0x22},
{0x7c,0x04},
{0x7d,0x07},
{0x7e,0x10},
{0x7f,0x28},
{0x80,0x36},
{0x81,0x44},
{0x82,0x52},
{0x83,0x60},
{0x84,0x6c},
{0x85,0x78},
{0x86,0x8c},
{0x87,0x9e},
{0x88,0xbb},
{0x89,0xd2},
{0x8a,0xe6},
#else
{0x11,0x81},
{0x6a,0x3e},
{0x3b,0x09},
{0x13,0xe0},
{0x01,0x80},
{0x02,0x80},
{0x00,0x00},
{0x10,0x00},
{0x13,0xe5},
{0x39,0x43}, //;50 for 30fps
{0x38,0x12},// ;93 for 30fps
{0x37,0x00},
{0x35,0x91}, //;81 for 30fps
{0x0e,0xa0},
{0x1e,0x04},
{0xA8,0x80},
{0x12,0x40},
{0x04,0x00},
{0x0c,0x04},
{0x0d,0x80},
{0x18,0xc6},
{0x17,0x26},
{0x32,0xad},
{0x03,0x00},
{0x1a,0x3d},
{0x19,0x01},
{0x3f,0xa6},
{0x14,0x2e},
{0x15,0x00},//0x02
{0x41,0x02},
{0x42,0x08},
{0x1b,0x00},
{0x16,0x06},
{0x33,0xe2},// ;c0 for internal regulator
{0x34,0xbf},
{0x96,0x04},
{0x3a,0x00},
{0x8e,0x00},
{0x3c,0x77},
{0x8B,0x06},
{0x94,0x88},
{0x95,0x88},
{0x40,0xc1},
{0x29,0x3f}, //;2f for internal regulator
{0x0f,0x42},
{0x3d,0x92},
{0x69,0x40},
{0x5C,0xb9},
{0x5D,0x96},
{0x5E,0x10},
{0x59,0xc0},
{0x5A,0xaf},
{0x5B,0x55},
{0x43,0xf0},
{0x44,0x10},
{0x45,0x68},
{0x46,0x96},
{0x47,0x60},
{0x48,0x80},
{0x5F,0xe0},
{0x60,0x8c}, //;0c for advanced AWB (related to lens)
{0x61,0x20},
{0xa5,0xd9},
{0xa4,0x74},
{0x8d,0x02},
{0x13,0xe7},
{0x4f,0x3a},
{0x50,0x3d},
{0x51,0x03},
{0x52,0x12},
{0x53,0x26},
{0x54,0x38},
{0x55,0x40},
{0x56,0x40},
{0x57,0x40},
{0x58,0x0d},
{0x8C,0x23},
{0x3E,0x02},
{0xa9,0xb8},
{0xaa,0x92},
{0xab,0x0a},
{0x8f,0xdf},
{0x90,0x00},
{0x91,0x00},
{0x9f,0x00},
{0xa0,0x00},
{0x3A,0x01},
{0x24,0x70},
{0x25,0x64},
{0x26,0xc3},
{0x2a,0x00}, //;10 for 50Hz
{0x2b,0x00}, //;40 for 50Hz
{0x6c,0x40},
{0x6d,0x30},
{0x6e,0x4b},
{0x6f,0x60},
{0x70,0x70},
{0x71,0x70},
{0x72,0x70},
{0x73,0x70},
{0x74,0x60},
{0x75,0x60},
{0x76,0x50},
{0x77,0x48},
{0x78,0x3a},
{0x79,0x2e},
{0x7a,0x28},
{0x7b,0x22},
{0x7c,0x04},
{0x7d,0x07},
{0x7e,0x10},
{0x7f,0x28},
{0x80,0x36},
{0x81,0x44},
{0x82,0x52},
{0x83,0x60},
{0x84,0x6c},
{0x85,0x78},
{0x86,0x8c},
{0x87,0x9e},
{0x88,0xbb},
{0x89,0xd2},
{0x8a,0xe6},
#endif
};
UINT8 ChangeMegaData[][2]=
{
{0x0c ,0x00},
{0x0d ,0x00},
{0x11 ,0x80},
{0x12 ,0x00},
{0x13 ,0xe7},
{0x18 ,0xbd},
{0x17 ,0x1d},
{0x03 ,0x12},
{0x1a ,0x81},
{0x19 ,0x01},
{0x39 ,0x43},
{0x38 ,0x12},
{0x35 ,0x91},
};
UINT8 ChangeVGAData[][2]=
{
{0x0c ,0x04},
{0x0d ,0x80},
{0x11 ,0x80},
{0x12 ,0x40},
{0x13 ,0xe5},
{0x18 ,0xc7},
{0x17 ,0x27},
{0x03 ,0x00},
{0x1a ,0x3d},
{0x19 ,0x01},
{0x39 ,0x50},
{0x38 ,0x92},
{0x35 ,0x81},
};
UINT8 ChangeCIFData[][2]=
{
{0x0c ,0x04},
{0x0d ,0x80},
{0x11 ,0x80},
{0x12 ,0x20},
{0x13 ,0xe5},
{0x18 ,0xc7},
{0x17 ,0x27},
{0x03 ,0x00},
{0x1a ,0x3d},
{0x19 ,0x01},
{0x39 ,0x50},
{0x38 ,0x92},
{0x35 ,0x81},
};
UINT8 ChangeQVGAData[][2]=
{
#if 0
{0x0c ,0x04},
{0x0d ,0x80},
{0x11 ,0x80},
{0x12 ,0x10},
{0x13 ,0xe5},
{0x18 ,0xc7},
{0x17 ,0x27},
{0x03 ,0x00},
{0x1a ,0x3d},
{0x19 ,0x01},
{0x39 ,0x50},
{0x38 ,0x92},
{0x35 ,0x81},
#endif
#if 1//20
{0x12,0x10},
{0x04,0x00},
{0x0c,0x04},
{0x0d,0x80},
{0x18,0xc7},
{0x17,0x27},
{0x32,0xad},
{0x03,0x00},
{0x1a,0x3d},
{0x19,0x01},
{0x11, 0x80}, //82
{0x6b, 0x0a},
{0x92, 0x00},
{0x93, 0x00},
{0x2a, 0x30},//00
{0x2b, 0x20},//00
{0x6a, 0x64},//32
{0x3b, 0x09},
#endif
};
UINT8 Brightness0[][2]=
{
{0x0f, 0x4a},
{0x27, 0xa0},
{0x28, 0xa0},
{0x2c, 0xa0},
{0x62, 0x20},
{0x63, 0xc0},
{0x64, 0x06},
{0x65, 0x20},
{0x66, 0x01},
{0x24, 0x50},
{0x25, 0x44}
};
UINT8 Brightness1[][2]=
{
{0x0f, 0x4a},
{0x27, 0x90},
{0x28, 0x90},
{0x2c, 0x90},
{0x62, 0x20},
{0x63, 0xc0},
{0x64, 0x06},
{0x65, 0x20},
{0x66, 0x01},
{0x24, 0x60},
{0x25, 0x54}
};
UINT8 Brightness2[][2]=
{
{0x0f, 0x4a},
{0x27, 0x80},
{0x28, 0x80},
{0x2c, 0x80},
{0x62, 0x20},
{0x63, 0xc0},
{0x64, 0x06},
{0x65, 0x20},
{0x66, 0x01},
{0x24, 0x70},
{0x25, 0x64}
};
UINT8 Brightness3[][2]=
{
{0x0f, 0x4a},
{0x27, 0x20},
{0x28, 0x20},
{0x2c, 0x20},
{0x62, 0x20},
{0x63, 0xc0},
{0x64, 0x05},
{0x65, 0x20},
{0x66, 0x01},
{0x24, 0x80},
{0x25, 0x74}
};
UINT8 Brightness4[][2]=
{
{0x0f, 0x4a},
{0x27, 0x40},
{0x28, 0x40},
{0x2c, 0x40},
{0x62, 0x20},
{0x63, 0xc0},
{0x64, 0x04},
{0x65, 0x20},
{0x66, 0x01},
{0x24, 0x90},
{0x25, 0x84}
};
UINT8 Brightness5[][2]=
{
{0x0f, 0x4a},
{0x27, 0x60},
{0x28, 0x60},
{0x2c, 0x60},
{0x62, 0x20},
{0x63, 0xc0},
{0x64, 0x02},
{0x65, 0x20},
{0x66, 0x01},
{0x24, 0xa0},
{0x25, 0x94}
};
UINT8 Saturation0[][2]=
{
{0x4f, 0x18},
{0x50, 0x19},
{0x51, 0x01},
{0x52, 0x0A},
{0x53, 0x15},
{0x54, 0x1E}
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -