/****************************************Copyright (c)************************************************** ** 广州致远电子有限公司 ** ** http://www.21cm.com.cn ** 数据类型的定义 系统时钟 总线的重要参数 **--------------文件信息-------------------------------------------------------------------------------- **文 件 名: config.h **创 建 人: 黄绍斌 **最后修改日期: 2005年11月11日 **描 述: 用户配置文件 ** **--------------历史版本信息---------------------------------------------------------------------------- ** 创建人: ** 版 本: ** 日 期: ** 描 述: **------------------------------------------------------------------------------------------------------ ********************************************************************************************************/ // 这一段无需改动 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #ifndef NULL #define NULL (void *)0 #endif typedef unsigned char uint8; /* 无符号8位整型变量 */ typedef signed char int8; /* 有符号8位整型变量 */ typedef unsigned short uint16; /* 无符号16位整型变量 */ typedef signed short int16; /* 有符号16位整型变量 */ typedef unsigned int uint32; /* 无符号32位整型变量 */ typedef signed int int32; /* 有符号32位整型变量 */ typedef float fp32; /* 单精度浮点数(32位长度) */ typedef double fp64; /* 双精度浮点数(64位长度) */ /********************************/ /* ARM的特殊代码 */ /********************************/ // 这一段无需改动 #include "s3c2410.h" #include <stdio.h> #include <ctype.h> #include <stdlib.h> // IRQ中断向量地址表 extern uint32 VICVectAddr[]; // 使能/禁能IRQ、FIQ中断 __swi(0x00) void SwiHandle1(int Handle); #define IRQDisable() SwiHandle1(0) #define IRQEnable() SwiHandle1(1) #define FIQDisable() SwiHandle1(2) #define FIQEnable() SwiHandle1(3) /* CPU时钟设置(PLLCON控制值) */ /* 50.00MHz (外部晶振为12MHz时) */ //#define MDIV_50 0x5C //#define PDIV_50 0x4 //#define SDIV_50 0x2 /* 200.00MHz (外部晶振为12MHz时) */ /* 设置值为:m=100,p=6,s=0, MPLL=FCLK=12*100/6=200MHz */ #define MDIV_200 0x5C #define PDIV_200 0x4 #define SDIV_200 0x0 #define MPLLCON_200 ((MDIV_200 << 12) | (PDIV_200 << 4) | (SDIV_200)) /* 系统时钟宏定义 */ #define FCLK (200*1000000) /* 系统时钟,由target.c文件的TargetResetInit()设置 */ #define HCLK (FCLK/2) /* HCLK只能为FCLK除上1、2 */ #define PCLK (HCLK/2) /* PCLK只能为HCLK除上1、2 */ /* 总线宽度控制定义(0表示8位,1表示16位,2表示32位) */ #define DW8 (0x0) #define DW16 (0x1) #define DW32 (0x2) #define WAIT (0x1<<2) #define UBLB (0x1<<3) /* Bank时序控制(位域)定义 */ #define MT 15 /* 存储类型选择,仅对Bank6和Bank7有效 (2bit) */ #define Trcd 2 /* RAS到CAS延迟,仅对SDRAM有效 (2bit) */ #define SCAN 0 /* 列地址位数,仅对SDRAM有效 (2bit) */ #define Tacs 13 /* 在nGCSn有效之前,地址信号的建立时间 (2bit) */ #define Tcos 11 /* 在nOE有效之前,片选的建立时间 (2bit) */ #define Tacc 8 /* 访问周期 (3bit) */ #define Tcoh 6 /* nOE结束之后,片选信号的保持时间 (2bit) */ #define Tcah 4 /* nGCSn结束之后,地址信号的保持时间 (2bit) */ #define Tacp 2 /* Page模式的访问周期 (2bit) */ #define PMC 0 /* Page模式配置 (2bit) */ /********************************/ /* 应用程序配置 */ /********************************/ // 以下根据需要改动 /**** 外部总线配置,用户可根据实际需要修改 ****/ #define B7_BWCON (DW16|WAIT|UBLB) #define B6_BWCON (DW32|UBLB) /* SDRAM所用的Bank,不要修改 */ #define B5_BWCON (DW16|WAIT|UBLB) #define B4_BWCON (DW16|WAIT|UBLB) #define B3_BWCON (DW16|WAIT|UBLB) #define B2_BWCON (DW16|WAIT|UBLB) #define B1_BWCON (DW16|WAIT|UBLB) #define B7_BANKCON ((0<<MT)|(1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) #define B6_BANKCON ((3<<MT)|(1<<Trcd)|(1<<SCAN)) /* SDRAM所用的Bank,不要修改 */ #define B5_BANKCON ((1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) #define B4_BANKCON ((1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) #define B3_BANKCON ((1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) #define B2_BANKCON ((1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) #define B1_BANKCON ((1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) #define B0_BANKCON ((1<<Tacs)|(1<<Tcos)|(7<<Tacc)|(1<<Tcoh)|(1<<Tcah)|(1<<Tacp)|(0<<PMC)) /********************************/ /* 用户包含文件 */ /********************************/ // 以下根据需要改动 #include <setjmp.h> #include <rt_misc.h> #include <string.h> #include "target.h" //This line may not be deleted 这一句不能删除 /********************************************************************************************************* ** End Of File ********************************************************************************************************/ |
|