Configuration Descriptor

This is the configuration descriptor of the mouse we are examining. The analyser is showing the significance of the 9 bytes which comprise the descriptor.

The first two bytes show the length and descriptor type, as with any descriptor. This is followed by a word which gives the total number of bytes contained in the configuration descriptor collection. In this case the four descriptors included contain a total of 34 bytes.

bNumInterfaces shows the number of interfaces in this device. Each interface could represent a different function such as a keyboard function or an audio transfer function. In this case though, we have a single interface which we will see acts as a HID mouse function.

bConfigurationValue has a value of 1. This is the number which the Set Configuration command must use to select this, the only, configuration.

iConfiguration has the value 0 to tell the host that this configuration has no special string defined to describe it.

bmAttributes tells the host that the device is bus-powered, and supports the remote wake-up functionality.

Finally bMaxPower tells the host that the device will draw no more that one unit load, or 100mA in normal operation.

In our current mouse descriptor collection, the configuration descriptor is followed by the (one and only) interface descriptor.

 

Interface Descriptor

This is the interface descriptor of our mouse. The analyser is showing the significance of the 9 bytes which comprise the descriptor.

The first two bytes show the length and descriptor type, as with any descriptor.

bInterfaceNumber, which is used by requests to reference this interface, is defined as 0. This value has to be unique within this configuration.

It defines bAlternateSetting to be 0. If the interface had an alternative version then there might be another interface defined with a different bAlternateSetting, but in this case there is no alternative interface and this one has the default setting of 0.

bNumEndpoints shows that this interface has just one endpoint, which we will see below is used as an interrupt in endpoint for the mouse to send its reports.

bInterfaceClass specifies that this interface is a Human Interface Device interface, a widely used class which includes the mouse and keyboard among its possible functionalities.

bInterfaceSubClass and bInterfaceProtocol are only used if the HID device is one which has to be recognised by the BIOS of the host computer (i.e. before the USB driver stack has been loaded into memory). The mouse is usually designed to be accessible by the BIOS.

Finally iInterface specifies that there is no string available to describe this interface.

 

HID Descriptor

The HID descriptor always follows the interface descriptor when the interface belongs to the HID class.

After the usual first 2 bytes, bcdHID specifies which version of the HID specification this interface is compliant with.

bCountryCode specifies that there is no special localisation involved with this mouse.

The last three fields specify that there is one further descriptor to fetch associated with this class; a HID REPORT descriptor, and informs the host to expect it to be 52 bytes in length.

 

Endpoint Descriptor

Finally, the endpoint descriptor follows. After the standard first two bytes, the host learns that this endpoint being defined has address 1 - IN.

bmAttributes says that it is to be used as an interrupt endpoint.

wMaxPacketSize specifies that packets no longer than 4 bytes will be send from the endpoint, and bInterval is a request that the interrupt endpoint should be polled at least as often as once every 10ms.