EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #239 background imageLoading...
Page #239 background image
Stream I/O—Reading and Writing Streams
Streaming I/O and Device Drivers 7-9
Figure 7-3. How SIO_get Works
In Figure 7-3, the device driver associated with stream fills a buffer as data
becomes available. At the same time, the application program is processing
the current buffer. When the application uses SIO_get to get the next buffer,
the new buffer that was filled by the input device is swapped for the buffer
passed in. This is accomplished by exchanging buffer pointers instead of
copying bufsize bytes of data, which would be very time consuming.
Therefore, the overhead of SIO_get is independent of the buffer size.
In each case, the actual physical buffer has been changed by SIO_get. The
important implication is that you must make sure that any references to the
buffer used in I/O are updated after each operation. Otherwise, you are
referencing an invalid buffer.
SIO_put uses the same exchange of pointers to swap buffers for an output
stream. SIO_issue and SIO_reclaim each move data in only one direction.
Therefore, an SIO_issue/SIO_reclaim pair result in the same swapping of
buffer pointers.
Note:
A single stream cannot be used by more than one task simultaneously.
That is, only a single task can call SIO_get/SIO_put or
SIO_issue/SIO_reclaim at once for each stream in your application.
SIO_get (stream, &bufp)
Free Buffer
Exchange
Full Buffer
Application
Program
Device
Driver

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals