You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
1.0 KiB

3 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. //采集端配置
  4. #define CONFIG_MODE (I2S_MODE_SLAVE | I2S_MODE_RX) //模式
  5. #define CONFIG_SAMPLE_RATE 48000 //采样率
  6. #define CONFIG_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_24BIT //采样位数
  7. #define CONFIG_CHANNEL_FORMAT I2S_CHANNEL_FMT_RIGHT_LEFT // I2S格式
  8. #define CONFIG_COMMUNICATION_FORMAT (I2S_COMM_FORMAT_STAND_MSB) // I2S标准
  9. #define CONFIG_INTR_ALLOC_FLAGS ESP_INTR_FLAG_LEVEL1 //
  10. //上报端格式配置
  11. #define CONFIG_REPORT_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT //上报数据 采样位数
  12. #define CONFIG_REPORT_SAMPLE_RATE CONFIG_SAMPLE_RATE //上报数据 采样率
  13. #define CONFIG_REPORT_BUF_SIZE 600 //每次上报的字节数(注意需要和采样位数存在倍数关系)
  14. typedef void (*encoder_acquisition_cb_t)(uint8_t *data, uint32_t size);
  15. void encoder_acquisition_init(encoder_acquisition_cb_t cb);
  16. void encoder_acquisition_start_cauture();
  17. void encoder_acquisition_stop_cauture();