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

📄 44bmon.c

📁 lcddemo-1(2004版) -- 320X240 STN 灰度LCD 测试 此代码在SDT2.51下调试通过。运行时LED会闪烁一下
💻 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;
extern int Image$$RW$$Base;
//static int delayLoopCount=400;


void Main(void)
{
    int i;
    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,57600);
    
    //Lcd_Init();     //to avoid LCD damage.

    Delay(1000);
    Uart_Select(0); //Select UART0
    /*******************************/
    /*          Banner             */
    /*******************************/
    Uart_Printf("\n    uuuuuuu    uuuuuu      uu       uu  uuuuuu      uuu   uuuu uuuu ");
	Uart_Printf("\n     uu   uu  uu   uu     uuu      uuu   uu  uu    uu uu   uu   uu  ");
	Uart_Printf("\n     uu uu    uu   uu    uuuu     uuuu   uu  uu   uu   uu   uu uu   ");
	Uart_Printf("\n     uu uu    uu        uu uu    uu uu   uu  uu   uu   uu   uu uu   ");
	Uart_Printf("\n     uuuuu     uu       uu uu    uu uu   uuuuu    uu   uu    uuu    ");
	Uart_Printf("\n     uu uu      uuu    uu  uu   uu  uu   uu  uu   uu   uu    uuu    ");
	Uart_Printf("\n     uu uu        uu   uu  uu   uu  uu   uu   uu  uu   uu    uuu    ");
	Uart_Printf("\n     uu            uu  uuuuuuu  uuuuuuu  uu   uu  uu   uu   uu uu   ");
	Uart_Printf("\n     uu       uu   uu      uu       uu   uu   uu  uu   uu   uu uu   ");
	Uart_Printf("\n     uu       uu   uu      uu       uu   uu  uu    uu uu   uu   uu  ");
    Uart_Printf("\n    uuuu      uuuuuu     uuuuu    uuuuu uuuuuu      uuu   uuuu uuuu \n");
	Uart_Printf("\n* Lcd Demo for FS44B0X V1.01");    
	Uart_Printf("\n* http://www.uCdragon.com");
	Uart_Printf("\n* Data: 2004.1"); 
	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();
	Lcd_DispON();
    Slib_Printf("\n****************************************");
	Slib_Printf("\n      #        #######     ###     ###");
	Slib_Printf("\n     ###       ##     ##   ####   ####");
	Slib_Printf("\n    ## ##      ##     ##   ## ## ## ##");
	Slib_Printf("\n   ##   ##     #######     ##  ###  ##");
	Slib_Printf("\n  #########    ##   ##     ##   #   ##");
	Slib_Printf("\n ##       ##   ##    ##    ##       ##");
	Slib_Printf("\n###       ### ####   #### ####     ####");
    Slib_Printf("\n****************************************");
    Slib_Printf("\n* Lcd Demo for FS44B0X V1.01");    
	Slib_Printf("\n* http://www.uCdragon.com");
	Slib_Printf("\n* Data: 2004.1"); 
	
	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 + -