|
int Ov511ModeInitRegs(PDRVCONTEXT pDrv,int width, int height, int sub_flag)
{
int hsegs, vsegs;
if (!Ov51xStop(pDrv))
{
return 0;
}
RegisterWrite(pDrv, R511_CAM_UV_EN, 0x01);
RegisterWrite(pDrv, R511_SNAP_UV_EN, 0x01);
RegisterWrite(pDrv, R511_SNAP_OPTS, 0x03);
/* Here I'm assuming that snapshot size == image size.
* I hope that's always true. --claudio
*/
hsegs = (width >> 3) - 1;
vsegs = (height >> 3) - 1;
RegisterWrite(pDrv, R511_CAM_PXCNT, hsegs);
RegisterWrite(pDrv, R511_CAM_LNCNT, vsegs);
RegisterWrite(pDrv, R511_CAM_PXDIV, 0x00);
RegisterWrite(pDrv, R511_CAM_LNDIV, 0x00);
/* YUV420, low pass filter on */
RegisterWrite(pDrv, R511_CAM_OPTS, 0x03);
/* Snapshot additions */
RegisterWrite(pDrv, R511_SNAP_PXCNT, hsegs);
RegisterWrite(pDrv, R511_SNAP_LNCNT, vsegs);
RegisterWrite(pDrv, R511_SNAP_PXDIV, 0x00);
RegisterWrite(pDrv, R511_SNAP_LNDIV, 0x00);
/*
if (ov->compress) {
/* Enable Y and UV quantization and compression */
/*RegisterWrite(pDrv, R511_COMP_EN, 0x07);
RegisterWrite(pDrv, R511_COMP_LUT_EN, 0x03);
ov51x_reset(ov, OV511_RESET_OMNICE);
}*/
if (!Ov51xRestart(pDrv))
{
return 0;
}
return 1;
}
//给OV511寄存器赋初始值(在OV511初始化时调用)
int WriteRegvals(PDRVCONTEXT pDrv)
{
RegisterWrite(pDrv,R51x_SYS_RESET,0x7f);
RegisterWrite(pDrv,R51x_SYS_INIT,0x01);
RegisterWrite(pDrv,R51x_SYS_RESET,0x7f);
RegisterWrite(pDrv,R51x_SYS_INIT,0x01);
RegisterWrite(pDrv,R51x_SYS_RESET,0x3f);
RegisterWrite(pDrv,R51x_SYS_INIT,0x01);
RegisterWrite(pDrv,R51x_SYS_RESET,0x3d);
return 1;
}
|
|