📄 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..
};
#define S5X532_VER 36 // V30 or V36 or V37
const unsigned char S5X532_YCbCr8bit_TV[][2] =
{
#if S5X532_VER == 30
// 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
#elif S5X532_VER == 36 // 2004.05.10 ISP_REV36
//=============== page0 ===============//
{0xec,0x00},
{0x02,0x00},
{0x14,0x60},
{0x15,0x60},
{0x16,0x60},
{0x1b,0x20},
{0x1c,0x20},
{0x1d,0x20},
{0x1e,0x20},
{0x72,0xdc},
{0x73,0x11},
{0x76,0x82},
{0x77,0x90},
{0x78,0x6c},
{0x0a,0x02},
{0x34,0x0d},
{0x35,0x0a},
{0x36,0x05},
{0x37,0x05},
{0x38,0x06},
{0x39,0x08},
{0x3A,0x0d},
{0x3B,0x0d},
{0x3C,0x18},
{0x3D,0xE0},
{0x3E,0x20},
{0x66,0x02},
{0x6c,0x40},
{0x7c,0x01},
{0x0D,0x24},
{0x40,0x1B},
{0x41,0x4F},
{0x42,0x24},
{0x43,0x3E},
{0x44,0x32},
{0x45,0x30},
{0x48,0xa0},
{0x49,0xd0},
{0x4A,0x28},
{0x4B,0x7d},
{0x4C,0xd0},
{0x4D,0xe0},
{0x4E,0x1a},
{0x4F,0xa0},
{0x50,0xc0},
{0x51,0xc0},
{0x52,0x42},
{0x53,0x7e},
{0x54,0xc0},
{0x55,0xf0},
{0x56,0x1e},
{0x57,0xe0},
{0x58,0xc0},
{0x59,0xa0},
{0x5A,0x4a},
{0x5B,0x7e},
{0x5C,0xc0},
{0x5D,0xf0},
{0x5E,0x2a},
{0x5F,0x10},
{0x79,0x00},
{0x7a,0x00},
{0xe0,0x0f},
{0xe3,0x14},
{0xe5,0x48},
{0xe7,0x58},
//=============== page1 ===============//
{0xec,0x01},
{0x10,0x05},
{0x20,0xde},
{0x0b,0x06},
{0x30,0x00},
{0x31,0x00},
{0x32,0x00},
{0x24,0x28},
{0x25,0x3F},
{0x26,0x65},
{0x27,0xA1},
{0x28,0xFF},
{0x29,0x96},
{0x2A,0x85},
{0x2B,0xFF},
{0x2C,0x00},
{0x2D,0x1B},
{0xB0,0x28},
{0xB1,0x3F},
{0xB2,0x65},
{0xB3,0xA1},
{0xB4,0xFF},
{0xB5,0x96},
{0xB6,0x85},
{0xB7,0xFF},
{0xB8,0x00},
{0xB9,0x1B},
{0x15,0x15},
{0x18,0x85},
{0x1f,0x05},
{0x87,0x40},
{0x37,0x60},
{0x38,0xd5},
{0x48,0xa0},
{0x61,0x54},
{0x62,0x54},
{0x63,0x14},
{0x64,0x14},
{0x6d,0x12},
{0x78,0x09},
{0x79,0xD7},
{0x7A,0x14},
{0x7B,0xEE},
//=============== page2 ===============//
{0xec,0x02},
{0x2c,0x76},
{0x25,0x25},
{0x27,0x27},
{0x30,0x29},
{0x36,0x08},
{0x38,0x04},
//=============== page3 ===============//
{0xec,0x03},
{0x08,0x00},
{0x09,0x33},
//=============== page4 ===============//
{0xec,0x04},
{0x00,0x21},
{0x01,0x00},
{0x02,0x9d},
{0x03,0x02},
{0x04,0x04},
{0x05,0x00},
{0x06,0x1f},
{0x07,0x02},
{0x08,0x21},
{0x09,0x00},
{0x0a,0x9d},
{0x0b,0x02},
{0x0c,0x04},
{0x0d,0x00},
{0x0e,0x20},
{0x0f,0x02},
{0x1b,0x3c},
{0x1c,0x3c},
//=============== page5 ===============//
{0xec,0x05},
{0x1f,0x00},
{0x08,0x59},
{0x0a,0x71},
{0x1e,0x23},
{0x0e,0x3c},
//=============== page7 ===============//
{0xec,0x07},
{0x11,0xfe},
// added by junon
{0xec,0x01},
{0x10,0x26}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
#elif S5X532_VER == 37 // 2004.05.10 ISP_REV37
{0xec,0x01},
{0x0f,0x03},
{0x8a,0x7e},
{0x10,0x04},
{0x20,0x90},
{0x22,0x26},
{0x0b,0x06},
{0x4c,0x03},
{0xc0,0xe0},
{0xc1,0xc0},
{0xc2,0xa0},
{0xc3,0x88},
{0xc4,0x90},
{0xc5,0xa0},
{0xc6,0xb0},
{0xc7,0xc0},
{0xc8,0xfb},
{0xc9,0xf0},
{0xca,0xc0},
{0xcb,0x90},
{0xcc,0x82},
{0xcd,0x9c},
{0xce,0xb0},
{0xcf,0xe0},
{0x61,0x54},
{0x62,0x54},
{0x63,0x14},
{0x64,0x14},
{0x7A,0x14},
{0x7B,0xEE},
//page2
{0xec,0x02},
{0x1b,0x99}, //99 at 20Mhz // aa at 19.2Mhz
{0x1c,0x99}, //99 at 20Mhz // aa at 19.2Mhz
{0x2c,0x75},
{0x25,0x25},
{0x27,0x27},
{0x30,0x29},
{0x36,0x08},
{0x38,0x04},
//page3
{0xec,0x03},
{0x08,0x00},
{0x09,0x10}, // 33 at 20frame
//page4
{0xec,0x04},
{0x00,0x21},
{0x01,0x00},
{0x02,0x9d},
{0x03,0x02},
{0x04,0x04},
{0x05,0x00},
{0x06,0x1f},
{0x07,0x02},
{0x08,0x21},
{0x09,0x00},
{0x0a,0x9d},
{0x0b,0x02},
{0x0c,0x04},
{0x0d,0x00},
{0x0e,0x20},
{0x0f,0x02},
{0x1b,0x40},
{0x1c,0x40},
//page5
{0xec,0x05},
{0x1f,0x00},
{0x08,0x59},
{0x0a,0x71},
{0x1e,0x00}, // 23 at 20frame
//page6
{0xec,0x06},
{0x00,0x3e},
{0x01,0xa6},
{0x02,0x40},
{0x03,0xcb},
{0x04,0x09},
{0x05,0xdb},
{0x06,0x40},
{0x07,0xf2},
{0x08,0x09},
{0x09,0xdb},
{0x0a,0x40},
{0x0b,0xf2},
//page7
{0xec,0x07},
{0x11,0xfe},
{0x23,0x07},
{0x08,0xff},
{0x09,0x6c},
{0x87,0x00},
{0x21,0xff},
{0x22,0x70},
{0x31,0x05},
{0x38,0x01},
{0x39,0x01},
{0x3a,0xf0},
{0x26,0x04},
{0x27,0x10},
{0x2a,0x10},
{0x2b,0x10},
{0x49,0x02},
{0x59,0x80},
{0x5A,0x04},
{0x5B,0x06},
{0x5C,0x06},
{0x5D,0x06},
{0x5E,0x04},
{0x5F,0x04},
//page0
{0xec,0x00},
{0x0a,0x01},
{0x13,0x20},
{0x14,0x20},
{0x15,0x20},
{0x16,0x20},
{0x17,0x30},
{0x18,0x30},
{0x19,0x20},
{0x1a,0x20},
{0x1b,0x20},
{0x1c,0x20},
{0x1d,0x20},
{0x1e,0x30},
{0x1f,0x30},
{0x20,0x20},
{0x71,0x11},
{0x72,0xaa}, //aa at 20.0Mhz // a2 at 19.2Mhz
{0x61,0xb0},
{0x66,0x01},
{0x6c,0x50},
{0x7c,0x00},
{0x0D,0x24},
{0x7e,0x04},
{0x64,0xf0},
{0x86,0x01},
{0x87,0x00},
{0x76,0x80},
{0x77,0x90},
{0x78,0x6c},
{0x34,0x0d},
{0x35,0x0a},
{0x36,0x05},
{0x37,0x05},
{0x38,0x06},
{0x39,0x08},
{0x3A,0x0a},
{0x3B,0x0a},
{0x3C,0x18},
{0x3D,0xE0},
{0x3E,0x10},
{0x40,0x1d},
{0x41,0x4f},
{0x42,0x24},
{0x43,0x3c},
{0x44,0x34},
{0x45,0x2e},
{0x48,0xb0},
{0x49,0xc0},
{0x4A,0x58},
{0x4B,0x50},
{0x4C,0xe0},
{0x4D,0xc0},
{0x4E,0x30},
{0x4F,0x20},
{0x50,0xb0},
{0x51,0xc0},
{0x52,0x50},
{0x53,0x60},
{0x54,0xe0},
{0x55,0xc0},
{0x56,0x20},
{0x57,0x10},
{0x58,0xa0},
{0x59,0xc0},
{0x5A,0x60},
{0x5B,0x58},
{0x5C,0xe0},
{0x5D,0xc0},
{0x5E,0x45},
{0x5F,0x10},
{0x79,0x00},
{0x7a,0xfe},
{0xe0,0x0f},
{0xe5,0x48},
{0xe3,0x58},
{0x73,0x11},
{0xa4,0x30},
{0xa5,0x30},
{0x7f,0x30},
{0xbb,0x01},
// TotalH : 0858(035a) = 0656(0290) + 0202(00ca)
// TotalV : 0559(022f) = 0508(01fc) + 0051(0033) + [04(04)]
{0xec,0x00},
{0x02,0x00},
{0x03,0x6b},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -