#ifndef OV2643_H #define OV2643_H // Scene Mode uint8_t ov2643_scene_mode_auto[] = { 0x03,0x10, 0x41,0x00, 0x03,0x20, 0xb2,0x80, 0xff,0xff, }; uint8_t ov2643_scene_mode_night[] = { 0x03,0x10, 0x41,0x15, 0x03,0x20, 0xb2,0xf0, 0xff,0xff, }; // White Balance uint8_t ov2643_wb_auto [] = { }; uint8_t ov2643_wb_incandescent [] = { }; uint8_t ov2643_wb_fluorescent [] = { }; uint8_t ov2643_wb_daylight [] = { }; uint8_t ov2643_wb_cloudy [] = { }; // Exposure uint8_t ov2643_exposure_neg6[] = { }; uint8_t ov2643_exposure_neg3[] = { }; uint8_t ov2643_exposure_zero[] = { }; uint8_t ov2643_exposure_pos3[] = { }; uint8_t ov2643_exposure_pos6[] = { }; // Resolution uint8_t ov2643_1600_1200_regs[]={ //;pclk=72mhz,30fps/pclk=36mhz,15fps //0x12,0x80, 0xc3,0x1f, 0xc4,0xff, 0x3d,0x48, 0xdd,0xa5, //;windows setup 0x20,0x01, 0x21,0x25, 0x22,0x00, 0x23,0x0c, 0x24,0x64,//;0x640=1600 0x25,0x08, 0x26,0x4b,//;0x4b0=1200 0x27,0x06, 0x28,0x42, //;format setting 0x12,0x08,//+MIRROR*0x20+FLIP*0x10,//mirror and flip 0x39,0x10, 0xcd,0x12, 0x3d,0x08, //;frame setting 0x0e,0x10,//clock 48Mhz PCLK 0x0f,0x14, 0x10,0x0a, 0x11,0x00, 0x29,0x07,//;dummy pixels 0x2a,0x9a, 0x2b,0x04,//;dummy lines//0x04 0x2c,0xd4,// //0xd4 //for 12.5fps 0x4d4*1.2=0x5cb 0x2d,0x00, 0x2e,0x00, 0x1c,0x25,//vsync width 0x1d,0x06,//;banding 0x1e,0x00, 0x1f,0xb9,//0xba,//0x5d, 0xde,0xc4,//added 2011-9-2 9:21:54 //0x75,0x6a,//advanced AWB for 2M }; uint8_t ov2643_1280_720_regs[]={ //;pclk=72mhz,30fps/pclk=36mhz,15fps //0x12,0x80, 0xc3,0x1f, 0xc4,0xff, 0x3d,0x48, 0xdd,0xa5, //;windows setup 0x20,0x01,//0x01,// 0x21,0x25,//0x60,// 0x22,0x00, 0x23,0x0c, 0x24,0x50,//;0x500=1280 0x25,0x04, 0x26,0x2d,//;0x2d0=720 0x27,0x04, 0x28,0x42, //format 0x12,0x48,//+MIRROR*0x20+FLIP*0x10,//mirror and flip 0x39,0x10, 0xcd,0x12, //;frame setting 0x0e,0x10,//0x10,//0xb4,//clock 48Mhz PCLK 0x0f,0x14, 0x10,0x0a, 0x11,0x00, 0x29,0x06,//;dummy pixels //24.75M 0x29,0x06//24M 0x29,0x06,// 0x2a,0x40, //24.75M 0x2a,0x72//24M 0x2a,0x40,// 0x2b,0x02,//;dummy lines //24.75M 0x2b,0x02//24M 0x2b,0x02,// 0x2c,0xee, //24.75M 0x2c,0xee//24M 0x2c,0xee,// //for 25fps 0x2ee*1.2=0x384 0x1c,0x25,//vsync width 0x1d,0x02,//0x04,//0x02, 0x1e,0x00, 0x1f,0xe1, 0xde,0x7c, 0x3d,0x08, }; uint8_t ov2643_640_480_regs[]={ //;pclk=72mhz,30fps/pclk=36mhz,15fps //0x12,0x80, 0xc3,0x1f, 0xc4,0xff, 0x3d,0x48, 0xdd,0xa5, //;windows setup 0x20,0x01, 0x21,0x98, 0x22,0x00, 0x23,0x06, 0x24,0x28,//;0x280=640 0x25,0x04, 0x26,0x1e,//;0x1e0=480 0x27,0x04, 0x28,0x40, //format 0x12,0x09, 0x39,0xd0, 0xcd,0x13, 0x3d,0x08, //;frame setting 0x0e,0x10,//clock 48Mhz PCLK 0x0f,0x14, 0x10,0x0a, 0x11,0x00, 0x29,0x07,//;dummy pixels//24.75M 0x29,0x07//24M 0x29,0x07,//->ov setting 0x2a,0x93, //24.75M 0x2a,0xd0//24M 0x2a,0x93,//->ov setting 0x2b,0x02,//;dummy lines //24.75M 0x2b,0x02//24M 0x2b,0x02,//->ov setting 0x2c,0x6a, //24.75M 0x2c,0x6a//24M 0x2c,0x6a,//->ov setting //for 25fps 0x26a*1.2=0x2e6 0x1c,0x25,//vsync width 0x1d,0x02, 0x1e,0x00, 0x1f,0xb9, 0xde,0x7c, 0x3d,0x08, }; uint8_t ov2643_default_regs_init[]={ 0x12,0x80, //reset 0x13,0xff, //;pclk=72mhz,30fps/pclk=36mhz,15fps 0xc3,0x1f, 0xc4,0xff, 0x3d,0x48, 0xdd,0xa5, //;windows setup 0x20,0x01, 0x21,0x98, 0x22,0x00, 0x23,0x06, 0x24,0x28,//;0x280=640 0x25,0x04, 0x26,0x1e,//;0x1e0=480 0x27,0x04, 0x28,0x40, //;format setting 0x12,0x09, 0x39,0xd0, 0xcd,0x13, 0x3d,0x08, //;frame setting 0x0e,0x10,//clock 48Mhz PCLK 0x0f,0x14, 0x10,0x0a, 0x11,0x00, 0x29,0x07,//;dummy pixels//24.75M 0x29,0x07//24M 0x29,0x07,//->ov setting 0x2a,0x93, //24.75M 0x2a,0xd0//24M 0x2a,0x93,//->ov setting 0x2b,0x02,//;dummy lines //24.75M 0x2b,0x02//24M 0x2b,0x02,//->ov setting 0x2c,0x6a, //24.75M 0x2c,0x6a//24M 0x2c,0x6a,//->ov setting //for 25fps 0x26a*1.2=0x2e6 0x1c,0x25,//vsync width 0x1d,0x02, 0x1e,0x00, 0x1f,0xb9, //common part except 0x3d,0xde 0x14,0x87, //band filter bit7: 1:50Hz 0:60Hz bit4: 0x15,0x42, 0x3c,0xa4, 0x18,0x78,//set to default then set to csi_ae value to wake up quickly 0x19,0x68,// 0x1a,0x71, 0x37,0xe8, 0x16,0x90, 0x43,0x00, 0x40,0xfb, 0xa9,0x44, 0x2f,0xec, 0x35,0x10, 0x36,0x10, 0x0c,0x00, 0x0d,0x00, 0xd0,0x93, 0xdc,0x2b, 0xd9,0x41, 0xd3,0x02, 0xde,0x7c, 0x3d,0x08, 0x0c,0x00, 0x9b,0x69, 0x9c,0x7d, 0x9d,0x7d, 0x9e,0x69, 0x35,0x04, 0x36,0x04, //;gamma //normal ////enhanced////zqh3 ////zqh2 ////zqh1 ////reset // 0x65,0x04,//0x65,0x12,//0x65,0x04,//0x65,0x04,//0x65,0x07,//0x65,0x05,// 0x66,0x07,//0x66,0x20,//0x66,0x07,//0x66,0x07,//0x66,0x12,//0x66,0x0c,// 0x67,0x19,//0x67,0x39,//0x67,0x19,//0x67,0x19,//0x67,0x1f,//0x67,0x1c,// 0x68,0x34,//0x68,0x4e,//0x68,0x34,//0x68,0x34,//0x68,0x35,//0x68,0x2a,// 0x69,0x4a,//0x69,0x62,//0x69,0x4a,//0x69,0x4a,//0x69,0x4a,//0x69,0x39,// 0x6a,0x5a,//0x6a,0x74,//0x6a,0x5a,//0x6a,0x5a,//0x6a,0x5d,//0x6a,0x45,// 0x6b,0x67,//0x6b,0x85,//0x6b,0x67,//0x6b,0x6b,//0x6b,0x6f,//0x6b,0x52,// 0x6c,0x71,//0x6c,0x92,//0x6c,0x71,//0x6c,0x78,//0x6c,0x7d,//0x6c,0x5d,// 0x6d,0x7c,//0x6d,0x9e,//0x6d,0x7c,//0x6d,0x84,//0x6d,0x8a,//0x6d,0x68,// 0x6e,0x8c,//0x6e,0xb2,//0x6e,0x8c,//0x6e,0x98,//0x6e,0x9f,//0x6e,0x7f,// 0x6f,0x9b,//0x6f,0xc0,//0x6f,0x9b,//0x6f,0xa6,//0x6f,0xae,//0x6f,0x91,// 0x70,0xa9,//0x70,0xcc,//0x70,0xa9,//0x70,0xb2,//0x70,0xbb,//0x70,0xa5,// 0x71,0xc0,//0x71,0xe0,//0x71,0xc0,//0x71,0xc6,//0x71,0xd0,//0x71,0xc6,// 0x72,0xd5,//0x72,0xee,//0x72,0xd5,//0x72,0xd5,//0x72,0xdf,//0x72,0xde,// 0x73,0xe8,//0x73,0xf6,//0x73,0xe8,//0x73,0xe8,//0x73,0xe8,//0x73,0xef,// 0x74,0x20,//0x74,0x11,//0x74,0x20,//0x74,0x20,//0x74,0x20,//0x74,0x16,// //;color matrix //ttune //ov seeting // 0xab,0x20,//0xab,0x28,// 0xac,0x5b,//0xac,0x48,// 0xad,0x05,//0xad,0x10,// 0xae,0x1b,//0xae,0x18,// 0xaf,0x76,//0xaf,0x75,// 0xb0,0x90,//0xb0,0x8c,// 0xb1,0x90,//0xb1,0x8d,// 0xb2,0x8c,//0xb2,0x8c,// 0xb3,0x04,//0xb3,0x00,// 0xb4,0x98,//0xb4,0x98,// 0xb5,0x00,//0xb5,0x00,// //;lens shading 0x40,0xFB,//0x40,0x08,// 0x4c,0x03,//0x4c,0x03,// 0x4d,0x30,//0x4d,0xd0,// 0x4e,0x02,//0x4e,0x02,// 0x4f,0x5c,//0x4f,0x5c,// 0x50,0x3e,//0x50,0x3e,// 0x51,0x00,//0x51,0x00,// 0x52,0x66,//0x52,0x66,// 0x53,0x03,//0x53,0x03,// 0x54,0x30,//0x54,0xd0,// 0x55,0x02,//0x55,0x02,// 0x56,0x5c,//0x56,0x5c,// 0x57,0x47,//0x57,0x47,// 0x58,0x00,//0x58,0x00,// 0x59,0x66,//0x59,0x66,// 0x5a,0x03,//0x5a,0x03,// 0x5b,0x20,//0x5b,0xd0,// 0x5c,0x02,//0x5c,0x02,// 0x5d,0x5c,//0x5d,0x5c,/ 0x5e,0x3e,//0x5e,0x3e,// 0x5f,0x00,//0x5f,0x00,// 0x60,0x66,//0x60,0x66,// 0x41,0x1f, 0xb5,0x01, 0xb6,0x07, 0xb9,0x3c, 0xba,0x28, 0xb7,0x90, 0xb8,0x08, 0xbf,0x0c, 0xc0,0x3e, 0xa3,0x0a, 0xa4,0x0f, 0xa5,0x09,//denoise threshold 0xa6,0x16, 0x9f,0x0a, 0xa0,0x0f, 0xa7,0x0a, 0xa8,0x0f, 0xa1,0x18,//0xa1,0x10, 0xa2,0x10,//0xa2,0x04, 0xa9,0x00,//0xa9,0x04, 0xaa,0xa6, //;awb 0x75,0x68,//0x75,0x6a,// 0x76,0x11,//0x76,0x11,// 0x77,0x92,//0x77,0x92,// 0x78,0xa1,//0x78,0xa1,// 0x79,0xe1,//0x79,0xe1,// 0x7a,0x02,//0x7a,0x02,// 0x7c,0x0e,//0x7c,0x05,// 0x7d,0x12,//0x7d,0x08,// 0x7e,0x12,//0x7e,0x08,// 0x7f,0x54,//0x7f,0x7c,// 0x80,0x78,//0x80,0x58,// 0x81,0xa2,//0x81,0x2a,// 0x82,0x80,//0x82,0xc5,// 0x83,0x4e,//0x83,0x46,// 0x84,0x40,//0x84,0x3a,// 0x85,0x4c,//0x85,0x54,// 0x86,0x43,//0x86,0x44,// 0x87,0xf8,//0x87,0xf8,// 0x88,0x08,//0x88,0x08,// 0x89,0x70,//0x89,0x70,// 0x8a,0xf0,//0x8a,0xf0,// 0x8b,0xf0,//0x8b,0xf0,// 0x90,0xe3, 0x93,0x10, 0x94,0x20, 0x95,0x10, 0x96,0x18, 0xff,0xff,//delay 255ms 0xff,0xff,//delay 255ms }; ; #endif