3765|6

64

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

VC和DS做USB驱动程序应用设计 [复制链接]

我已经用DS的向导生成了一个USB驱动程序. 没有手工增加任何代码. 现在该驱动程序已经可以在插入USB器件后安装成功. 我想在该工程下再加一个界面. 直接在VC下增加一个AppWizard到该DS工程中编译很多错误. 是否应该用DS向导生成一个驱动程序后. 再用VC另开一个工程做界面和应用开发并调用该驱动程序?

最新回复

/*-------------------------------------------------------------------------- AT89X52.H Header file for the low voltage Flash Atmel AT89C52 and AT89LV52. Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved. --------------------------------------------------------------------------*/ #ifndef __AT89X52_H__ #define __AT89X52_H__ /*------------------------------------------------ Byte Registers ------------------------------------------------*/ sfr P0      = 0x80; sfr SP      = 0x81; sfr DPL     = 0x82; sfr DPH     = 0x83; sfr PCON    = 0x87; sfr TCON    = 0x88; sfr TMOD    = 0x89; sfr TL0     = 0x8A; sfr TL1     = 0x8B; sfr TH0     = 0x8C; sfr TH1     = 0x8D; sfr P1      = 0x90; sfr SCON    = 0x98; sfr SBUF    = 0x99; sfr P2      = 0xA0; sfr IE      = 0xA8; sfr P3      = 0xB0; sfr IP      = 0xB8; sfr T2CON   = 0xC8; sfr T2MOD   = 0xC9; sfr RCAP2L  = 0xCA; sfr RCAP2H  = 0xCB; sfr TL2     = 0xCC; sfr TH2     = 0xCD; sfr PSW     = 0xD0; sfr ACC     = 0xE0; sfr B       = 0xF0; /*------------------------------------------------ P0 Bit Registers ------------------------------------------------*/ sbit P0_0 = 0x80; sbit P0_1 = 0x81; sbit P0_2 = 0x82; sbit P0_3 = 0x83; sbit P0_4 = 0x84; sbit P0_5 = 0x85; sbit P0_6 = 0x86; sbit P0_7 = 0x87; /*------------------------------------------------ PCON Bit Values ------------------------------------------------*/ #define IDL_    0x01 #define STOP_   0x02 #define PD_     0x02    /* Alternate definition */ #define GF0_    0x04 #define GF1_    0x08 #define SMOD_   0x80 /*------------------------------------------------ TCON Bit Registers ------------------------------------------------*/ sbit IT0  = 0x88; sbit IE0  = 0x89; sbit IT1  = 0x8A; sbit IE1  = 0x8B; sbit TR0  = 0x8C; sbit TF0  = 0x8D; sbit TR1  = 0x8E; sbit TF1  = 0x8F; /*------------------------------------------------ TMOD Bit Values ------------------------------------------------*/ #define T0_M0_   0x01 #define T0_M1_   0x02 #define T0_CT_   0x04 #define T0_GATE_ 0x08 #define T1_M0_   0x10 #define T1_M1_   0x20 #define T1_CT_   0x40 #define T1_GATE_ 0x80 #define T1_MASK_ 0xF0 #define T0_MASK_ 0x0F /*------------------------------------------------ P1 Bit Registers ------------------------------------------------*/ sbit P1_0 = 0x90; sbit P1_1 = 0x91; sbit P1_2 = 0x92; sbit P1_3 = 0x93; sbit P1_4 = 0x94; sbit P1_5 = 0x95; sbit P1_6 = 0x96; sbit P1_7 = 0x97; sbit T2   = 0x90;       /* External input to Timer/Counter 2, clock out */ sbit T2EX = 0x91;       /* Timer/Counter 2 capture/reload trigger & dir ctl */ /*------------------------------------------------ SCON Bit Registers ------------------------------------------------*/ sbit RI   = 0x98; sbit TI   = 0x99; sbit RB8  = 0x9A; sbit TB8  = 0x9B; sbit REN  = 0x9C; sbit SM2  = 0x9D; sbit SM1  = 0x9E; sbit SM0  = 0x9F; /*------------------------------------------------ P2 Bit Registers ------------------------------------------------*/ sbit P2_0 = 0xA0; sbit P2_1 = 0xA1; sbit P2_2 = 0xA2; sbit P2_3 = 0xA3; sbit P2_4 = 0xA4; sbit P2_5 = 0xA5; sbit P2_6 = 0xA6; sbit P2_7 = 0xA7; /*------------------------------------------------ IE Bit Registers ------------------------------------------------*/ sbit EX0  = 0xA8;       /* 1=Enable External interrupt 0 */ sbit ET0  = 0xA9;       /* 1=Enable Timer 0 interrupt */ sbit EX1  = 0xAA;       /* 1=Enable External interrupt 1 */ sbit ET1  = 0xAB;       /* 1=Enable Timer 1 interrupt */ sbit ES   = 0xAC;       /* 1=Enable Serial port interrupt */ sbit ET2  = 0xAD;       /* 1=Enable Timer 2 interrupt */ sbit EA   = 0xAF;       /* 0=Disable all interrupts */ /*------------------------------------------------ P3 Bit Registers (Mnemonics & Ports) ------------------------------------------------*/ sbit P3_0 = 0xB0; sbit P3_1 = 0xB1; sbit P3_2 = 0xB2; sbit P3_3 = 0xB3; sbit P3_4 = 0xB4; sbit P3_5 = 0xB5; sbit P3_6 = 0xB6; sbit P3_7 = 0xB7; sbit RXD  = 0xB0;       /* Serial data input */ sbit TXD  = 0xB1;       /* Serial data output */ sbit INT0 = 0xB2;       /* External interrupt 0 */ sbit INT1 = 0xB3;       /* External interrupt 1 */ sbit T0   = 0xB4;       /* Timer 0 external input */ sbit T1   = 0xB5;       /* Timer 1 external input */ sbit WR   = 0xB6;       /* External data memory write strobe */ sbit RD   = 0xB7;       /* External data memory read strobe */ /*------------------------------------------------ IP Bit Registers ------------------------------------------------*/ sbit PX0  = 0xB8; sbit PT0  = 0xB9; sbit PX1  = 0xBA; sbit PT1  = 0xBB; sbit PS   = 0xBC; sbit PT2  = 0xBD; /*------------------------------------------------ T2CON Bit Registers ------------------------------------------------*/ sbit CP_RL2= 0xC8;      /* 0=Reload, 1=Capture select */ sbit C_T2 = 0xC9;       /* 0=Timer, 1=Counter */ sbit TR2  = 0xCA;       /* 0=Stop timer, 1=Start timer */ sbit EXEN2= 0xCB;       /* Timer 2 external enable */ sbit TCLK = 0xCC;       /* 0=Serial clock uses Timer 1 overflow, 1=Timer 2 */ sbit RCLK = 0xCD;       /* 0=Serial clock uses Timer 1 overflow, 1=Timer 2 */ sbit EXF2 = 0xCE;       /* Timer 2 external flag */ sbit TF2  = 0xCF;       /* Timer 2 overflow flag */ /*------------------------------------------------ T2MOD Bit Values ------------------------------------------------*/ #define DCEN_   0x01    /* 1=Timer 2 can be configured as up/down counter */ #define T2OE_   0x02    /* Timer 2 output enable */ /*------------------------------------------------ PSW Bit Registers ------------------------------------------------*/ sbit P    = 0xD0; sbit FL   = 0xD1; sbit OV   = 0xD2; sbit RS0  = 0xD3; sbit RS1  = 0xD4; sbit F0   = 0xD5; sbit AC   = 0xD6; sbit CY   = 0xD7; /*------------------------------------------------ Interrupt Vectors: Interrupt Address = (Number * 8) + 3 ------------------------------------------------*/ #define IE0_VECTOR        0  /* 0x03 External Interrupt 0 */ #define TF0_VECTOR        1  /* 0x0B Timer 0 */ #define IE1_VECTOR        2  /* 0x13 External Interrupt 1 */ #define TF1_VECTOR        3  /* 0x1B Timer 1 */ #define SIO_VECTOR        4  /* 0x23 Serial port */ #define TF2_VECTOR        5  /* 0x2B Timer 2 */ #define EX2_VECTOR        5  /* 0x2B External Interrupt 2 */ #endif 不知道哪里错了,说有102个error   详情 回复 发表于 2008-10-17 20:24
点赞 关注

回复
举报

92

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
请问你的inf用什么编写的啊?
 
 

回复

60

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
是driver studio的向导生成的.
 
 
 

回复

84

帖子

0

TA的资源

一粒金砂(初级)

4
 
请问用向导生成的驱动可以直接用?
比如我想写个USB驱动,应该如何生成,测试.我能用U盘试吗
 
 
 

回复

77

帖子

0

TA的资源

一粒金砂(初级)

5
 
没有用过DS,应用程序应该不能用DS生成吧?驱动归驱动,应用程序归应用程序,需要用不同的开发环境来开发。

建议多去“驱动开发网”看看。
 
 
 

回复

64

帖子

0

TA的资源

一粒金砂(初级)

6
 
放弃了DS. 太难懂了. 还不如直接学DDK. 已经找了一个开源USB驱动做了个USB数据通讯系统
 
 
 

回复

66

帖子

0

TA的资源

一粒金砂(初级)

7
 
/*--------------------------------------------------------------------------
AT89X52.H

Header file for the low voltage Flash Atmel AT89C52 and AT89LV52.
Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/

#ifndef __AT89X52_H__
#define __AT89X52_H__

/*------------------------------------------------
Byte Registers
------------------------------------------------*/
sfr P0      = 0x80;
sfr SP      = 0x81;
sfr DPL     = 0x82;
sfr DPH     = 0x83;
sfr PCON    = 0x87;
sfr TCON    = 0x88;
sfr TMOD    = 0x89;
sfr TL0     = 0x8A;
sfr TL1     = 0x8B;
sfr TH0     = 0x8C;
sfr TH1     = 0x8D;
sfr P1      = 0x90;
sfr SCON    = 0x98;
sfr SBUF    = 0x99;
sfr P2      = 0xA0;
sfr IE      = 0xA8;
sfr P3      = 0xB0;
sfr IP      = 0xB8;
sfr T2CON   = 0xC8;
sfr T2MOD   = 0xC9;
sfr RCAP2L  = 0xCA;
sfr RCAP2H  = 0xCB;
sfr TL2     = 0xCC;
sfr TH2     = 0xCD;
sfr PSW     = 0xD0;
sfr ACC     = 0xE0;
sfr B       = 0xF0;

/*------------------------------------------------
P0 Bit Registers
------------------------------------------------*/
sbit P0_0 = 0x80;
sbit P0_1 = 0x81;
sbit P0_2 = 0x82;
sbit P0_3 = 0x83;
sbit P0_4 = 0x84;
sbit P0_5 = 0x85;
sbit P0_6 = 0x86;
sbit P0_7 = 0x87;

/*------------------------------------------------
PCON Bit Values
------------------------------------------------*/
#define IDL_    0x01

#define STOP_   0x02
#define PD_     0x02    /* Alternate definition */

#define GF0_    0x04
#define GF1_    0x08
#define SMOD_   0x80

/*------------------------------------------------
TCON Bit Registers
------------------------------------------------*/
sbit IT0  = 0x88;
sbit IE0  = 0x89;
sbit IT1  = 0x8A;
sbit IE1  = 0x8B;
sbit TR0  = 0x8C;
sbit TF0  = 0x8D;
sbit TR1  = 0x8E;
sbit TF1  = 0x8F;

/*------------------------------------------------
TMOD Bit Values
------------------------------------------------*/
#define T0_M0_   0x01
#define T0_M1_   0x02
#define T0_CT_   0x04
#define T0_GATE_ 0x08
#define T1_M0_   0x10
#define T1_M1_   0x20
#define T1_CT_   0x40
#define T1_GATE_ 0x80

#define T1_MASK_ 0xF0
#define T0_MASK_ 0x0F

/*------------------------------------------------
P1 Bit Registers
------------------------------------------------*/
sbit P1_0 = 0x90;
sbit P1_1 = 0x91;
sbit P1_2 = 0x92;
sbit P1_3 = 0x93;
sbit P1_4 = 0x94;
sbit P1_5 = 0x95;
sbit P1_6 = 0x96;
sbit P1_7 = 0x97;

sbit T2   = 0x90;       /* External input to Timer/Counter 2, clock out */
sbit T2EX = 0x91;       /* Timer/Counter 2 capture/reload trigger & dir ctl */

/*------------------------------------------------
SCON Bit Registers
------------------------------------------------*/
sbit RI   = 0x98;
sbit TI   = 0x99;
sbit RB8  = 0x9A;
sbit TB8  = 0x9B;
sbit REN  = 0x9C;
sbit SM2  = 0x9D;
sbit SM1  = 0x9E;
sbit SM0  = 0x9F;

/*------------------------------------------------
P2 Bit Registers
------------------------------------------------*/
sbit P2_0 = 0xA0;
sbit P2_1 = 0xA1;
sbit P2_2 = 0xA2;
sbit P2_3 = 0xA3;
sbit P2_4 = 0xA4;
sbit P2_5 = 0xA5;
sbit P2_6 = 0xA6;
sbit P2_7 = 0xA7;

/*------------------------------------------------
IE Bit Registers
------------------------------------------------*/
sbit EX0  = 0xA8;       /* 1=Enable External interrupt 0 */
sbit ET0  = 0xA9;       /* 1=Enable Timer 0 interrupt */
sbit EX1  = 0xAA;       /* 1=Enable External interrupt 1 */
sbit ET1  = 0xAB;       /* 1=Enable Timer 1 interrupt */
sbit ES   = 0xAC;       /* 1=Enable Serial port interrupt */
sbit ET2  = 0xAD;       /* 1=Enable Timer 2 interrupt */

sbit EA   = 0xAF;       /* 0=Disable all interrupts */

/*------------------------------------------------
P3 Bit Registers (Mnemonics & Ports)
------------------------------------------------*/
sbit P3_0 = 0xB0;
sbit P3_1 = 0xB1;
sbit P3_2 = 0xB2;
sbit P3_3 = 0xB3;
sbit P3_4 = 0xB4;
sbit P3_5 = 0xB5;
sbit P3_6 = 0xB6;
sbit P3_7 = 0xB7;

sbit RXD  = 0xB0;       /* Serial data input */
sbit TXD  = 0xB1;       /* Serial data output */
sbit INT0 = 0xB2;       /* External interrupt 0 */
sbit INT1 = 0xB3;       /* External interrupt 1 */
sbit T0   = 0xB4;       /* Timer 0 external input */
sbit T1   = 0xB5;       /* Timer 1 external input */
sbit WR   = 0xB6;       /* External data memory write strobe */
sbit RD   = 0xB7;       /* External data memory read strobe */

/*------------------------------------------------
IP Bit Registers
------------------------------------------------*/
sbit PX0  = 0xB8;
sbit PT0  = 0xB9;
sbit PX1  = 0xBA;
sbit PT1  = 0xBB;
sbit PS   = 0xBC;
sbit PT2  = 0xBD;

/*------------------------------------------------
T2CON Bit Registers
------------------------------------------------*/
sbit CP_RL2= 0xC8;      /* 0=Reload, 1=Capture select */
sbit C_T2 = 0xC9;       /* 0=Timer, 1=Counter */
sbit TR2  = 0xCA;       /* 0=Stop timer, 1=Start timer */
sbit EXEN2= 0xCB;       /* Timer 2 external enable */
sbit TCLK = 0xCC;       /* 0=Serial clock uses Timer 1 overflow, 1=Timer 2 */
sbit RCLK = 0xCD;       /* 0=Serial clock uses Timer 1 overflow, 1=Timer 2 */
sbit EXF2 = 0xCE;       /* Timer 2 external flag */
sbit TF2  = 0xCF;       /* Timer 2 overflow flag */

/*------------------------------------------------
T2MOD Bit Values
------------------------------------------------*/
#define DCEN_   0x01    /* 1=Timer 2 can be configured as up/down counter */
#define T2OE_   0x02    /* Timer 2 output enable */

/*------------------------------------------------
PSW Bit Registers
------------------------------------------------*/
sbit P    = 0xD0;
sbit FL   = 0xD1;
sbit OV   = 0xD2;
sbit RS0  = 0xD3;
sbit RS1  = 0xD4;
sbit F0   = 0xD5;
sbit AC   = 0xD6;
sbit CY   = 0xD7;

/*------------------------------------------------
Interrupt Vectors:
Interrupt Address = (Number * 8) + 3
------------------------------------------------*/
#define IE0_VECTOR        0  /* 0x03 External Interrupt 0 */
#define TF0_VECTOR        1  /* 0x0B Timer 0 */
#define IE1_VECTOR        2  /* 0x13 External Interrupt 1 */
#define TF1_VECTOR        3  /* 0x1B Timer 1 */
#define SIO_VECTOR        4  /* 0x23 Serial port */

#define TF2_VECTOR        5  /* 0x2B Timer 2 */
#define EX2_VECTOR        5  /* 0x2B External Interrupt 2 */

#endif


不知道哪里错了,说有102个error
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表