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

📄 main_disphz.c

📁 s3c2410开发板的测试代码,包括lcd
💻 C
字号:
/*
*********************************************************
* Copyright (c)
* All rights reserved.				            
*
* 文件名称:main_DispHZ.c
* 文件标识:程序实现体
* 摘    要:本文件是测试LCD字符显示功能
*
* 当前版本:1.0
* 作    者:刘征
* 完成日期:2005.4.3
*
* 取代版本:
* 作    者:
* 完成日期:
*********************************************************
*/

/*
*********************************************************
*  					 头文件
*********************************************************
*/
#include "2410addr.h"
#include "2410lib.h"
#include "def.h"
#include "lcdlib.h"
#include "glib.h"
#include "LCD_DispHZ.h"

/*
*********************************************************
*  					  变量
*********************************************************
*/
char *TXT[18] =
{
    {"          S3c2410 1.01 开发平台\n"},                //0
    {" 1. CPU S3c2410(Samsung ARM920T 208MHz)\n"},      //1
    {" 2. Flash ROM  16MB(E28F128J3A150)\n"},                //2
    {" 3. RAM  64MB SDRAM, 两片32MB\n"},               //3
    {" 4. NAND Flash  64MB\n"},            //4
    {" 5. 处理器支持NOR 或 NAND Flash 启动 \n"},                        //5
    {" 6. 网络:基于cs8900a的10M网络\n"},             //6
    {" 7. 声音:基于uda1341的声音输入输出\n"},                  //7 
    {" 8. 串口:2个九针串口座.插针引出另外一个串口可以焊接红外模块\n"},                     //8
    {" 9. USB host:2个usb host\n"},                    //9
    {"10. USB device:1个usb device\n"},              //12
    {"11. IIC EEPROM  AT24C08\n"},                       //15
    {"12. SD卡:标准SD卡接口\n"},                       //16
    {"13. LCD接口:支持各款tft lcd和stn lcd\n"},                    //17
    {"14. 按键与LED: 板上4个按键 5个led  \n"},                 //18
    {"15. 电源指示LED 及系统复位键\n"},                  //19
    {"16. CF卡:标准CF卡接口\n"},                        //20
    {"17. RTC电池: 3v RTC电池\n"},                            //21
};

/*
*********************************************************
* 函数介绍:本函数被用来用作测试LCD字符显示功能。 				
* 输入参数:无
* 输出参数:无
* 返回值  :无
*********************************************************
*/

void Main(void)
{
	U8 key = 0;
	Port_Init();  //端口初始化
    Isr_Init();   //中断初始化
    
    Uart_Init(0,115200);  //串口初始化 波特率为115200
    Uart_Select(1);  //选者串口0
    ChangeClockDivider(1,1);          // 1:2:4
    ChangeMPllValue(0xa1,0x3,0x1);    // FCLK=202.8MHz  
    
    Uart_Printf("Display Hz/letter test!\n");
    
    Lcd_Port_Init();
    Lcd_Init(MODE_TFT_16BIT_640480);
    Glib_Init(MODE_TFT_16BIT_640480);
    
    Lcd_PowerEnable(0, 1);
    Lcd_EnvidOnOff(1);
    Glib_ClearScr(0, MODE_TFT_16BIT_640480);
	while(1)
	{
	    Uart_Printf("Press 'l'or'L' to Display Hz/letter!!!\n");
		//接收串口字符
		key = Uart_Getch();
		
		if(key == 'l' || key == 'L')
		{
			Lcd_GotoXY(0,0);        
	        Lcd_printf(0xf800,"%s",TXT[0]);
	        Delay(500);

	        Lcd_GotoXY(0,1);        
	        Lcd_printf(0xf800,"%s",TXT[1]);
	        Delay(500);

	        Lcd_GotoXY(0,2);        
	        Lcd_printf(0xf800,"%s",TXT[2]);
	        Delay(500);

	        Lcd_GotoXY(0,3);        
	        Lcd_printf(0xf800,"%s",TXT[3]);
	        Delay(500);

	        Lcd_GotoXY(0,4);        
	        Lcd_printf(0xf800,"%s",TXT[4]);
	        Delay(500);

	        Lcd_GotoXY(0,5);        
	        Lcd_printf(0xf800,"%s",TXT[5]);
	        Delay(500);

	        Lcd_GotoXY(0,6);        
	        Lcd_printf(0xf800,"%s",TXT[6]);
	        Delay(500);

	        Lcd_GotoXY(0,7);        
	        Lcd_printf(0xf800,"%s",TXT[7]);
	        Delay(500);

	        Lcd_GotoXY(0,8);        
	        Lcd_printf(0xf800,"%s",TXT[8]);
	        Delay(500);

	        Lcd_GotoXY(0,9);        
	        Lcd_printf(0xf800,"%s",TXT[9]);
	        Delay(500);

	        Lcd_GotoXY(0,10);        
	        Lcd_printf(0xf800,"%s",TXT[10]);
	        Delay(500);

	        Lcd_GotoXY(0,11);        
	        Lcd_printf(0xf800,"%s",TXT[11]);
	        Delay(500);
	        
	        Lcd_GotoXY(0,12);        
	        Lcd_printf(0xf800,"%s",TXT[12]);
	        Delay(500);

	        Lcd_GotoXY(0,13);        
	        Lcd_printf(0xf800,"%s",TXT[13]);
	        Delay(500);
	        
	        Lcd_GotoXY(0,14);        
	        Lcd_printf(0xf800,"%s",TXT[14]);
	        Delay(500);
	        
	        Lcd_GotoXY(0,15);        
	        Lcd_printf(0xf800,"%s",TXT[15]);
	        Delay(500);
	        
	        Lcd_GotoXY(0,16);        
	        Lcd_printf(0xf800,"%s",TXT[16]);
	        Delay(500);
	        
	        Lcd_GotoXY(0,17);        
	        Lcd_printf(0xf800,"%s",TXT[17]);
	        Delay(500); 
	        
	        //==================
	        Glib_ClearScr(0, MODE_TFT_16BIT_640480);
	        key = 0;
	    }
	    else
	    {
	    	Uart_Printf("Please press 'l'or'L' again!!!\n");
	    	key = 0;
	    }
	}
}

⌨️ 快捷键说明

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