有没有人调过战舰的板子?lcd,战舰自带的开发板没有问题,横屏竖屏都可以,读id一直是0,于是确认是9341,我们买的其他lcd,开始读出来是0, if(lcddev.id<0XFF||lcddev.id==0XFFFF||lcddev.id==0X9300)//读到ID不正确,新增lcddev.id==0X9300判断,因为9341在未被复位的情况下会被读成9300
{
//尝试9341 ID的读取
LCD_WR_REG(0XD3);
LCD_RD_DATA(); //dummy read
LCD_RD_DATA(); //读到0X00
lcddev.id=LCD_RD_DATA(); //读取93
lcddev.id<<=8;
lcddev.id|=LCD_RD_DATA(); //读取41
if(lcddev.id!=0X9341) //非9341,尝试是不是6804
{
LCD_WR_REG(0XBF);
LCD_RD_DATA(); //dummy read
LCD_RD_DATA(); //读回0X01
LCD_RD_DATA(); //读回0XD0
lcddev.id=LCD_RD_DATA();//这里读回0X68
lcddev.id<<=8;
lcddev.id|=LCD_RD_DATA();//这里读回0X04
}
if(lcddev.id!=0X9341&&lcddev.id!=0X6804)lcddev.id=0x9341;//新增,用于识别9341
}经过这里读出来的是9486, if(lcddev.id<0XFF||lcddev.id==0XFFFF||lcddev.id==0X9300)//读到ID不正确,新增lcddev.id==0X9300判断,因为9341在未被复位的情况下会被读成9300
{
//尝试9341 ID的读取
LCD_WR_REG(0XD3);
LCD_RD_DATA(); //dummy read
LCD_RD_DATA(); //读到0X00
lcddev.id=LCD_RD_DATA(); //读取93
lcddev.id<<=8;
lcddev.id|=LCD_RD_DATA(); //读取41
if(lcddev.id!=0X9341) //非9341,尝试是不是6804
{
LCD_WR_REG(0XBF);
LCD_RD_DATA(); //dummy read
LCD_RD_DATA(); //读回0X01
LCD_RD_DATA(); //读回0XD0
lcddev.id=LCD_RD_DATA();//这里读回0X68
lcddev.id<<=8;
lcddev.id|=LCD_RD_DATA();//这里读回0X04
}
if(lcddev.id!=0X9341&&lcddev.id!=0X6804)lcddev.id=0x9341;//新增,用于识别9341
}在这里是1400,于是也确认是9341,竖屏没问题,横屏却出问题,有熟悉的望告知,谢谢。
|