Real-Time I/O
7-40
Figure 7-29 is a template for Dxx_issue for a typical terminating device.
Example 7-29.
Template for Dxx_issue for a Typical Terminating Device
A call to Dxx_issue starts the device for the appropriate mode, either
DEV_INPUT or DEV_OUTPUT. Once the device is known to be started,
Dxx_issue simply returns. The actual data handling is performed by an HWI.
Figure 7-30 is a template for Dxx_reclaim for a typical terminating device.
Example 7-30.
Template for Dxx_reclaim for a Typical Terminating Device
A call to Dxx_reclaim waits for the HWI to place a frame on the
device->fromdevice queue, then returns.
Dxx_reclaim calls SEM_pend with the timeout value specified at the time the
stream is created (either statically or with SIO_create) with this value. If the
timeout expires before a buffer becomes available, Dxx_reclaim returns
SYS_ETIMEOUT. In this situation, SIO_reclaim does not attempt to get
anything from the device->fromdevice queue. SIO_reclaim returns
SYS_ETIMEOUT, and does not return a buffer.
/*
* ======== Dxx_issue ========
*/
Int Dxx_issue(DEV_Handle device)
{
Dxx_Handle objptr = (Dxx_Handle) device->object;
if ( `device is not operating in correct mode` ) {
`start the device for correct mode`
}
return (SYS_OK);
}
/*
* ======== Dxx_reclaim ========
*/
Int Dxx_reclaim(DEV_Handle device)
{
Dxx_Handle objptr = (Dxx_Handle) device->object;
if (SEM_pend(objptr->sync, device->timeout)) {
return (SYS_OK);
}
else { /* SEM_pend() timed out */
return (SYS_ETIMEOUT);
}
}
Содержание 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 ...