#ifndef __SP0838_H_ #define __SP0838_H_ //ECLK Drv #define Pre_Value_P0_0x30 0x00 //Filter en&dis #define Pre_Value_P0_0x56 0x70 #define Pre_Value_P0_0x57 0x10 //filter outdoor #define Pre_Value_P0_0x58 0x10 //filter indoor #define Pre_Value_P0_0x59 0x10 //filter night #define Pre_Value_P0_0x5a 0x08 //smooth outdoor 0x02 #define Pre_Value_P0_0x5b 0x14 //smooth indoor 0x02 #define Pre_Value_P0_0x5c 0x30 //smooht night 0x20 //outdoor sharpness #define Pre_Value_P0_0x65 0x03 #define Pre_Value_P0_0x66 0x01 #define Pre_Value_P0_0x67 0x03 #define Pre_Value_P0_0x68 0x46 //indoor sharpness #define Pre_Value_P0_0x6b 0x04 #define Pre_Value_P0_0x6c 0x01 #define Pre_Value_P0_0x6d 0x03// 0x03 #define Pre_Value_P0_0x6e 0x43 //night sharpness #define Pre_Value_P0_0x71 0x05 #define Pre_Value_P0_0x72 0x01 #define Pre_Value_P0_0x73 0x03 #define Pre_Value_P0_0x74 0x43 //color #define Pre_Value_P0_0x7f 0xd7 //R #define Pre_Value_P0_0x87 0xf8 //B //satutation #define Pre_Value_P0_0xd8 0x48 #define Pre_Value_P0_0xd9 0x44//0x48 #define Pre_Value_P0_0xda 0x3a//0x48 #define Pre_Value_P0_0xdb 0x38//0x48 //AE target #define Pre_Value_P0_0xf7 0x78 #define Pre_Value_P0_0xf8 0x63 #define Pre_Value_P0_0xf9 0x68 #define Pre_Value_P0_0xfa 0x53 //HEQ #define Pre_Value_P0_0xdd 0x78 // 0x70 #define Pre_Value_P0_0xde 0x88 // 0x90 //AWB pre gain #define Pre_Value_P1_0x28 0x75 #define Pre_Value_P1_0x29 0x4e //VBLANK #define Pre_Value_P0_0x05 0x00 #define Pre_Value_P0_0x06 0x00 //HBLANK #define Pre_Value_P0_0x09 0x01 #define Pre_Value_P0_0x0a 0x76 // Scene Mode uint8_t sp0838_scene_mode_auto[] = { //caprure preview daylight 24M 50hz 20-8FPS maxgain:0x70 0xfd,0x00, 0x05,0x0 , 0x06,0x0 , 0x09,0x1 , 0x0a,0x76, 0xf0,0x62, 0xf1,0x0 , 0xf2,0x5f, 0xf5,0x78, 0xfd,0x01, 0x00,0xb2, 0x0f,0x60, 0x16,0x60, 0x17,0xa2, 0x18,0xaa, 0x1b,0x60, 0x1c,0xaa, 0xb4,0x20, 0xb5,0x3a, 0xb6,0x5e, 0xb9,0x40, 0xba,0x4f, 0xbb,0x47, 0xbc,0x45, 0xbd,0x43, 0xbe,0x42, 0xbf,0x42, 0xc0,0x42, 0xc1,0x41, 0xc2,0x41, 0xc3,0x41, 0xc4,0x41, 0xc5,0x70, 0xc6,0x41, 0xca,0x70, 0xcb,0xc , 0x14,0x20, 0x15,0x0f, 0xfd,0x00, }; uint8_t sp0838_scene_mode_night[] = { //capture preview night 24M 50hz 20-6FPS maxgain:0x78 0xfd,0x00, 0x05,0x0 , 0x06,0x0 , 0x09,0x1 , 0x0a,0x76, 0xf0,0x62, 0xf1,0x0 , 0xf2,0x5f, 0xf5,0x78, 0xfd,0x01, 0x00,0xc0, 0x0f,0x60, 0x16,0x60, 0x17,0xa8, 0x18,0xb0, 0x1b,0x60, 0x1c,0xb0, 0xb4,0x20, 0xb5,0x3a, 0xb6,0x5e, 0xb9,0x40, 0xba,0x4f, 0xbb,0x47, 0xbc,0x45, 0xbd,0x43, 0xbe,0x42, 0xbf,0x42, 0xc0,0x42, 0xc1,0x41, 0xc2,0x41, 0xc3,0x41, 0xc4,0x41, 0xc5,0x41, 0xc6,0x41, 0xca,0x78, 0xcb,0x10, 0x14,0x20, 0x15,0x1f, 0xfd,0x00, }; // White Balance uint8_t sp0838_wb_auto [] = { 0xfd,0x01, 0x28,Pre_Value_P1_0x28, 0x29,Pre_Value_P1_0x29, 0xfd,0x00, 0x32,0x15, 0xfd,0x00, }; uint8_t sp0838_wb_incandescent [] = { 0xfd,0x00, //2800K-3000K 0x32,0x05, 0xfd,0x01, 0x28,0x41, 0x29,0x71, 0xfd,0x00, }; uint8_t sp0838_wb_fluorescent [] = { 0xfd,0x00, //4200K-5000K 0x32,0x05, 0xfd,0x01, 0x28,0x5a, 0x29,0x62, 0xfd,0x00, }; uint8_t sp0838_wb_daylight [] = { 0xfd,0x00, 0x32,0x05, 0xfd,0x01, 0x28,0x6b, 0x29,0x48, 0xfd,0x00, }; uint8_t sp0838_wb_cloudy [] = { 0xfd,0x00, 0x32,0x05, 0xfd,0x01, 0x28,0x71, 0x29,0x41, 0xfd,0x00, }; uint8_t sp0838_wb_tungsten [] = { 0xfd,0x00, //4000K 0x32,0x05, 0xfd,0x01, 0x28,0x57, 0x29,0x66, 0xfd,0x00 }; // Exposure uint8_t sp0838_exposure_neg2[] = { //level -2 0xfd,0x00, 0xed,Pre_Value_P0_0xf7-0x20+0x04, 0xf7,Pre_Value_P0_0xf7-0x20, 0xf8,Pre_Value_P0_0xf8-0x20, 0xec,Pre_Value_P0_0xf8-0x20-0x04, 0xef,Pre_Value_P0_0xf9-0x20+0x04, 0xf9,Pre_Value_P0_0xf9-0x20, 0xfa,Pre_Value_P0_0xfa-0x20, 0xee,Pre_Value_P0_0xfa-0x20-0x04, 0xfd, 0x00, }; uint8_t sp0838_exposure_neg1[] = { //level -2 0xfd,0x00, 0xed,Pre_Value_P0_0xf7-0x10+0x04, 0xf7,Pre_Value_P0_0xf7-0x10, 0xf8,Pre_Value_P0_0xf8-0x10, 0xec,Pre_Value_P0_0xf8-0x10-0x04, 0xef,Pre_Value_P0_0xf9-0x10+0x04, 0xf9,Pre_Value_P0_0xf9-0x10, 0xfa,Pre_Value_P0_0xfa-0x10, 0xee,Pre_Value_P0_0xfa-0x10-0x04, 0xfd, 0x00, }; uint8_t sp0838_exposure_zero[] = { //level 0 0xfd,0x00, 0xed,Pre_Value_P0_0xf7+0x04, 0xf7,Pre_Value_P0_0xf7, 0xf8,Pre_Value_P0_0xf8, 0xec,Pre_Value_P0_0xf8-0x04, 0xef,Pre_Value_P0_0xf9+0x04, 0xf9,Pre_Value_P0_0xf9, 0xfa,Pre_Value_P0_0xfa, 0xee,Pre_Value_P0_0xfa-0x04, 0xfd, 0x00, }; uint8_t sp0838_exposure_pos1[] = { //level +2 0xfd,0x00, 0xed,Pre_Value_P0_0xf7+0x10+0x04, 0xf7,Pre_Value_P0_0xf7+0x10, 0xf8,Pre_Value_P0_0xf8+0x10, 0xec,Pre_Value_P0_0xf8+0x10-0x04, 0xef,Pre_Value_P0_0xf9+0x10+0x04, 0xf9,Pre_Value_P0_0xf9+0x10, 0xfa,Pre_Value_P0_0xfa+0x10, 0xee,Pre_Value_P0_0xfa+0x10-0x04, 0xfd, 0x00, }; uint8_t sp0838_exposure_pos2[] = { //level +2 0xfd,0x00, 0xed,Pre_Value_P0_0xf7+0x20+0x04, 0xf7,Pre_Value_P0_0xf7+0x20, 0xf8,Pre_Value_P0_0xf8+0x20, 0xec,Pre_Value_P0_0xf8+0x20-0x04, 0xef,Pre_Value_P0_0xf9+0x20+0x04, 0xf9,Pre_Value_P0_0xf9+0x20, 0xfa,Pre_Value_P0_0xfa+0x20, 0xee,Pre_Value_P0_0xfa+0x20-0x04, 0xfd, 0x00, }; // Color Effect uint8_t sp0838_colorfx_none[] = { 0xfd, 0x00, 0x62, 0x00, 0x63, 0x80, 0x64, 0x80, }; uint8_t sp0838_colorfx_bw[] = { 0xfd, 0x00, 0x62, 0x40, 0x63, 0x80, 0x64, 0x80, }; uint8_t sp0838_colorfx_sepia[] = { 0xfd, 0x00, 0x62, 0x20, 0x63, 0xc0, 0x64, 0x20, }; uint8_t sp0838_colorfx_negative[] = { 0xfd, 0x00, 0x62, 0x10, 0x63, 0x80, 0x64, 0x80, }; uint8_t sp0838_colorfx_emboss[] = { 0xfd, 0x00, 0x62, 0x02, 0x63, 0x80, 0x64, 0x80, }; uint8_t sp0838_colorfx_sketch[] = { 0xfd, 0x00, 0x62, 0x01, 0x63, 0x80, 0x64, 0x80, }; uint8_t sp0838_colorfx_sky_blue[] = { 0xfd, 0x00, 0x62, 0x20, 0x63, 0x20, 0x64, 0xf0, }; uint8_t sp0838_colorfx_grass_green[] = { 0xfd, 0x00, 0x62, 0x20, 0x63, 0x20, 0x64, 0x20, }; uint8_t sp0838_colorfx_skin_whiten[] = { }; uint8_t sp0838_colorfx_vivid[] = { }; // Brightness uint8_t sp0838_brightness_neg4[] = { 0xfd,0x00, 0xdc,0xc0,//level -4 }; uint8_t sp0838_brightness_neg3[] = { 0xfd,0x00, 0xdc,0xd0,//level -3 }; uint8_t sp0838_brightness_neg2[] = { 0xfd,0x00, 0xdc,0xe0,//level -2 }; uint8_t sp0838_brightness_neg1[] = { 0xfd,0x00, 0xdc,0x00,//level -1 }; uint8_t sp0838_brightness_zero[] = { 0xfd,0x00, 0xdc,0x00,//level 0 }; uint8_t sp0838_brightness_pos1[] = { 0xfd,0x00, 0xdc,0x10,//level +1 }; uint8_t sp0838_brightness_pos2[] = { 0xfd,0x00, 0xdc,0x20,//level +2 }; uint8_t sp0838_brightness_pos3[] = { 0xfd,0x00, 0xdc,0x30,//level +3 }; uint8_t sp0838_brightness_pos4[] = { 0xfd,0x00, 0xdc,0x40,//level +4 }; // Contrast uint8_t sp0838_contrast_neg4[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd-0x40, //level -4 0xde,Pre_Value_P0_0xde-0x40, }; uint8_t sp0838_contrast_neg3[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd-0x30, //level -3 0xde,Pre_Value_P0_0xde-0x30, }; uint8_t sp0838_contrast_neg2[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd-0x20, //level -2 0xde,Pre_Value_P0_0xde-0x20, }; uint8_t sp0838_contrast_neg1[] = { 0xfd, 0x00, 0xdd, Pre_Value_P0_0xdd-0x10, //level -1 0xde, Pre_Value_P0_0xde-0x10, }; uint8_t sp0838_contrast_zero[] = { 0xfd, 0x00, 0xdd, Pre_Value_P0_0xdd, //level 0 0xde, Pre_Value_P0_0xde, }; uint8_t sp0838_contrast_pos1[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd+0x10, //level +1 0xde,Pre_Value_P0_0xde+0x10, }; uint8_t sp0838_contrast_pos2[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd+0x20, //level +2 0xde,Pre_Value_P0_0xde+0x20, }; uint8_t sp0838_contrast_pos3[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd+0x30, //level +3 0xde,Pre_Value_P0_0xde+0x30, }; uint8_t sp0838_contrast_pos4[] = { 0xfd, 0x00, 0xdd,Pre_Value_P0_0xdd+0x40, //level +4 0xde,Pre_Value_P0_0xde+0x40, }; // Saturation uint8_t sp0838_saturation_neg4[] = { 0xfd, 0x00, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, }; uint8_t sp0838_saturation_neg3[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8-0x30, 0xd9, Pre_Value_P0_0xd9-0x30, 0xda, Pre_Value_P0_0xda-0x30, 0xdb, Pre_Value_P0_0xdb-0x30, }; uint8_t sp0838_saturation_neg2[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8-0x20, 0xd9, Pre_Value_P0_0xd9-0x20, 0xda, Pre_Value_P0_0xda-0x20, 0xdb, Pre_Value_P0_0xdb-0x20, }; uint8_t sp0838_saturation_neg1[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8-0x10, 0xd9, Pre_Value_P0_0xd9-0x10, 0xda, Pre_Value_P0_0xda-0x10, 0xdb, Pre_Value_P0_0xdb-0x10, }; uint8_t sp0838_saturation_zero[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8, 0xd9, Pre_Value_P0_0xd9, 0xda, Pre_Value_P0_0xda, 0xdb, Pre_Value_P0_0xdb, }; uint8_t sp0838_saturation_pos1[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8+0x10, 0xd9, Pre_Value_P0_0xd9+0x10, 0xda, Pre_Value_P0_0xda+0x10, 0xdb, Pre_Value_P0_0xdb+0x10, }; uint8_t sp0838_saturation_pos2[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8+0x20, 0xd9, Pre_Value_P0_0xd9+0x20, 0xda, Pre_Value_P0_0xda+0x20, 0xdb, Pre_Value_P0_0xdb+0x20, }; uint8_t sp0838_saturation_pos3[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8+0x30, 0xd9, Pre_Value_P0_0xd9+0x30, 0xda, Pre_Value_P0_0xda+0x30, 0xdb, Pre_Value_P0_0xdb+0x30, }; uint8_t sp0838_saturation_pos4[] = { 0xfd, 0x00, 0xd8, Pre_Value_P0_0xd8+0x40, 0xd9, Pre_Value_P0_0xd9+0x40, 0xda, Pre_Value_P0_0xda+0x40, 0xdb, Pre_Value_P0_0xdb+0x40, }; // Resolution // QCIF uint8_t sp0838_176x144[]={ }; // QVGA uint8_t sp0838_320x240[]={ }; // CIF uint8_t sp0838_352x288[]={ }; // VGA uint8_t sp0838_640x480[]={ }; // SVGA uint8_t sp0838_800x600[]={ }; // XGA uint8_t sp0838_1024x768[]={ }; // 720p uint8_t sp0838_1280x720[]={ }; // UXGA uint8_t sp0838_1600x1200[]={ }; // 1080p uint8_t sp0838_1920x1080[]={ }; // QXGA uint8_t sp0838_2048x1536[]={ }; uint8_t sp0838_2592x1944[]={ }; // Initiliztion uint8_t sp0838_default_regs_init[] = { //SP0838 ini 0xfd,0x00,//P0 0x1B,0x02, 0x27,0xe8, 0x28,0x0B, 0x32,0x00, 0x22,0xc0, 0x26,0x10, 0x5f,0x11,//Bayer order 0xfd,0x01,//P1 0x25,0x1a,//Awb start 0x26,0xfb, 0x28,Pre_Value_P1_0x28, 0x29,Pre_Value_P1_0x29, 0xfd,0x00, 0xe7,0x03, 0xe7,0x00, 0xfd,0x01, 0x31,0x60,//64 0x32,0x18, 0x4d,0xdc, 0x4e,0x53, 0x41,0x8c, 0x42,0x57, 0x55,0xff, 0x56,0x00, 0x59,0x82, 0x5a,0x00, 0x5d,0xff, 0x5e,0x6f, 0x57,0xff, 0x58,0x00, 0x5b,0xff, 0x5c,0xa8, 0x5f,0x75, 0x60,0x00, 0x2d,0x00, 0x2e,0x00, 0x2f,0x00, 0x30,0x00, 0x33,0x00, 0x34,0x00, 0x37,0x00, 0x38,0x00,//awb end 0xfd,0x00,//P0 0x33,0x6f,//LSC BPC EN 0x51,0x3f,//BPC debug start 0x52,0x09, 0x53,0x00, 0x54,0x00, 0x55,0x10,//BPC debug end 0x4f,0x08,//blueedge 0x50,0x08, 0x57,Pre_Value_P0_0x57,//Raw filter debut start 0x58,Pre_Value_P0_0x58, 0x59,Pre_Value_P0_0x59, 0x56,Pre_Value_P0_0x56, 0x5a,Pre_Value_P0_0x5a, 0x5b,Pre_Value_P0_0x5b, 0x5c,Pre_Value_P0_0x5c,//Raw filter debut end 0x65,Pre_Value_P0_0x65,//Sharpness debug start 0x66,Pre_Value_P0_0x66, 0x67,Pre_Value_P0_0x67, 0x68,Pre_Value_P0_0x68, 0x69,0x7f, 0x6a,0x01, 0x6b,Pre_Value_P0_0x6b, 0x6c,Pre_Value_P0_0x6c, 0x6d,Pre_Value_P0_0x6d,//Edge gain normal 0x6e,Pre_Value_P0_0x6e,//Edge gain normal 0x6f,0x7f, 0x70,0x01, 0x71,Pre_Value_P0_0x71, //锐化阈值 0x72,Pre_Value_P0_0x72, //弱轮廓阈值 0x73,Pre_Value_P0_0x73, //边缘正向增益值 0x74,Pre_Value_P0_0x74, //边缘反向增益值 0x75,0x7f, //使能位 0x76,0x01,//Sharpness debug end 0xcb,0x07,//HEQ&Saturation debug start 0xcc,0x04, 0xce,0xff, 0xcf,0x10, 0xd0,0x20, 0xd1,0x00, 0xd2,0x1c, 0xd3,0x16, 0xd4,0x00, 0xd6,0x1c, 0xd7,0x16, 0xdd,Pre_Value_P0_0xdd,//Contrast 0xde,Pre_Value_P0_0xde,//HEQ&Saturation debug end 0x7f,Pre_Value_P0_0x7f,//Color Correction start 0x80,0xbc, 0x81,0xed, 0x82,0xd7, 0x83,0xd4, 0x84,0xd6, 0x85,0xff, 0x86,0x89, 0x87,Pre_Value_P0_0x87, 0x88,0x3c, 0x89,0x33, 0x8a,0x0f,//Color Correction end 0x8b,0x0 ,//gamma start 0x8c,0x1a, 0x8d,0x29, 0x8e,0x41, 0x8f,0x62, 0x90,0x7c, 0x91,0x90, 0x92,0xa2, 0x93,0xaf, 0x94,0xbc, 0x95,0xc5, 0x96,0xcd, 0x97,0xd5, 0x98,0xdd, 0x99,0xe5, 0x9a,0xed, 0x9b,0xf5, 0xfd,0x01,//P1 0x8d,0xfd, 0x8e,0xff,//gamma end 0xfd,0x00,//P0 0xca,0xcf, 0xd8,Pre_Value_P0_0xd8,//UV outdoor 0xd9,Pre_Value_P0_0xd9,//UV indoor 0xda,Pre_Value_P0_0xda,//UV dummy 0xdb,Pre_Value_P0_0xdb,//UV lowlight 0xb9,0x00,//Ygamma start 0xba,0x04, 0xbb,0x08, 0xbc,0x10, 0xbd,0x20, 0xbe,0x30, 0xbf,0x40, 0xc0,0x50, 0xc1,0x60, 0xc2,0x70, 0xc3,0x80, 0xc4,0x90, 0xc5,0xA0, 0xc6,0xB0, 0xc7,0xC0, 0xc8,0xD0, 0xc9,0xE0, 0xfd,0x01,//P1 0x89,0xf0, 0x8a,0xff,//Ygamma end 0xfd,0x00,//P0 0xe8,0x30,//AEdebug start 0xe9,0x30, 0xea,0x40,//Alc Window sel 0xf4,0x1b,//outdoor mode sel 0xf5,0x80, 0xf7,Pre_Value_P0_0xf7,//AE target 0xf8,Pre_Value_P0_0xf8, 0xf9,Pre_Value_P0_0xf9,//AE target 0xfa,Pre_Value_P0_0xfa, 0xfd,0x01,//P1 0x09,0x31,//AE Step 3.0 0x0a,0x85, 0x0b,0x0b,//AE Step 3.0 0x14,0x20, 0x15,0x0f, //caprure preview daylight 24M 50hz 20-8FPS maxgain:0x70 0xfd,0x00, 0x05,Pre_Value_P0_0x05 , 0x06,Pre_Value_P0_0x06 , 0x09,Pre_Value_P0_0x09 , 0x0a,Pre_Value_P0_0x0a , 0xf0,0x62, 0xf1,0x0 , 0xf2,0x5f, 0xf5,0x78, 0xfd,0x01, 0x00,0xb2, 0x0f,0x60, 0x16,0x60, 0x17,0xa2, 0x18,0xaa, 0x1b,0x60, 0x1c,0xaa, 0xb4,0x20, 0xb5,0x3a, 0xb6,0x5e, 0xb9,0x40, 0xba,0x4f, 0xbb,0x47, 0xbc,0x45, 0xbd,0x43, 0xbe,0x42, 0xbf,0x42, 0xc0,0x42, 0xc1,0x41, 0xc2,0x41, 0xc3,0x41, 0xc4,0x41, 0xc5,0x70, 0xc6,0x41, 0xca,0x70, 0xcb,0x0c, 0xfd,0x00, 0xfd,0x00, //P0 0x32,0x15, //Auto_mode set 0x34,0x66, //Isp_mode set 0x35,0x40, //out format 0x36,0x80, }; // Exit uint8_t sp0838_default_regs_exit[] = { }; #endif /* #ifndef __SP0838_H_ */