
USB Audio Design Guide 35/61
3.18.3 HID
The reference design implements basic HID controls. The call to
vendor_ReadHidButtons()
simply reads from buttons A and B and returns their
state in the relevant bits depending on the desired functionality (play/pause/skip
etc). Note the buttons are active low, the HID controls active high. The buttons are
therefore read and then inverted.
/* Write HID Repor t Data into hidDat a array
*
* Bits are as follows :
* 0: Play / Pause
* 1: Scan Next Trac k
* 2: Scan Prev Trac k
* 3: Volume Up
* 4: Volime Down
* 5: Mute
*/
void Ven d o r _Rea d H I DButt o n s ( unsigned char hidData [])
{
# ifndef MIDI
unsigned a , b ;
p_but_a :> a;
p_but_b :> b;
a = (~ a ) & 1;
b = (~ b ) & 1;
/* Assign buttons A and B to Vol Up / D own */
hidData [0] = ( a << 3) | ( b << 4);
# endif
}
In the example above the buttons are assigned to volume up/down.
3.18.4 Validated Build Options
The reference design can be built in several ways by changing the build options.
These are described in §5.1.
The design has only been fully validated against the build options as set in the
application as distributed. See §3.1 for details and binary naming.
In practise, due to the similarities between the U-Series and L-Series feature set, it
is fully expected that all listed U-Series configurations will operate as expected on
the L-Series and vice versa.
REV 6.1
Comentários a estes Manuais