⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sed1356.c

📁 YL9200开发板的测试代码,详细请下载后细看
💻 C
📖 第 1 页 / 共 4 页
字号:
	printf( "BPP16_GREEN Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	VGA_ClearScr_16BPP640480( BPP16_BLUE ) ;
	printf( "BPP16_BLUE Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	VGA_ClearScr_16BPP640480( BPP16_WHITE ) ;
	printf( "BPP16_WHITE Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	VGA_ClearScr_16BPP640480( BPP16_BLACK ) ;
	printf( "BPP16_BLACK Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

#ifdef SHOW_PIC_640480
	VGA640480_Paint_Bmp( 0, 0, 640, 480, girl0_640_480 ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	VGA640480_Paint_Bmp( 0, 0, 640, 480, girl2_640_480 ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	VGA640480_Paint_Bmp( 0, 0, 640, 480, girl3_640_480 ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续
#endif

	printf( "'ESC' key to exit...\n" );
	while( getkey() != ESC_KEY )
	{
		VGA_ClearScr_16BPP640480( BPP16_RED ) ;
		VGA_ClearScr_16BPP640480( BPP16_GREEN ) ;
		VGA_ClearScr_16BPP640480( BPP16_BLUE ) ;
	}

/*	printf( "'ESC' key to exit...\n" );
	while( getkey() != ESC_KEY )
	{
		Test_Vedio_Memory_Cut_Paste( pMem );
	}*/
}

/*******************************************************************************************************************
【函数名称】void Test_SED1356_LCD_240_320( U32 m , U32 n )
【功能描述】SED1356测试夏普240×320TFT型液晶屏
【参数输入】
【参数返回】无
********************************************************************************************************************/
void Test_SED1356_LCD_240_320( U32 m , U32 n )
{
	int i;
	U16 v;
	volatile U8* pReg = ( U8* ) DIS_REG_BASE;
	//U16* pMem;

	pReg[1] = 0;
	printf( "SED1356 Product version is 0x%x, " , pReg[0] );
	printf( "MD configruation is 0x%x\n" , ( pReg[0xd] << 8 ) | pReg[0xc] );
	//printf( "sizeof( SED_Reg_LCD240320 ) is %d\n" , sizeof( SED_Reg_LCD240320 ) );
	//printf( "sizeof( SED_Reg_LCD240320[0] ) is %d\n" , sizeof( SED_Reg_LCD240320[0] ) );

	for ( i = 0; i < sizeof( SED_Reg_LCD240320 ) / sizeof( SED_Reg_LCD240320[0] ); i++ )
	{
		v = *( U16 * ) ( DIS_REG_BASE + ( SED_Reg_LCD240320[i].index & ~1 ) );
		v &= ( SED_Reg_LCD240320[i].index & 1 ) ? 0xff : ( 0xff << 8 );
		v |= ( SED_Reg_LCD240320[i].index & 1 ) ? ( SED_Reg_LCD240320[i].value << 8 ) : SED_Reg_LCD240320[i].value;
		*( U16 * ) ( DIS_REG_BASE + ( SED_Reg_LCD240320[i].index & ~1 ) ) = v;
		//pReg[SED_Reg_LCD240320[i].index] = SED_Reg_LCD240320[i].value;
	}

	printf( "LCD H : %d\n" , ( (pReg[0x32]+1) * 8 ) );
	printf( "LCD V : %d\n" , ( ( pReg[0x39] << 8 ) | pReg[0x38] + 1 ) );


	//Test_SED1356_Vidio_Memory() ;		//显示存储器读写测试

	printf( "LCD Display test......\n" );

	LcdClearScr_16BPP240320( BPP16_RED ) ;
	printf( "BPP16_RED Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP240320( BPP16_GREEN ) ;
	printf( "BPP16_GREEN Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP240320( BPP16_BLUE ) ;
	printf( "BPP16_BLUE Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP240320( BPP16_WHITE ) ;
	printf( "BPP16_WHITE Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP240320( BPP16_BLACK ) ;
	printf( "BPP16_BLACK Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

#ifdef SHOW_PIC_240320
	LCD240320_Paint_Bmp( 0, 0, 320, 240, ucdragon_logo ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LCD240320_Paint_Bmp( 0, 0, 320, 240, sxz_logo ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续
#endif

	printf( "'ESC' key to exit...\n" );
	while( getkey() != ESC_KEY )
	{
		//LcdClearScr_16BPP240320( BPP16_RED ) ;
		//LcdClearScr_16BPP240320( BPP16_GREEN ) ;
		//LcdClearScr_16BPP240320( BPP16_BLUE ) ;
	}
}


/*******************************************************************************************************************
【函数名称】void Test_SED1356_LCD_240_320_TouchPanel( U32 m , U32 n )
【功能描述】SED1356测试夏普240×320TFT型液晶屏
【参数输入】
【参数返回】无
********************************************************************************************************************/
/*void Test_SED1356_LCD_240_320_TouchPanel( U32 m , U32 n )
{
	int i;
	U16 v;
	U16 lcd_x, lcd_y ;
	volatile U8* pReg = ( U8* ) DIS_REG_BASE;
	U16* pMem = ( U16 * ) DIS_MEM_BASE ;

	pReg[1] = 0;
	printf( "SED1356 Product version is 0x%x, " , pReg[0] );
	printf( "MD configruation is 0x%x\n" , ( pReg[0xd] << 8 ) | pReg[0xc] );
	//printf( "sizeof( SED_Reg_LCD240320 ) is %d\n" , sizeof( SED_Reg_LCD240320 ) );
	//printf( "sizeof( SED_Reg_LCD240320[0] ) is %d\n" , sizeof( SED_Reg_LCD240320[0] ) );

	for ( i = 0; i < sizeof( SED_Reg_LCD240320 ) / sizeof( SED_Reg_LCD240320[0] ); i++ )
	{
		v = *( U16 * ) ( DIS_REG_BASE + ( SED_Reg_LCD240320[i].index & ~1 ) );
		v &= ( SED_Reg_LCD240320[i].index & 1 ) ? 0xff : ( 0xff << 8 );
		v |= ( SED_Reg_LCD240320[i].index & 1 ) ? ( SED_Reg_LCD240320[i].value << 8 ) : SED_Reg_LCD240320[i].value;
		*( U16 * ) ( DIS_REG_BASE + ( SED_Reg_LCD240320[i].index & ~1 ) ) = v;
		//pReg[SED_Reg_LCD240320[i].index] = SED_Reg_LCD240320[i].value;
	}

	printf( "LCD H : %d\n" , ( (pReg[0x32]+1) * 8 ) );
	printf( "LCD V : %d\n" , ( ( pReg[0x39] << 8 ) | pReg[0x38] + 1 ) );
	
	LcdClearScr_16BPP240320( BPP16_WHITE ) ;

	//printf( "SED1356 LCD 240*320 & Touchpanel Test, 'ESC' to exit, 'Enter' to clear screen!\n" );
	printf( "SED1356 LCD 240*320 & Touchpanel Test, 'ESC' to exit!\n" );
	
//	ADS7843_Init() ;		//触摸屏初始化

    while( !( kbhit() && (getkey()==ESC_KEY) ) )
    {
    	if ( PENIRQ_GET() == 0 )
    	{
   			ADS7843_Get_XY( &lcd_x, &lcd_y ) ;
   			
   			if( (lcd_x != 4095)&&(lcd_y != 4095)&&(lcd_x != 0)&&(lcd_y != 0) )
   			{
				lcd_x = 240 - ( ((lcd_x*240*100)/4095)/100 ) ;
				lcd_y = 320 - ( ((lcd_y*320*100)/4095)/100 ) ;

				//printf( "\tlcd_x = %04d lcd_y = %04d\n", lcd_x, lcd_y );
				pMem[ ((lcd_y+0)*240) + (lcd_x+0) ] = BPP16_BLACK  ;
			}
    	}
    	
    	//if( getkey()==ENTER_KEY )		LcdClearScr_16BPP240320( BPP16_WHITE ) ;
    }
}
*/
/*******************************************************************************************************************
【函数名称】void Test_SED1356_LCD_640_480( U32 m , U32 n )
【功能描述】SED1356测试夏普640×480TFT型液晶屏
【参数输入】
【参数返回】无
********************************************************************************************************************/
void Test_SED1356_LCD_640_480( U32 m , U32 n )
{
	int i;
	U16 v;
	volatile U8* pReg = ( U8* ) DIS_REG_BASE;
//	U16* pMem = ( U16 * ) DIS_MEM_BASE;

	pReg[1] = 0;
	printf( "SED1356 Product version is 0x%x, " , pReg[0] );
	printf( "MD configruation is 0x%x\n" , ( pReg[0xd] << 8 ) | pReg[0xc] );
	//printf( "sizeof( SED_Reg_LCD640480 ) is %d\n" , sizeof( SED_Reg_LCD640480 ) );
	//printf( "sizeof( SED_Reg_LCD640480[0] ) is %d\n" , sizeof( SED_Reg_LCD640480[0] ) );

	for ( i = 0; i < sizeof( SED_Reg_LCD640480 ) / sizeof( SED_Reg_LCD640480[0] ); i++ )
	{
		v = *( U16 * ) ( DIS_REG_BASE + ( SED_Reg_LCD640480[i].index & ~1 ) );
		v &= ( SED_Reg_LCD640480[i].index & 1 ) ? 0xff : ( 0xff << 8 );
		v |= ( SED_Reg_LCD640480[i].index & 1 ) ? ( SED_Reg_LCD640480[i].value << 8 ) : SED_Reg_LCD640480[i].value;
		*( U16 * ) ( DIS_REG_BASE + ( SED_Reg_LCD640480[i].index & ~1 ) ) = v;
		//pReg[SED_Reg_LCD640480[i].index] = SED_Reg_LCD640480[i].value;
	}

	printf( "LCD H : %d\n" , ( (pReg[0x32]+1) * 8 ) );
	printf( "LCD V : %d\n" , ( ( pReg[0x39] << 8 ) | pReg[0x38] + 1 ) );

	//Test_SED1356_Vidio_Memory() ;		//显示存储器读写测试

	printf( "LCD Display test......\n" );

	LcdClearScr_16BPP640480( BPP16_RED ) ;
	printf( "BPP16_RED Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP640480( BPP16_GREEN ) ;
	printf( "BPP16_GREEN Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP640480( BPP16_BLUE ) ;
	printf( "BPP16_BLUE Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP640480( BPP16_WHITE ) ;
	printf( "BPP16_WHITE Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LcdClearScr_16BPP640480( BPP16_BLACK ) ;
	printf( "BPP16_BLACK Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

#ifdef SHOW_PIC_640480
	LCD640480_Paint_Bmp( 0, 0, 640, 480, girl0_640_480 ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LCD640480_Paint_Bmp( 0, 0, 640, 480, girl2_640_480 ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续

	LCD640480_Paint_Bmp( 0, 0, 640, 480, girl3_640_480 ) ;
	printf( "Any key to continue...\n" );
	getch() ;		//等待串口输入一个字符,然后继续
#endif

	/*
	while( getkey() != ESC_KEY )
	{
		U8 m ;
		for( m = 0; m < 16; m++ )
		{
			printf( "Vedio = 0x%04x\n", (1<<m) );
			LcdClearScr_16BPP640480( 1 << m ) ;
			getch() ;		//等待串口输入一个字符,然后继续
		}
	}*/

	printf( "'ESC' key to exit...\n" );
	while( getkey() != ESC_KEY )
	{
		LcdClearScr_16BPP640480( BPP16_RED ) ;
		LcdClearScr_16BPP640480( BPP16_GREEN ) ;
		LcdClearScr_16BPP640480( BPP16_BLUE ) ;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -