码迷,mamicode.com
首页 > 其他好文 > 详细

AM3358--Uboot支持LCD输出1024*768

时间:2015-06-10 19:27:40      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

1. uboot/include/lcd/tq3358_fb.h

#define TFT240320								1
#define TFT320240								2
#define TFT480272								3//T43(天嵌4.3寸屏)
#define TFT800480_H50							4//H50(5寸高清屏)
#define TFT800480								5//A70(群创7.0寸屏)
#define TFT800600								6//A104(友达10.4寸屏)
#define TFT1024600_H70							7//H70(7寸高清屏)
#define DYNAMIC_CONFIG							8//动态配置LCD

typedef enum _LCD_TYPE{
	X240Y320=0,
	X320Y240,
	X480Y272,
	X640Y480,
	X800Y480,
	X800Y480_H50,
	X800Y600,
	X1024Y600_H70,
	X1024Y768,
	X1280Y800,
	LCD_TYPE_MAX,
} LCD_TYPE;

2. uboot\common\cmd_menu.c

void lcd_menu_usage()
{
	printf("\r\n##### LCD select Menu #####\r\n");
	printf("[1] T43\" screen.\r\n");
	printf("[2] A70\" screen.\r\n");
	printf("[3] A104\" screen.\r\n");
	printf("[4] H50\" screen.\r\n");
	printf("[5] H70\" screen.\r\n");
	printf("[6] A133\" screen.\r\n");
	printf("[7] W35\" screen.\r\n");
	printf("[8] VGA1280X800\" screen.\r\n");
	printf("[r] Reboot u-boot\r\n");
//	printf("[s] Reinitializtion lcd.\r\n");
	printf("[q] Return Parameter Menu \r\n");
	printf("Enter your selection: ");
}
void lcd_menu_shell()
{
	char c;
	char cmd_buf[256];
	while (1)
	{
		lcd_menu_usage();
		c = getc();
		printf("%c\n", c);
		switch (c)
		{
			case ‘1‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X480Y272;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
			}
			case ‘2‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X800Y480;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
			}
			case ‘3‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X800Y600;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
			}
			case ‘4‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X800Y480_H50;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
			}
			case ‘5‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X1024Y600_H70;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
				break;
			}
			case ‘6‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X1280Y800;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
				break;
			}
			case ‘7‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X320Y240;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
			}
			case ‘8‘:
			{
				sprintf(cmd_buf, "setenv lcdtype VGA1280X800;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
				break;
			}
                          case ‘9‘:
			{
				sprintf(cmd_buf, "setenv lcdtype X1024Y768;");
				run_command(cmd_buf, 0);
				run_command("saveenv;", 0);
				break;
				break;
			}
			case ‘R‘:
			case ‘r‘:
			{
				strcpy(cmd_buf, "reset");
				run_command(cmd_buf, 0);
				break;
			}
			case ‘Q‘:
			case ‘q‘:
			{
				return;
				break;
			}
		}
	}
}



AM3358--Uboot支持LCD输出1024*768

标签:

原文地址:http://blog.csdn.net/mao0514/article/details/46445637

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!