PrepareBufferList
The
PrepareBufferList
for submission to the DMA manager (when the device is supported by
peripheral DMA) or the physical driver (when the device is not supported
by peripheral DMA).
The function begins by determining the value of the direction field in the
DMA configuration control register. Because the data structures for
circular buffers, one-dimensional buffers, and two-dimensional buffers
differ, each must be treated separately.
If passed as a circular buffer, the function assumes there is only one buffer
in the buffer list. For devices opened with the
dataflow method, only a single buffer is provided so this is a valid assump-
tion to make. The function configures the DMA configuration control
register according to the parameters within the circular buffer data struc-
ture. The DMA configuration control register is set to generate inner-loop
interrupts if the application wants to be called back when each sub-buffer
has completed processing, or is set to generate outer-loop interrupts if the
application wants to be called back when the entire buffer has completed
processing, or neither if the application does not want any callbacks. The
word size is set to the width of a data element in the buffer, and the direc-
tion field is set appropriately. The function then returns to the caller.
If the buffer type passed into the function specifies one-dimensional or
two-dimensional buffers, the processing is largely the same except where
noted.
For each buffer passed in, the processed flag and processed count fields
within the buffer structure are cleared. If the physical device is supported
by peripheral DMA, the reserved area at the beginning of each buffer
structure is converted into a large model descriptor. The descriptor is then
configured according to the parameters within the buffer structure,
including such things as buffer size, width of an element, data direction,
whether it is one-dimensional or two-dimensional, and so on.
VisualDSP++ 5.0 Device Drivers and System
Services Manual for Blackfin Processors
function prepares a single buffer or list of buffers
Device Driver Manager
ADI_DEV_MODE_CIRCULAR
10-43
Need help?
Do you have a question about the VisualDSP++ 5.0 and is the answer not in the manual?