Specifications
2
6263A–ATARM–10-Oct-06
Application Note
3. Framework Description
The framework is comprised of several components:
• Standard USB structures
• USB API
–Structures
– Methods
• Callback API
• Standard Request handler
3.1 Standard USB Structures
The following standard structures have been implemented in the USB framework:
• Setup request data: S_usb_request
• Device descriptor: S_usb_device_descriptor
• Configuration descriptor: S_usb_configuration_descriptor
• Interface descriptor: S_usb_interface_descriptor
• Endpoint descriptor: S_usb_endpoint_descriptor
• Device_Qualifier descriptor: S_usb_device_qualifier_descriptor
• String descriptor zero: S_usb_language_id
For more information about how these structures are defined and used, refer to Section 5.2.2 on
page 16 and to chapter 9 of the USB specification 2.0.
3.2 USB API Structures
Several specific structures are used by the USB API to perform various operations, such as
invoking callbacks or accessing the USB controller.
There are four main structures:
•S_usb
• S_usb_driver
• S_usb_endpoint
• S_usb_callbacks
Note that it is possible to save RAM by declaring some of these objects as constants. By doing
so, they will be stored along with the code (in Flash, most of the time). Refer to the description of
each structure for more information.
3.2.1 S_usb
This is the main structure of the USB API. It contains the following elements:
• Pointer to the USB controller driver to use (S_usb_driver, see Section 3.2.2)
• List of endpoints used by the device (S_usb_endpoint, see Section 3.2.3)
• Number of endpoints used by the device
• List of callback functions (S_usb_callbacks, see Section 3.2.4)
• Pointer to the last setup packet received (S_usb_request, see Section 3.1)