www.pudn.com > usbhost_source.rar > USBDEF.H


/** 
*	USB 関連定数の宣言 
*/ 
 
/* USB1.0のリクエスト */ 
#define		GET_STATUS		0 
#define		CLEAR_FEATURE		1 
#define		SET_FEATURE		3 
#define		SET_ADDRESS		5 
#define		GET_DESCRIPTOR		6 
#define		SET_DESCRIPTOR		7 
#define		GET_CONFIGURATION	8 
#define		SET_CONFIGURATION	9 
#define		GET_INTERFACE		10 
#define		SET_INTERFACE		11 
#define		SYNCH_FRAME		12 
 
/* デハイスリクエスト */ 
/* データ転送方向 */ 
#define	DEV2HOST	0x80		/* デバイス→ホスト */ 
#define	HOST2DEV	0x00		/* ホスト→デバイス */ 
/* タイプ */ 
#define	TYPESTD		0x00 
#define	TYPECLASS	0x20 
#define	TYPEVEND	0x60 
/* 受信側 */ 
#define	RXDEVICE	0x00 
#define	RXINTERFACE	0x01 
#define	RXENDPOINT	0x02 
#define	RXOTHER		0x04 
 
 
/* ディスクリプタ名 */ 
#define		DEVICE			1	/* デバイスディスクリプタ */ 
#define		CONFIGURATION		2	/* コンフィギュレーションディスクリプタ */ 
#define		XSTRING			3	/* ストリングディスクリプタ */ 
#define		INTERFACE		4	/* インターフェースディスクリプタ */ 
#define		ENDPOINT		5	/* エンドポイント */ 
#define		HID			0x21	/*  */ 
#define		HIDREPORT		0x22	/*  */ 
#define		HIDPHYSICAL		0x23	/*  */ 
 
#define		DEVICE_REMOTE_WAKEUP	1 
#define		ENDPOINT_STALL		0 
 
/* クラスコード */ 
#define		HIDCLASS		3 
#define		NOSUBCLASS		0 
#define		BOOTSUBCLASS		1 
#define		VENDORSPEC		0xFF 
 
/* HID リクエストに関する定数 */ 
#define		GET_REPORT		1 
#define		GET_IDLE		2 
#define		GET_PROTOCOL		3 
#define		SET_REPORT		9 
#define		SET_IDLE		0xA 
#define		SET_PROTOCOL		0xB 
 
/* 各ディスクリプタの長さ */ 
#define		DEV_LENGTH		18 
#define		CFG_LENGTH		9 
#define		INT_LENGTH		9 
#define		HID_LENGTH		0 
#define		END_LENGTH		7 
 
/* 転送タイプ */ 
#define		CONTROL			0	/* コントロール転送 */ 
#define		ISO			1	/* アイソクロナス転送 */ 
#define		BULK			2	/* バルク転送 */ 
#define		INT			3	/* インタラプト転送 */ 
 
 
/* end of usbdef.h */