269 lines
4.5 KiB
C
269 lines
4.5 KiB
C
#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"
|
||
#include "syscfg.h"
|
||
|
||
|
||
|
||
#if DEV_SENSOR_BF20A6
|
||
|
||
|
||
SENSOR_INIT_SECTION static const unsigned char bf20a6InitTable[CMOS_INIT_LEN]=
|
||
{
|
||
0xf2,0x01,
|
||
0x12,0x20,
|
||
0x3a,0x00,
|
||
0xe1,0x92,
|
||
0xe3,0x02,
|
||
0xe0,0x00,
|
||
0x2a,0x98,
|
||
//0x03,0x01,//dummy line加上是15帧
|
||
//0x2b,0xf4,//dummy line
|
||
0x0e,0x47,
|
||
0x0f,0x60,
|
||
0x10,0x57,
|
||
0x11,0x60,
|
||
0x30,0x61,
|
||
0x62,0xcd,
|
||
0x63,0x1a,
|
||
0x64,0x38,
|
||
0x65,0x52,
|
||
0x66,0x68,
|
||
0x67,0xc2,
|
||
0x68,0xa7,
|
||
0x69,0xab,
|
||
0x6a,0xad,
|
||
0x6b,0xa9,
|
||
0x6c,0xc4,
|
||
0x6d,0xc5,
|
||
0x6e,0x18,
|
||
0xc0,0x20,
|
||
0xc1,0x24,
|
||
0xc2,0x29,
|
||
0xc3,0x25,
|
||
0xc4,0x28,
|
||
0xc5,0x2a,
|
||
0xc6,0x41,
|
||
0xca,0x23,
|
||
0xcd,0x34,
|
||
0xce,0x32,
|
||
0xcf,0x35,
|
||
0xd0,0x6c,
|
||
0xd1,0x6e,
|
||
0xd2,0xcb,
|
||
0xe2,0x09,
|
||
0xe4,0x73,//72->73 20220722
|
||
0xe5,0x22,
|
||
0xe6,0x24,
|
||
0xe7,0x64,
|
||
0xe8,0xa2,//VDDIO=1.8v 0xe8[2]=1,VDDIO=2.8v 0xe8[2]=0
|
||
0x4a,0x00,//flip[2:3]
|
||
0x00,0x03,
|
||
0x1f,0x02,
|
||
0x22,0x02,
|
||
0x0c,0x31,
|
||
0x00,0x00,
|
||
0x60,0x81,
|
||
0x61,0x81,
|
||
0xa0,0x08,
|
||
0x01,0x1a,
|
||
0x01,0x1a,
|
||
0x01,0x1a,
|
||
0x02,0x15,
|
||
0x02,0x15,
|
||
0x02,0x15,
|
||
0x13,0x08,
|
||
0x8a,0x96,
|
||
0x8b,0x06,
|
||
0x87,0x18,
|
||
0x34,0x48,//lens
|
||
0x35,0x48,//40
|
||
0x36,0x40,
|
||
0x71,0x44,//add 10.27
|
||
0x72,0x48,
|
||
0x74,0xa2,
|
||
0x75,0xa9,
|
||
0x78,0x12,
|
||
0x79,0xa0,
|
||
0x7a,0x94,
|
||
0x7c,0x97,
|
||
0x40,0x30,
|
||
0x41,0x30,
|
||
0x42,0x28,
|
||
0x43,0x1f,
|
||
0x44,0x1c,
|
||
0x45,0x16,
|
||
0x46,0x13,
|
||
0x47,0x10,
|
||
0x48,0x0D,
|
||
0x49,0x0C,
|
||
0x4B,0x0A,
|
||
0x4C,0x0B,
|
||
0x4E,0x09,
|
||
0x4F,0x08,
|
||
0x50,0x08,
|
||
0x5f,0x21,//29
|
||
0x23,0x99,//gren gain 33
|
||
0xa1,0x10,//AWB
|
||
0xa2,0x0d,
|
||
0xa3,0x30,
|
||
0xa4,0x06,
|
||
0xa5,0x22,
|
||
0xa6,0x56,
|
||
0xa7,0x18,
|
||
0xa8,0x1a,
|
||
0xa9,0xb2,//12
|
||
0xaa,0xb2,//12
|
||
0xab,0xb6,//16
|
||
0xac,0xb1,
|
||
0xba,0x12,
|
||
0xbb,0x12,
|
||
0xad,0x12,
|
||
0xae,0x56,
|
||
0xaf,0x0a,
|
||
0x3b,0x30,
|
||
0x3c,0x12,
|
||
0x3d,0x22,
|
||
0x3e,0x3f,
|
||
0x3f,0x28,
|
||
0xb8,0xc3,
|
||
0xb9,0xA3,
|
||
0x39,0x47,//pure color threshold
|
||
0x26,0x13,
|
||
0x27,0x16,
|
||
0x28,0x14,
|
||
0x29,0x18,
|
||
0xee,0x0d,
|
||
0x13,0x05,
|
||
0x24,0x48,//liangdu亮度38
|
||
0x81,0x20,
|
||
0x82,0x40,
|
||
0x83,0x30,
|
||
0x84,0x58,
|
||
0x85,0x30,
|
||
0x92,0x08,
|
||
0x86,0xA0,
|
||
0x8a,0x96,
|
||
0x91,0xff,
|
||
0x94,0x62,
|
||
0x9a,0x18,//outdoor threshold//18
|
||
0xf0,0x45,//4e最高30帧//44最高25帧
|
||
0x51,0x17,//color normal
|
||
0x52,0x03,
|
||
0x53,0x5F,
|
||
0x54,0x47,
|
||
0x55,0x66,
|
||
0x56,0x0F,
|
||
0x7e,0x14,
|
||
0x57,0x36,//A<><41>color
|
||
0x58,0x2A,
|
||
0x59,0xAA,
|
||
0x5a,0xA8,
|
||
0x5b,0x43,
|
||
0x5c,0x10,
|
||
0x5d,0x00,
|
||
0x7d,0x36,
|
||
0x5e,0x10,
|
||
0xd6,0xa8,//contrast对比度 88
|
||
0xd5,0x20,
|
||
0xb0,0x84,
|
||
0xb5,0x08,
|
||
0xb1,0xe8,//saturation//blue c8
|
||
0xb2,0xe0,//red c0
|
||
0xb3,0xd0,
|
||
0xb4,0xB0,
|
||
0x32,0x00,//10->00 20220722
|
||
0xa0,0x09,
|
||
0x00,0x03,
|
||
0x0b,0x02,
|
||
0x80,0x33,//AE速度
|
||
//gamma艳丽但噪点大
|
||
0x40,0x20,
|
||
0x41,0x30,
|
||
0x42,0x30,
|
||
0x43,0x28,
|
||
0x44,0x22,
|
||
0x45,0x1a,
|
||
0x46,0x13,
|
||
0x47,0x10,
|
||
0x48,0x0D,
|
||
0x49,0x0a,
|
||
0x4B,0x09,
|
||
0x4C,0x08,
|
||
0x4E,0x07,
|
||
0x4F,0x06,
|
||
0x50,0x04,
|
||
//color
|
||
0x51,0x1c,//color normCamWriteCmosSensor(0x52, 0x07);
|
||
0x53,0x73,
|
||
0x54,0x5e,
|
||
0x55,0x81,
|
||
0x56,0x17,
|
||
0x7e,0x16,
|
||
//windows
|
||
0x1b,0x00,
|
||
0x17,0x00,
|
||
0x18,0xa0,
|
||
0x19,0x00,
|
||
0x1a,0x78,//78
|
||
|
||
0xef, 0x00,
|
||
-1,-1
|
||
//switch direction
|
||
//0x1e,0x30,//00:normal 10:IMAGE_V_MIRROR
|
||
|
||
};
|
||
|
||
|
||
static void bf20a6_rotate(uint32 r)
|
||
{
|
||
|
||
}
|
||
|
||
|
||
|
||
uint32 bf20a6_hvblank(int8 dh,int8 dv)
|
||
{
|
||
|
||
}
|
||
|
||
SENSOR_OP_SECTION const _Sensor_Adpt_ bf20a6_cmd=
|
||
{
|
||
.typ = 1, //YUV
|
||
.pixelw = 640,
|
||
.pixelh= 480,
|
||
.hsyn = 1,
|
||
.vsyn = 1,
|
||
.rduline = 0,//
|
||
.rawwide = 1,//10bit
|
||
.colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
|
||
.init = (uint8 *)bf20a6InitTable,
|
||
.rotate_adapt = {0},
|
||
//.hvb_adapt = {0xde,0x24,0xde,0x24},
|
||
. mclk = 24000000,
|
||
.p_fun_adapt = {bf20a6_rotate,NULL,NULL},
|
||
.p_xc7016_adapt = {NULL},
|
||
|
||
};
|
||
|
||
const _Sensor_Ident_ bf20a6_init=
|
||
{
|
||
0xa6,0xdc,0xdd,0x01,0x01,0xfd,//bf3
|
||
};
|
||
|
||
const _Sensor_ISP_Init bf20a6_isp_init =
|
||
{
|
||
.type = ISP_INPUT_DAT_SRC_DVP,
|
||
.pixel_h = 480,
|
||
.pixel_w = 640,
|
||
.bayer_patten = ISP_BAYER_FORMAT_GRBG,
|
||
.input_format = ISP_INPUT_DAT_FORMAT_YUV422,
|
||
};
|
||
|
||
#endif
|
||
|