Specifications

16
6263A–ATARM–10-Oct-06
Application Note
// USB instance
static const S_usb sUsb = {
&sDefaultDriver,
pEndpoints,
1,
&sCallbacks,
&sSetup
};
Please refer to Section 3.2.1 on page 2 for more information about the S_usb structure.
5.2.2 Descriptors
The USB specification 2.0 defines a set of descriptors used to give information about the device.
Depending on the USB class implemented, different descriptors have to be used with varying
values.
In this example program, only a few descriptors are required. The device descriptor is always
mandatory, so it will have to be defined. At least one configuration descriptor is required, so one
is implemented. The described configuration must have at least one interface, so one more
descriptor is needed. Finally, four string descriptors are used: one for the language ID, one for
the manufacturer name, one for the product name and one for the serial number.
5.2.2.1 Device Descriptor
The device descriptor used by this example looks like this:
// Device descriptor
static const S_usb_device_descriptor sDeviceDescriptor = {
sizeof(S_usb_device_descriptor), // Size of this descriptor in bytes
USB_DEVICE_DESCRIPTOR, // DEVICE Descriptor Type
USB_20, // USB Specification 2.0
0x00, // Class is specified in the interface descriptor.
0x00, // Subclass is specified in the interface descriptor.
0x00, // Protocol is specified in the interface descriptor.
USB_ENDPOINT0_MAXPACKETSIZE, // Maximum packet size for endpoint zero
USB_VENDOR_ATMEL, // Vendor ID
0x0000, // Product ID
0x0001, // Device release number
0x01, // Index 1: manufacturer string
0x02, // Index 2: product string
0x03, // Index 3: serial number string
0x01 // Number of possible configurations
};
The values are nothing special here. Note that the first three fields always have the same data in
them (unless using USB 1.1). It is also very common to define the class, subclass and protocol
values at the interface level.
Note: The vendor ID value is provided by the USB-IF organization. The product ID is vendor-specific and
can be assigned any value.