我的开发环境是S3C2410+NEC3.5LCD(240*320)。屏在LINUX下显示是正常的,可是我用UCgui,显示的时候屏就有错位现象,(0,0)不是在左上角,而是在右上角靠左100的位置,所以在屏的右边有一条从上到下的黑条。请问该如何解决。先谢谢各位了!
我的代码如下:
//void _PutTft16Bit_240320(U32 x,U32 y,U32 c)
U32 _PutTft16Bit_240320(U32 x,U32 y,U32 c)// changed by yhu
{
if(x<SCR_XSIZE_TFT_240320 && y<SCR_YSIZE_TFT_240320)
frameBuffer16BitTft240320[(y)][(x)/2]=( frameBuffer16BitTft240320[(y)][x/2]
& ~(0xffff0000>>((x)%2)*16) ) | ( (c&0x0000ffff)<<((2-1-((x)%2))*16) );
}
void Lcd_Init( ){
frameBuffer16BitTft240320=(U32 (*)[SCR_XSIZE_TFT_240320/2])LCDFRAMEBUFFER;
rLCDCON1=(CLKVAL_TFT_240320<<8)|(MVAL_USED<<7)|(3<<5)|(12<<1)|0;
// TFT LCD panel,12bpp TFT,ENVID=off
rLCDCON2=(VBPD_240320<<24)|(LINEVAL_TFT_240320<<14)|(VFPD_240320<<6)|(VSPW_240320);
rLCDCON3=(HBPD_240320<<19)|(HOZVAL_TFT_240320<<8)|(HFPD_240320);
rLCDCON4=(MVAL<<8)|(HSPW_240320);
//rLCDCON5=(1<<11)|(1<<9)|(1<<8); //FRM5:6:5,HSYNC and VSYNC are inverted___the old setting
rLCDCON5=(1<<11)|(1<<9)|(1<<8)|(0<<6); //FRM5:6:5,HSYNC and VSYNC are inverted
rLCDSADDR1=(((U32)frameBuffer16BitTft240320>>22)<<21)|M5D((U32)frameBuffer16BitTft240320>>1);
rLCDSADDR2=M5D( ((U32)frameBuffer16BitTft240320+(SCR_XSIZE_TFT_240320*LCD_YSIZE_TFT_240320*2))>>1 );
rLCDSADDR3=(((SCR_XSIZE_TFT_240320-LCD_XSIZE_TFT_240320)/1)<<11)|(LCD_XSIZE_TFT_240320/1);
rLCDINTMSK|=(3); // MASK LCD Sub Interrupt
rLPCSEL&=(~7); // Disable LPC3600
rTPAL=0; // Disable Temp Palette
}