/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: target.c
** Last modified Date: 2004-09-17
** Last Version: 1.0
** Descriptions: header file of the specific codes for LPC2100 target boards
** Every project should include a copy of this file, user may modify it as needed
**------------------------------------------------------------------------------------------------------
** Created by: Chenmingji
** Created date: 2004-02-02
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by: Chenmingji
** Modified date: 2004-09-17
** Version: 1.01
** Descriptions: Renewed the template, added more compiler supports
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#define IN_TARGET
#include "config.h"
/*********************************************************************************************************
** Function name: IRQ_Exception
**
** Descriptions: interrupt exceptional handler , change it as needed
**
** input parameters: None
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Chenmingji
** Created Date: 2004/02/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
void __irq IRQ_Exception(void)
{
while(1); // change it to your code 这一句替换为自己的代码
}
/*********************************************************************************************************
** Function name: FIQ_Exception
**
** Descriptions: Fast interrupt exceptional handler , change it as needed
**
** input parameters: None
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Chenmingji
** Created Date: 2004/02/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
void FIQ_Exception(void)
{
while(1); // change it to your code 这一句替换为自己的代码
}
/*********************************************************************************************************
** Function name: TargetInit
**
** Descriptions: Initialize the target board; it is called in a necessary place, change it as
** needed
**
** input parameters: None
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Chenmingji
** Created Date: 2004/02/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
void TargetInit(void)
{
/* 添加自己的代码 */
/* Add your codes here */
}
/*********************************************************************************************************
** Function name: TargetResetInit
**
** Descriptions: Initialize the target board before running the main() function; User may
** change it as needed, but may not deleted it.
**
** input parameters: None
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Chenmingji
** Created Date: 2004/02/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
void TargetResetInit(void)
{
#ifdef __DEBUG_RAM
MEMMAP = 0x2; //remap
#endif
#ifdef __DEBUG_FLASH
MEMMAP = 0x1; //remap
#endif
#ifdef __IN_CHIP
MEMMAP = 0x1; //remap
#endif
/* 设置系统各部分时钟 */
/* Set system timers for each component */
PLLCON = 1;
#if (Fpclk / (Fcclk / 4)) == 1
VPBDIV = 0;
#endif
#if (Fpclk / (Fcclk / 4)) == 2
VPBDIV = 2;
#endif
#if (Fpclk / (Fcclk / 4)) == 4
VPBDIV = 1;
#endif
#if (Fcco / Fcclk) == 2
PLLCFG = ((Fcclk / Fosc) - 1) | (0 << 5);
#endif
#if (Fcco / Fcclk) == 4
PLLCFG = ((Fcclk / Fosc) - 1) | (1 << 5);
#endif
#if (Fcco / Fcclk) == 8
PLLCFG = ((Fcclk / Fosc) - 1) | (2 << 5);
#endif
#if (Fcco / Fcclk) == 16
PLLCFG = ((Fcclk / Fosc) - 1) | (3 << 5);
#endif
PLLFEED = 0xaa;
PLLFEED = 0x55;
while((PLLSTAT & (1 << 10)) == 0);
PLLCON = 3;
PLLFEED = 0xaa;
PLLFEED = 0x55;
/* 设置存储器加速模块 */
/* Set memory accelerater module*/
MAMCR = 0;
#if Fcclk < 20000000
MAMTIM = 1;
#else
#if Fcclk < 40000000
MAMTIM = 2;
#else
MAMTIM = 3;
#endif
#endif
MAMCR = 2;
/* 初始化VIC */
/* initialize VIC*/
VICIntEnClr = 0xffffffff;
VICVectAddr = 0;
VICIntSelect = 0;
/* 添加自己的代码 */
/* Add your codes here */
}
/*********************************************************************************************************
** 以下为一些与系统相关的库函数的实现
** 具体作用请ads的参考编译器与库函数手册
** 用户可以根据自己的要求修改
********************************************************************************************************/
/*********************************************************************************************************
** The implementations for some library functions
** For more details, please refer to the ADS compiler handbook and The library
** function manual
** User could change it as needed
********************************************************************************************************/
#include "rt_sys.h"
#include "stdio.h"
#pragma import(__use_no_semihosting_swi)
int __rt_div0(int a)
{
a = a;
return 0;
}
int fputc(int ch,FILE *f)
{
ch = ch;
f = f;
return 0;
}
int fgetc(FILE *f)
{
f = f;
return 0;
}
int _sys_close(FILEHANDLE fh)
{
fh = fh;
return 0;
}
int _sys_write(FILEHANDLE fh, const unsigned char * buf,
unsigned len, int mode)
{
fh = fh;
buf = buf;
len =len;
mode = mode;
return 0;
}
int _sys_read(FILEHANDLE fh, unsigned char * buf,
unsigned len, int mode)
{
fh =
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
simple_example1.zip (50个子文件)
simple_example1
key_led.hex 9KB
GPIO_KeyIn
Last Loaded GPIO_KeyIn.DBK 195KB
GPIO_KeyIn.mcp 207KB
GPIO_KeyIn_Data
RelInFLASH
TargetDataWindows.tdt 54KB
DebugInRAM
ObjectCode
IRQ.o 1KB
target.o 35KB
Startup.o 4KB
main.o 29KB
TargetDataWindows.tdt 74KB
GPIO_KeyIn.axf 17KB
CWSettingsWindows.stg 3KB
DebugInFLASH
ObjectCode
IRQ.o 1KB
target.o 34KB
Startup.o 3KB
main.o 35KB
TargetDataWindows.tdt 84KB
GPIO_KeyIn.axf 22KB
GPIO_KeyIn.pdsprj.DESKTOP-8LOKJDH.Ray.workspace 328B
GPIO_KeyIn.PWI 4KB
Backup Of GPIO_KeyIn.DBK 195KB
_desktop.ini 8B
src
STARTUP.LST 14KB
tr.lnp 41B
main.c 3KB
tr.M51 3KB
aaaaa.arm.uvproj 580B
mem_b.scf 1KB
STARTUP.A51 6KB
inc.h 3KB
config.h 4KB
tr.uvgui_Administrator.bak 76KB
aaaaa.arm_uvproj.bak 0B
target.h 4KB
tr_uvopt.bak 6KB
tr.plg 208B
tr.uvgui.Administrator 79KB
_desktop.ini 8B
target.c 9KB
aaaaa.arm.uvopt 49KB
STARTUP.OBJ 758B
IRQ.s 3KB
tr.uvopt 6KB
mem_a.scf 1KB
mem_c.scf 1KB
Startup.s 11KB
tr_uvproj.bak 13KB
LPC2294.h 38KB
tr.hex 69B
tr.uvproj 13KB
GPIO_KeyIn.DSN 195KB
共 50 条
- 1
Jeff·Ray
- 粉丝: 124
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0