Stream I/O—Reading and Writing Streams
Streaming I/O and Device Drivers
7-7
7.3 Stream I/O—Reading and Writing Streams
There are two models for streaming data in DSP/BIOS: the standard model
and the Issue/Reclaim model. The standard model provides a simple method
for using streams, while the Issue/Reclaim model provides more control over
the stream operation.
SIO_get and SIO_put implement the standard stream model as shown in
Example 7-3. SIO_get is used to input the data buffers. SIO_get exchanges
buffers with the stream. The bufp parameter is used to pass the device a
buffer and return a different buffer to the application. SIO_get returns the
number of bytes in the input buffer. The SIO_put function performs the output
of data buffers, and, like SIO_get, exchanges physical buffers with the
stream. SIO_put takes the number of bytes in the output buffer
Example 7-3.
Inputting and Outputting Data Buffers
Note:
Since the buffer pointed to by bufp is exchanged with the stream, the buffer
size, memory segment, and alignment must correspond to the attributes of
stream.
SIO_issue and SIO_reclaim are the calls that implement the Issue/Reclaim
streaming model as shown in Example 7-4. SIO_issue sends a buffer to a
stream. No buffer is returned, and the stream returns control to the task
without blocking. arg is not interpreted by DSP/BIOS, but is offered as a
service to the stream client. arg is passed to each device with the associated
buffer data. It can be used by the stream client as a method of communicating
with the device drivers. For example, arg could be used to send a time stamp
to an output device, indicating exactly when the data is to be rendered.
SIO_reclaim requests a stream to return a buffer.
Int SIO_get(stream, bufp)
SIO_Handle stream;
Ptr *bufp;
Int SIO_put(stream, bufp, nbytes)
SIO_Handle stream;
Ptr *bufp;
Uns nbytes;
Содержание TMS320 Series
Страница 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Страница 16: ...xvi ...
Страница 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Страница 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Страница 202: ...5 20 ...
Страница 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Страница 288: ...Index 10 Index ...