Configuration Functions - 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
/* Master clock defines ( in Hz ) */
# define MCLK_441
# define MCLK_48
/* Maximum frequency device runs at */
# ifndef MAX_FREQ
# define MAX_FREQ
# endif
Finally, there are some general USB identification defines to be set. These are set
for the XMOS reference design but vary per manufacturer:
# define VENDOR_ID
# define PID_AUDIO_2
# define PID_AUDIO_1
For a full description of all the defines that can be set in customdefines.h see
5.6.2 Configuration Functions
In addition to the custom defines file, the application needs to provide implemen-
tations of user functions that are specific to the application.
For app_usb_aud_l1 the implementations can be found in audiohw.xc.
Firstly, code is required to initialise the external audio hardware. In the case of the
CODEC on the L1 Refence Design board there is no required action so the funciton
is left empty:
void AudioHwInit ( chanend ? c_codec )
{
}
On every sample-rate change a call is made to AudioHwConfig(). In the case of the
CODEC on the L1 Reference Design baord the CODEC must be reset and set the
relevant clock input from the two oscillators on the board.
Both the CODEC reset line and clock selection line are attached to the 32 bit port
32A. This is accessed through the port32A_peek and port32A_out functions:
# define PORT32A_PEEK ( X ) { asm ( " peek %0 , res [%1] " : " = r " ( X ) : " r " ( XS1_PORT_32A ) )
# define PORT32A_OUT ( X )
XM0088546.1
return ;
;}
(256*44100)
(512*48000)
(192000)
(0 x20B1 ) /* XMOS VID */
(0 x0002 ) /* L1 USB Audio Reference Design PID */
(0 x0003 ) /* L1 USB Audio Reference Design PID */
{ asm ( " out res [%0] , %1 " :: " r " ( XS1_PORT_32A ) ," r " ( X ) ) ;}
/* 44.1 , 88.2 etc */
/* 48 , 96 etc */
55/110
§7.1

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the xCORE-200 Multi-channel Audio board and is the answer not in the manual?

Questions and answers

Table of Contents