summaryrefslogtreecommitdiff
path: root/code/fe310/eos/i2s_def.h
blob: 0f3207e4967c9b24213a9decf4646945d881f9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#define I2S_EVT_MIC             0x0
#define I2S_EVT_SPK             0x1
#define I2S_MAX_HANDLER         2

#define I2S_PIN_SD              12  // pin 18
// #define I2S_PIN_CK              19  // pin 3
#define I2S_PIN_CK              1   // pin 9
#define I2S_PIN_WS              11  // pin 17

#define I2S_PIN_LR              13  // pin 19

#define I2S_IRQ_SD_ID           (INT_PWM0_BASE + 2)
#define I2S_IRQ_CK_ID           (INT_PWM0_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_BITS           13
#define I2S_SMPL_BITS_S         5

#define I2S_PWM_SCALE_CK        2
#define I2S_ABUF_SIZE_CHUNK     16

/* 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