Request AudioReQuest N.Series Manual Pagina 47

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 62
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 46
USB Audio Design Guide 47/61
For a full description of all the defines that can be set in
customdefines.h
see §5.1.
4.3.2 Configuration Functions
In addition to the custom defines file, the application needs to provide definitions
of user functions that are specific to the application. Firstly, code is required to
handle the CODEC. On boot up you do not need to do anything with the CODEC so
there is just an empty function:
void CodecInit ( c hanend ? c_codec )
{
return ;
}
On sample rate changes, you need to reset the CODEC 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 toggled through the
port32A_peek and port32A_out functions:
/* C onfi gures the CODE C f or the req uired s ample freq uency .
* COD EC reset and freq uency s elect are conn ected to p ort 32 A
*
* Port 32A is shared w ith other funct i onali ty ( LEDs etc ) so we
* acc ess via inline a ssem bly . We also t ake car e to retain the
* sta te of the oth er bits .
*/
void C o decCo nfig ( unsi gned samFreq , u nsigned mClk , chanend ? c_c odec )
{
timer t ;
uns igned time ;
uns igned tmp ;
/* Put codec in reset and set master clock sel ect a pprop r iatel y */
/* Read cur rent p ort outp ut */
PORT 32A_P E EK ( tmp ) ;
/* Put CODEC reset l ine low */
tmp &= (~ P32A _ COD_R ST );
if (( samFreq % 22050) == 0)
{
/* Frequ ency select low for 4410 00 etc */
tmp &= (~ P32A _ CLK_S EL );
}
else //if (( s amFr eq % 24000) == 0)
{
/* Frequ ency select h igh for 480 00 etc */
tmp |= P32A_ CLK_S E L ;
}
PORT 32A_O UT ( tmp ) ;
/* Hold in reset for 2 ms */
t : > time ;
time += 200 000;
REV 6.1
Vista de pagina 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 61 62

Comentarios a estos manuales

Sin comentarios