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

📄 main.c

📁 嵌入式系统设计与开发实例详解--基于ARM的应用(采用ARM7TDMI内核的、三星公司推出的S3C44B0X) 第一部分包含:ADCtest,ARPscan,ColorLCDtest,EINTtes
💻 C
字号:
#include <string.h>
#include <stdio.h>
#include "Target\44blib.h"
#include "adctest\adc.h"
/********************************************/
//   ARMSYS实验十二:A/D转换器应用 
//   描述:通过A/D转换器读入模拟信号伏值
/********************************************/
void * function[][2]=
{
	(void *)Test_Adc,		"ADC test ",
//	(void *)Test_DMA_Adc,	"DMA Adc test",
	0,0
};

void Main(void)
{
	char aa;
	int i;

	Port_Init();
	Uart_Init(0,115200);

	Led_Display(0xf);
	Delay(0);
	Beep(0x1);
	
	Uart_Select(0); //Select UART0//
	Uart_Printf("\n\n*************************************************************************");
	Beep(0x0);
	Uart_Printf("\n*                             立泰电子                                   *");
	Uart_Printf("\n*                     -S3C44B0X功能部件:ADC测试-                         *");
	Uart_Printf("\n*                          Version 1.11                                 *");    
	Uart_Printf("\n*                     Email:rao_dali@263.net                            *");
	Uart_Printf("\n*             UART Config--COM:115.2kbps,8Bit,NP,UART0                  *");
	Uart_Printf("\n*------------------Begin to Start ADC test,OK? (Y/N)--------------------*");
    
	Led_Display(0x0);
    aa= Uart_Getch();
	if((aa=='Y')||(aa=='y'))
	while(1)
	{
			i=0;
			Uart_Printf("\n");
			while(1)
			{   //display menu
				Uart_Printf("%2d:%s",i+1,function[i][1]);
				i++;
				if((int)(function[i][0])==0)
				{
					Uart_Printf("\n");
					break;
				}
				if((i%4)==0)
					Uart_Printf("\n");
			}
			Uart_Printf("\nSelect the function to test?");
			i=Uart_GetIntNum();
			i--;
			Uart_Printf("\n");
			if(i>=0 && (i<(sizeof(function)/8)) ) 
				( (void (*)(void)) (function[i][0]) )();
	}
}

⌨️ 快捷键说明

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