|
System.USB.Descriptors | Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
|
|
|
|
|
Description |
USB devices report their attributes using descriptors. A descriptor is a data
structure with a defined format. Using descriptors allows concise storage of
the attributes of individual configurations because each configuration may
reuse descriptors or portions of descriptors from other configurations that
have the same characteristics. In this manner, the descriptors resemble
individual data records in a relational database.
Where appropriate, descriptors contain references to string descriptors
(StrIx) that provide textual information describing a descriptor in
human-readable form. The inclusion of string descriptors is optional. If a
device does not support string descriptors, string reference fields must be
reset to zero to indicate no string descriptor is available.
|
|
Synopsis |
|
|
|
|
Device descriptor
|
|
|
A structure representing the standard USB device descriptor.
This descriptor is documented in section 9.6.1 of the USB 2.0 specification.
This structure can be retrieved by deviceDesc.
| Instances | |
|
|
Querying device descriptors
|
|
|
USB specification release
number in binary-coded
decimal.
|
|
|
USB-IF class code for the
device.
|
|
|
USB-IF subclass code for the
device, qualified by the
deviceClass value.
|
|
|
USB-IF protocol code for the
device, qualified by the
deviceClass and
deviceSubClass values.
|
|
|
Maximum packet size for
endpoint 0.
|
|
|
USB-IF vendor ID.
|
|
|
USB-IF product ID.
|
|
|
Device release number in
binary-coded decimal.
|
|
|
Index of string descriptor
describing manufacturer.
|
|
|
Index of string descriptor
describing product.
|
|
|
Index of string descriptor
containing device serial
number.
|
|
|
Number of possible
configurations.
|
|
|
List of configurations
supported by the device.
|
|
|
A decoded 16 bits Binary Coded Decimal using 4 bits for each digit.
|
|
For a database of USB vendors and products see the usb-id-database
package at: http://hackage.haskell.org/package/usb-id-database
|
|
|
|
|
|
Configuration descriptor
|
|
|
A structure representing the standard USB configuration descriptor.
This descriptor is documented in section 9.6.3 of the USB 2.0 specification.
This structure can be retrieved by deviceConfigs.
| Instances | |
|
|
Querying configuration descriptors
|
|
|
Identifier value for the
configuration.
|
|
|
Index of string descriptor
describing the configuration.
|
|
|
Configuration characteristics.
|
|
|
Maximum power consumption of the
USB device from the bus in the
configuration when the device is
fully operational. Expressed in
2 mA units (i.e., 50 = 100 mA).
|
|
|
Number of interfaces supported by
the configuration.
|
|
|
List of interfaces supported by
the configuration.
Note that the length of this list
should equal
configNumInterfaces.
|
|
|
Extra descriptors. If libusb
encounters unknown configuration
descriptors, it will store them
here, should you wish to parse
them.
|
|
|
An interface is represented as a list of alternate interface settings.
|
|
Configuration attributes
|
|
|
|
|
Constructors | DeviceStatus | | remoteWakeup :: Bool | The Remote Wakeup field indicates whether the
device is currently enabled to request remote
wakeup. The default mode for devices that
support remote wakeup is disabled.
| selfPowered :: Bool | The Self Powered field indicates whether the
device is currently self-powered
|
|
| Instances | |
|
|
Interface descriptor
|
|
|
A structure representing the standard USB interface descriptor.
This descriptor is documented in section 9.6.5 of the USB 2.0 specification.
This structure can be retrieved using configInterfaces.
| Instances | |
|
|
Querying interface descriptors
|
|
|
Number of the
interface.
|
|
|
Value used to select
the alternate setting
for the interface.
|
|
|
USB-IF class code for
the interface.
|
|
|
USB-IF subclass code for
the interface,
qualified by the
interfaceClass value.
|
|
|
USB-IF protocol code for
the interface,
qualified by the
interfaceClass and
interfaceSubClass
values.
|
|
|
Index of string
descriptor describing
the interface.
|
|
|
List of endpoints
supported by the
interface.
|
|
|
Extra descriptors. If
libusb encounters
unknown interface
descriptors, it will
store them here, should
you wish to parse them.
|
|
Endpoint descriptor
|
|
|
A structure representing the standard USB endpoint descriptor.
This descriptor is documented in section 9.6.3 of the USB 2.0 specification. All
multiple-byte fields are represented in host-endian format.
| Instances | |
|
|
Querying endpoint descriptors
|
|
|
The address of the endpoint described
by the descriptor.
|
|
|
Attributes which apply to the
endpoint when it is configured using
the configValue.
|
|
|
Maximum packet size the endpoint is
capable of sending/receiving.
|
|
|
Interval for polling endpoint for
data transfers. Expressed in frames
or microframes depending on the
device operating speed (i.e., either
1 millisecond or 125 s units).
|
|
|
For audio devices only: the rate at
which synchronization feedback is
provided.
|
|
|
For audio devices only: the address
if the synch endpoint.
|
|
|
Extra descriptors. If libusb
encounters unknown endpoint
descriptors, it will store
them here, should you wish to
parse them.
|
|
Endpoint address
|
|
|
The address of an endpoint.
| Constructors | | Instances | |
|
|
|
The direction of data transfer relative to the host.
| Constructors | Out | Out transfer direction (host -> device) used
for writing.
| In | In transfer direction (device -> host) used
for reading.
|
| Instances | |
|
|
Endpoint attributes
|
|
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | NoSynchronization | | Asynchronous | | Adaptive | | Synchronous | |
| Instances | |
|
|
|
Constructors | | Instances | |
|
|
Endpoint max packet size
|
|
|
Constructors | | Instances | |
|
|
data TransactionOpportunities | Source |
|
Number of additional transactions.
| Constructors | | Instances | |
|
|
String descriptors
|
|
|
Retrieve a list of supported languages.
This function may throw USBExceptions.
|
|
|
The language ID consists of the primary language identifier and the
sublanguage identififier as described in:
http://www.usb.org/developers/docs/USB_LANGIDs.pdf
For a mapping between IDs and languages see the usb-id-database package at:
http://hackage.haskell.org/package/usb-id-database
To see which LangIds are supported by a device see getLanguages.
|
|
|
|
|
|
|
Type of indici of string descriptors.
Can be retrieved by all the *StrIx functions.
|
|
|
Retrieve a string descriptor from a device.
This is a convenience function which formulates the appropriate control message
to retrieve the descriptor. The string returned is Unicode, as detailed in the
USB specifications.
This function may throw USBExceptions.
|
|
|
Retrieve a string descriptor from a device using the first supported
language.
This is a convenience function which formulates the appropriate control message
to retrieve the descriptor. The string returned is Unicode, as detailed in the
USB specifications.
This function may throw USBExceptions.
|
|
Produced by Haddock version 2.4.2 |