Creating and Deleting Streams
Streaming I/O and Device Drivers
7-5
7.2 Creating and Deleting Streams
To enable your application to do streaming I/O with a device, the device must
first be added to the configuration. You can add a device for any driver
included in the product distribution or a user-supplied driver. To use a stream
to perform I/O with a device, first configure the device. Then, create the
stream object in the configuration or at runtime with the SIO_create function.
7.2.1
Creating Streams Statically
In the configuration, you can create streams and set the properties for each
stream and for the SIO Manager itself. You cannot use the SIO_delete
function to delete statically-created streams.
7.2.2
Creating and Deleting Streams Dynamically
You can also create a stream at run time with the SIO_create function as
shown in Example 7-1.
Example 7-1.
Creating a Stream with SIO_create
SIO_create creates a stream and returns a handle of type SIO_Handle.
SIO_create opens the device(s) specified by name, specifying buffers of size
bufsize. Optional attributes specify the number of buffers, the buffer memory
segment, the streaming model, etc. The mode parameter is used to specify
whether the stream is an input (SIO_INPUT) or output (SIO_OUTPUT)
stream.
Note:
The parameter name must be the same as the name configured for the
device but preceded by a slash character ( / ). For example, for a device
called sine, name should be “/sine.”
SIO_Handle SIO_create(name, mode, bufsize, attrs)
String name;
Int mode;
Uns bufsize;
SIO_Attrs *attrs;
Содержание 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 ...