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


 
Getting Started with ADSP-BF548 EZ-KIT Lite 3-15
Using ADSP-BF548 EZ-KIT Lite Peripherals
desc[i].ProcessedFlag = FALSE;
desc[i].pNext = NULL;
if ((Result = adi_dev_Write(AD1980DriverHandle,
ADI_DEV_1D,
(ADI_DEV_BUFFER *)&desc[i]))
!= ADI_DEV_RESULT_SUCCESS)
{
printf(“Failed to submit buffer descriptor, “
“Error Code: 0x%08X\n”, Result);
return 1;
}
return (Result != ADI_DEV_RESULT_SUCCESS);
}
The data transfer functions require more information than just the appli-
cation buffer’s address and length—the functions need to know whether
the application wants notified when the transfer is complete. To accom-
modate this per-transfer information, the device manager API defines a
structure (ADI_DEV_BUFFER) for a buffer descriptor containing appropriate
fields. The PlayBuffer() function in Listing 3-4 fills in the required fields
and passes the address of the buffer descriptor to adi_dev_Write().
Note that the call to adi_dev_Write() is asynchronous with respect to the
actual data transfer. A successful function return does not imply that the
data has been written to the peripheral; rather the buffer is queued for
transfer at some future point. Similarly, a call to adi_dev_Read() does not
return any data: the function only queues the buffer for future filling.
How does an application know when data has been received or written? By
setting the
CallbackParameter field of the buffer descriptor to a non-NULL
value, the application signals that it wants its callback function, which it
registered when it opened the device driver, to be called when the buffer
has been processed.