
USB Audio Design Guide 50/61
{
uns igned x ;
asm ( " ldw %0, dp[ clk_a udio_ m clk ] " : " = r"(x));
asm ( " setc lk res [%0] , %1":: " r " ( p _for_m c lk_co u nt ) , "r"(x));
}
buf fer( c_xu d_ou t [ E P_NUM _ OUT_A U D ] ,/* A udi o Ou t */
c_x ud_in [ E P_NUM _ IN_AU D ] , /* Aud io In */
c_x ud_in [ E P_NUM _IN_F B ] , /* Aud io FB */
# i fde f MIDI
c_xu d_ou t [ E P_NUM _ OUT_M I DI ], /* M IDI Out */ // 2
c_x ud_in [ E P_NUM _ IN_MI D I ] , /* MIDI In */ // 4
c_midi ,
# e ndi f
# i fde f IAP
c_xu d_ou t [ E P_NUM _OUT_I AP ], c_xu d_in [ E P _NUM_ IN_IA P ] , c _xud _in [
> EP_NU M _IN_IA P _INT ] ,
# e ndi f
# if def ined ( S PDIF _RX ) || defi ned ( ADAT _RX )
/* Aud io Inte rrup t - only used for inte rrupt s on e xter nal clock
> change */
c_x ud_in [ E P_NUM_ I N_AUD _ INT ] ,
# e ndi f
c_sof , c_a ud_ ctl , p _for_ m clk_co unt
# i fde f H ID_CO NTROL S
, c_xud _in [ EP_NU M _IN_H ID ]
# e ndi f
);
}
/* Decouple core */
on stdc ore [0]:
{
thre ad_sp e ed ();
dec ouple ( c_m ix_out , null
# i fde f IAP
, c _ia p
# e ndi f
);
}
These then connect to the audio driver which controls the I2S output and S/PDIF
output (if enabled). If S/PDIF output is enabled, this component spawns into two
cores as opposed to one.
on stdcore [ AUDIO_IO_CORE ]:
{
thread_speed ();
audio ( c_mix _out , null , null , c_adc ) ;
}
Finally, if MIDI is enabled you need a core to drive the MIDI input and output.
The MIDI core also optionally handles authentication with Apple devices. Due to
licensing issues this code is only available to Apple MFI licensees. Please contact
XMOS for details.
REV 6.1
Komentáře k této Příručce