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.
20 lines
1.0 KiB
20 lines
1.0 KiB
#pragma once
|
|
#include <stdint.h>
|
|
|
|
//采集端配置
|
|
#define CONFIG_MODE (I2S_MODE_SLAVE | I2S_MODE_RX) //模式
|
|
#define CONFIG_SAMPLE_RATE 48000 //采样率
|
|
#define CONFIG_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_24BIT //采样位数
|
|
#define CONFIG_CHANNEL_FORMAT I2S_CHANNEL_FMT_RIGHT_LEFT // I2S格式
|
|
#define CONFIG_COMMUNICATION_FORMAT (I2S_COMM_FORMAT_STAND_MSB) // I2S标准
|
|
#define CONFIG_INTR_ALLOC_FLAGS ESP_INTR_FLAG_LEVEL1 //
|
|
//上报端格式配置
|
|
#define CONFIG_REPORT_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT //上报数据 采样位数
|
|
#define CONFIG_REPORT_SAMPLE_RATE CONFIG_SAMPLE_RATE //上报数据 采样率
|
|
#define CONFIG_REPORT_BUF_SIZE 600 //每次上报的字节数(注意需要和采样位数存在倍数关系)
|
|
|
|
typedef void (*encoder_acquisition_cb_t)(uint8_t *data, uint32_t size);
|
|
|
|
void encoder_acquisition_init(encoder_acquisition_cb_t cb);
|
|
void encoder_acquisition_start_cauture();
|
|
void encoder_acquisition_stop_cauture();
|