HP (Hewlett-Packard) EZ-KIT Switch User Manual


 
Example 4: Audio.c File
3-8 Getting Started with ADSP-BF548 EZ-KIT Lite
Example 4: Audio.c File
Four functions in Audio.c interact with the AD1980 audio codec device
driver: InitAudio() (see “InitAudio()—Opening the Driver”), Termina-
teAudio()
, PlayBuffer(), and AD1980Callback(). The following sections
describe some parts of these functions.
InitAudio()—Opening the Driver
The audio functions assume that the SSL is initialized. The initialization
process is described in Chapters 4 and 5 on page 4-1 and on page 5-1,
respectively. InitAudio() opens an instance of the Analog Devices-sup-
plied device driver for the AD1980 audio codec and uses the driver to
configure the hardware. InitAudio() also uses the driver to prepare the
SSL data transfer functions to handle the buffers of PCM audio samples
that the application will send to the codec. Listing 3-1 shows the call to
the adi_dev_Open() function that opens the AD1980 driver.
Listing 3-1. Opening the Device Driver
/* open the AD1980 driver */
if((Result = adi_dev_Open( adi_dev_ManagerHandle,
&ADIAD1980EntryPoint,
0,
NULL,
&AD1980DriverHandle,
ADI_DEV_DIRECTION_OUTBOUND,
adi_dma_ManagerHandle,
DCBQueueHandle,
AD1980Callback ))
!= ADI_DEV_RESULT_SUCCESS)
{
printf(“Failed to open audio output device, “
“Error Code: 0x%08X\n”, Result);
break;
}