📄 sensor.c
字号:
{0x801, 0x05, 0},
{0x802, 0x02, 0},
{0x803, 0x1b, 0},
{0x804, 0x05, 0},
{0x814, 0x00, 0},
{0x815, 0x00, 0},
{0x816, 0x02, 0},
{0x817, 0x80, 0},
{0x820, 0x00, 0},
{0x821, 0x00, 0},
{0x822, 0x01, 0},
{0x823, 0xe0, 0},
{0x81c, 0x00, 0},
{0x81d, 0x01, 0},
{0x81e, 0x00, 0},
{0x81f, 0x02, 0},
// {0x800, 0x66, 0},
};
const V558_SENSORREGVALUE SensorRegVal[] =
{
{0x12, 0x80, 10},
{0x03, 0xa4, 1},
// {0x04, 0x2a, 1},
// {0x05, 0x2a, 1},
{0x04, 0x30, 1},
{0x05, 0x88, 1},
{0x06, 0x60, 1},
{0x11, 0x00, 1},
{0x12, 0x45, 1},
{0x13, 0xa3, 1},
{0x14, 0x04, 1},
// {0x15, 0x04, 1},
{0x15, 0x14, 1},
{0x1f, 0x41, 1},
{0x20, 0xd0, 1},
{0x23, 0xde, 1},
// {0x24, 0x90, 1},//add
// {0x25, 0x78, 1},//add
{0x24, 0x80, 1},//add
{0x25, 0x70, 1},//add
// {0x26, 0xa2, 1},//add
// {0x27, 0xe2, 1},
{0x26, 0x32, 1},//add
{0x27, 0xea, 1},
{0x28, 0x20, 1},
{0x2a, 0x91, 1},
#if FREQ == 0
{0x2b, 0x98, 1},
#else
{0x2b, 0x00, 1},
#endif
{0x2d, 0x05, 1},
// {0x2f, 0x9c, 1},
{0x2f, 0x9d, 1},
{0x30, 0x00, 1},
{0x31, 0xc4, 1},
{0x60, 0x86, 1},
{0x61, 0xe0, 1},
{0x62, 0x88, 1},
{0x63, 0x11, 1},
{0x64, 0x89, 1},
{0x65, 0x00, 1},
{0x67, 0x94, 1},
{0x68, 0x7a, 1},
// {0x69, 0x04, 1},
{0x69, 0x08, 1},
{0x6c, 0x11, 1},
{0x6d, 0x33, 1},
{0x6e, 0x22, 1},
{0x6f, 0x00, 1},
// {0x74, 0x20, 1},
{0x74, 0x60, 1},
{0x75, 0x8e, 1},
{0x77, 0xc4, 1},
{0x79, 0x88, 1},
{0x7a, 0x84, 1},
};
const V558_SENSORREGVALUE IspRegVal[] =
{
{0x00, 0x00, 1},
};
const V558_SENSORINFO SensorInfo =
{
"ov7649 yuv mode",
{640, 480},
1, //yuv mode
0x1, //pixel rate
0x1, //sensor mast clock count
12000, //sif clock
V558_SNRC_I2C,
OV7649_YUV,
{1,1,0,0,0},
{sizeof(SifRegVal) / sizeof(V558_SENSORREGVALUE), SifRegVal},
{0, 0x42, 0, sizeof(SensorRegVal) / sizeof(V558_SENSORREGVALUE), SensorRegVal},
{
0x42, 0, IspRegVal,
{
//tgt, yfldstp,lck,ulck,gain,gadly,gmax,gainrange[4],yfldmstp,steptime,inlck, gmin, etdem, etnum,reserved1,2,3;
{0x78, 0x40, 0x0a, 0x14, 0x60, 1, 0xe0, {0x20, 0x20, 0xb, 0x10}, 0x20, 4, 0, 0x20, 4, 3, 0, 0, 0}, //ae
//flkcnt,flklinemode,flkstep,flklst,outthd,lighttype,freqtype,timeinout,reserved1,2
{0x39 ,0x1 ,0x0 ,0xd0 ,3 ,0 ,FREQ , 98, 0, 0}, //aflk
//enae,enflk,intfrq,maxexp,defexp,minexp,exppoint,dpcthd,enlight,reserved1,2
1, AUTO_FLK, 0 ,1000 ,400 ,80 ,1000 ,1000 ,1 ,0,0
},
{
32, 32 //brightness
},
{
0x00,0x04,0x16,0x30,0x4e,0x68,0x81,0x98,0xac,0xbe,0xcd,0xda,0xe4,0xed,0xf5,0xfb,0xff //gamma table
}
}
};
/********************************************************************************
Description: Write sensor register to change exposure time
Parameter: t -- exposure time clock num
*********************************************************************************/
void V558_SifSetSnrTime(UINT8 freqtype, UINT32 t)
{
}
/********************************************************************************
Description: Write sensor register when change freq
Parameter: freqflag -- freq type (0)50hz,else 60hz
*********************************************************************************/
void V558_SifSetFlkParam(UINT8 freqflag)
{
}
#endif
#if SELECT_TCM8210MD_YUV
const V558_SENSORREGVALUE SifRegVal[] =
{
// {0x800, 0x60, 1},
// {0x800, 0x61, 1},
// {0x805, 0x00, 0},
// {0x806, 0x01, 0},
{0x802, 0x00, 0},
{0x801, 0x01, 0},
{0x803, 0x0b, 0},
{0x804, 0x05, 0},
{0x815, 0x04, 0},
{0x816, 0x02, 0},
{0x817, 0x7f, 0},
{0x821, 0x00, 0},
{0x823, 0xe0, 0},
{0x81d, 0x01, 0},
{0x81f, 0x02, 0},
{0x834, 0x01, 0},
{0x835, 0xbc, 0},
// {0x800, 0x63, 0}
};
const V558_SENSORREGVALUE SensorRegVal[] =
{
{0x02, 0x80, 10},
{0x03, 0x00, 10},
{0x22, 0x0e, 10},
{0x24, 0x0f, 10},
{0x28, 0x06, 10},
{0x2d, 0x08, 10},
{0x04, 0x0f, 10},
{0x05, 0x02, 10},
{0x08, 0x08, 10},
{0x0a, 0x00, 10},
{0x0d, 0x80, 10},
{0x11, 0x9a, 10},
{0x12, 0xdc, 10},
{0x18, 0x30, 10},
{0x1a, 0x00, 10},
{0x1c, 0x9a, 10}
};
const V558_SENSORREGVALUE IspRegVal[] =
{
{0x00, 0x00, 1},
};
const V558_SENSORINFO SensorInfo =
{
"TCM8210MD yuv mode",
{640, 480},
1, //yuv mode
0x1, //pixel rate
0x0, //sensor mast clock count
12000, //sif clock
V558_SNRC_I2C,
TCM8210MD_YUV,
{0,1,0,0,1},
{sizeof(SifRegVal) / sizeof(V558_SENSORREGVALUE), SifRegVal},
{0, 0x78, 0, sizeof(SensorRegVal) / sizeof(V558_SENSORREGVALUE), SensorRegVal},
{
0x78, 0, IspRegVal,
{
//tgt, yfldstp,lck,ulck,gain,gadly,gmax,gainrange[4],yfldmstp,steptime,inlck, gmin, etdem, etnum,reserved1,2,3;
{0x78, 0x40, 0x0a, 0x14, 0x60, 1, 0xe0, {0x20, 0x20, 0xb, 0x10}, 0x20, 4, 0, 0x20, 4, 3, 0, 0, 0}, //ae
//flkcnt,flklinemode,flkstep,flklst,outthd,lighttype,freqtype,timeinout,reserved1,2
{0x39 ,0x1 ,0x0 ,0xd0 ,3 ,0 ,FREQ , 98, 0, 0}, //aflk
//enae,enflk,intfrq,maxexp,defexp,minexp,exppoint,dpcthd,enlight,reserved1,2
1, AUTO_FLK, 0 ,1000 ,400 ,80 ,1000 ,1000 ,1 ,0,0
},
{
32, 32 //brightness
},
{
0x00,0x04,0x16,0x30,0x4e,0x68,0x81,0x98,0xac,0xbe,0xcd,0xda,0xe4,0xed,0xf5,0xfb,0xff //gamma table
}
}
};
/********************************************************************************
Description: Write sensor register to change exposure time
Parameter: t -- exposure time clock num
*********************************************************************************/
void V558_SifSetSnrTime(UINT8 freqtype, UINT32 t)
{
}
/********************************************************************************
Description: Write sensor register when change freq
Parameter: freqflag -- freq type (0)50hz,else 60hz
*********************************************************************************/
void V558_SifSetFlkParam(UINT8 freqflag)
{
}
#endif
#if SELECT_PIXEL2030K_BAYER
const V558_SENSORREGVALUE SifRegVal[] =
{
// {0x800, 0x24, 1},
// {0x800, 0x25, 1},
// {0x805, 0x00, 0},
// {0x806, 0x01, 0},
{0x801, 0x01, 0},
{0x803, 0x1b, 0},
{0x804, 0x05, 0},
{0x815, 0x00, 0},
{0x816, 0x02, 0},
{0x817, 0x7f, 0},
{0x821, 0x00, 0},
{0x823, 0xe0, 0},
{0x81d, 0x01, 0},
{0x81f, 0x08, 0},
{0x840, 0x01, 0},
{0x841, 0xd0, 0},
{0x842, 0x01, 0},
{0x843, 0xe0, 0}
// {0x800, 0x27, 0}
};
const V558_SENSORREGVALUE SensorRegVal[] =
{
{0x05, 0xe7, 1},
{0x08, 0x01, 1},
{0x09, 0x3c, 1},
{0x0d, 0xbc, 1},
{0x13, 0x03, 1},
{0x1e, 0x0f, 1},
{0x1d, 0x00, 1},
{0x87, 0x00, 1},
{0x88, 0x05, 1},
{0x89, 0x00, 1},
{0x8a, 0x06, 1},
{0x8b, 0x00, 1},
{0x8c, 0x01, 1},
{0x20, 0xc4, 1},
{0x2a, 0x01, 1},
{0x2b, 0x31, 1},
{0x2d, 0xb5, 1},
{0x2e, 0xaa, 1},
{0x2f, 0xda, 1},
{0x30, 0x79, 1},
{0x31, 0x1d, 1},
{0x32, 0x72, 1},
{0x33, 0x75, 1},
{0x34, 0x72, 1},
{0x35, 0xa2, 1},
{0x36, 0x60, 1},
{0x37, 0x08, 1},
{0x3b, 0x2a, 1},
{0x3c, 0x03, 1},
{0x3d, 0x05, 1},
{0x3e, 0x90, 1},
{0x5a, 0x06, 1},
{0x5b, 0x14, 1},
{0x5c, 0x23, 1},
{0x5d, 0x31, 1},
{0x5e, 0x4f, 1},
{0x5f, 0x66, 1},
{0x60, 0x8a, 1},
{0x61, 0xa7, 1},
{0x62, 0xc1, 1},
{0x63, 0xd8, 1},
{0x66, 0xc0, 1},
{0x67, 0x50, 1},
{0x6b, 0xa0, 1},
{0x6c, 0x50, 1},
{0x78, 0x40, 1},
{0x79, 0x80, 1},
{0x7a, 0x00, 1},
{0x7b, 0x02, 1},
{0x8d, 0x0f, 1},
{0x92, 0x48, 1},
{0x93, 0x0a, 1},
{0x94, 0x30, 1},
{0x99, 0x08, 1},
{0x46, 0x87, 1},
{0x4b, 0x28, 1},
{0x4c, 0x1e, 1},
{0x4d, 0x00, 1},
{0x4e, 0x19, 1},
{0x4f, 0x00, 1},
{0x53, 0x16, 1},
{0x54, 0x10, 1}
};
const V558_SENSORREGVALUE IspRegVal[] =
{
{0x2000, 0x31, 0},
{0x2001, 0x7d, 0},
{0x2027, 0x20, 0},
{0x2026, 0x60, 0},
{0x200a, 0x40, 0},
{0x200b, 0x60, 0},
{0x200c, 0x05, 0},
{0x200d, 0x0f, 0},
{0x200e, 0x05, 0},
{0x200f, 0x0f, 0},
{0x2022, 0x40, 0},
{0x2023, 0x40, 0},
{0x2024, 0x40, 0},
{0x202c, 0x60, 0},
{0x202d, 0xf0, 0},
{0x202e, 0xf0, 0},
{0x202f, 0xf0, 0},
{0x2030, 0x60, 0},
{0x2031, 0xf0, 0},
{0x2032, 0xf0, 0},
{0x2033, 0xf0, 0},
{0x2034, 0x60, 0},
{0x208b, 0xff, 0},
// {0x208c, 0xff, 0},
// {0x208d, 0xff, 0},
{0x2081, 0x01, 0}
};
const V558_SENSORINFO SensorInfo =
{
"Pixe2030k bayer mode",
{640, 480},
0, //bayer mode
0x1, //pixel rate
0x0, //sensor mast clock count
12000, //sif clock
V558_SNRC_I2C,
PIXEL2030K_BAYER,
{0,1,0,0,1},
{sizeof(SifRegVal) / sizeof(V558_SENSORREGVALUE), SifRegVal},
{0, 0xdc, 0, sizeof(SensorRegVal) / sizeof(V558_SENSORREGVALUE), SensorRegVal},
{
0x0, sizeof(IspRegVal) / sizeof(V558_SENSORREGVALUE),
IspRegVal,
{
//tgt, yfldstp,lck,ulck,gain,gadly,gmax,gainrange[4],yfldmstp,steptime,inlck, gmin, etdem, etnum,reserved1,2,3;
{0x80, 0x40, 0x0a, 0x14, 0x60, 1, 0xe0, {0x20, 0x20, 0xb, 0x10}, 0x20, 4, 0, 0x20, 4, 3, 0, 0, 0}, //ae
//flkcnt,flklinemode,flkstep,flklst,outthd,lighttype,freqtype,timeinout,reserved1,2
{0x39 ,0x1 ,0x0 ,0xd0 ,3 ,0 ,FREQ , 98, 0, 0}, //aflk
//enae,enflk,intfrq,maxexp,defexp,minexp,exppoint,dpcthd,enlight,reserved1,2
1, AUTO_FLK, 0 ,2000 ,400 ,80 ,1000 ,1000 ,1 ,0,0
},
{
32, 32 //brightness
},
{
0x00,0x13,0x38,0x59,0x79,0x92,0xa7,0xb9,0xc8,0xd4,0xdf,0xe7,0xee,0xf4,0xf9,0xfc,0xff //gamma table
}
}
};
/********************************************************************************
Description: Write sensor register to change exposure time
Parameter: t -- exposure time clock num
*********************************************************************************/
void V558_SifSetSnrTime(UINT8 freqtype, UINT32 t)
{
UINT16 uTemp = 0;
V558_I2C_BATCH AeData;
uTemp = (UINT16)(t/900);
AeData.RegBytes = 2;
AeData.RegAddr = 0x1a;
AeData.RegVal[0]= (UINT8)(uTemp>>8);
AeData.RegVal[1]= (UINT8)uTemp;
V558_SifI2cAeBatch(1, &AeData);
}
/********************************************************************************
Description: Write sensor register when change freq
Parameter: freqflag -- freq type (0)50hz,else 60hz
*********************************************************************************/
void V558_SifSetFlkParam(UINT8 freqflag)
{
}
#endif
#if SELECT_PIXEL2030NC_BAYER
const V558_SENSORREGVALUE SifRegVal[] =
{
// {0x800, 0x24, 1},
// {0x800, 0x25, 1},
// {0x805, 0x00, 0},
// {0x806, 0x01, 0},
{0x801, 0x01, 0},
{0x803, 0x1b, 0},
{0x804, 0x05, 0},
{0x815, 0x00, 0},
{0x816, 0x02, 0},
{0x817, 0x7f, 0},
{0x821, 0x00, 0},
{0x823, 0xe0, 0},
{0x81d, 0x01, 0},
{0x81f, 0x08, 0},
{0x840, 0x01, 0},
{0x841, 0xd0, 0},
{0x842, 0x01, 0},
{0x843, 0xe0, 0}
// {0x800, 0x27, 0}
};
const V558_SENSORREGVALUE SensorRegVal[] =
{
{0x08, 0x00, 1},
{0x09, 0xd6, 1},
{0x0b, 0x03, 1},
{0x0d, 0x54, 1},
{0x0f, 0xea, 1},
{0x29, 0xe8, 1},
{0x2d, 0x45, 1},
{0x1e, 0x0a, 1},
{0x1d, 0x00, 1},
{0x87, 0x00, 1},
{0x88, 0x05, 1},
{0x89, 0x00, 1},
{0x8a, 0x06, 1},
{0x8b, 0x00, 1},
{0x8c, 0x01, 1},
{0x15, 0x04, 1},
{0x16, 0x40, 1},
{0x17, 0x40, 1},
{0x18, 0x40, 1},
{0x19, 0x40, 1},
{0x20, 0x44, 1},
{0x21, 0x00, 1},
{0x33, 0x36, 1},
{0x36, 0x60, 1},
{0x37, 0x08, 1},
{0x3b, 0x31, 1},
{0x44, 0x0f, 1},
{0x58, 0x02, 1},
{0x66, 0xc0, 1},
{0x67, 0x44, 1},
{0x6b, 0xa0, 1},
{0x6c, 0x54, 1},
{0x50, 0xec, 1},
{0x51, 0x05, 1},
{0x52, 0x0a, 1},
{0x53, 0x2f, 1},
{0x5f, 0x40, 1},
{0x60, 0x60, 1},
{0x61, 0x80, 1},
{0x62, 0xa0, 1},
{0x63, 0xc0, 1},
{0x64, 0xe0, 1},
{0x79, 0xa0, 1},
{0x7b, 0x02, 1},
{0x8d, 0x00, 1},
{0xd6, 0x07, 1},
{0x46, 0x87, 1},
{0x4b, 0x28, 1},
{0x4c, 0x1e, 1},
{0x4d, 0x00, 1},
{0x4e, 0x19, 1},
{0x4f, 0x00, 1}
};
const V558_SENSORREGVALUE IspRegVal[] =
{
{0x2000, 0x31, 0},
{0x2001, 0x7d, 0},
{0x2027, 0x20, 0},
{0x2026, 0x60, 0},
{0x200a, 0x40, 0},
{0x200b, 0x60, 0},
{0x200c, 0x05, 0},
{0x200d, 0x0f, 0},
{0x200e, 0x05, 0},
{0x200f, 0x0f, 0},
{0x2022, 0x40, 0},
{0x2023, 0x40, 0},
{0x2024, 0x40, 0},
{0x202c, 0x60, 0},
{0x202d, 0xf0, 0},
{0x202e, 0xf0, 0},
{0x202f, 0xf0, 0},
{0x2030, 0x60, 0},
{0x2031, 0xf0, 0},
{0x2032, 0xf0, 0},
{0x2033, 0xf0, 0},
{0x2034, 0x60, 0},
{0x208b, 0xff, 0},
// {0x208c, 0xff, 0},
// {0x208d, 0xff, 0},
{0x2081, 0x01, 0}
};
const V558_SENSORINFO SensorInfo =
{
"Pixe2030NC bayer mode",
{640, 480},
0, //bayer mode
0x1, //pixel rate
0x0, //sensor mast clock count
12000, //sif clock
V558_SNRC_I2C,
PIXEL2030NC_BAYER,
{0,1,0,0,1},
{sizeof(SifRegVal) / sizeof(V558_SENSORREGVALUE), SifRegVal},
{0, 0xdc, 0, sizeof(SensorRegVal) / sizeof(V558_SENSORREGVALUE), SensorRegVal},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -