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

📄 44bmon.c

📁 基于S3C44B0X的LCD320240-16色项目工程源码
💻 C
字号:
 #include <stdlib.h>
#include <string.h>
#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"
#include "..\inc\lcd.h"
#include "..\inc\lcdlib.h"
#include "..\inc\glib.h"

//unsigned int (*frameBuffer)[10];//for LCD


void Isr_Init(void);

extern int Image$$RO$$Limit;
//static int delayLoopCount=400;
extern int Image$$RW$$Base;


void Main(void)
{
    int i,x,y;
    long int m;
    char aa;

    rSYSCFG=CACHECFG;   // Using 8KB Cache//

    //__rt_lib_init(); //for ADS 1.0

    pISR_SWI=(_ISR_STARTADDRESS+0xf0);	  //for pSOS

    Port_Init();
    
//    Led_Display(0x00);
//    Delay(10000);
//    Led_Display(0x07);
//    Delay(5000);
//    Led_Display(0x0);
    
    Isr_Init();
    
    Uart_Init(0,115200);
    
    //Lcd_Init();     //to avoid LCD damage.

    Delay(1000);
    Uart_Select(0); //Select UART0
    /*******************************/
    /*          Banner             */
    /*******************************/
 
     Uart_Printf("\n*                            杭州莱顿电子                               *");
	Uart_Printf("\n*                     -S3C44B0X功能部件:LCD实验测试-                    *");
	Uart_Printf("\n*                            Version 1.1                                *");    
	Uart_Printf("\n*                        Email:aedkhz@163.com                           *");
	Uart_Printf("\n*             UART Config--COM:115.2kbps,8Bit,NP,UART0                  *");
	Uart_Printf("\n*------------------Begin to Start LCD实验测试,OK? (Y/N)-----------------*");
	Uart_Printf("\n");
    aa= Uart_Getch();
	if((aa=='Y')||(aa=='y'))
	
	Uart_Printf("\n* MCLK=%dMHz",MCLK/1000000);  
	Uart_Printf("\n* COM:115.2kbps,8Bit,NP,UART0");
	Uart_Printf("\n* RO_Limit=0x%8x",Image$$RO$$Limit);
	Uart_Printf("\n* RW_BASE =0x%8x",Image$$RW$$Base);
	Uart_Printf("\n******************************************************");
	
	Lcd_Init(MODE_MONO);
	Slib_ClearScr();
	Slib_Init();
	Glib_Init(1);
	Lcd_DispON();

	
	Slib_Printf("hello  world                              ");
	Slib_Printf("333333333333333333333333333333333333333333");
	Slib_Printf("ddddddddddddddddddddddddddddddddddddddddddd");
	Slib_Printf("66666666666666666666666666666666666666666666");
	Slib_Printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
	Slib_Printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
	Slib_Printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
	Slib_Printf("333333333333333333333333333333333333333333");
	Slib_Printf("ddddddddddddddddddddddddddddddddddddddddddd");
	Slib_Printf("66666666666666666666666666666666666666666666");
    Slib_Printf("* Lcd Demo for 44B0X V1.01");    
	Slib_Printf("* http://www.jzx51.com");
	Slib_Printf("* Data: 2005.1"); 

/*    m=0; 
    for( y = 0; y <16; y++ )		//画16色图片
    {
    	for( x =24; x >0; x-- )
    	{
			PutPixel( (x+0), y, (bmp2[m]&0xff) );    	    
	//		PutPixel( (x+1), y, (bmp[m]>>4) );    	    
    	    m++ ;
    	}
    } 
    */   
//    for( y = 160; y < 320; y++ )		//画16色图片
//    {
//    	for( x = 0; x < 240; x++ )
//    	{
//			PutPixel( (x+0), y, (bmp[m]&0x0f) );    	    
	//		PutPixel( (x+1), y, (bmp[m]>>4) );    	    
//    	    m++ ;
//    	}
//    }    
	while(1)
	{
		Uart_Printf("\n <LCD Test>PRESS ANY KEY!");
		Uart_Printf("\n R(r)>>LCD POWER RESET");
		Uart_Printf("\n U(u)>>LCD POWER UP");
		Uart_Printf("\n 1   >>LCD Mono TEST");
		Uart_Printf("\n 4   >>LCD G4 TEST");
		Uart_Printf("\n T(t)>>LCD Text TEST");
		aa= Uart_Getch();
		switch(aa)
		{
		    case 'R':
		    case 'r':
			    Lcd_PowerReset();
			    break;
		    case 'U':
		    case 'u':
			    Lcd_PowerUp();
			    break;
		    case '1':
			    Test_LcdMono();
		    case '4':
		       	Test_LcdG4();
			    break;
			case 'T':
			case 't':
				Test_LcdStr();
			    break;
			default:
				break;
		}
	}
}


void Isr_Init(void)
{
    rINTCON=0x5;    //Non-vectored,IRQ enable,FIQ disable 
    rINTMOD=0x0;    //All=IRQ mode
    //rINTMSK=~( BIT_URXD0 | BIT_GLOBAL);	//Default value=0x7ffffff
    /*pISR_FIQ,pISR_IRQ must be initialized*/
    //pISR_URXD0=(unsigned)Uart0_RxInt;
}

⌨️ 快捷键说明

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