|
void Lcd_TFT_Init(void)
{
Lcd_Init();
Lcd_PowerEnable(0, 1);
Lcd_EnvidOnOff(1); //turn on vedio
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00) );
#define LCD_BLANK 12
#define C_UP ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define C_RIGHT ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define V_BLACK ( ( LCD_YSIZE_TFT - LCD_BLANK*4 ) / 6 )
Glib_FilledRectangle( LCD_BLANK, LCD_BLANK, ( LCD_XSIZE_TFT - LCD_BLANK ), ( LCD_YSIZE_TFT - LCD_BLANK ),0x0000); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*0), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*1),0x001f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*1), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*2),0x07e0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*2), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*3),0xf800); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*3), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*4),0xffe0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*4), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*5),0xf81f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*5), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*6),0x07ff); //fill a Rectangle with some color
Glib_Line( LCD_BLANK,LCD_BLANK, (LCD_XSIZE_TFT-LCD_BLANK), (LCD_YSIZE_TFT-LCD_BLANK), 0x0000 ) ;
Glib_Line( LCD_BLANK,(LCD_YSIZE_TFT-LCD_BLANK), (LCD_XSIZE_TFT-LCD_BLANK), LCD_BLANK, 0x0000 ) ;
Glib_Line( (LCD_XSIZE_TFT/2),(LCD_BLANK*2 + V_BLACK*0), (LCD_XSIZE_TFT/2), (LCD_BLANK*2 + V_BLACK*6), 0x0000 ) ;
}
void Lcd_TFT_Test( void )
{
Uart_Printf("\nTest TFT LCD!\n");
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00) ) ; //clear screen
Uart_Printf( "\nDisplay Black! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x3f<<5) | (0x1f) ) ; //clear screen
Uart_Printf( "Display White! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x1f) ) ; //clear screen
Uart_Printf( "Display Blue! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x00<<11) | (0x3f<<5) | (0x00) ) ; //clear screen
Uart_Printf( "Display Green! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x00<<5) | (0x00) ) ; //clear screen
Uart_Printf( "Display Red! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
/* Lcd_ClearScr( (0x00<<11) | (0x3f<<5) | (0x1f) ) ; //clear screen
Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x00<<5) | (0x1f) ) ; //clear screen
Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x3f<<5) | (0x00) ) ; //clear screen
Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
Uart_Getch() ; //wait uart input
*/
Lcd_ClearScr(0xffff); //fill all screen with some color
#define LCD_BLANK 12
#define C_UP ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define C_RIGHT ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define V_BLACK ( ( LCD_YSIZE_TFT - LCD_BLANK*4 ) / 6 )
Glib_FilledRectangle( LCD_BLANK, LCD_BLANK, ( LCD_XSIZE_TFT - LCD_BLANK ), ( LCD_YSIZE_TFT - LCD_BLANK ),0x0000); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*0), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*1),0x001f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*1), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*2),0x07e0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*2), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*3),0xf800); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*3), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*4),0xffe0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*4), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*5),0xf81f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*5), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*6),0x07ff); //fill a Rectangle with some color
Glib_Line( LCD_BLANK,LCD_BLANK, (LCD_XSIZE_TFT-LCD_BLANK), (LCD_YSIZE_TFT-LCD_BLANK), 0x0000 ) ;
Glib_Line( LCD_BLANK,(LCD_YSIZE_TFT-LCD_BLANK), (LCD_XSIZE_TFT-LCD_BLANK), LCD_BLANK, 0x0000 ) ;
Glib_Line( (LCD_XSIZE_TFT/2),(LCD_BLANK*2 + V_BLACK*0), (LCD_XSIZE_TFT/2), (LCD_BLANK*2 + V_BLACK*6), 0x0000 ) ;
#if(LCD_Type == LCDT35)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 240, 320, TQ_LOGO_240320);
#elif((LCD_Type == LCDW35) || (LCD_Type == LCDS35))
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 320, 240, TQ_LOGO_320240);
#elif(LCD_Type == LCDW43)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 480, 272, TQ_LOGO_480272);
#elif(LCD_Type == VGA)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 640, 480, TQ_LOGO_640480);
#elif(LCD_Type == LCDA70)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 800, 480, TQ_LOGO_800480);
#endif
Uart_Printf("LCD Test Complete!\n");
Uart_Printf("Press any key to quit!\n");
Uart_Getch();
} |
|