summaryrefslogtreecommitdiff
path: root/os/mpc/dsp.h
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 21:39:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 21:39:35 +0000
commit74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (patch)
treec6e220ba61db3a6ea4052e6841296d829654e664 /os/mpc/dsp.h
parent46439007cf417cbd9ac8049bb4122c890097a0fa (diff)
20060303
Diffstat (limited to 'os/mpc/dsp.h')
-rw-r--r--os/mpc/dsp.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/os/mpc/dsp.h b/os/mpc/dsp.h
new file mode 100644
index 00000000..9838757f
--- /dev/null
+++ b/os/mpc/dsp.h
@@ -0,0 +1,62 @@
+/*
+ * MPC82x/QUICC DSP support
+ */
+
+typedef struct DSP DSP;
+typedef struct FnD FnD;
+
+typedef short Real;
+typedef struct Complex Complex;
+
+struct Complex {
+ Real im;
+ Real re;
+};
+
+struct FnD {
+ ushort status;
+ ushort param[7];
+};
+
+enum {
+ FnDsize = 8*2, /* each function descriptor is 8 shorts */
+
+ /* standard bits in FnD.status */
+ FnStop = 1<<15,
+ FnWrap = 1<<13,
+ FnInt = 1<<12,
+
+ /* optional bits */
+ FnZ = 1<<11, /* FIR[35], MOD */
+ FnIALL = 1<<10, /* FIRx */
+ FnXinc0 = 0<<8, /* FIRx, IRR */
+ FnXinc1 = 1<<8,
+ FnXinc2 = 2<<8,
+ FnXinc3 = 3<<8,
+ FnPC = 1<<7, /* FIRx */
+
+
+ /* DSP functions (table 16-6) */
+ FnFIR1 = 0x01,
+ FnFIR2 = 0x02,
+ FnFIR3 = 0x03,
+ FnFIR5 = 0x03,
+ FnFIR6 = 0x06,
+ FnIIR = 0x07,
+ FnMOD = 0x08,
+ FnDEMOD = 0x09,
+ FnLMS1 = 0x0A,
+ FnLMS2 = 0x0B,
+ FnWADD = 0x0C,
+};
+
+void dspinitialise(void);
+DSP* dspacquire(void (*)(void*), void*);
+void dspexec(DSP*, FnD*, ulong);
+void* dspmalloc(ulong);
+void dspfree(void*, ulong);
+void dspsetfn(DSP*, FnD*, ulong);
+void dspstart(DSP*);
+void dsprelease(DSP*);
+FnD* fndalloc(ulong);
+void fndfree(FnD*, ulong);