|
我在6223a 上 spi 驱动lcd, lcd 的数据位是9位(D/C D7 D6 D5....D0), d/c=1是数据, d/c=0是指令;
现在现象是开机出现花屏,然后又没有啦, 但是spi的几个脚位信号都正常 clk, data, sce, 望调过的兄弟指点下,实在没办法了,请看看的我的代码:
#define LCD_CtrlWrite(_data) { *(volatile kal_uint16 *)MAIN_LCD_CMD_ADDR = (_data&0x00ff); LCD_Drv_delay();}
#define LCD_DataWrite(_data){ *(volatile kal_uint16 *)MAIN_LCD_DATA_ADDR= (_data&0x01FF); LCD_Drv_delay();}
void LCD_BlockWrite(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
{
kal_uint16 roi_width;
kal_uint16 x,y;
kal_uint8 data;
kal_uint8 counter =0;
while (LCD_IS_RUNNING){};
WMLCDCOM(0x2a);
LCD_DataWrite(startx);
LCD_DataWrite(endx); // 98
WMLCDCOM(0x2b);
LCD_DataWrite_SPFD54124(starty); // 69 0x45
LCD_DataWrite_SPFD54124(endy);
WMLCDCOM(0x2c);
ENABLE_LCD_TRANSFER_COMPLETE_INT;
DISABLE_LCD_ROI_CTRL_CMD_FIRST;
START_LCD_TRANSFER;
} |
|