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


 
Example 4: Audio.c File
3-12 Getting Started with ADSP-BF548 EZ-KIT Lite
D The first set is commands to the device manager, requesting
the device manager to take certain actions on behalf of the
device driver instance. These commands are defined in the
device manager header file (<drivers/adi_dev.h>) and start
with “ADI_DEV_CMD_”.
D The second set is commands specific to the device driver
and start with “ADI_xxx_CMD_”, where “xxx” identifies the
driver. In our example, the driver identifiers start with
ADI_AD1980_CMD_”. There is a separate header file for each
device driver where these commands are defined. For the
AD1980 codec driver, the header is
<drivers/codec/adi_ad1980.h>.
The third argument is a pointer-sized value that acts as the operand
for the command. If the operand is not needed, the argument is
ignored.
Listing 3-2 shows a call to adi_dev_Control(), which is using a device
manager command (ADI_DEV_CMD_SET_DATAFLOW_METHOD) and operand
(ADI_DEV_MODE_CHAINED). Together they specify how the device manager
should manage the flow of data buffers that the application will send later.
Listing 3-2. Configuring the Device Manager
if((Result = adi_dev_Control(
AD1980DriverHandle,
ADI_DEV_CMD_SET_DATAFLOW_METHOD,
(void*)ADI_DEV_MODE_CHAINED))
!= ADI_DEV_RESULT_SUCCESS)
{
printf(“Failed to set dataflow method for audio output device,”
“Error Code: 0x%08X\n”,Result);
break;
}