Files
kunlun/dtest/camera_test/xc7027_reg.h
2024-09-28 14:24:04 +08:00

441 lines
9.2 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const uint8_t XC7027_default_regs[] = {
// XC7027 setting
//0xff, 0xff,0xfef1,
//0xff, 0xf0,0x36,
0xff, 0xfd, 0x80,
0xff, 0xfe, 0x50,
//0x00, 0x1c, 0xff, //clock and reset
0x00, 0x1c, 0xff,
0x00, 0x1d, 0xff,
0x00, 0x1e, 0xff,
0x00, 0x1f, 0xff,
0x00, 0x18, 0x00,
0x00, 0x19, 0x00,
0x00, 0x1a, 0x00,
0x00, 0x1b, 0x00,
0x00, 0xbc, 0x19,
0x00, 0x30, 0x44,
0x00, 0x31, 0x14,
0x00, 0x32, 0x72,
0x00, 0x33, 0x70,
0x00, 0x20, 0x04, //0x05
0x00, 0x21, 0x05,
0x00, 0x22, 0x01,
0x00, 0x23, 0x85,
0x00, 0x24, 0x00, //0x02
0x00, 0x25, 0x04, //0x0d
0x00, 0x26, 0x02,
0x00, 0x27, 0x06,
0x00, 0x28, 0x05,
0x00, 0x29, 0x00,
0x00, 0x2a, 0x01,
0x00, 0x2b, 0x05,
0x00, 0x2c, 0x05,
0x00, 0x2d, 0x00,
0x00, 0x2e, 0x01,
0x00, 0x50, 0x0f,
0x00, 0x54, 0x0f,
0x00, 0x58, 0x01,
0xff, 0xfe,0x25,
//0x02, 0x00, 0x0f, //mipi_rx1_pad_en
0x60, 0x02, 0x01,
//0x02, 0x02, 0x80,
0x60, 0x03, 0xf0,
0xff, 0xfe,0x26,
//0x00, 0xbc, 0x19,//¹Ì¶¨
//0x00, 0x90, 0x38,//ISP1 bit[1:0] 00:MIPI RX1;01:MIPI RX2;10:colorbar1;11:colorbar2
//0x00, 0xa8, 0x09,//ISP2 bit[1:0] 00:MIPI RX1;01:MIPI RX2;10:colorbar1;11:colorbar2
//0xff, 0xfe, 0x2e,
//0x00, 0x00, 0x02,//RT1,RT2Ö±Á¬
//0xff, 0xfe,0x26,
0x80, 0x00, 0x1d,
0x80, 0x01, 0x00,
0x80, 0x02, 0x05,
0x80, 0x03, 0xD0,
0x80, 0x04, 0x02,
0x80, 0x08,0x4e,
//0xff, 0xfe,0x26, //crop
0x80, 0x10,0x04,
0x80, 0x12,0x00,
0x80, 0x13,0x05,
0x80, 0x14,0xD0,
0x80, 0x15,0x02,
0x80, 0x16,0x00,
0x80, 0x17,0x00,
0x80, 0x18,0x00,
0x80, 0x19,0x00,
0xff, 0xfe, 0x30,
0x19, 0x00, 0x00,
0x19, 0x01, 0x00,
0x19, 0x02, 0x00,
0x19, 0x03, 0x00,
0x19, 0x04, 0x05,
0x19, 0x05, 0x00,
0x19, 0x06, 0x02,
0x19, 0x07, 0xD0,
0x19, 0x08, 0x00,
0xff, 0xfe, 0x2c,
0x00, 0x00, 0x40,
0x00, 0x01, 0x05,
0x00, 0x02, 0x00,
0x00, 0x04, 0x02,
0x00, 0x05, 0xD0,
0x00, 0x08, 0x10,
0x00, 0x44, 0x09,
0x00, 0x45, 0x04,
0x00, 0x48, 0x04,
0x00, 0x49, 0xF0,
0xff, 0xfe, 0x26,
0x20, 0x19, 0x05,
0x20, 0x1a, 0x00,
0x20, 0x1b, 0x02,
0x20, 0x1c, 0xD0,
0x20, 0x1d, 0x00,
0x20, 0x1e, 0x00,
0x20, 0x1f, 0x00,
0x20, 0x20, 0x00,
0x20, 0x15, 0x80,
0x20, 0x17, 0x2A,
0x20, 0x18, 0x00,
0x20, 0x23, 0x03,
0x00, 0x00, 0x00,
0x00, 0x09, 0xc4,
0xff, 0xfe, 0x30,
0x00, 0x00, 0x01,
0x00, 0x01, 0x00,
0x00, 0x02, 0x10,
0x00, 0x03, 0x20,
0x00, 0x04, 0x00,
0x00, 0x50, 0x20,
0x00, 0x19, 0x09,
0x00, 0x5e, 0xFF,
0x00, 0x5f, 0x04,
0x00, 0x60, 0xCF,
0x00, 0x61, 0x02,
0x00, 0x64, 0x00,
0x00, 0x65, 0x05,
0x00, 0x66, 0xD0,
0x00, 0x67, 0x02,
0x00, 0x06, 0x05,
0x00, 0x07, 0x00,
0x00, 0x08, 0x02,
0x00, 0x09, 0xD0,
0x00, 0x0a, 0x05,
0x00, 0x0b, 0x00,
0x00, 0x0c, 0x02,
0x00, 0x0d, 0xD0,
//0xff, 0xfe,0x26, //mipi RX
//0x00, 0x00,0x20,
//0x00, 0x09,0x04,
0xff, 0xfe,0x2c, //stitch
0x00, 0x00,0x41,
0x00, 0x01,0x05,
0x00, 0x02,0x00,
0x00, 0x04,0x02,
0x00, 0x05,0xd0,
0x00, 0x08,0x11, //[0]:dvp enable
0x00, 0x44,0x00, //fifo
0x00, 0x45,0x04,
0x00, 0x48,0x09,
0x00, 0x49,0xf0,
//AE
/////////////////////////////////////////////////////
//////////////////// 1. AE statistical /////////////
/////////////////////////////////////////////////////
0xff, 0xfe,0x30, // AE_avg
0x1f, 0x00,0x00, // WIN start X
0x1f, 0x01,0x00,
0x1f, 0x02,0x00, // WIN stat Y
0x1f, 0x03,0x00,
0x1f, 0x04,0x05, // WIN width
0x1f, 0x05,0x00,
0x1f, 0x06,0x02, // WIN height
0x1f, 0x07,0xd0, //20
0x1f, 0x08,0x03,
0x00, 0x51,0x3, // ae统计数据选择gamma后
/////////////////////////////////////////////////////
///////////////////// 2. AE SENSOR /////////////
/////////////////////////////////////////////////////
0xff, 0xfe,0x14,
0x01, 0x0e,0xc0, //camera i2c id
0x01, 0x0f,0x01, //camera i2c bits
0x01, 0x10,0x00, //sensor type gain
0x01, 0x11,0x00, //sensor type exposure
//ex, 0xposure
//0x, 0x0114,0x00, //write camera exposure variable [19:16]
//0x, 0x0115,0x00,
0x01, 0x16,0x35, //write camera exposure variable [15:8]
0x01, 0x17,0x01,
0x01, 0x18,0x35, //write camera exposure variable [7:0]
0x01, 0x19,0x02,
//0x, 0x011c,0x00, //camera exposure addr mask 1
//0x, 0x011d,0x00,
0x01, 0x1e,0x00, //camera exposure addr mask 2
0x01, 0x1f,0xff,
0x01, 0x20,0x00,
0x01, 0x21,0xff,
//gain
//0x, 0x0134,0x35, //camera gain addr0
//0x, 0x0135,0x08,
0x01, 0x36,0x35, //camera gain addr1
0x01, 0x37,0x09,
//0x, 0x013c,0x00, //camera gain addr mask 0
//0x, 0x013d,0xff,
0x01, 0x3e,0x00, //camera gain addr mask 1
0x01, 0x3f,0xff,
0x01, 0x45,0x00, //gain delay frame
//0x, 0x31,0x01, //effect in arith end
//0x, 0x32,0x01, //effect in arith end
0x02, 0x12,0x00,
0x02, 0x19,0x40,
0x01, 0x04,0x02, //nFlicker5060SW; /**< CFG(BANDING): banding mode 0. disable 1. 60HZ 2.50HZ*/
0x01, 0x05,0x00, //bNotForceMiniFlickerLinesEnable
0x01, 0x08,0x15, //nFlicker50HzUnit
0x01, 0x09,0x00,
0xff, 0xfe,0x14,
0x01, 0x44,0x00, //expo delay frame
0x01, 0x45,0x00, //gain delay frame
//0x, 0x31,0x01, //effect in arith end
//0x, 0x32,0x01, //effect in arith end
0x00, 0xc6,0x01, // delay frame
////, 0x/////////////////////////////////////////////////
////, 0x////////////// 3. AE NORMAL ////////////////
////, 0x/////////////////////////////////////////////////
0xff, 0xfe,0x14,
0x00, 0x4c,0x00, //0 SW process 1 manual 1 is no AE
0x00, 0x2b,0x01, //ae enable
0x00, 0x4d,0x01, //ae Force write
0x00, 0xfa,0x01,
0x00, 0xfb,0xf0, //max gain
0x00, 0xfc,0x00,
0x00, 0xfd,0x20, //min gain
0x00, 0xe2,0x38, //max exp line low to 1/2.9,11fps
0x00, 0xe3,0x20,
0x00, 0xde,0x00,
0x00, 0xdf,0x10, //min exp line
0x00, 0xa0,0x01, //day target
0x00, 0xa1,0xc0,
//flicker
0x01, 0x04,0x00, //0 desable 1 60Hz 2 50Hz
0x01, 0x05,0x01, //Min FlickerLines Enable
0x01, 0x08,0x15, //50Hz
0x01, 0x09,0x00,
//weight
0x00, 0x55, 0x10,
0x00, 0x56, 0x10,
0x00, 0x57, 0x10,
0x00, 0x58, 0x10,
0x00, 0x59, 0x10,
0x00, 0x5a, 0x10,
0x00, 0x5b, 0x10,
0x00, 0x5c, 0x10,
0x00, 0x5d, 0x10,
0x00, 0x5e, 0x10,
0x00, 0x5f, 0x10,
0x00, 0x60, 0x10,
0x00, 0x61, 0x10,
0x00, 0x62, 0x10,
0x00, 0x63, 0x10,
0x00, 0x64, 0x10,
0x00, 0x65, 0x10,
0x00, 0x66, 0x10,
0x00, 0x67, 0x10,
0x00, 0x68, 0x10,
0x00, 0x69, 0x10,
0x00, 0x6a, 0x10,
0x00, 0x6b, 0x10,
0x00, 0x6c, 0x10,
0x00, 0x6d, 0x10, //权重for CurAvg
0x00, 0x88, 0x04,
0x00, 0x89, 0x04,
0x00, 0x8a, 0x04,
0x00, 0x8b, 0x04, //关注区域 for 亮块
0x00, 0x50, 0x01, //refresh
///////////////////////////////////////////////////
///////////////// 4.AE SPEED ///////////////
///////////////////////////////////////////////////
0x00, 0xca,0x00, //thr_low 60
0x00, 0xcb,0x80,
0x00, 0xcc,0x00, //thr_high 80
0x00, 0xcd,0xa0,
0x01, 0xbc,0x00, //thr_l_all
0x01, 0xbd,0x60, //thr_l_all 50
0x01, 0xbe,0x00, //thr_l_avg
0x01, 0xbf,0x50, //thr_l_avg 40
0x00, 0xc7,0x20, //3. finally thrL 18
0x00, 0xd8,0x80, //4. stable thr_h
0x00, 0xc8,0x01, //total speed
0x02, 0x08,0x02, //speed limit factor
0x00, 0xda,0x00, // LumaDiffThrLow
0x00, 0xdb,0xa0,
0x00, 0xdc,0x03, // LumaDiffThrHigh
0x00, 0xdd,0x00,
///////////////////////////////////////////////////
///////////////////////////////////////////////////
///////////////// 5.AE SMART ///////////////
///////////////////////////////////////////////////
0x00, 0x92,0x00, //smart mode
0x00, 0x93,0x00, //0x15 //analysis mode+zhifangtu
0x00, 0x94,0x00, //smart speed limit//打开会造成震荡
0x00, 0xad,0x02, //ATT block Cnt 关注区域亮块数算平均
///////////////////table reftarget//////////////////
0x00, 0x22,0x1e, //use cur fps
0x01, 0xe4,0x00, // Exp value Table
0x01, 0xe5,0x00,
0x01, 0xe6,0x04,
0x01, 0xe7,0x00, //table0
0x01, 0xe8,0x00,
0x01, 0xe9,0x00,
0x01, 0xea,0x0c,
0x01, 0xeb,0x00, //table1
0x01, 0xec,0x00,
0x01, 0xed,0x00,
0x01, 0xee,0x24,
0x01, 0xef,0x00, //table2
0x01, 0xf0,0x00,
0x01, 0xf1,0x00,
0x01, 0xf2,0x6c,
0x01, 0xf3,0x00, //table3
0x01, 0xf4,0x00,
0x01, 0xf5,0x01,
0x01, 0xf6,0x44,
0x01, 0xf7,0x00, //table4
0x01, 0xf8,0x00,
0x01, 0xf9,0x04,
0x01, 0xfa,0x00,
0x01, 0xfb,0x00, //table5
///////////////////reftarget/////////////////////////
0x00, 0xb2,0x02, // ref target table 0可更改的目标亮度
0x00, 0xb3,0x30,
0x00, 0xb4,0x02, // ref target table 1
0x00, 0xb5,0x10,
0x00, 0xb6,0x02, // ref target table 2
0x00, 0xb7,0x00,
0x00, 0xb8,0x01, // ref target table 3
0x00, 0xb9,0xf0,
0x00, 0xba,0x01, // ref target table 4
0x00, 0xbb,0xb0,
0x00, 0xbc,0x00, // ref target table 5
0x00, 0xbd,0xf0,
//基于平均亮度维度分?
0x01, 0xcd,0x28,//avg affect val
0x01, 0xcb,0x00,//avg thr_h
0x01, 0xcc,0x40, //avg thr_h
////////////////////////over exposure offest/////////
0x01, 0xd6,0x00,
0x01, 0xd7,0x04,
0x01, 0xd8,0x14,
0x01, 0xd9,0x50,
0x01, 0xda,0x70,
0x01, 0xc0,0x08,
0x01, 0xc7,0x06,
0x01, 0xc9,0x02,
0x01, 0xca,0x30,
0x01, 0xd1,0x40,
//基于方差维度分析模式/Variance /////////////////
0x01, 0xb1,0x30, // variance affect
0x01, 0xb2,0x01, // thr l
0x01, 0xb3,0x00,
0x01, 0xb4,0x06, // thr h
0x01, 0xb5,0x00,
//基于关注区亮度压制
0x01, 0x6e,0x02,
0x01, 0x6f,0x80, //%%%%%%%Max ATT thrshold关注区域的门限值
0x01, 0xd3,0x00, // no use Att limit ratio L
0x01, 0xd4,0x30, // %%%%%Att limit ratio L关注区域的调整值
0x01, 0x6c,0x00, //min att thr
0x01, 0x6d,0x00, //min att thr
0x01, 0xba,0x08, //att limit ratio h
//////////////////////smart ae end ///////////////
0xff, 0xfe, 0x2e,
0x00, 0x04, 0x04,
};
const uint8_t bypass_on[] = {
0xff,0xfd,0x80,
0xff,0xfe,0x50,
0x00,0x4d,0x01,
};
const uint8_t bypass_off[] = {
0xff,0xfd,0x80,
0xff,0xfe,0x50,
0x00,0x4d,0x00,
};