summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/soc/i2s.h
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/soc/i2s.h')
-rw-r--r--fw/fe310/eos/soc/i2s.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/fw/fe310/eos/soc/i2s.h b/fw/fe310/eos/soc/i2s.h
index c5e92b7..e2155a4 100644
--- a/fw/fe310/eos/soc/i2s.h
+++ b/fw/fe310/eos/soc/i2s.h
@@ -2,39 +2,41 @@
#include "i2s_def.h"
+#define EOS_I2S_MODE_STEREO 0
+#define EOS_I2S_MODE_MONO_L 1
+#define EOS_I2S_MODE_MONO_R 2
+
typedef struct EOSABuf {
uint16_t idx_r;
uint16_t idx_w;
uint16_t size;
- uint8_t *array;
+ uint16_t *array;
} EOSABuf;
typedef void (*eos_i2s_handler_t) (unsigned char);
-int eos_i2s_init(uint8_t wakeup_cause);
-void eos_i2s_init_mux(void);
-void eos_i2s_start(uint32_t sample_rate);
+int eos_i2s_init(void);
+int eos_i2s_start(uint32_t sample_rate, int mode);
void eos_i2s_stop(void);
int eos_i2s_running(void);
-void eos_i2s_set_fmt(unsigned char fmt);
-void eos_i2s_set_mode(unsigned char mode);
+int eos_i2s_set_lsgain(int gain);
void eos_i2s_mic_set_handler(eos_i2s_handler_t handler, uint16_t wm);
-void eos_i2s_mic_set_buf(uint8_t *mic_arr, uint16_t mic_arr_size);
-uint8_t *eos_i2s_mic_get_buf(void);
+void eos_i2s_mic_set_buf(uint16_t *mic_arr, uint16_t mic_arr_size);
+uint16_t *eos_i2s_mic_get_buf(void);
uint16_t eos_i2s_mic_len(void);
-uint16_t eos_i2s_mic_read(uint8_t *sample, uint16_t ssize);
-int eos_i2s_mic_pop8(uint8_t *sample);
-int eos_i2s_mic_pop16(uint16_t *sample);
+uint16_t eos_i2s_mic_read(uint16_t *smpl_buf, uint16_t buf_size);
+int eos_i2s_mic_pop(uint16_t *sample);
int eos_i2s_mic_get_vol(void);
void eos_i2s_mic_set_vol(int vol);
void eos_i2s_spk_set_handler(eos_i2s_handler_t handler, uint16_t wm);
-void eos_i2s_spk_set_buf(uint8_t *spk_arr, uint16_t spk_arr_size);
-uint8_t *eos_i2s_spk_get_buf(void);
+void eos_i2s_spk_set_buf(uint16_t *spk_arr, uint16_t spk_arr_size);
+uint16_t *eos_i2s_spk_get_buf(void);
uint16_t eos_i2s_spk_len(void);
-uint16_t eos_i2s_spk_write(uint8_t *sample, uint16_t ssize, uint8_t transform);
-int eos_i2s_spk_push8(uint8_t sample);
-int eos_i2s_spk_push16(uint16_t sample);
+uint16_t eos_i2s_spk_write(uint16_t *smpl_buf, uint16_t buf_len);
+int eos_i2s_spk_push(uint16_t sample);
int eos_i2s_spk_get_vol(void);
void eos_i2s_spk_set_vol(int vol);
+
+void eos_i2s_hp_change(int hp_det);