Opening Devices
7-34
7.12 Opening Devices
Dxx_open opens a Dxx device and returns its status seen in Example 7-23:
Example 7-23.
Opening a Device with Dxx_open
SIO_create calls Dxx_open to open a Dxx device as seen in Example 7-24.
Example 7-24.
Opening an Input Terminating Device
This sequence of steps illustrates the opening process for an input-
terminating device:
1) Find string matching a prefix of /adc16 in DEV_devtab device table. The
associated DEV_Device structure contains driver function, device ID,
and device parameters.
2) Allocate DEV_Obj device object.
3) Assign bufsize, nbufs, segid, etc. fields in DEV_Obj from parameters and
SIO_Attrs passed to SIO_create.
4) Create todevice and fromdevice queues.
5) If opened for DEV_STANDARD streaming model, allocate attrs.nbufs
buffers of size BUFSIZE and put them on todevice queue.
6) Call Dxx_open with pointer to new DEV_Obj and remaining name string
using syntax as shown:
status - Dxx_open (device, "16")
7) Validate fields in DEV_Obj pointed to by device.
8) Parse string for additional parameters (for example, 16 kHz).
9) Allocate and initialize device-specific object.
10) Assign device-specific object to device
→
object.
The arguments to Dxx_open are shown in Example 7-25.
Example 7-25.
Arguments to Dxx_open
status = Dxx_open(device, name);
input = SIO_create("/adc16", SIO_INPUT, BUFSIZE, NULL)
DEV_Handle device; /* driver handle */
String name; /* device name */
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...