DGN Driver
Application Program Interface
2-83
right-shifted before being copied into the input buffer. For example, if
you set the Gain to 100, the sine wave magnitude is 128, the nearest
power of two.
Tconf Name: gain
Type: Numeric
Example:
myDgn.gain = 32767;
❏
Frequency
. The frequency of the generated sine wave (in cycles per
second) if the Device category is sine. DGN uses a static (256 word)
sine table to approximate a sine wave. Only frequencies that divide
evenly into 256 can be represented exactly with DGN. A “step” value
is computed at open time for stepping through this table:
step = (256 * Frequency / Rate)
Tconf Name: frequency
Type: Numeric
Example:
myDgn.frequency = 1;
❏
Phase
. The phase of the generated sine wave (in radians) if the
Device category is sine.
Tconf Name: phase
Type: Numeric
Example:
myDgn.phase = 0;
❏
Sample rate
. The sampling rate of the generated sine wave (in
sample points per second) if the Device category is sine.
Tconf Name: rate
Type: Int32
Example:
myDgn.rate = 256;
❏
User function
. If the Device category is user, specifies the function
to be used to compute the successive values of the data sequence
in an input device, or to be used to process the data stream, in an
output device. If this function is written in C and you are using the
DSP/BIOS Configuration Tool, use a leading underscore before the
C function name. If you are using Tconf, do not add an underscore
before the function name; Tconf adds the underscore needed to call
a C function from assembly internally.
Tconf Name: fxn
Type: Extern
Example:
myDgn.fxn = prog.extern("usrFxn");
❏
User function argument
. An argument to pass to the User function.
A user function must have the following form:
fxn(Arg arg, Ptr buf, Uns nmadus)
where buf contains the values generated or to be processed. buf and
nmadus correspond to the buffer address and buffer size (in
MADUs), respectively, for an SIO_get operation.
Tconf Name: arg
Type: Arg
Example:
myDgn.arg = prog.extern("myArg");