Files
TAIXIN/sdk/lib/bus/iic/sensor/sensor_bf3a01.c

273 lines
4.5 KiB
C
Raw Permalink Blame History

#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_BF3A01
SENSOR_INIT_SECTION static const unsigned char bf3a01InitTable[CMOS_INIT_LEN]=
{
0xfe,0x00,
0x3d,0x00,
0x30,0x3b,
0x31,0x3b,
0x3d,0xff,
#if 1
0xfe,0x01,
0x50,0x00,//mtk mode //ryx
0x52,0xf1,
0x53,0x20,
0x66,0x01,
#else
0xfe,0x01,
0x50,0x20,//mtk mode //ryx
0x52,0xf1,
0x53,0x20,
0x66,0x00,
#endif
0xe0,0x9a,//98 VCLK=48M //9a ,99 VCLK=24M
0xe1,0x03,
0xe2,0x25,
0xe3,0x40,//bit[1]=1,bypass PLL 42 40
0xe4,0x22,//Bit[1:0]: Control the drive of Data and CLK output
0xe5,0x03,//zheng jun
0xe7,0x05, //05//Bit[7:6]: VCLK delay sel. Bit[5:4]: MCLK delay sel.
0x51,0x00,// Bit[4]: VCLK reverse,after gated latch //00 //ryx
0x66,0x00,
0xfe,0x00,
0x00,0x7b,//bit[5]:1,mirror,bit[4]:1,flip, 4b 7b
0x02,0x04,//dummy pixel
0x15,0x0a,
0x3c,0x9f,
0x41,0x02,
0x3e,0x68,
0x0f,0x13,
//initial AWB
0xfe,0x00,
0xa0,0x54,
0xb0,0x19,//blue gain
0xb1,0x25,//red gain
0xa0,0x55,
//initial AE
0xfe,0x01,
0x00,0x08,
0x0e,0x03,
0x0f,0x30,//CamWriteCmosSensor0x0e,0x0f:exposure time
0x10,0x18,//global gain
0x00,0x05,
0xfe,0x00,
0x84,0xa2,
0x82,0x08,//denoise, The larger the smaller noise,
0x86,0x23,//bit[6:4]:bright edge enhancement,bit[2:0]:dark edge enhancement,
//gamma default
0xfe,0x00,
0x60,0x38,
0x61,0x30,
0x62,0x24,
0x63,0x1f,
0x64,0x1c,
0x65,0x16,
0x66,0x12,
0x67,0x0f,
0x68,0x0d,
0x69,0x0c,
0x6a,0x0b,
0x6b,0x09,
0x6c,0x09,
0x6d,0x08,
0x6e,0x07,
0x6f,0xc0,
0x72,0x0c,//gamma offset
0x73,0x0c,//gamma offset
0x74,0x44,//bit[7:4] and bit[3:0]ֵԽ<D6B5><D4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD>
/*//gamma low noise
0xfe,0x00,
0x60,0x24,
0x61,0x30,
0x62,0x24,
0x63,0x1d,
0x64,0x1a,
0x65,0x14,
0x66,0x11,
0x67,0x0f,
0x68,0x0e,
0x69,0x0d,
0x6a,0x0c,
0x6b,0x0b,
0x6c,0x0a,
0x6d,0x09,
0x6e,0x09,*/
//outdoor color
0xfe,0x00,
0xc7,0x21,
0xc8,0x19,
0xc9,0x84,
0xca,0x64,
0xcb,0x89,
0xcc,0x3f,
0xcd,0x16,
//indoor color default
0xfe,0x00,
0xc0,0x05,
0xc1,0x07,
0xc2,0x30,
0xc3,0x28,
0xc4,0x3c,
0xc5,0x10,
0xc6,0x96,
/*//indoor color vivid green OK
0xfe,0x00,
0xc0,0x26,
0xc1,0x1b,
0xc2,0x5e,
0xc3,0x58,
0xc4,0x7d,
0xc5,0x2b,
0xc6,0x96, */
/*//indoor color vivid blue OK
0xfe,0x00,
0xc0,0x39,
0xc1,0x31,
0xc2,0x76,
0xc3,0x64,
0xc4,0x57,
0xc5,0x07,
0xc6,0x96,
*/
//AWB
0xfe,0x00,
0xb2,0x01,
0xb3,0x11,//green gain
0xa0,0x55,
0xa2,0x18,//low limit of blue gain in indoor scene
0xa3,0x36,//high limit of blue gain in indoor scene
0xa4,0x11,//low limit of red gain in indoor scene
0xa5,0x36,//high limit of red gain in indoor scene
0xa7,0x80,//blue target
0xa8,0x7f,//red target
0xa9,0x15,
0xaa,0x10,
0xab,0x10,
0xac,0x2c,
0xad,0xf0,
0xae,0x20,//0x80->0x20 Ycbcr LIMIT
0xb4,0x18,//low limit of blue gain in outdoor scene
0xb5,0x1a,//high limit of blue gain in outdoor scene
0xb6,0x1c,//low limit of red gain in outdoor scene
0xb7,0x30,//high limit of red gain in outdoor scene
0xd0,0x4c,
//AE
0xfe,0x01,
0x00,0x05,
0x04,0x4f,//AE target
0x09,0x04,//bit[5:0]:max integration time step//0d 03
0x0a,0x45,
0x0b,0x82,//minimum integration time
0x0c,0x52,//50hz banding //30 60
0x0d,0x50,//60hz banding
0x15,0x42,
0x17,0xb5,
0x18,0x60,//The value should be smaller than the 50hz banding. add 20140702
0x1b,0x28,//minimum global gain
0x1c,0x50,
0x1d,0x39,
0x1e,0x5d,
0x1f,0x99,//max global gain
0xfe,0x00,
0xce,0x48,//Contrast
//saturation
0xfe,0x01,
0x64,0xc0,//blue saturation
0x65,0xb0,//red saturation
//240*320 resolution
0xfe,0x00,
0x05,0x0c,
0x06,0x00,
0x07,0xf8,
0x08,0x00,
0x09,0x48,
0x0a,0x10,
0xfe,0x01,
0x54,0x00,
0x55,0x00,
0x56,0x78,//3c //78
0x57,0x00,
0x58,0xa0,//50
//0x52,0xf3,
0x59,0x00,
0x5a,0x11,
0x5b,0x11,
0x5c,0x11,
-1,-1};
static void bf3a01_rotate(uint32 r)
{
}
uint32 bf3a01_hvblank(int8 dh,int8 dv)
{
}
SENSOR_OP_SECTION const _Sensor_Adpt_ bf3a01_cmd=
{
.typ = 1, //YUV
.pixelw = 240,
.pixelh= 320,
.hsyn = 1,
.vsyn = 1,
.rduline = 0,//
.rawwide = 1,//10bit
.colrarray = 2,//0:_RGRG_ 1:_GRGR_,2:_BGBG_,3:_GBGB_
.init = (uint8 *)bf3a01InitTable,
.rotate_adapt = {0},
//.hvb_adapt = {0xde,0x24,0xde,0x24},
. mclk = 40000000,
.p_fun_adapt = {bf3a01_rotate,NULL,NULL},
.p_xc7016_adapt = {NULL},
};
const _Sensor_Ident_ bf3a01_init=
{
0x01,0xdc,0xdd,0x01,0x01,0xfd,//bf3
};
#endif