USB Audio Design Guide
5.6.1
Custom Defines
The
customdefines.h
file contains all the #defines required to tailor the USB audio
framework to the particular application at hand. Typically these over-ride default
values in
devicedefines.h
in
module_usb_audio
.
First there are defines to determine overall capability. For this appliction S/PDIF
output and DFU are enabled. Note that
ifndef
is used to check that the option is
not already defined in the makefile.
/* E n a b l e / D i s a b l e M I D I - D e f a u l t is M I D I off */
# i f n d e f M I D I
# d e f i n e M I D I
(0)
# e n d i f
/* E n a b l e / D i s a b l e S P D I F - D e f a u l t is S P D I F on */
# i f n d e f S P D I F _ T X
# d e f i n e S P D I F _ T X
(1)
# e n d i f
Next, the file defines the audio properties of the application. This application has
stereo in and stereo out with an S/PDIF output that duplicates analogue channels 1
and 2 (note channels are indexed from 0):
/* N u m b e r of USB s t r e a m i n g c h a n n e l s - D e f a u l t is 2 in 2 out */
# i f n d e f N U M _ U S B _ C H A N _ I N
# d e f i n e N U M _ U S B _ C H A N _ I N
(2)
/* D e v i c e to H o s t */
# e n d i f
# i f n d e f N U M _ U S B _ C H A N _ O U T
# d e f i n e N U M _ U S B _ C H A N _ O U T
(2)
/* H o s t to D e v i c e */
# e n d i f
/* N u m b e r of IS2 c h a n s to DAC . . * /
# i f n d e f I 2 S _ C H A N S _ D A C
# d e f i n e I 2 S _ C H A N S _ D A C
(2)
# e n d i f
/* N u m b e r of I2S c h a n s f r o m ADC */
# i f n d e f I 2 S _ C H A N S _ A D C
# d e f i n e I 2 S _ C H A N S _ A D C
(2)
# e n d i f
/* I n d e x of S P D I F TX c h a n n e l ( d u p l i c a t e d DAC c h a n n e l s 1 / 2 ) */
# d e f i n e S P D I F _ T X _ I N D E X
(0)
The file then sets some defines for the master clocks on the hardware and the
maximum sample-rate for the device.
XM0088546.1
Summary of Contents for xCORE-200 Multi-channel Audio board
Page 6: ...1 Overview XM0088546 1...