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

📄 target.c

📁 达盛EL-ARM-830
💻 C
字号:
//====================================================================
// File Name : 2410test.c
// Function  : S3C2410 Test Main Menu
// Program   : 
// Date      : May 30, 2002
// Version   : 0.0
// History
//   0.0 : Programming start (February 20,2002) -> SOP
//   1.0 (20020530) : First release for customer
//   1.1 (20020801) : Strata NOR Flash Added and etc. -> SOP
//====================================================================

#include <stdlib.h>
#include <string.h>
#include "2410addr.h"
#include "2410lib.h"
#include "mmu.h"
#include "touch2410.h"


/*
*************************************************************************************************************
-  
- 程序段说明 : 以下函数为各异常模式服务子程序。设成死循环是为调试用,一旦发生此类异常,程序便跳入异常模式服务
-              子程序,终止程序运行。
-
*************************************************************************************************************
*/

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);
}

/*
*************************************************************************************************************
-
-                                   程序段说明 : 以下函数均为初始化函数
-            
*************************************************************************************************************
*/

/*
*************************************************************************************************************
- 函数名称 : Exep_S3cint_Init(void)
- 函数说明 : 异常及中断控制器的初始化
- 输入参数 : 无
- 输出参数 : 无
*************************************************************************************************************
*/
void Isr_Init(void)
{
    pISR_UNDEF  = (unsigned)HaltUndef;
    pISR_SWI    = (unsigned)HaltSwi;
    pISR_PABORT = (unsigned)HaltPabort;
    pISR_DABORT = (unsigned)HaltDabort;
    
    rINTMOD     = 0x0;                     //All=IRQ mode
    rINTMSK     = BIT_ALLMSK;              //All interrupt is masked.
    rINTSUBMSK  = BIT_SUB_ALLMSK;          //All sub-interrupt is masked. <- April 01, 2002 SOP
}
/*
*************************************************************************************************************
- 函数名称 : TargetInit(void)
- 函数说明 : 目标板初始化程序,主函数中只需调用此函数,即可完成目标板的初始化
- 输入参数 : 无
- 输出参数 : 无
*************************************************************************************************************
*/
void Target_Init(void)
{
	MMU_Init();
	ChangeClockDivider(1,1);          // 1:2:4    
	ChangeMPllValue(0xa1,0x3,0x1);    // FCLK=202.8MHz  
	//ChangeMPllValue(0x7f,0x2,0x2);    // FCLK=101.25MHz  
    
    Port_Init();
    Isr_Init();

	Uart_Init(0,115200);
    Uart_Select(0); 
    
    Touch_Init(); 
    TouchINT_Init(); 
    
}

⌨️ 快捷键说明

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