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

📄 main.c

📁 基于2410的一个iis总线测试程序 声音控制芯片是飞利浦的UTS1341 可通过xmodem发送声音文件(WAV)到内存
💻 C
字号:


#include <stdlib.h>
#include <string.h>

#include "def.h"
#include "option.h"
#include "config.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
#include "timer.h"
#include "iis.h"


//===================================================================
void   __main(void)
{   

  	char selection;//the selection for the menu
  	
    ChangeClockDivider(1,1);          // 1:2:4    
    ChangeMPllValue(0xa1,0x3,0x1);    // FCLK=202.8MHz  
    Port_Init();					  //初始化I/O口
	
    Uart_Init(0,115200);			  //初始化串口
    Uart_Select(0);					  //选择串口0
	//Uart_FIFOON();
	
	timerInit();		//initial the timer
	iisInit();			//make preparasion for iis test
	
	clearScreen();								  
    Uart_SendString("\n*S3C2410 IIS Test program v0.1 build 001\n");
    Uart_SendString("*NetKit Crop,Decell.Zhou\n");
    Uart_SendString("*Base on NK bootloader v0.2\n");
    Uart_SendString("*SAMSUNG S3C2410@135Mhz,ARM920T\n");
    Uart_SendString("*64MB SDRAM,32MB Nand Flash,2MB Nor Flash\n");
    Uart_SendString("*Baud rate=115200, no flow control,8n1\n");
	
	
	timerStart();//start the timer
	
	for(;1;){
		Uart_SendString("\nPlease select a function to test:\n");
		Uart_SendString("1.DownLoad a WAV file thougth the serial port\n");
		Uart_SendString("2.Record a WAV file thougth the mic\n");
		Uart_SendString("3.play the WAV file!\n");
		for(;(selection = Uart_GetKey()) == 0;);
		switch(selection){
			case '1':{//down load a file
				if(iisDownloadFile() == DOWNLOADSUCCESS){//if download completed successfully
					Uart_SendString("Download Successfully!\n");
				}else{//download failed
					Uart_SendString("Download failed,try again!...\n");
				}
				break;
			}
			case '2':{
				if(iisRecord() == RECORDSUCCESS){//if record completed successfully 
					Uart_SendString("Record complete successfully!!\n");
				}else{
					Uart_SendString("Record failed,try again!....\n");
				}
				break;
			}
			case '3':{
				iisPlay();
				break;
			}
			default:{
				Uart_SendString("Wrong selection!\n");
				clearScreen();
				break;
			}
		}
	
	}
	
	
}

⌨️ 快捷键说明

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