📄 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 + -