Specifications
31
31
Device Descriptor Example
A look at a device descriptor declared in code:
//---------------------------
// Descriptor Declarations
//---------------------------
const device_descriptor DeviceDesc =
{
18, // bLength
0x01, // bDescriptorType
0x0002, // bcdUSB
0x02, // bDeviceClass
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
EP0_PACKET_SIZE, // 0x40
0x10c4, // idVendor
0x3413, // idProduct
0x0000, // bcdDevice
0x01, // iManufacturer
0x02, // iProduct
0x00, // iSerialNumber
0x01 // bNumConfigurations
}; //end of DeviceDesc
Strings
Remember the length we asked
for in the device descriptor
example?
Tells how many bytes this
endpoint can handle
How many configuration
descriptors this device has
So what would a device descriptor look like when we determine all of the values
required? Here is an example of a device descriptor. You can compare these values
to the fields identified in the table to see how each value maps to the specification.
Shown in the slide is a descriptor for a standard class called CDC as the values
reflect the requirements of both specifications (USB 2.0 and the CDC class
specification). We have this labeled as const in order to have this stored in the non-
volatile flash memory so that we have them available all the time.