📄 camdata.h
字号:
/*****************************************
NAME: camdata.h
DESC: data for initializing camera module
HISTORY: 2004.01.16:draft ver 0.0
*****************************************/
#ifndef __CAMDATA_H__
#define __CAMDATA_H__
#ifdef __cplusplus
extern "C"{
#endif
#define CAM_ACT_HSIZE (640) // Max 640
#define CAM_ACT_VSIZE (480) // Max 480
#define CAM_STX (0x2f) //47
#define CAM_STY (6) //6
#define CAM_ENDX (((CAM_ACT_HSIZE)/4) + CAM_STX)
#define CAM_ENDY ((CAM_ACT_VSIZE/2) + CAM_STY-1)
const unsigned char Ov7620_Yuv16bit[][2] = {
{0x12, 0x80}, // Camera Soft reset. Self cleared after reset.
{0x17, CAM_STX}, //
{0x18, CAM_ENDX}, // (207-47)*4 = 640
{0x19, CAM_STY}, //
{0x1a, CAM_ENDY}, // ((244-5)+1)*2=480
{0x01, 0x80}, // set blue gain
{0x02, 0x80}, // set red gain
{0x03, 0xb0},
{0x06, 0x70}, // set brightness
{0x07, 0x00},
{0x0c, 0x24}, // set blue background
{0x0d, 0x24}, // set red background
{0x10, 0xff}, // set exposure time, brightness control
{0x11, 0x40}, // set frame rate 27Mhz/[(0+1)*2]=13.5MHz
{0x12, 0x24}, // set YUV mode, enable AGC/AWB, mirror image.
{0x15, 0x01}, // Use PCLK rising edge to latch data
{0x16, 0x03}, //
{0x12, 0x64}, // set YUV mode, enable AGC/AWB, mirror image.
{0x13, 0x01}, // YUV 16-bit format, Disable AEC/AGC/AWB
{0x14, 0x84}, // turn off GAMMA
{0x24, 0x3a}, //
{0x25, 0x60}, //
{0x28, 0x20}, // Progressive mode.
{0x2d, 0x95}, //
{0x67, 0x92}, //
{0x74, 0x00} //
};
const unsigned char Ov7620_YCbCr8bit[][2] = {
{0x12, 0x80}, // Camera Soft reset. Self cleared after reset.
{0x00, 0x00},
{0x01, 0x80}, // set blue gain
{0x02, 0x80}, // set red gain
{0x03, 0xb0},
{0x06, 0x60}, // set brightness
{0x0c, 0x24}, // set blue background
{0x0d, 0x24}, // set red background
{0x10, 0xff}, // set exposure time, brightness control
{0x11, 0x80}, // set frame rate CLK_input = PCLK
{0x13, 0x21}, // set 8 Bit YUV mode
{0x14, 0x94},
{0x16, 0x03}, //
{0x17, 0x2f}, //
{0x18, 0xcf}, // (207-47)*4 = 640
{0x19, 0x06}, //
{0x1a, 0xf5}, // ((244-5)+1)*2=480
{0x1b, 0x00},
{0x20, 0x00},
{0x21, 0x80},
{0x22, 0x80},
{0x23, 0x00},
{0x26, 0xa2},
{0x27, 0xea},
{0x29, 0x00},
{0x2a, 0x00},
{0x2b, 0x00},
{0x2c, 0x88},
{0x2e, 0x80},
{0x2f, 0x44},
{0x60, 0x27},
{0x61, 0x82},
{0x62, 0x5f},
{0x63, 0xd5},
{0x64, 0x57},
{0x65, 0x83},
{0x66, 0x55},
{0x68, 0xcf},
{0x69, 0x76},
{0x6a, 0x22},
{0x6b, 0x00},
{0x6c, 0x08},
{0x6d, 0x48},
{0x6e, 0x80},
{0x6f, 0x0c},
{0x70, 0x89},
{0x71, 0x00},
{0x72, 0x14},
{0x73, 0x54},
{0x75, 0x0e},
{0x76, 0x00},
{0x77, 0xff},
{0x78, 0x80},
{0x79, 0x80},
{0x7a, 0x80},
{0x7b, 0xe6},
{0x7c, 0x00},
{0x24, 0x10},
{0x25, 0x8a},
{0x28, 0x20},
{0x2d, 0x95},
{0x67, 0x92},
{0x74, 0x00},
{0x15, 0x41}, // inversed PCLK : falling edge to get data, 8 Bit -U-V- sequence....
{0x12, 0x34}, // enable AGC/AWB, mirror image. YUYV-must set at last..
};
const unsigned char S5X532_YCbCr8bit_TV[][2] =
{
// page 5
{0xec,0x05},
{0x08,0x55},
{0x0a,0x75},
{0x0c,0x90},
{0x0e,0x18},
{0x12,0x09},
{0x14,0x9d},
{0x16,0x90},
{0x1a,0x18},
{0x1c,0x0c},
{0x1e,0x09},
{0x20,0x06},
{0x22,0x20},
{0x2a,0x00},
{0x2d,0x04},
{0x12,0x24},
// page 3
{0xec,0x03},
{0x0c,0x09},
{0x6c,0x09},
{0x2b,0x10}, // momo clock inversion
// page 2
{0xec,0x02},
{0x03,0x09},
{0x05,0x08},
{0x06,0x01},
{0x07,0xf8},
{0x15,0x25},
{0x30,0x29},
{0x36,0x12},
{0x38,0x04},
{0x1b,0x77}, // 24MHz : 0x77, 12MHz : 0x22
{0x1c,0x77}, // 24MHz : 0x77, 12MHz : 0x22
// page 1
{0xec,0x01},
{0x00,0x03}, //
{0x0a,0x08}, // 0x0-QQVGA, 0x06-CIF, 0x02-QCIF, 0x08-VGA, 0x04-QVGA, 0x0a-SXGA
//{0x10,0x22}, // 0x22-ITU-R656(YCbYCr), 0x26-ITU-R601(YCbYCr)
{0x10,0x26}, // 0x22-ITU-R656(YCbYCr), 0x26-ITU-R601(YCbYCr)
{0x50,0x21}, // Hblank
{0x51,0x00}, // Hblank
{0x52,0xA1}, // Hblank
{0x53,0x02}, // Hblank
{0x54,0x01}, // Vblank
{0x55,0x00}, // Vblank
{0x56,0xE1}, // Vblank
{0x57,0x01}, // Vblank
{0x58,0x21}, // Hsync
{0x59,0x00}, // Hsync
{0x5a,0xA1}, // Hsync
{0x5b,0x02}, // Hsync
{0x5c,0x03}, // Vref
{0x5d,0x00}, // Vref
{0x5e,0x05}, // Vref
{0x5f,0x00}, // Vref
{0x70,0x0E},
{0x71,0xD6},
{0x72,0x30},
{0x73,0xDB},
{0x74,0x0E},
{0x75,0xD6},
{0x76,0x18},
{0x77,0xF5},
{0x78,0x0E},
{0x79,0xD6},
{0x7a,0x28},
{0x7b,0xE6},
{0x50,0x00},
{0x5c,0x00},
// page 0
{0xec,0x00},
{0x79,0x01},
{0x58,0x90},
{0x59,0xA0},
{0x5a,0x50},
{0x5b,0x70},
{0x5c,0xD0},
{0x5d,0xC0},
{0x5e,0x28},
{0x5f,0x08},
{0x50,0x90},
{0x51,0xA0},
{0x52,0x50},
{0x53,0x70},
{0x54,0xD0},
{0x55,0xC0},
{0x56,0x28},
{0x57,0x00},
{0x48,0x90},
{0x49,0xA0},
{0x4a,0x50},
{0x4b,0x70},
{0x4c,0xD0},
{0x4d,0xC0},
{0x4e,0x28},
{0x4f,0x08},
{0x72,0xd2}, // main clock = 24MHz:0xd2, 16M:0x82, 12M:0x54
{0x75,0x05} // absolute vertical mirror. junon
};
/*****************************2005.09.20*********************/
const unsigned char S5K3BAFX_SVGA[][2]={
#if 1 //samsung 2M 800*600
/////////// page0 20050626 cmtY /////////////////////////////
/*********************test 4**************************/
{0xec,0x00},
{0x75,0x02}, // Mirror setting Horizontal Mirror //supercoolgk
{0x7f,0x30},
{0xa3,0x04},
{0xa4,0x28},
{0xa5,0x31},
{0x70,0x00},
/////////// page2_CIS ///////////////////////////////////////
{0xec,0x02},
{0x00,0x0e}, // DCLK = MCLK/2, Electric shutter on, ADC = 10bit
{0x01,0x00}, // mirror_subs.
{0x02,0x00},
{0x03,0x0a},
{0x04,0x00},
{0x05,0x0a},
{0x06,0x04}, // wrd_high sxga = 1216d
{0x07,0xc0}, // wrd_low
{0x08,0x06}, // wcw_high sxga = 1616d
{0x09,0x50}, // wcw_low
{0x27,0x4c}, //YE24-SS-keh clamp On
{0x33,0x00},
//=========================================================//
// H_size : wcw(1616d_650h) + Hblk(84d_54h) = 1700d(6a4h) //
// //
// V_size : wrd(1216d_4c0h) + Vblk(39d_27h) = 1255d(4e7h) //
//=========================================================//
{0x0a,0x0a}, //04 // single frame capture off, sync ctrl.
{0x0b,0x04},
{0x0c,0x64},
{0x0d,0x04}, // cintr_high
{0x0e,0x64}, // cintr_low
{0x0f,0x00}, // cintc_high
{0x10,0x00}, // cintc_low
{0x11,0x00},
{0x12,0x01},
{0x13,0x00},
{0x14,0x00},
{0x15,0x00}, // Vblank_high
{0x16,0x27}, // Vblank_low
{0x17,0x00},
{0x18,0x20},
{0x19,0x00},
{0x1a,0x00},
{0x1b,0x00}, // Hblank_high
{0x1c,0x54}, // Hblank_low
{0x1d,0x14}, // global gain for 24Mhz
{0x1e,0x00}, // gain ctrl.
{0x24,0x86}, // Frame_ADLC
{0x26,0x99}, // DAC_TX Ctrl.
{0x2c,0x20}, // by sul, yf18-sec_nuke_kimyongsu, change a value [ 80 --> a0 ]
{0x2e,0x41}, // external cap add
{0x31,0x00}, // line ADLC
{0x1f,0x80}, // ¢ CIS sensor test mode
//#if 1//YE24-SS-keh
{0x2d,0x30},
//#endif
{0xec,0x03},
// Table index 0
{0x01,0x00},
{0x02,0x27}, // V/1: Vblk(39d)=27h
// Table index 2
{0x51,0x00}, // 02
{0x52,0x27}, //5d // 87 // V/2: wrd(1216d/2d)+Vblk(39d)=647d(287h)
//0x5e,0x35, // 0912 added
{0x62,0x0a}, //05 yf13-ss-ktj_tunning original 0x08
{0x63,0x02},
{0x64,0x60}, //55 original 0x87
{0x68,0x35}, // 0912 added
// Table index 3
{0x79,0x00},
{0x7a,0x27}, // V/1: Vblk(39d)=27h
// Table index 4
{0xa1,0x00}, //03
{0xa2,0x27}, //5d //e4 // H/2: wrd(1216d/4d)*3+Vblk(84d)=996d(3e4h)
// Table index 5
{0xc9,0x00},
{0xca,0x27}, // V/1: Vblk(39d)=27h
// Table index 0 : H=2, V=1
{0x03,0x03},
{0x04,0x7c}, // H/2: wcw(1616d/2d)+Hblk(84d)=892(37ch)
{0x05,0x2f},
{0x06,0x05}, // <1,7f> write Y,C order, YC 601 format
{0x0e,0x37}, // HBLK_START
{0x12,0x10}, // VBLK_START
{0x15,0x04}, // VBLK_CNTEND high, Total V_size = 1255d(4e7h)
{0x16,0xe7}, // VBLK_CNTEND low, Total V_size = 1255d(4e7h)
{0x18,0x37}, // HS656_START
{0x1c,0x0d}, // VS656_START
{0x15,0x04}, // VS656_CNTEND high, Total V_size = 1255d(4e7h)
{0x16,0xe7}, // VS656_CNTEND low, Total V_size = 1255d(4e7h)
// Table index 1 : H=1, V=2
{0x2b,0x00},
{0x2c,0x54}, // H/1: Hblk(84d)=54h
{0x2e,0x05}, // <1,7f> write Y,C order, YC 601 format
{0x36,0x37}, //
{0x3a,0x11}, //
//#if 1//YD27-SS-keh cam tuning Frame Rate 促矫 函版 17 frames 捞惑 闰 临 积扁绰 巩力肺.
{0x53,0x03},
{0x54,0x7c},
//#endif
/* YD27-SS-keh cam tuning Frame Rate Setting */
//#ifdef SYS_LSI_CAM2M //ktj_cam_driver => Sub-sampling : 800x600
{0x55,0x2f},
{0x56,0x05}, //Y-Cb-Y-Cr //Sub-sampling 800x600 : <1,7f> YC order, YC 601 format setting
//#else
//0x56,0x07, // <1,7f> write Y,C order, YC 601 format
//#endif //ktj_cam_driver
{0x5e,0x35}, //yf24-ss-ktj_tunning
{0x5f,0x03},
//0x60,0x28,
{0x68,0x35},
{0x6a,0x28}, // 0912 added
{0x6c,0x09},
{0x6d,0x02},
{0x6e,0x60},
// Table index 3 : H
{0x7b,0x05},
{0x7c,0x10}, // H/4: wcw(1616d/4d)*3+Hblk(84d)=1296d(510h)
{0x7d,0x2f},
{0x7e,0x05}, // <1,7f> write Y,C order, YC 601 format
{0x86,0x37},
{0x90,0x37},
// Table index 4
{0xa3,0x05},
{0xa4,0x10}, // H/4: wcw(1616d/4d)*3+Hblk(84d)=1296d(510h)
{0xa5,0x2f},
{0xa6,0x05}, // Y-Cb-Y-Cr <1,7f> write Y,C order, YC 601 format
{0xae,0x37},
{0xb8,0x37},
// Table index 5
{0xcb,0x00},
{0xcc,0x54}, // H/1: Hblk(84d)=54h
{0xcd,0x2f},
{0xce,0x05}, // Y-Cb-Y-Cr <1,7f> write Y,C order, YC 601 format
////////////////// page 4_scale down ////////////////////////////
{0xec,0x04},
// UXGA (Table Index 0)
{0x01,0x00}, // Vblk high
{0x02,0x27}, // Vblk low
//0x03,0x00, // Hblk high
//0x04,0x54, // Hblk low
{0x05,0x2f}, // UXGA Change
{0x06,0x05}, //06 //UXGA<1,7f> YC order, YC 601 format setting
//0x0e,0x37,
{0x10,0x40},
// test 0924
{0x12,0x0a},
//0x13,0x02,
//0x14,0x60,
{0x0e,0x35},//37, // HBLK_START //yf13-ss-ktj_tunning [37->39] //yf16-sec_nuke_kimyongsu, change value [39 --> 35]
//0x12,0x15, // VBLK_START
{0x15,0x04}, // VBLK_CNTEND high, Total V_size = 1255d(4e7h)
{0x16,0xe7}, // VBLK_CNTEND low, Total V_size = 1255d(4e7h)
{0x18,0x37}, // HS656_START
{0x1c,0x10}, // VS656_START
{0x1f,0x04}, // VS656_CNTEND high, Total V_size = 1255d(4e7h)
{0x20,0xe7}, // VS656_CNTEND low, Total V_size = 1255d(4e7h)
// SXGA_1280x1024 (Table Index 1)
{0x28,0x01},
{0x2c,0xd8},
{0x2d,0x3f},
{0x2e,0x06}, // Y-Cb-Y-Cr SXGA<1,7f> YC order, YC 601 format setting
{0x35,0x02},
{0x36,0xd2},
{0x37,0x04},//05
{0x38,0xff},//00
{0x3a,0x06},//0d,
// VGA_640x480 (Table Index 2)
{0x50,0x01},
{0x55,0x3c},
{0x56,0x05}, // Y-Cb-Y-Cr
{0x5e,0x24},
{0x6c,0x07},
// QVGA_320x240 (Table Index 3)
{0x78,0x01},
//0x7d,0x35,
{0x7e,0x04}, // Y-Cb-Y-Cr
{0x86,0xce},
{0x8a,0x01},
// QQVGA_160x120 (Table Index 4)
{0xa0,0x01},
//0xa5,0x37,
{0xa6,0x05}, // Y-Cb-Y-Cr
{0xae,0x36},
// CIF_352x288 (Table Index 5)
{0xc8,0x01},
// page 1.80 01 --> 11(CIF mode矫父 setting)
{0x8d,0x05},
{0x8e,0x0f},
////////////////// page 0 command //////////////////////////////
{0xec,0x00},
{0x03,0x4b}, //yf13-ss-ktj_tunning - AE target offset on [ae target offset ON : 6b , OFF : 4b]
{0x22,0x22}, // I2C master ctrl.
{0x23,0x93},
{0x29,0x04}, // Brightness high
{0x2a,0x00}, // Brightness low
{0x2b,0x07}, // Color level high
{0x2c,0x00}, // Color level low
{0x2d,0x40},//YD27-SS-keh 历炼档俊辑 frame rate 冻绢瘤霸 窃. but 拳搁篮 灌酒咙. 荐沥.
{0x3e,0x10}, // Y_min Y min level limit value of AWB ODM
{0x34,0x08},
{0x35,0x02},
{0x36,0x05},
{0x37,0x03}, // B linit high 5->3
{0x38,0x03},
{0x39,0x09}, //yf16-sec_nuke_kimyongsu, change a value [05 --> 0a]
{0x3a,0x06}, //yf16-sec_nuke_kimyongsu, change a value [04 --> 0a]
{0x3b,0x08}, //yf16-sec_nuke_kimyongsu, change a value [05 --> 07]
{0x66,0x01},
{0x8b,0x02},
{0x6c,0xa0}, //d0//yf13-ss-ktj_tunning [d8->f0] :灌扁 臭烙.....
{0x6d,0x00}, // AE target high //yf13-ss-ktj_tunning
//YE24-SS-keh 困摹捞悼.
{0x73,0x21}, // frame AE 1/3
{0x78,0x60}, // // AGC gain x4
//0x79,0x00, // white balance R ctrl. //yf15-ss-ktj_tunning
//0x7a,0x00, //02 // white balance B ctrl. //yf15-ss-ktj_tunning
{0x7e,0x98}, //98->88 Suppress function
{0x80,0x00}, // Back light compension [0]:on/off
{0x81,0x20}, // G_gain offset [0]:on/off //yf15-ss-ktj_tunning
//edge enhancement
{0xe0,0x03}, //taeyoon
{0xe1,0x00}, //yf24-ss-ktj_tunning_test taeyoon
{0xe2,0x60},
{0xe3,0x38}, //38->48 yf13-ss-ktj_tunning [30->40 ] : 急疙档 臭烙 => EDGE ,40 -->10 taeyoon
{0xe4,0x00}, //yf13-ss-ktj_tunning 10->00
{0xe5,0x50},
{0xe6,0x30}, //yf13-ss-ktj_tunning 2f->30
{0xe7,0x00},
///////////////// page 1 ISP ///////////////////////////////////
{0xec,0x01},
{0x00,0x10}, // AD Delay(3clk)
{0x0c,0x10}, // ISP pattern 0ff 13-green, 0x11-4color bar
{0x0d,0x18}, //yf24-ss-ktj_tunning // color filter bayer selection
//0x1a,0x22, // Highlight color suppress
{0x1d,0x38}, // Taeyoon
{0x1e,0x38}, // Taeyoon
{0x1f,0x30}, // Taeyoon
{0x21,0x30}, // Taeyoon
{0x22,0x22}, // Taeyoon
{0x23,0x50}, // Taeyoon
{0x24,0x3f}, // Taeyoon
{0x25,0x28}, // Taeyoon
{0x26,0x14}, // Taeyoon
{0x27,0x08}, // Taeyoon
{0x22,0x2e}, //aa, //yf13-ss-ktj_tunning ,60 -->aa
{0x24,0x3f},
{0x25,0x70}, //30, // edge enhancement slice //yf13-ss-ktj_tunning 10->30
{0x26,0x0a},
{0x27,0x00},
//s60fc // C delay +2MCLK
//R.G.B matrix
//s1160
//s1330
//s1580
{0x3b,0x05},
{0x39,0x10}, //yf15-ss-ktj_tunning [20->30]
//
// Color Matrix ===============================================================================
//
{0x6b,0x05},
{0x6c,0x00},
{0x6d,0x00},
{0x6e,0x00},
{0x6f,0xff},
{0x70,0x00},
{0x71,0xff},
{0x72,0x00},
{0x73,0x05},
{0x74,0xf0},
{0x75,0xff},
{0x76,0x10},
{0x77,0xff},
{0x78,0x00},
{0x79,0xff},
{0x7a,0x00},
{0x7b,0x06},
{0x7c,0x00},
//////////////////////// page 9 //////////////////////////
//
//shade_float(55,50,45)
//
{0xec,0x00},
{0x0e,0x00}, // RGB shade 0:off, 1:on
{0xec,0x09},
{0x00,0x89},
{0x01,0x71},
{0x02,0x83},
{0x03,0x02},
{0x04,0x82},
{0x05,0x87},
{0x06,0x82},
{0x07,0x92},
{0x08,0xf4},
{0x09,0x0b},
{0x0a,0xa9},
{0x0b,0xa8},
{0x0c,0x02},
{0x0d,0x98},
{0x0e,0xa7},
{0x0f,0x02},
{0x10,0xc6},
{0x11,0x6c},
{0x12,0x88},
{0x13,0x16},
{0x14,0x71},
{0x15,0x09},
{0x16,0xa0},
{0x17,0x1d},
{0x18,0x85},
{0x19,0x00},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -