智能车制作
标题:
上位机图像数据格式与LCD数据格式一样吗
[打印本页]
作者:
405845831
时间:
2015-11-18 14:37
标题:
上位机图像数据格式与LCD数据格式一样吗
这几天在弄ov7670上位机显示 我想问问向TFT屏发送图像数据的格式跟想上位机发送图像数据的格式有区别吗 上位机一直不能出现图像这是向上位机发送数据的格式
for(j=0;j<76800;j++)
{
GPIOB->CRL=0X88888888;
OV7670_RCK=0;
color1=OV7670_DATA; //
//color1=GPIOB->IDR&0XFF; //???
OV7670_RCK=1;
color=color1;
color<<=8;
OV7670_RCK=0;
color2=OV7670_DATA; /
//color2=GPIOB->IDR&0XFF; //???
OV7670_RCK=1;
//color|=color2;
GPIOB->CRL=0X33333333;
//LCD_WR_DATA(color);
//LCD->LCD_RAM=color;
// printf("%d,",color1);
// printf("%d\n",color2);
r= color1 & 0xF8;
g=((color1 &0x07 )<<3 | (color2 & 0xe0 ) >>5 ) << 2;
b=(color2 & 0x1f )<<3;
printf("%d,%d,%d,\n",r,g,b);
这是TFT屏的格式(TFT是可以显示图像的)
*void camera_refresh(void)
{
u32 j;
u16 color;
if(ov_sta==2)
{
LCD_Scan_Dir(U2D_L2R); //′óéÏμ½ÏÂ,′ó×óμ½óò
LCD_SetCursor(0x00,0x0000); //éèÖÃ1a±êλÖÃ
LCD_WriteRAM_Prepare(); //¿aê¼D′èëGRAM
OV7670_CS=0;
OV7670_RRST=0; //¿a꼸′λ¶áÖ¸Õë
OV7670_RCK=0;
OV7670_RCK=1;
OV7670_RCK=0;
OV7670_RRST=1; //¸′λ¶áÖ¸Õë½áêø
OV7670_RCK=1;
for(j=0;j<76800;j++)
{
GPIOB->CRL=0X88888888;
OV7670_RCK=0;
color=OV7670_DATA; //¶áêy¾Y
OV7670_RCK=1;
color<<=8;
OV7670_RCK=0;
color|=OV7670_DATA; //¶áêy¾Y
OV7670_RCK=1;
GPIOB->CRL=0X33333333;
LCD_WR_DATA(color);
}
OV7670_CS=1;
OV7670_RCK=0;
OV7670_RCK=1;
EXTI->PR=1<<15; //Çå3yLINE8éÏμÄÖD¶Ï±ê־λ
ov_sta=0; //¿aê¼ÏÂò»′Î2é¼ˉ
ov_frame++;
LCD_Scan_Dir(DFT_SCAN_DIR); //»Ö¸′ĬèÏé¨Ãè·½Ïò
}
}
欢迎光临 智能车制作 (http://dns.znczz.com/)
Powered by Discuz! X3.2