From a0059ab4365f41c84bb8bdf914477f5d4feeb985 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 21 Apr 2023 21:13:50 +0200 Subject: improved i2s driver --- fw/fe310/eos/soc/i2s.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'fw/fe310/eos/soc/i2s.h') diff --git a/fw/fe310/eos/soc/i2s.h b/fw/fe310/eos/soc/i2s.h index a5a67df..c5e92b7 100644 --- a/fw/fe310/eos/soc/i2s.h +++ b/fw/fe310/eos/soc/i2s.h @@ -18,20 +18,22 @@ 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); -void eos_i2s_mic_init(uint8_t *mic_arr, uint16_t mic_arr_size); -void eos_i2s_mic_set_handler(eos_i2s_handler_t wm_handler); -void eos_i2s_mic_set_wm(uint16_t wm); + +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); 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); int eos_i2s_mic_get_vol(void); void eos_i2s_mic_set_vol(int vol); -void eos_i2s_spk_init(uint8_t *mic_arr, uint16_t mic_arr_size); -void eos_i2s_spk_set_handler(eos_i2s_handler_t wm_handler); -void eos_i2s_spk_set_wm(uint16_t wm); + +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); uint16_t eos_i2s_spk_len(void); -uint16_t eos_i2s_spk_write(uint8_t *sample, uint16_t ssize); +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); int eos_i2s_spk_get_vol(void); -- cgit v1.2.3