中级会员
- 积分
- 312
- 威望
- 168
- 贡献
- 94
- 兑换币
- 96
- 注册时间
- 2016-5-20
- 在线时间
- 25 小时
|
我也遇到了一个问题,采集的图像不对呀!代码如下
unsigned int Ov7725_Init()
{
uint16_t i = 0;
uint8_t Sensor_IDCode = 0;
// DEBUG("ov7725 Register Config Start......");
if(SCCB_WriteByte ( 0x12, 0x80 )==0) /*sensor */
{
//DEBUG("sccb write data error");
//User_Delay(50);
return ERROR ;
}
// User_Delay(50);
if( 0 == SCCB_ReadByte( &Sensor_IDCode, 1, 0x0b ) ) /* ??sensor ID?*/
{
//DEBUG("read id faild");
return ERROR;
}
//DEBUG("Sensor ID is 0x%x", Sensor_IDCode);
if(Sensor_IDCode == OV7725_ID)
{
for( i = 0 ; i < OV7725_REG_NUM ; i++ )
{
if( 0 == SCCB_WriteByte(Sensor_Config[i].Address, Sensor_Config[i].Value) )
{
//DEBUG("write reg faild", Sensor_Config[i].Address);
return ERROR;
}
}
}
else
{
return ERROR;
}
//DEBUG("ov7725 Register Config Success");
return SUCCESS;
}
void get_image()
{
uint8_t ca_data;
// uint8_t dat[H_RESOLUTION*W_RESOLUTION*2];
uint16_t i,j;
long flag=0;
for(i=0;i<W_RESOLUTION;i++)
{
for(j=0;j<H_RESOLUTION;j++)
{
READ_FIFO_PIXEL(ca_data);
// dat[flag]=ca_data;
R_UART0_Send_Data(&ca_data,1);
// flag++;
// READ_FIFO_PIXEL(ca_data);
// dat[flag]=ca_data;
// R_UART0_Send_Data(&ca_data,1);
// flag++;
}
}
}
__interrupt static void r_intc8_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
if( Ov7725_vsync == 0 )
{
FIFO_WRST_L();
FIFO_WE_H();
Ov7725_vsync = 1;
FIFO_WE_H();
FIFO_WRST_H();
}
else if( Ov7725_vsync == 1 )
{
FIFO_WE_L();
Ov7725_vsync = 2;
}
/* End user code. Do not edit comment generated here */
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|