Audio Controls Via Human Interface Device (Hid) - 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
Due to bandwidth limitations of full-speed USB the following sample-frequency
restrictions are also applied:
Sample rate is limited to a maximum of 48kHz if both input and output are
enabled.
Sample rate is limited to a maximum of 96kHz if only input or output is enabled.

4.3 Audio Controls via Human Interface Device (HID)

The design supports simple audio controls such as play/pause, volume up/down
etc via the USB Human Interface Device Class Specification.
This functionality is enabled by setting the HID_CONTROLS define to 1 . Setting to 0
disables this feature.
When turned on the following items are enabled:
1. HID descriptors are enabled in the Configuration Descriptor informing the host
that the device has HID interface
2. A Get Report Descriptor request is enabled in endpoint0 .
3. Endpoint data handling is enabled in the buffer core
The Get Descriptor Request enabled in endpoint 0 returns the report descriptor for
the HID device. This details the format of the HID reports returned from the device
to the host. It maps a bit in the report to a function such as play/pause.
The USB Audio Framework implements a report descriptor that should fit most basic
audio device controls. If further controls are necessary the HID Report Descriptor
in descriptors.h should be modified. The default report size is 1 byte with the
format as follows:
Bit
Function
0
Play/Pause
1
Scan Next Track
2
Scan Prev Track
3
Volume Up
Figure 28:
4
Volume Down
Default HID
Report
5
Mute
Format
6-7
Unused
On each HID report request from the host the function Vendor_ReadHidButtons(unsigned char h
is called from buffer() . This function is passed an array hidData[] by reference.
The programmer should report the state of his buttons into this array. For
example, if a volume up command is desired, bit 3 should be set to 1, else 0.
XM0088546.1
45/110

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents