Enabling Dataflow
Once the dataflow method has been defined, and buffers provided to the
device as appropriate (see
tion enables dataflow by calling the
ADI_DEV_CMD_SET_DATAFLOW
application should ensure that, if not using synchronous mode, devices
that are opened for inbound or bidirectional data are provided with buff-
ers, or else data may be lost.
Providing Buffers to a Device
Buffers are provided to a device via the
API function calls. The
inbound data,
buffers to the device via these API calls is slightly different depending on
the dataflow method chosen.
When a device is configured to use the circular dataflow method, the
application provides the device driver with one and only one buffer for
inbound data and/or one and only one buffer for outbound data. The data
provided buffer points to a contiguous piece of memory corresponding to
however many sub-buffers the application wants to use.
For example, assume the application wants to process data in 512-byte
increments and wants to work in a traditional "ping-pong" type (two
sub-buffer) fashion. The application provides the device driver with a sin-
gle data buffer 1024 bytes in length, consisting of two 512-byte
sub-buffers. By doing this, the device driver can use 512 bytes of the
buffer while the application uses the other 512 bytes simultaneously.
Another example is an application that wants to process a standard NTSC
video frame (525 lines with 1716 bytes per line). The data buffer provided
to the device manager could be a contiguous piece of memory
bytes in size (
525 * 1716
Regardless of how many sub-buffers are provided, with the circular
VisualDSP++ 5.0 Device Drivers and System
Services Manual for Blackfin Processors
"Providing Buffers to a
command. Dataflow starts immediately so the
adi_dev_Read
for outbound data. How the client provides
adi_dev_Write
). The sub-buffer count in this case is 525.
Device Driver Manager
Device"), the applica-
function with the
adi_dev_Control
and
adi_dev_Read
function provides buffers for
adi_dev_Write
900900
10-15