#define LCD_YSIZE 272
unsigned int LCD_BUF0;
unsigned int LCD_BUF1;
void LCD_Disable(void)
{
WINCON0 &= ~0x1;//窗口0关闭
}
void LCD_Enable(void)
{
WINCON0 |= 0x1;//窗口0使能
}
void LCD_Init(void)//LCD配置初始化好后,将要显示的内容写入相应位置的缓存即可
{
GPICON=0xaaaaaaaa;
GPJCON=0xaaaaaaaa;//配置输出端口为LCD输出
MOFPCON &=~0x00000008;
SPCON &= ~0x00000003;// 将SPCON寄存器中,最低两位设为01,即RGB I/F style
SPCON |= 0x00000001;
LCD_Disable();
VIDCON0=((8<<6)|(1<<4)|3);
VIDCON1=((1<<6)|(1<<5));
VIDTCON0=((2<<16)|(2<<8)|10);
VIDTCON1=((2<<16)|(2<<8)|41);
VIDTCON2=((271<<11)|479);
WINCON0=(11<<2);
VIDOSD0B=((479<<11)|271);
VIDOSD0C=480*272;
VIDW00ADD2 = ((0 << 13)|(LCD_XSIZE * 4));
VIDW00ADD0B0=(unsigned int)LCD_BUF0;
VIDW00ADD0B1=(unsigned int)LCD_BUF1;
VIDW00ADD1B0=(unsigned int)(LCD_BUF0+480*272*4);
VIDW00ADD1B1=(unsigned int)(LCD_BUF1+480*272*4);
DITHMODE=(1<<5)|(1<<3)|(1<<1)|(1<<0);
LCD_Clear();
LCD_Enable();
}
以上是我写的初始化程序,只用了窗口0的两个缓冲区,其它窗口未开,希望能供你参考!不对的地方还请指正!
页:
[1]