![XMOS xCORE-200 Multi-channel Audio board Скачать руководство пользователя страница 55](http://html2.mh-extra.com/html/xmos/xcore-200-multi-channel-audio-board/xcore-200-multi-channel-audio-board_design-manual_3530329055.webp)
USB Audio Design Guide
/* M a s t e r c l o c k d e f i n e s ( in Hz ) */
# d e f i n e M C L K _ 4 4 1
( 2 5 6 * 4 4 1 0 0 )
/* 44.1 , 8 8 . 2 etc */
# d e f i n e M C L K _ 4 8
( 5 1 2 * 4 8 0 0 0 )
/* 48 , 96 etc */
/* M a x i m u m f r e q u e n c y d e v i c e r u n s at */
# i f n d e f M A X _ F R E Q
# d e f i n e M A X _ F R E Q
( 1 9 2 0 0 0 )
# e n d i f
Finally, there are some general USB identification defines to be set. These are set
for the XMOS reference design but vary per manufacturer:
# d e f i n e V E N D O R _ I D
(0 x 2 0 B 1 ) /* X M O S VID */
# d e f i n e P I D _ A U D I O _ 2
(0 x 0 0 0 2 ) /* L1 USB A u d i o R e f e r e n c e D e s i g n PID */
# d e f i n e P I D _ A U D I O _ 1
(0 x 0 0 0 3 ) /* L1 USB A u d i o R e f e r e n c e D e s i g n PID */
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:
v o i d A u d i o H w I n i t ( c h a n e n d ? c _ c o d e c )
{
r e t u r n ;
}
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:
# d e f i n e P O R T 3 2 A _ P E E K ( X ) { asm ( " p e e k %0 , res [ % 1 ] " : " = r " ( X ) : " r " ( X S 1 _ P O R T _ 3 2 A ) )
>
;}
# d e f i n e P O R T 3 2 A _ O U T ( X )
{ asm ( " out res [%0] , %1 " :: " r " ( X S 1 _ P O R T _ 3 2 A ) , " r " ( X ) ) ;}
XM0088546.1
Содержание xCORE-200 Multi-channel Audio board
Страница 6: ...1 Overview XM0088546 1...