25 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG00_RESET, 0x1F));
26 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG00_RESET, 0x00));
36 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG0D_SYSTEM, 0x01));
38 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG0E_SYSTEM, 0x02));
40 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG12_SYSTEM, 0x00));
42 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG13_SYSTEM, 0x10));
44 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG1C_ADC, 0x6A));
46 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG37_DAC, 0x08));
48 ES8311_ERROR_FAILED(this->
write_byte(ES8311_REG00_RESET, 0x80));
120 uint8_t reg01 = 0x3F;
130 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG01_CLK_MANAGER, reg01));
134 if (coefficient ==
nullptr) {
135 ESP_LOGE(TAG,
"Unable to configure sample rate %" PRIu32
"Hz with %" PRIu32
"Hz MCLK", this->
sample_frequency_,
142 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG02_CLK_MANAGER, ®02));
144 reg02 |= (coefficient->pre_div - 1) << 5;
145 reg02 |= encode_pre_mult(coefficient->pre_mult) << 3;
146 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG02_CLK_MANAGER, reg02));
149 const uint8_t reg03 = (coefficient->fs_mode << 6) | coefficient->adc_osr;
150 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG03_CLK_MANAGER, reg03));
153 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG04_CLK_MANAGER, coefficient->dac_osr));
156 const uint8_t reg05 = ((coefficient->adc_div - 1) << 4) | (coefficient->dac_div - 1);
157 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG05_CLK_MANAGER, reg05));
161 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG06_CLK_MANAGER, ®06));
168 if (coefficient->bclk_div < 19) {
169 reg06 |= (coefficient->bclk_div - 1) << 0;
171 reg06 |= (coefficient->bclk_div) << 0;
173 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG06_CLK_MANAGER, reg06));
177 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG07_CLK_MANAGER, ®07));
179 reg07 |= coefficient->lrck_h << 0;
180 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG07_CLK_MANAGER, reg07));
183 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG08_CLK_MANAGER, coefficient->lrck_l));
192 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG00_RESET, ®00));
194 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG00_RESET, reg00));
198 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG09_SDPIN, reg09));
202 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG0A_SDPOUT, reg0a));
209 uint8_t reg14 = 0x1A;
213 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG14_SYSTEM, reg14));
216 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG17_ADC, 0xC8));