DSP main page,
DSP System calls.
DMA System calls.
DSP Host Communication Example.
DMA Handshaked Communication Example.
Here are some useful DMA system calls:
Opcode #139
devconnect(src, dst, srclk, prescale, protocol)
int src;
int dst;
int srclk;
int prescale;
int protocol;
The devconnect function call is used to attach a source device
to any of the destination devices in the matrix. Given a source device,
this call will attach that one source device to one or all of the
destination devices. This call also sets up the source clock
prescale value and protocol used.
Opcode #137
- src: Source devices are:
- 3 - ADC (microphone/PSG)
2 - EXTINP (External Port Input)
1 - DSPXMIT (DSP Transmit)
0 - DMAPLAY (DMA Playback)
- dst: A bitmap of destination devices, several are allowed.
- 0x8 - DAC (Headphone or Internal speaker)
0x4 - EXTOUT (External Port Output)
0x2 - DSPRECV (DSP Receive)
0x1 - DMAREC (DMA Record)
- srclk: The Clock source the device will use.
- 0 - Internal 25.175 MHz Clock (ADC/DAC compatible)
1 - External Clock
2 - Internal 32 MHz Clock
- prescale: Clock prescale value.
- 1 - 49170Hz
2 - 33880Hz
3 - 24585Hz
4 - 20770Hz
5 - 16490Hz
7 - 12292Hz
9 - 9834Hz
11 - 8195Hz
- protocol: Handshake mode.
- 0 - Enable Handshaking
1 - Disable Handshaking
Opcode #136
- dspxmit:
- 0 - Tristate
- 1 - Enable
- dsprec:
- 0 - Tristate
- 1 - Enable
Opcode #131
- mode: Mode code, several modes are allowed.
- 0x8 - Record Repeat on
- 0x4 - Record Enable on
- 0x2 - Playback Repeat on
- 0x1 - Playback Enable on
- -1 - Current status is returned
- reg: Register select.
- 0 - Sets playback registers.
- 1 - Sets record registers.
- begaddr: Sets the beginning address to the buffer.
- endaddr: Sets the ending address to the buffer.