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

📄 2410bios.c.bak

📁 内容包含了所有2410的测试程序,比如串口,时钟,IIC,ADC等
💻 BAK
字号:
#include "def.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"

// GPB1/TOUT1 for Backlight control(PWM)
#define GPB1_TO_OUT()   (rGPBUP &= 0xfffd, rGPBCON &= 0xfffffff3, rGPBCON |= 0x00000004)
#define GPB1_TO_1()     (rGPBDAT |= 0x0002)
#define GPB1_TO_0()     (rGPBDAT &= 0xfffd)
    
	//qjy: special power on timing, please research it!
extern void Lcd_Port_Init(void);
extern void Lcd_Init(void);

*/
/******************************************************************************
【功能说明】系统主函数
******************************************************************************/
int Main(U32 RstStat)
{
	int i;
	int curr_x,curr_y;
	char code;
//	ChangeClockDivider(1, 1);	// 1:2:4
//	ChangeMPllValue(172,4,1);	//FCLK=180.0Mhz
	SetClockDivider(1, 1);
	SetSysFclk(FCLK_200M);		//to save power, use 50M
	
	Port_Init();
	Isr_Init();

	Uart_Init(0, Console_Baud);
	Uart_Select(Console_Uart);	
	
#if 1			//bank0 modified to RO_START
	MMU_Init();	//MMU should be reconfigured or turned off for the debugger, 
	//After downloading, MMU should be turned off for the MMU based program,such as WinCE.	
#else
	MMU_EnableICache();
	UsbMain();
#endif
	
	//enable GPIO,UART0,PWM TIMER,NAND FLASH module clock
//	DisableModuleClock(CLOCK_ALL);
	EnableModuleClock(CLOCK_ALL);	

	LcdBackLightOff();
	putch('\n');

	PwrKeyChkInit();

	rMISCCR &= ~(0x3007);		//USB port0,1 = normal, D0~D31 pull-up enable

	Set_Tout1_Pwm( 60 ) ;
	
	
	//turn on the LCD blacklight!
    GPB1_TO_OUT();
    GPB1_TO_1();
    
	//special power on timing, please research it!
    Lcd_Port_Init();
    Lcd_Init();

	Beep( 2000, 1000 ) ;
	
	RequestBiosTimerEvent(30, Led4Flash);	//when request, auto open bios timer
	//RequestBiosTimerEvent(20, Led2Flash);
	//RequestBiosTimerEvent(50, Led3Flash);
	//RequestBiosTimerEvent(100, Led1Flash);
	
	
	NFSearchParams((char *)&Env);
	printf("Env.Os_Auto_Flag=%x\n",Env.Os_Auto_Flag);
	
	printf("<*******************************************>\n");
	printf("<*                                         *>\n");
	printf("<*         S3C2410 Board BIOS V2006        *>\n");
	printf("<*******************************************>\n");
	curr_x=20;
	curr_y=140;
	while(1)
	{
		if(code=Uart_Getch()){
			putch(code);
			
			display_char(curr_x,curr_y,code);
			curr_x+=8;
			if(curr_x>=240){curr_x=20;curr_y+=16;}
		}
		
	}
}

⌨️ 快捷键说明

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