基于OHCI的USB主机 —— USB设备常量定义

USB 设备枚举过程中使用到的常量定义如下:
/*-------------------------------------------------------------------------

 * Standard Chapter 9 definition

 *-------------------------------------------------------------------------

 */

#define  GET_STATUS      0x00                                                        

#define  CLEAR_FEATURE   0x01

#define  SET_FEATURE     0x03

#define  SET_ADDRESS     0x05

#define  GET_DESCRIPTOR  0x06

#define  SET_DESCRIPTOR  0x07

#define  GET_CONFIG      0x08

#define  SET_CONFIG      0x09

#define  GET_INTERFACE   0x0a

#define  SET_INTERFACE   0x0b

#define  SYNCH_FRAME     0x0c

 

#define  DESC_DEVICE          0x0100

#define  DESC_CONFIGURATION   0x0200

#define  DESC_STRING          0x0300

#define  DESC_INTERFACE       0x0400

#define  DESC_ENDPOINT        0x0500

 

#define  USB_BUF_SIZE 512

 

#define  ENUM_DEV_IDLE              0

#define  ENUM_DEV_SEND_DEV_DESC_0   1

#define  ENUM_DEV_SET_ADDRESS       2

#define  ENUM_DEV_GET_DESC_CFG      3

#define  ENUM_DEV_FILL_DESC_DEV     4

#define  ENUM_DEV_SEND_DEV_DESC_1   5

#define  ENUM_DEV_FILL_DESC_SET     6

#define  ENUM_DEV_SET_INTERFACE     7

#define  ENUM_DEV_SET_CONFIGURATION 8

#define  ENUM_DEV_GET_CONFIGURATION 9

#define  ENUM_DEV_CHECK_CONFIG      10

#define  ENUM_DEV_CHECK_INTERFACE   11

#define  ENUM_DEV_WAIT_CMD_OVER     12

#define  ENUM_DEV_WAIT_RESET_OVER   13

#define  ENUM_DEV_GET_MAX_LUN       14

#define  ENUM_DEV_CHECK_MAX_LUN     15

#define  ENUM_DEV_RESET_ING         16

#define  ENUM_DEV_IDLE_DALAY        17

#define  ENUM_DEV_OVER              100

 

#define  USB_CMD_OVER            100

 

#define  DEV_ERROR_TD            1

#define  DEV_ERROR_CONFIGURATION    2

#define  DEV_ERROR_RESET_TIME_OUT   3

 

#define  USB_DEV_ENUM_OK            1

#define  USB_DEV_NOT_CONNECTED      2

 

#define  CC_STALL                4

 

#define  DESC_TYPE_DEVICE        1

#define  DESC_TYPE_CONFIG        2

#define  DESC_TYPE_INTERFACE        3

#define  DESC_TYPE_END_POINT        4

 

typedef   struct  _ENUM_USB_DEV

{

     unsigned   char   state ;

     unsigned   char   newState ;

     unsigned   char   oldState ;

     //unsigned char count;

     unsigned   char   errReason ;

     //unsigned int delay;

} ENUM_USB_DEV ;





本文转自 tywali 51CTO博客,原文链接:http://blog.51cto.com/lancelot/274093,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值