?? config.h
字號:
/*******************************************************************************************************
**config.h
********************************************************************************************************/
#ifndef __CONFIG_H
#define __CONFIG_H
//------------------------------------------------------------------------------------------------------
/********************************************************************************************************
** "以下為系統配置"
** system configs in here
********************************************************************************************************/
// 這一段無需改動
#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位長度) */
/*********************************************************************************************************
** "以下為程序配置"
** project configs in here
********************************************************************************************************/
// 這一段無需改動
#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時鐘設置(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) */
/*********************************************************************************************************
** "以下為應用程序配置"
** project configs in here
********************************************************************************************************/
// 以下根據需要改動
/**** 外部總線配置,用戶可根據實際需要修改 ****/
#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時表示需要顯示 */
/* 串口(UART0/UART1)波特率 */
#define UART_BPS 115200 /* 定義通訊波特率 */
/*------------------------------------------------------------------------------------------------------*/
/* 其它包含文件在這里 */
/* header files in here */
#include "i2c.h"
#include "ZLG7290.h"
// 定義CAT1025的器件地址
#define CAT1025 0xA0
//------------------------------------------------------------------------------------------------------
#endif // __CONFIG_H
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -