174 NA DSP(3)
NAME
NASetDSPProgram, NAGetDSPProgram, NADSPWrite, NADSPRead – library routines for DSP32C
D
access
ESCRIPTION
These routines allow C programs to access the DSP32C processor inside the DAT-Link using the
r
i
NetAudio server on the local machine or other machines connected via a network. See netaudio(3) fo
nformation on opening and closing connections to the NetAudio server,
ROUTINES
#include <netaudio.h>
)
N
int NASetDSPProgram(port,pgm
Aport ∗port;
;struct Program ∗pgm
Set the DAT-Link’s currently running DSP program to pgm. Once set, the DAT-Link software
i
will not attempt to load built-in programs as needed, possibly making recording or playback
mpossible. A null value of pgm resets the DAT-Link to use it’s built-in DSP programs.
N
struct Program ∗NAGetDSPProgram(port)
Aport ∗port;
Retrieve the currently running DSP program from the DAT-Link server.
N
int NADSPWrite(port,addr,buffer,buflen)
Aport ∗port;
;
c
unsigned int addr
onst char ∗buffer;
int buflen;
Writes data to the DSP32C’s memory using the NetAudio server. A connection to the server
t
must be opened using NAOpen() before using this routine. Data should be stored in buffer in
he DSP32C byte order, regardless of the host byte-ordering. Note that whenever the DSP32C
e
D
is restarted due to invocation of narecord(1),naplay(1) or other NetAudio programs, th
SP32C is automatically reloaded with the current program. Thus, NASetDSPProgram()
T
should be used to load a new program that is meant to operate with other NetAudio software.
he following special memory addresses write to the DSP32C’s parallel (PIO) ports instead of
s
writing to memory. Note that modifying these registers may disable the normal NetAudio
oftware.
____________________________________
_
Address PIO Register Size (bits)
___________________________________
0
0xffffff00 PAR 16
xffffff02 PDR 16
6
0
0xffffff04 ESR 1
xffffff06 PCR 16
60xffffff08 EMR 1
0xffffff0a PIR 16
0
0xffffff0c PARE 8
xffffff0e PDR2 16
_
0xffffff10 IREQ1 1
___________________________________
e
a
Writing a non-zero value to the IREQ1 address causes the IREQ1 line on the DSP32C to b
sserted (low). A zero value turns off the the IREQ1 line.
N
int NADSPRead(port,addr,buffer,buflen)
Aport ∗port;
i
char ∗buffer;
nt buflen;
Read data from the DSP32C’s memory using the NetAudio server. The special addresses