#include "sys_config.h" #include "typesdef.h" #include "lib/video/dvp/cmos_sensor/csi.h" #include "tx_platform.h" #include "list.h" #include "dev.h" #include "hal/i2c.h" #if DEV_SENSOR_OV7660 SENSOR_INIT_SECTION static const unsigned char OV7660InitTable[CMOS_INIT_LEN]= //OV7670InitTable[][2] { #if 1 0x12, 0x80, 0x11, 0x81, 0x92, 0xA0, 0x93, 0x00, 0x9d, 0x4c, 0x9e, 0x3f, 0x3b, 0x02,//0a 0x13, 0xf0, 0x10, 0x00, 0x00, 0x00, 0x01, 0x80, 0x02, 0x80, 0x13, 0xf5, 0x12, 0x00, 0x04, 0x00, 0x18, 0x01, 0x17, 0x13, 0x32, 0x92, 0x19, 0x02, 0x1a, 0x7a, 0x03, 0x00, 0x0e, 0x84, 0x0f, 0x62, //0x15, 0x02, 0x16, 0x02, 0x1b, 0x01, #if 1 0x1e, 0x31,//0x01//0x31 #else 0x1e, 0x01,//0x01//0x31 #endif 0x29, 0x3c, 0x33, 0x00, 0x34, 0x07, 0x35, 0x84, 0x36, 0x00, 0x38, 0x13, 0x39, 0x43, 0x3a, 0x00, 0x3c, 0x6c, 0x3d, 0x90, 0x3f, 0x29, 0x40, 0xc1, 0x41, 0x20, 0x6B, 0x0a, 0xa1, 0xc8, 0x69, 0x80, 0x43, 0xf0, 0x44, 0x10, 0x45, 0x78, 0x46, 0xa8, 0x47, 0x60, 0x48, 0x80, 0x59, 0xba, 0x5a, 0x9a, 0x5b, 0x22, 0x5c, 0xb9, 0x5d, 0x9b, 0x5e, 0x10, // Flip (bit4) & Mirror (bit5) 0x5f, 0xe0, 0x60, 0x85, 0x61, 0x60, 0x62, 0x00, 0x63, 0x00, 0x64, 0x10, 0x65, 0x10, 0x66, 0x05, 0x94, 0x10, 0x95, 0x0E, 0x9f, 0x9d, 0xa0, 0xa0, 0x4f, 0x66, 0x50, 0x6b, 0x51, 0x05, 0x52, 0x1a, 0x53, 0x40, 0x54, 0x5a, 0x55, 0x40, 0x56, 0x40, 0x57, 0x40, 0x58, 0x0d, 0x8b, 0xcc, 0x8c, 0xcc, 0x8d, 0xcf, 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, 0x14, 0x2a,//8X gain 0x24, 0xa0, 0x25, 0x90, 0x27, 0x40, 0x28, 0x40, 0x2c, 0x40, 0x13, 0xf7, 0x3b, 0x00,//night mode enable 1/4 fps #endif #if 0 0x12,0x80, 0x11,0x80, 0x92,0x66, 0x93,0x00, 0x9D,0x4C, 0x9E,0x3F, 0x3B,0x0A, 0x13,0xF0, 0x10,0x00, 0x00,0x00, 0x01,0x80, 0x02,0x80, 0x13,0xF5, 0x12,0x00, 0x04,0x00, 0x18,0x01, 0x17,0x13, 0x32,0x92, 0x19,0x02, 0x1A,0x7A, 0x03,0x00, 0x0E,0x84, 0x0F,0x62, 0x15,0x02, 0x16,0x02, 0x1B,0x01, 0x1E,0x31, ///0x01 0x29,0x3C, 0x33,0x00, 0x34,0x07, 0x35,0x84, 0x36,0x00, 0x38,0x13, 0x39,0x43, 0x3A,0x00, 0x3C,0x6C, 0x3D,0x90, 0x3F,0x29, 0x40,0xC1, 0x41,0x20, 0x6B,0x0A, 0xA1,0xC8, 0x69,0x80, 0x43,0xF0, 0x44,0x10, 0x45,0x78, 0x46,0xA8, 0x47,0x60, 0x48,0x80, 0x59,0xBA, 0x5A,0x9A, 0x5B,0x22, 0x5C,0xB9, 0x5D,0x9B, 0x5E,0x10, 0x5F,0xE0, 0x60,0x85, 0x61,0x60, 0x9F,0x9D, 0xA0,0xA0, 0x4F,0x66, 0x50,0x6B, 0x51,0x05, 0x52,0x19, 0x53,0x40, 0x54,0x59, 0x55,0x40, 0x56,0x40, 0x57,0x40, 0x58,0x0D, 0x8B,0xCC, 0x8C,0xCC, 0x8D,0xCF, 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, 0x14,0x1A, 0x24,0x78, 0x25,0x6C, 0x13,0xF7, 0x3B,0xC0, #endif -1,-1 }; SENSOR_OP_SECTION const _Sensor_Adpt_ ov7660_cmd = { .typ = 1,//YUV .pixelw = 640, .pixelh= 480, .hsyn = 1, #if 0//OVSENSOR_CHOICE ==OV7670_YXK ||OVSENSOR_CHOICE == OV7670_HTX .vsyn =1,// 1, #else .vsyn =0,// 1, #endif .rduline = 0,// .rawwide = 1,//10bit // .AVDD = SYS_VOL_V2_8, // .DVDD = SYS_VOL_V1_8, // .VDDIO = SYS_VOL_V2_8, .colrarray =2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_ .init = (uint8 *)OV7660InitTable, .rotate_adapt = {0}, //.hvb_adapt = {42000000,1120,0,0,0xff,25,0}, .hvb_adapt = {0,0,0,0}, .mclk = 24000000, .p_fun_adapt = {NULL,NULL,NULL}, .p_xc7016_adapt = {NULL}, }; const _Sensor_Ident_ ov7660_init= { 0x76,0x42,0x43,0x01,0x01,0x0a }; #endif