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

📄 44bmon.c.bak

📁 此代码在SDT2.51下调试通过
💻 BAK
字号:
#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,115200);
    
    //Lcd_Init();     //to avoid LCD damage.

    Delay(1000);
    Uart_Select(0); //Select UART0
    /*******************************/
    /*          Banner             */
    /*******************************/
    Uart_Printf("\n******************************************************");
	Uart_Printf("\n         #           #########        ###       ###");
	Uart_Printf("\n        ###          ##       ##      ####     ####");
	Uart_Printf("\n       ## ##         ##       ###     ## ##   ## ##");
	Uart_Printf("\n      ##   ##        ##       ##      ##  ## ##  ##");
	Uart_Printf("\n     #########       #########        ##   ###   ##");
	Uart_Printf("\n    ##       ##      ##     ##        ##    #    ##");
	Uart_Printf("\n   ##         ##     ##      ##       ##         ##");
	Uart_Printf("\n  ####       ####   ####     ####    ####       ####");
    Uart_Printf("\n******************************************************");
	Uart_Printf("\n* 44MON V1.0 for S3C44B0X ARM DEVELOPER BOARD V1.0");    
	Uart_Printf("\n* Copyright (C) by RT & ZQ");
	Uart_Printf("\n* Data: 2003.2"); 
	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******************************************************");
	Uart_Printf("\n\n Use USB? (Y/N)(in sdram)");

	aa= Uart_Getch();
	if((aa=='Y')||(aa=='y'))
		Uart_Printf("\n USB is active!");
		//init_usb();
	else
		Uart_Printf("\n USB is inactive!");
	while(1)
	{
		Uart_Printf("\n******************************************************");
		Uart_Printf("\n* You can selected Monitor Tools:                    *");
		Uart_Printf("\n*        N(n)>>NET test                              *");
		Uart_Printf("\n*        U(u)>>USB test                              *");
		Uart_Printf("\n*        L(l)>>LCD test                              *");
		Uart_Printf("\n*        I(i)>>IDE test                              *");
		Uart_Printf("\n*        F(f)>>CPU Functions test                    *");
		Uart_Printf("\n******************************************************");
		//i=Uart_GetIntNum();
		
		//Uart_Printf("\n i= d%",i);
		Uart_Printf("\n \b \b");
		Uart_Printf("\n \r");
		aa= Uart_Getch();
		switch(aa)
		{
		case 'i':
		case 'I':
			Uart_Printf("\n<IDE Test>");
		        break;
		case 'n':
		case 'N':
			Uart_Printf("\n<NET Test>");
		        break;
		case 'u':
		case 'U':
			Uart_Printf("\n<USB Test>");
			break;
		case 'l':
		case 'L':
			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 '4':
				
			       	    Test_LcdG4();
				    break;
			    case '1':
				    Test_LcdMono();
				case 'T':
				case 't':
					Test_LcdStr();
				    break;
			    }
			break;
		case 'f':
		case 'F':
			Uart_Printf("\n*******************************************************************************");
			Uart_Printf("\n* ARM DEVELOPE BOARD's CPU Functions Test Program:                            *");
			Uart_Printf("\n*                                                                             *");
			Uart_Printf("\n* 0: SL_IDLE Mode    1: SL_IDLE Mode20  2: IDLE Mode       3: IDLE(hard)      *");
			Uart_Printf("\n* 4: nWAIT pin       5: nXDREQ0         6: Cache           7: Adc 0,1,2,3     *");
			Uart_Printf("\n* 8: Adc with DMA    9: UART 0          10:UART 0 FIFO     11:UART 1          *");
			Uart_Printf("\n* 12:UART 1 FIFO     13:SLOW Mode       14:HOLD Mode       15:STOP Mode       *");
			Uart_Printf("\n* 16:Zdma0           17:Zdma1           18:SIO Tx/Rx       19:SIO Tx BDMA0    *");
			Uart_Printf("\n* 20:SIO Rx BDMA1    21:WDTimer         22:RTC(display)    23:RTC(Test)       *");
			Uart_Printf("\n* 24:RTC Tick        25:IIC(KS24C080)   26:Timer Int       27:Tout test       *");
			Uart_Printf("\n* 28:Ext. Int        29:Etc...          30:Change PLL      31:Test AFC(Tx)    *");
			Uart_Printf("\n* 32:Test AFC(Rx)                                                             *");
			Uart_Printf("\n*******************************************************************************");
			Uart_Printf("\n  Please select a CPU function to test!");
			i=Uart_GetIntNum();
			Uart_Printf("\ni=%d",i);
			//( (void (*)(void)) (function[i]) )();		
			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 + -