summaryrefslogtreecommitdiff
path: root/code/fe310/eos/i2s_def.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-03-14 19:08:00 +0100
committerUros Majstorovic <majstor@majstor.org>2018-03-14 19:08:00 +0100
commit5fe913c88d8c1781de336cca3949142bd9fc370d (patch)
tree6bf57e4e34fb60e46035175946b15581b2ef638c /code/fe310/eos/i2s_def.h
parent4b655364d426f8429b063d9746c754beca6f7d1f (diff)
i2s driver added; new amd trap entry vector added
Diffstat (limited to 'code/fe310/eos/i2s_def.h')
-rw-r--r--code/fe310/eos/i2s_def.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/code/fe310/eos/i2s_def.h b/code/fe310/eos/i2s_def.h
new file mode 100644
index 0000000..04e9c27
--- /dev/null
+++ b/code/fe310/eos/i2s_def.h
@@ -0,0 +1,28 @@
+#define I2S_EVT_MIC 0x0
+#define I2S_EVT_SPK 0x1
+#define I2S_MAX_HANDLER 2
+
+#define I2S_PIN_CK 19 // pin 3
+#define I2S_PIN_WS 11 // pin 17
+#define I2S_PIN_SD 12 // pin 18
+
+#define I2S_PIN_LR 13 // pin 19
+
+#define I2S_IRQ_SD_ID (INT_PWM1_BASE + 2)
+#define I2S_IRQ_CK_ID (INT_PWM1_BASE + 0)
+#define I2S_IRQ_WS_ID (INT_PWM2_BASE + 0)
+#define I2S_IRQ_CI_ID (INT_PWM2_BASE + 2)
+
+#define I2S_IRQ_SD_PRIORITY 7
+#define I2S_IRQ_CK_PRIORITY 7
+#define I2S_IRQ_WS_PRIORITY 6
+#define I2S_IRQ_CI_PRIORITY 6
+#define I2S_IRQ_MASK 5
+
+#define I2S_SMPL_WIDTH 13
+
+/* asm */
+#define I2S_ABUF_OFF_IDXR 0
+#define I2S_ABUF_OFF_IDXW 2
+#define I2S_ABUF_OFF_SIZE 4
+#define I2S_ABUF_OFF_ARRAY 8