?? config.h
字號(hào):
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.zyinside.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: config.h
** Last modified Date: 2005-12-31
** Last Version: v1.0
** Descriptions: 用戶配置頭文件
**
**------------------------------------------------------------------------------------------------------
** Created By: 黃紹斌
** Created date: 2005-12-31
** Version: v1.0
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#ifndef __CONFIG_H
#define __CONFIG_H
//------------------------------------------------------------------------------------------------------
/********************************************************************************************************
** "以下為系統(tǒng)配置"
** system configs in here
********************************************************************************************************/
// 這一段無需改動(dòng)
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL (void *)0
#endif
typedef unsigned char uint8; /* 無符號(hào)8位整型變量 */
typedef signed char int8; /* 有符號(hào)8位整型變量 */
typedef unsigned short uint16; /* 無符號(hào)16位整型變量 */
typedef signed short int16; /* 有符號(hào)16位整型變量 */
typedef unsigned int uint32; /* 無符號(hào)32位整型變量 */
typedef signed int int32; /* 有符號(hào)32位整型變量 */
typedef float fp32; /* 單精度浮點(diǎn)數(shù)(32位長度) */
typedef double fp64; /* 雙精度浮點(diǎn)數(shù)(64位長度) */
/*********************************************************************************************************
** "以下為程序配置"
** project configs in here
********************************************************************************************************/
// 這一段無需改動(dòng)
#include "S3C2410.h"
#include "target.h"
#include "UART.h"
#include "LCDDRIVE.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時(shí)鐘設(shè)置(PLLCON控制值) */
/* 50.00MHz (外部晶振為12MHz時(shí)) */
#define MDIV_50 0x5C
#define PDIV_50 0x4
#define SDIV_50 0x2
/* 200.00MHz (外部晶振為12MHz時(shí)) */
/* 設(shè)置值為: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))
/* 系統(tǒng)時(shí)鐘宏定義 */
#define FCLK (200*1000000) /* 系統(tǒng)時(shí)鐘,由target.c文件的TargetResetInit()設(shè)置 */
#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時(shí)序控制(位域)定義 */
#define MT 15 /* 存儲(chǔ)類型選擇,僅對(duì)Bank6和Bank7有效 (2bit) */
#define Trcd 2 /* RAS到CAS延遲,僅對(duì)SDRAM有效 (2bit) */
#define SCAN 0 /* 列地址位數(shù),僅對(duì)SDRAM有效 (2bit) */
#define Tacs 13 /* 在nGCSn有效之前,地址信號(hào)的建立時(shí)間 (2bit) */
#define Tcos 11 /* 在nOE有效之前,片選的建立時(shí)間 (2bit) */
#define Tacc 8 /* 訪問周期 (3bit) */
#define Tcoh 6 /* nOE結(jié)束之后,片選信號(hào)的保持時(shí)間 (2bit) */
#define Tcah 4 /* nGCSn結(jié)束之后,地址信號(hào)的保持時(shí)間 (2bit) */
#define Tacp 2 /* Page模式的訪問周期 (2bit) */
#define PMC 0 /* Page模式配置 (2bit) */
/*********************************************************************************************************
** "以下為應(yīng)用程序配置"
** project configs in here
********************************************************************************************************/
// 以下根據(jù)需要改動(dòng)
/**** 外部總線配置,用戶可根據(jù)實(shí)際需要修改 ****/
#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))
/* 是否顯示液晶背景圖片 */
#define DISP_BGPIC 0 /* 非0時(shí)表示需要顯示 */
/* 串口(UART0/UART1)波特率 */
#define UART_BPS 115200 /* 定義通訊波特率 */
/*------------------------------------------------------------------------------------------------------*/
/* 其它包含文件在這里 */
/* header files in here */
//------------------------------------------------------------------------------------------------------
/* 程序自己定義的內(nèi)容 */
/* other project configs in here */
//------------------------------------------------------------------------------------------------------
#endif // __CONFIG_H
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -