void Main(void) { ChangeClockDivider(1, 1); ChangeMPllValue(0xa1,3,1); Port_Init(); Uart_Select(0); Uart_Init(0, 115200); Led_Display(); Test_Lcd_Tft_320X240(); }
其中的Test_Lcd_Tft_320X240();具体为下代码 void Test_Lcd_Tft_320X240( void ) { Uart_Printf("
Test 320*240 TFT LCD !
"); Lcd_Port_Init(); LTV350QV_Power_ON(); Lcd_Init(); Lcd_EnvidOnOff(1); //turn on vedio Lcd_ClearScr(0xffff); //fill all screen with white while(1) { Paint_Bmp( 0,0,320,240, flower_320_240) ; //paint a bmp Delay(1000); } while(1); }
void Uart_Init(int pclk,int baud) { int i; if(pclk == 0) pclk = PCLK; rUFCON0 = 0x0; //UART channel 0 FIFO control register, FIFO disable rUFCON1 = 0x0; //UART channel 1 FIFO control register, FIFO disable rUFCON2 = 0x0; //UART channel 2 FIFO control register, FIFO disable rUMCON0 = 0x0; //UART chaneel 0 MODEM control register, AFC disable rUMCON1 = 0x0; //UART chaneel 1 MODEM control register, AFC disable rULCON0 = 0x3; //Line control register : Normal,No parity,1 stop,8 bits rUCON0 = 0x245; // Control register rUBRDIV0=( (int)(pclk/16./baud) -1 ); //Baud rate divisior register 0 rULCON1 = 0x3; rUCON1 = 0x245; rUBRDIV1=( (int)(pclk/16./baud) -1 ); rULCON2 = 0x3; rUCON2 = 0x245; rUBRDIV2=( (int)(pclk/16./baud) -1 );
for(i=0;i<100;i++); }
|