예제 #1
0
파일: lcd.c 프로젝트: elliotxu/tiny6410
void lcd_enable(void)
{
	/* 使能LCD本身 */
	lcd_on();
	
	/* 打开背光 */
	backlight_enable();
	
	/* 使能display controller */
	displaycon_on();
}
예제 #2
0
파일: lcd_ok.c 프로젝트: bourne015/myCODES
void lcd_test(void)
{
	unsigned char c;
	static int lcdon = 0;
	static int blon = 0;
	static int dispon = 0;

	lcd_init();
	
	while (1)
	{
		printf("********LCD TEST MENU********\n\r");
		printf("[L] enable/disable LCD\n\r");
		printf("[B] enable/disable back light\n\r");
		printf("[C] enable/disable s3c6410 display controller\n\r");
		printf("[D] display color\n\r");
		printf("[Q] quit\n\r");

		do {
			c = getc();
			if (c == '\n' || c == '\r')
			{
				printf("\n\r");
			}
			else
			{
				putc(c);
			}
		} while (c == '\n' || c == '\r');

		switch (c) {
			case 'l':
			case 'L':
			{
				if (lcdon)
				{
					lcd_off();
					printf("LCD off\n\r");
				}
				else
				{
					lcd_on();
					printf("LCD on\n\r");
				}
				lcdon = !lcdon;
				break;
			}


			case 'b':
			case 'B':
			{
				if (blon)
				{
					backlight_disable();
					printf("Backlight off\n\r");
				}
				else
				{
					backlight_enable();
					printf("Backlight on\n\r");
				}
				blon = !blon;
				break;
			}


			case 'c':
			case 'C':
			{
				if (dispon)
				{
					displaycon_off();
					printf("Display controller off\n\r");
				}
				else
				{
					displaycon_on();
					printf("Display controller on\n\r");
				}
				blon = !blon;
				break;
			}

			case 'd':
			case 'D':
			{
				display_red();
				break;
			}

			case 'q':
			case 'Q':
			{
				return ;
				break;
			}

		}

	}
}