USB Audio Design Guide
# i n c l u d e < xs1 . h >
# i n c l u d e " p o r t 3 2 A . h "
/* F u n c t i o n s t h a t h a n d l e f u n c t i o n s t h a t m u s t o c c u r on s t r e a m
* s t a r t / s t o p e . g . DAC m u t e / un - m u t e . T h e s e n e e d i m p l e m e n t i n g
* for a s p e c i f i c d e s i g n .
*
* I m p l e m e n t a t i o n s for the L1 USB A u d i o R e f e r e n c e D e s i g n
*/
/* Any a c t i o n s r e q u i r e d for s t r e a m s t a r t e . g . DAC un - m u t e - run e v e r y
* s t r e a m s t a r t .
*
* For L1 USB A u d i o R e f e r e n c e D e s i g n we i l l u m i n a t e LED B ( c o n n e c t e d
* to p o r t 32 A )
*
* S i n c e t h i s p o r t is s h a r e d w i t h o t h e r f u n c t i o n a l i t y i n l i n e a s s e m b l y
* is u s e d to a c c e s s the p o r t r e s o u r c e .
*/
v o i d U s e r A u d i o S t r e a m S t a r t ( v o i d )
{
int x ;
/* P e e k at c u r r e n t p o r t v a l u e u s i n g p o r t 32 A r e s o u r c e ID */
asm ( " p e e k %0 , res [ % 1 ] " : " = r " ( x ) : " r " ( X S 1 _ P O R T _ 3 2 A ) ) ;
x |= P 3 2 A _ L E D _ B ;
/* O u t p u t to p o r t */
asm ( " out res [%0] , %1 " :: " r " ( X S 1 _ P O R T _ 3 2 A ) , " r " ( x ) ) ;
}
/* Any a c t i o n s r e q u i r e d on s t r e a m s t o p e . g . DAC m u t e - run e v e r y
* s t r e a m s t o p
* For L1 USB A u d i o R e f e r e n c e D e s i g n we e x t i n g u i s h LED B ( c o n n e c t e d
* to p o r t 32 A )
*/
v o i d U s e r A u d i o S t r e a m S t o p ( v o i d )
{
int x ;
asm ( " p e e k %0 , res [ % 1 ] " : " = r " ( x ) : " r " ( X S 1 _ P O R T _ 3 2 A ) ) ;
x &= (~ P 3 2 A _ L E D _ B ) ;
asm ( " out res [%0] , %1 " :: " r " ( X S 1 _ P O R T _ 3 2 A ) , " r " ( x ) ) ;
}
5.6.3
The main program
The
main()
function is shared across all applications is therefore part of the
framework. It is located in
sc_usb_audio
and contains:
·
A declaration of all the ports used in the framework. These vary depending on
the PCB an application is running on.
·
A
main
function which declares some channels and then has a
par
statement
which runs the required cores in parallel.
XM0088546.1
Summary of Contents for xCORE-200 Multi-channel Audio board
Page 6: ...1 Overview XM0088546 1...