DTR Driver
Application Program Interface
2-105
Important Note:
This driver will no longer be supported in the next
major release of DSP/BIOS. We recommend that you use the IOM
driver interface instead. See the
DSP/BIOS Driver Developer’s Guide
(SPRU616). This driver is still supported in DSP/BIOS 5.32 and will be
supported in any patch releases or minor enhancements to DSP/BIOS
5.32.
Description
The DTR driver manages a class of stackable devices known as
transformers, which modify a data stream by applying a function to each
point produced or consumed by an underlying device. The number of
active transformer devices in the system is limited only by the availability
of memory; DTR instantiates a new transformer on opening a device, and
frees this object when the device is closed.
Buffers are read from the device and copied into a single (large) buffer.
Configuring a
DTR Device
To create a DTR device object in a configuration script, use the following
syntax:
var myDtr = bios.UDEV.create("myDtr");
Set the DEV Object Properties for the device you created as follows.
❏
init function
. Type 0 (zero).
❏
function table ptr
. Type _DTR_FXNS
❏
function table type
. DEV_Fxns
❏
device id
. Type 0 (zero), _DTR_multiply, or _DTR_multiplyInt16.
If you type 0, you need to supply a user function in the device
parameters. This function is called by the driver as follows to perform
the transformation on the data stream:
if (user.fxn != NULL) {
(*user.fxn)(user.arg, buffer, size);
}
If you type _DTR_multiply, a built-in data scaling operation is
performed on the data stream to multiply the contents of the buffer by
the scale.value of the device parameters.
If you type _DTR_multiplyInt16, a built-in data scaling operation is
performed on the data stream to multiply the contents of the buffer by
the scale.value of the device parameters. The data stream is
assumed to contain values of type Int16.
DTR Driver
Stackable streaming transformer driver