Real-Time I/O
7-38
7.13 Real-Time I/O
In DSP/BIOS there are two models that can be used for real-time I/O—the
DEV_STANDARD streaming model and the DEV_ISSUERECLAIM
streaming model. Each of these models is described in this section.
7.13.1 DEV_STANDARD Streaming Model
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.
Figure 7-8.
Flow of DEV_STANDARD Streaming Model
Application
Dxx_module
SIO_module
SIO_put(outStream, &bufp, BUFSIZE)
SIO_get(inStream, &bufp)
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.
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.
Содержание 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 ...