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


 
Example 4: Audio.c File
3-10 Getting Started with ADSP-BF548 EZ-KIT Lite
processing or error event occurs. For the single instance of the
AD1980 audio codec on the ADSP-BF548 EZ-KIT Lite, we do not
need a distinguishing value, so we supply
NULL.
&AD1980DriverHandle: Argument five informs the device manager
where to store the device driver instance value (handle). As noted
earlier, we will use this handle to identify the driver instance in
later device manager calls.
ADI_DEV_DIRECTION_OUTBOUND: For some peripherals, the device
manager (and sometimes the device driver) requires to know
whether the application is going read data from the peripheral,
write data to the peripheral, or both. If data is to flow in one direc-
tion only, interrupt and memory resources can be saved. The
device manager header file (<drivers/adi_dev.h>) contains defini-
tions of three identifiers to enumerate the possibilities. We select
this identifier to pass as the sixth argument to adi_dev_Open()
because we only are sending data to the AD1980 codec.
adi_dma_ManagerHandle: Each of the data transfer peripherals on
the ADSP-BF548 processor has at least one dedicated direct mem-
ory access (DMA) channel. DMA relieves the device driver from
writing bytes or words of data to or reading them from the periph-
eral programmatically. All DMA channels operate in an identical
manner, so the SSL provides a DMA manager for the drivers. The
DMA manager must be initialized before use—the seventh argu-
ment to
adi_dev_Open() passes in the DMA manager handle
obtained elsewhere in the application.
DCBQueueHandle: The eighth argument is the handle of another SSL
service—the delayed callback manager. Device drivers contain code
that runs when the controlled peripheral raises an interrupt. The
driver does what is required to service the peripheral but often
needs to inform the driver’s user—the application—that a data
transfer has completed or an error has occurred. The application’s
response to the information may be some lengthy operation, such