最終更新:2015-07-13 (月) 19:01:06 (3573d)
USB/代替設定
インターフェイスディスクリプタのbAlternateSettingを使って定義される。
- An interface may include alternate settings that allow the endpoints and/or their characteristics to be varied after the device has been configured. The default setting for an interface is always alternate setting zero.
主な使用法
- アイソクロナスエンドポイントにおいて、デフォルトの代替設定0ではバスのバンド幅を消費しない設定になっていて、データ転送を行う設定はデフォルト以外の代替設定を使用して、実際にデータ転送を行うときのみ代替設定を切り替える
- 代替設定により、ホストがいろいろな帯域幅やその他の要件と機能を持つインターフェイスを要求できるようになる
USB/HIDのインタラプト転送
- Universal Serial Bus Specification Revision 2.0 (P49)
- USB 2.0およびUSB 3.0仕様に準拠するために、デフォルトインターフェイスでのインタラプトエンドポイントは64KB/sを超えて要求してはいけない。
- All high-speed device default interface settings must not include any interrupt endpoints with a data payload size (specified via wMaxPacketSize in the endpoint descriptor) greater than 64 bytes.
- Alternate interface settings may specify larger data payload sizes for interrupt endpoints.
- If the interrupt endpoints have a large data payload size, it is recommended that additional configurations or alternate interface settings be used to specify a range of data payload sizes.
- This increases the chances that the device can be used successfully in combination with other USB devices.
- HIDは1トランザクションあたりハイスピードで最大64バイトまで。
- A device may send or receive a transaction every USB frame (1 millisecond).
- A transaction may be made up of multiple packets (token, data, handshake) but is limited in size to 8 bytes for low-speed devices and 64 bytes for high-speed devices.
リクエスト
- GET_INTERFACE?で現在アクティブなbAlternateSettingを取得
- SET_INTERFACEでアクティブなbAlternateSettingを設定