usbdef.h

来自「使用ch375和stc 51写的usb鼠标的代码」· C头文件 代码 · 共 33 行

H
33
字号
typedef union _REQUEST_PACK
{
	unsigned char  buffer[8];
	struct
	{
		unsigned char  bmReuestType;     	//标准请求字
		unsigned char  bRequest;     			//请求代码
		unsigned int     wvalue; 					//特性选择高
		unsigned int     wIndx; 					//索引
		unsigned int     wLength; 				//数据长度
	}r;
} mREQUEST_PACKET, *mpREQUEST_PACKET;

/* standard descriptor types */
#define USB_DEVICE                      0x01
#define USB_CONFIGURATION               0x02
#define USB_STRING                      0x03
#define USB_INTERFACE                   0x04
#define USB_ENDPOINT                    0x05

#define DISABLE_REMOTE_WAKEUP           0x00 /* bit[1] = 0 */
#define ENABLE_REMOTE_WAKEUP            0x02 /* bit[1] = 1 */

/* standard feature selectors */
#define USB_ENDPOINT_STALL              0x00 /* recipient endpoint */
#define USB_DEVICE_REMOTE_WAKEUP        0x01 /* recipient device */

/* from HID Class v1.0 Draft #4 
 * class specific descriptor types from section 7.1 Standard R ests
 ***/
#define USB_HID                         0x21
#define USB_REPORT                      0x22
#define USB_PHYSICAL                    0x23

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?