处理器: S3C2440A
LCD: AT070TN83 7" TFT (群创/富士康/foxconn/InnoLux) 分辨率(800*480)
#define MVAL (13)
#define MVAL_USED (0) //0=each frame 1=rate by MVAL
#define INVVDEN (1) //0=normal 1=inverted
#define BSWP (0) //Byte swap control
#define HWSWP (1) //Half word swap control
#define M5D(n) ((n) & 0x1fffff) // To get lower 21bits
#define LCD_XSIZE_TFT (800)
#define LCD_YSIZE_TFT (480)
#define SCR_XSIZE_TFT (LCD_XSIZE_TFT) //video buffer的宽, video buffer应该比lcd屏幕的点阵要多,屏幕显示可以移动
#define SCR_YSIZE_TFT (LCD_YSIZE_TFT) //video buffer的高
#define HOZVAL_TFT (LCD_XSIZE_TFT -1)
#define LINEVAL_TFT (LCD_YSIZE_TFT -1)
#define VBPD (29) //垂直同步信号的后肩
#define VFPD (13) //垂直同步信号的前肩
#define VSPW (3) //垂直同步信号的脉宽
#define HBPD (40) //水平同步信号的后肩
#define HFPD (40) //水平同步信号的前肩
#define HSPW (48) //水平同步信号的脉宽
#define CLKVAL_TFT (1) //LCD手册要求时钟频率(Max:50Mhz, Typ:33.3Mhz), 2440A工作在FCLK=400,HCLK=133情况下,CLKVAL_TFT >= 1
volatile unsigned short LCD_BUFER[SCR_YSIZE_TFT][SCR_XSIZE_TFT];
/**************************************************************
800×480 16Bpp TFT LCD数据和控制端口初始化
**************************************************************/
void Lcd_Port_Init(void)
{
rGPCUP=0xffffffff; // Disable Pull-up register
rGPCCON=0xaaaa56a9; //Initialize VD[7:0],LCDVF[2:0],VM,VFRAME,VLINE,VCLK,LEND
rGPDUP=0xffffffff; // Disable Pull-up register
rGPDCON=0xaaaaaaaa; //Initialize VD[15:8]
}
/**************************************************************
800×480 16Bpp TFT LCD功能模块初始化
**************************************************************/
void Lcd_Init(void)
{
rLCDCON1=(CLKVAL_TFT<<8)|(MVAL_USED<<7)|(3<<5)|(12<<1)|0; // TFT LCD panel,12bpp TFT,ENVID=off
rLCDCON2=(VBPD<<24)|(LINEVAL_TFT<<14)|(VFPD<<6)|(VSPW);
rLCDCON3=(HBPD<<19)|(HOZVAL_TFT<<8)|(HFPD);
rLCDCON4=(MVAL<<8)|(HSPW);
rLCDCON5=(1<<11)|(0<<9)|(0<<8)|(0<<6)|(BSWP<<1)|(HWSWP); //FRM5:6:5,HSYNC and VSYNC are inverted
rLCDSADDR1=(((U32)LCD_BUFER>>22)<<21)|M5D((U32)LCD_BUFER>>1);
rLCDSADDR2=M5D( ((U32)LCD_BUFER+(SCR_XSIZE_TFT*LCD_YSIZE_TFT*2))>>1 );
rLCDSADDR3=(((SCR_XSIZE_TFT-LCD_XSIZE_TFT)/1)<<11)|(LCD_XSIZE_TFT/1); //virtual screen的x起点和显示宽度.
rLCDINTMSK|=(3); // MASK LCD Sub Interrupt
rTCONSEL&=(~7); // Disable LPC3600
rTPAL=0; // Disable Temp Palette
}