Endpoint 0: Management And Control; Enumeration - XMOS xCORE-200 Multi-channel Audio board Design Manual

Usb audio
Hide thumbs Also See for xCORE-200 Multi-channel Audio board:
Table of Contents

Advertisement

USB Audio Design Guide

3.3 Endpoint 0: Management and Control

All USB devices must support a mandatory control endpoint, Endpoint 0. This
controls the management tasks of the USB device.
These tasks can be generally split into enumeration, audio configuration and
firmware upgrade requests.

3.3.1 Enumeration

When the device is first attached to a host, enumeration occurs. This process
involves the host interrogating the device as to its functionality. The device does
this by presenting several interfaces to the host via a set of descriptors.
During the enumeration process the host will issue various commands to the device
including assigning the device a unique address on the bus.
The endpoint 0 code runs in its own core and follows a similar format to that of
the USB Device examples in sc_usb_device (i.e. Example HID Mouse Demo). That
is, a call is made to USB_GetSetupPacket() to receive a command from the host.
This populates a USB_SetupPacket_t structure, which is then parsed.
There are many mandatory requests that a USB Device must support as required by
the USB Specification. Since these are required for all devices in order to function
a USB_StandardRequests() function is provided (see module_usb_device ) which
implements all of these requests. This includes the following items:
Requests for standard descriptors (Device descriptor, configuration descriptor
etc) and string descriptors
USB GET/SET INTERFACE requests
USB GET/SET_CONFIGURATION requests
USB SET_ADDRESS requests
For more information and full documentation, including full worked examples of
simple devices, please refer the XMOS USB Device Design Guide
The USB_StandardRequests() function takes the devices various descriptors as
parameters, these are passed from data structures found in the descriptors.h
file. These data structures are fully customised based on the how the design is
configured using various defines (see §7.1).
The USB_StandardRequests() functions returns a XUD_Result_t . XUD_RESULT_OKAY
indicates that the request was fully handled without error and no further action is
required - The device should move to receiving the next request from the host (via
USB_GetSetupPacket() ).
The function returns XUD_RES_ERR if the request was not recognised by the
USB_StandardRequests() function and a STALL has been issued.
20
https://www.xmos.com/zh/node/17007?page=9
XM0088546.1
22/110
20

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents