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

📄 44btest.c

📁 57A49(320X240的LCD手册).pdf 原代码+驱动
💻 C
字号:
#include <string.h>
#include "..\inc\option.h"
#include "..\inc\44b.h"
#include "..\inc\44blib.h"
#include "..\inc\def.h"
#include "..\inc\cache.h"
#include "..\inc\uart.h"
#include "..\inc\power.h"
#include "..\inc\dma.h"
#include "..\inc\timer.h"
#include "..\inc\rtc.h"
#include "..\inc\etc.h"
#include "..\inc\iic.h"
#include "..\inc\stop.h"
#include "..\inc\extdma.h"
#include "..\inc\tp.h"
#include "..\inc\usb.h"
#include "..\inc\kb.h"
#include "..\inc\Pwm.h"
#include "..\inc\led.h"
#include "..\inc\lcd.h"
#include "..\inc\lcdlib.h"
#include "..\inc\44blcd.h"
#include "..\inc\slib.h"
#include "..\inc\uda1341.h"


void Isr_Init(void);
void HaltUndef(void);
void HaltSwi(void);
void HaltPabort(void);      
void HaltDabort(void);


//****************************************************************
// *		  S3C44B0X developer's notes			*  
// ****************************************************************
void * function[][2]=
{
	(void *)LcdInit, 	 "LCD DISPLAY     ",
	(void *)Test_Cache, 	 "Cache           ",
	(void *)Test_Kb,	 "keyboard	 ",
	(void *)Test_Uart0, 	 "UART 0          ",
	(void *)Test_Uart0Fifo,	 "UART 0 FIFO     ",
	(void *)Test_Uart1,	 "UART 1          ",
	(void *)Test_Uart1Fifo,	 "UART 1 FIFO     ",
	(void *)USBON,		 "USB TEST	 ",
	(void *)Test_HoldMode,	 "HOLD Mode       ",
	(void *)Test_Zdma0,	 "Zdma0           ",
	(void *)Test_Zdma1,	 "Zdma1           ",
	(void *)Test_WDTimer,	 "WDTimer         ",
	(void *)Display_Rtc,	 "RTC(display)    ",
	(void *)Test_Rtc_Alarm,	 "RTC(Test)       ",
	(void *)Test_Rtc_Tick,	 "RTC Tick        ",
	(void *)Test_Iic,	 "IIC(KS24C08)   ",
	(void *)Test_PLL,        "Change PLL      ",
	(void *)Test_Pwm,   "Test PWM (BEEP) ",
	(void *)Test_Led, "Test LED      ",
	(void *)IISMain, "UDA1341 Play test",
    (void *)Ts_Sep, "ADC test",
     0,0
};


void Main(void)
{
    int i;

    rSYSCFG=SYSCFG_8KB;
#if (PLLON==1)
    ChangePllValue(PLL_M,PLL_P,PLL_S);
#endif

    Isr_Init();
    Port_Init();
    Uart_Init(0,115200);
    Uart_Select(0);
    Delay(0);  //calibrate Delay()
    Delay(5000);
    Lcd_ELON();
    Lcd_Init(MODE_MONO);
    Glib_Init(MODE_MONO);
    Slib_ClearScr();
    Glib_ClearScr(0);
    Slib_SetCursor(1,11);
    Slib_Printf("HengFengRuiKe");
    Slib_SetCursor(2,8);
  	Slib_Printf("HF44B0 Test Ver V2.0");
  	Slib_SetCursor(3,8);
  	Slib_Printf("TEL: 010-63734126");
  	Slib_SetCursor(4,8);
  	Slib_Printf("TEL: 010-63726790");
  	Slib_SetCursor(5,8);
    Slib_Printf("CLK: %dHz",MCLK);
   
    
    while(1)
    {
	i=0;
    Uart_Printf("\n\n\n    欢迎使用恒丰锐科hf44b0 测试程序V2.0 (2007-08-00 )");
       
  	Uart_Printf("MCLK=%d\n\n",MCLK);
	
	while(1)
	{   //display menu
	    Uart_Printf("%2d:%s",i,function[i][1]);
	    i++;
	    if((int)(function[i][0])==0)
	    {
		Uart_Printf("\n");
		break;
	    }
	    if((i%4)==0)
		Uart_Printf("\n");
	}
	DisplayRtc();
	Uart_Printf("\nSelect the function to test?");
	i=Uart_GetIntNum();
	Uart_Printf("\n");
	if(i>=0 && (i<(sizeof(function)/8)) ) 
	    ( (void (*)(void)) (function[i][0]) )();
    }
}

void Isr_Init(void)
{
    U32 i;
    
    pISR_UNDEF=(unsigned)HaltUndef;
    pISR_SWI  =(unsigned)HaltSwi;
    pISR_PABORT=(unsigned)HaltPabort;
    pISR_DABORT=(unsigned)HaltDabort;
    
     for(i=_RAM_STARTADDRESS;i<(_RAM_STARTADDRESS+0x20);i+=4)
    {
	*((volatile unsigned *)i)=0xEA000000+0x1FFE;
    }

    //rINTCON=0x1;	  // Vectored Int. IRQ enable,FIQ disable    
    rINTCON=0x5;	  // Non-vectored,IRQ enable,FIQ disable    

    rINTMOD=0x0;	  // All=IRQ mode
    rINTMSK|=BIT_GLOBAL|BIT_EINT4567;	  // All interrupt is masked.
}


void HaltUndef(void)
{
    Uart_Printf("Undefined instruction exception!!!\n");
    while(1);
}

void HaltSwi(void)
{
    Uart_Printf("SWI exception!!!\n");
    while(1);
}

void HaltPabort(void)
{
    Uart_Printf("Pabort exception!!!\n");
    while(1);
}

void HaltDabort(void)
{
    Uart_Printf("Dabort exception!!!\n");
    while(1);
}

⌨️ 快捷键说明

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