?? d13config.h
字號:
/****************************************Copyright (c)**************************************************
** Guangzhou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: D13Config.h
** Last modified Date: 2004-12-10
** Last Version: V1.0
** Descriptions: ISP1181B (D13) 設備端驅動程序 硬件配置頭文件
** Soft Packet of USB Driver: the Driver of Device of ISP1181B(D13)
** the Header Files of Hardware Configuration
**------------------------------------------------------------------------------------------------------
** Created by: Ming Yuan Zheng
** Created date: 2004-12-10
** Version: V1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
typedef unsigned char INT8U; /* 無符號8位整型變量 */
typedef signed char INT8; /* 有符號8位整型變量 */
typedef unsigned short INT16U; /* 無符號16位整型變量 */
typedef signed short INT16; /* 有符號16位整型變量 */
typedef unsigned int INT32U; /* 無符號32位整型變量 */
typedef signed int INT32; /* 有符號32位整型變量 */
typedef float FP32; /* 單精度浮點數(32位長度) */
typedef double FP64; /* 雙精度浮點數(64位長度) */
#define D13_16BIT_EN 1 //是否使用16位數據總線訪問 enable or disable 16bit data bus
/* ISP1181B(D13) 命令地址與數據地址 */
/* the command and data address of ISP1181B(D13) */
#if D13_16BIT_EN
#define D13_COM (*((volatile INT16U *) 0x82000006)) //16位總線方式下的命令地址 command address under 16-bit data bus
#define D13_DAT (*((volatile INT16U *) 0x82000004)) //16位總線方式下的數據地址 data address under 16-Bit data bus
#else
#define D13_COM (*((volatile INT8U *) 0x82000001)) //8位總線方式下的命令地址 command adddress under 8-bit data bus
#define D13_DAT (*((volatile INT8U *) 0x82000000)) //8位總線方式下的數據地址 data adderss under 8-bit data bus
#endif
/* 設定 ISP1181B(D13) 與 LPC220 P0 間的連線引腳數 */
/* configure the pin number of connection between ISP1181B and the P0 of LPC2200 */
#define USBRST_NUM 10 //RESET 引腳連接到 LPC2200 P0 口引腳的引腳數 pin num of LPC2200 P0 to ISP1181B RESET
#define SUSP_NUM 13 //SUSPEND 引腳連接到 LPC2200 P0 口引腳的引腳數 pin num of LPC2200 P0 to ISP1181B SUSPEND
#define WKUP_NUM 11 //WAKEUP 引腳連接到 LPC2200 P0 口引腳的引腳數 pin num of LPC2200 P0 to ISP1181B WAKEUP
/* 設定 ISP1181B(D13) 各端口的功能 */
/* configure the function of all port of ISP1181B */
#define USBRST_GPIO() PINSEL0 &= ~(3 << (USBRST_NUM * 2)) //初始化 為GPIO initialize RESET is GPIO
#define SUSP_GPIO() PINSEL0 &= ~(3 << (SUSP_NUM * 2)) //初始化SUSPEND 為GPIO initialize SUSPEND is GPIO
#define WKUP_GPIO() PINSEL0 &= ~(3 << (WKUP_NUM * 2)) //初始化WAKEUP 為GPIO initialize WAKEUP is GPIO
/* 設定 LPC2200 連接到ISP1181B 各端口的方向 */
/* configure the direction of all port that LPC220 is connected to ISP1181B */
#define USBRST_OUT() IO0DIR |= (1 << USBRST_NUM) //設定RESET 引腳為輸出口 set RESET is output
#define SUSP_IN() IO0DIR &= ~(1 << SUSP_NUM) //設定SUSPEND 引腳為輸入口 set SUSPEND is input
#define WKUP_OUT() IO0DIR |= (1 << WKUP_NUM) //設定WAKEUP 引腳為輸出口 set WAKEUP is output
/* 置 ISP1181B(D13) 各端口為高電平或低電平 */
/* the macro define that set logical voltage of the ISP1181B port */
#define SET_USBRST() IO0SET |= (1 << USBRST_NUM) //置RESET 為高電平 set RESET high
#define SET_WKUP() IO0SET |= (1 << WKUP_NUM) //置WAKEUP 為高電平 set WAKEUP high
#define CLR_USBRST() IO0CLR |= (1 << USBRST_NUM) //置RESET 為低電平 clear RESET low
#define CLR_WKUP() IO0CLR |= (1 << WKUP_NUM) //置WAKEUP 為低電平 clear WAKEUP low
/* 配置 ISP1181B(D13) 到 LPC2200 的中斷引腳 */
/* configure the interrupt pin that LPC2200 is connected to ISP1181B */
#define INIT_INTD13() PINSEL1 &= 0xFFFFFFFC;PINSEL1 |= 0x01 //初始化 INT 為中斷輸入口 initialize INT is interrupt input
#define CLR_INTD13() EXTINT = 0x01 //清除EINT0中斷標志 clear EINT0 interrupt flag of LPC2200
#define CLR_INT() VICVectAddr = 0x00 //通知中斷結束 inform LPC2200 the end of interrupt
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -