diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-10-16 13:15:11 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-10-16 13:15:11 +0200 |
commit | b7a007eb9d3548e2bcd141681a91b8a748d3ce49 (patch) | |
tree | 44989cf767870a7a19e02796b29ab7e70bff4e24 /code/fe310/eos/i2s.h | |
parent | 68d4d71ca06654bfa35603fcc7fc090220d87693 (diff) |
i2s has pcm 16bit audio format
Diffstat (limited to 'code/fe310/eos/i2s.h')
-rw-r--r-- | code/fe310/eos/i2s.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/code/fe310/eos/i2s.h b/code/fe310/eos/i2s.h index b9f2e02..09b9228 100644 --- a/code/fe310/eos/i2s.h +++ b/code/fe310/eos/i2s.h @@ -1,5 +1,8 @@ #include <stdint.h> +#define EOS_I2S_FMT_ALAW 0 +#define EOS_I2S_FMT_PCM16 1 + typedef struct EOSABuf { uint16_t idx_r; uint16_t idx_w; @@ -12,15 +15,18 @@ typedef void (*eos_i2s_fptr_t) (unsigned char); void eos_i2s_init(uint32_t sample_rate); void eos_i2s_start(void); void eos_i2s_stop(void); +void eos_i2s_set_fmt(unsigned char fmt); void eos_i2s_mic_init(uint8_t *mic_arr, uint16_t mic_arr_size); void eos_i2s_mic_set_handler(eos_i2s_fptr_t wm_handler); void eos_i2s_mic_set_wm(uint16_t wm); uint16_t eos_i2s_mic_len(void); uint16_t eos_i2s_mic_read(uint8_t *sample, uint16_t ssize); -int eos_i2s_mic_pop(uint8_t *sample); +int eos_i2s_mic_pop8(uint8_t *sample); +int eos_i2s_mic_pop16(uint16_t *sample); void eos_i2s_spk_init(uint8_t *mic_arr, uint16_t mic_arr_size); void eos_i2s_spk_set_handler(eos_i2s_fptr_t wm_handler); void eos_i2s_spk_set_wm(uint16_t wm); uint16_t eos_i2s_spk_len(void); uint16_t eos_i2s_spk_write(uint8_t *sample, uint16_t ssize); -int eos_i2s_spk_push(uint8_t sample); +int eos_i2s_spk_push8(uint8_t sample); +int eos_i2s_spk_push16(uint16_t sample); |