Specifications
19
6263A–ATARM–10-Oct-06
Application Note
(char *) &sLanguageID,
pManufacturer,
pProduct,
pSerial
};
The actual descriptors list can then be instantiated:
// List of descriptors used by the device
static S_std_descriptors sDescriptors = {
&sDeviceDescriptor,
(S_usb_configuration_descriptor *) &sConfigurationDescriptor,
pStringDescriptors,
0 // List of endpoint descriptors (excluding endpoint 0), not used
};
The core configuration descriptor, which is actually made up of the configuration descriptor and
the first interface descriptor (see Section 5.2.2 on page 16), has to be cast to the
S_usb_configuration_descriptor type.
5.2.3.2 Class Driver Instance
Finally, the class driver can be instancied:
// Basic class driver
static S_std_class sClass = {
&sUsb,
&sDescriptors,
};
While this example only contains a pointer to the USB driver and the list of descriptors, it is prob-
ably more complex in an actual USB class implementation.
5.3 Interrupt Service Routines
5.3.1 USB Controller Interrupt
The USB controller peripheral generates an interrupt when an event occurs. Since that event
must be forwarded to the USB_Handler method, an interrupt service routine must be installed to
do that.
A standard ISR should simply call the USB_Handler function:
void ISR_Driver()
{
USB_Handler(&sUsb);
}
5.3.2 VBus PIO Interrupt
The Vbus power line can be monitored (if a PIO pin is connected to it) by the user application to
enable or disable the USB controller peripheral when the device is connected/disconnected. To