Real-Time I/O; Flow Of Dev_Standard Streaming Model - Texas Instruments TMS320 User Manual

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Real-Time I/O

7.13 Real-Time I/O
7.13.1 DEV_STANDARD Streaming Model
Figure 7-8. Flow of DEV_STANDARD Streaming Model
Application
SIO_get(inStream, &bufp)
SIO_put(outStream, &bufp, BUFSIZE)
7-38
In DSP/BIOS there are two models that can be used for real-time I/O—the
DEV_STANDARD
streaming
streaming model. Each of these models is described in this section.
In the DEV_STANDARD streaming model, SIO_get is used to get a non-
empty buffer from an input stream. To accomplish this, SIO_get first places
an empty frame on the device->todevice queue. SIO_get then calls
Dxx_issue, which starts the I/O and then calls Dxx_reclaim pending, until a
full frame is available on the device->fromdevice queue. This blocking is
accomplished by calling SEM_pend on the device semaphore objptr->sync
that is posted whenever a buffer is filled.
Dxx_issue calls a low-level hardware function to initiate data input. When the
required amount of data has been received, the frame is transferred to
device->fromdevice. Typically, the hardware device triggers an interrupt
when a certain amount of data has been received. Dxx handles this interrupt
by means of an HWI (ISR in Figure 7-8), which accumulates the data and
determine if more data is needed for the waiting frame. If the HWI determines
that the required amount of data has been received, the HWI transfers the
frame to device->fromdevice and then call SEM_post on the device
semaphore. This allows the task, blocked in Dxx_reclaim, to continue.
Dxx_reclaim then returns to SIO_get, which will complete the input operation
as illustrated in Figure 7-8.
SIO_module
1) Put bufp on todevice queue.
2) Call Dxx_issue function.
3) Call Dxx_reclaim function.
4) Get next buffer from
fromdevice queue.
5) Set bufp to point to this
buffer.
1) Put bufp on todevice queue.
2) Call Dxx_issue function.
3) Call Dxx_reclaim function.
4) Get next buffer from
fromdevice queue.
5) Set bufp to point to this
buffer.
model
and
the
DEV_ISSUERECLAIM
Dxx_module
1) Get next buffer from todevice
queue and make "visible" to ISR.
2) If first "get," enable interrupts.
3) Pend on semaphore for
non-empty buffer on fromdevice
queue.
1) Get next buffer from todevice
queue and make "visible" to ISR.
2) If first "put," enable interrupts.
3) Pend on semaphore for empty
buffer on fromdevice queue.

Advertisement

Table of Contents
loading

Table of Contents