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

📄 44btest.c

📁 华恒S3C44B0X开发板带的测试源程序
💻 C
字号:
#include <string.h>
#include "..\inc\option.h"
#include "..\inc\44b.h"
#include "..\inc\44blib.h"
#include "..\inc\def.h"
#include "..\inc\uart.h"

void Isr_Init(void);

//****************************************************************
// *		  S3C44B0X developer's notes			*  
// ****************************************************************
void * function[][2]=
{
	(void *)Test_Uart0, 	 "UART 0          ",
	(void *)Test_Uart0Fifo,	 "UART 0 FIFO     ",
	(void *)Test_Uart1,	 "UART 1          ",
	(void *)Test_Uart1Fifo,	 "UART 1 FIFO     ",
	        0,0
};

void Main(void)
{
    Isr_Init();
    Port_Init();
    Uart_Init(0,115200);
    Uart_Select(0);
    Delay(0);  //calibrate Delay()
    Delay(5000);
  
    while(1)
    {
	int i=0;
    Uart_Printf("\n\n*********************************************************************");
    Uart_Printf("\n\n          欢迎使用恒丰锐科S3C44B0 UART 测试程序(2007)\n ");
    Uart_Printf("\n*-------------------Begin to Start UART test--------------------*");
  	Uart_Printf("\n\n");
  	 	 		
    while(1)
	{   //display menu
	    Uart_Printf("%2d:%s",i,function[i][1]);
	    i++;
	    if((int)(function[i][0])==0)
	    {
	    Uart_Printf("\n");
		break;
	    }
    }
	Uart_Printf("\nSelect the function to test:");
	i=Uart_GetIntNum();
	Uart_Printf("\n");
	if((i>=0)&&(i<4)) ( (void(*)(void))(function[i][0]) )();
	}	
}


void Isr_Init(void)
{
    U32 i;
    
    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.
}

⌨️ 快捷键说明

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