OK, I thought I solved things just now, but apparently not. I've got
Code: Select all
static const int i2s_num = 0; // i2s port number
#define RATE 8000
static const i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN,
.sample_rate = RATE,
.bits_per_sample = I2S_BITS_PER_SAMPLE_8BIT,
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S,
.intr_alloc_flags = 0, // default interrupt priority
.dma_buf_count = 8,
.dma_buf_len = 64,
.use_apll = false
};
ret = i2s_driver_install(i2s_num, &i2s_config, 0, NULL);
assert(ret == ESP_OK);
But I get an assertion error, with the message
Code: Select all
E (7650) I2S: Invalid bits per sample
How do I fix this?
Also, I'm confused as to how I should set .dma_buf_count and .dma_buf_len. I assume it's got something to do with how you can buffer input, but the documentation doesn't decribe how to set or use them. They're just kinda magic numbers as far as I'm concerned.