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));
105 uint8_t reg01 = 0x3F;
115 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG01_CLK_MANAGER, reg01));
119 if (coefficient ==
nullptr) {
120 ESP_LOGE(TAG,
"Unable to configure sample rate %" PRIu32
"Hz with %" PRIu32
"Hz MCLK", this->
sample_frequency_,
127 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG02_CLK_MANAGER, ®02));
129 reg02 |= (coefficient->pre_div - 1) << 5;
130 reg02 |= coefficient->pre_mult << 3;
131 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG02_CLK_MANAGER, reg02));
134 const uint8_t reg03 = (coefficient->fs_mode << 6) | coefficient->adc_osr;
135 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG03_CLK_MANAGER, reg03));
138 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG04_CLK_MANAGER, coefficient->dac_osr));
141 const uint8_t reg05 = ((coefficient->adc_div - 1) << 4) | (coefficient->dac_div - 1);
142 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG05_CLK_MANAGER, reg05));
146 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG06_CLK_MANAGER, ®06));
153 if (coefficient->bclk_div < 19) {
154 reg06 |= (coefficient->bclk_div - 1) << 0;
156 reg06 |= (coefficient->bclk_div) << 0;
158 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG06_CLK_MANAGER, reg06));
162 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG07_CLK_MANAGER, ®07));
164 reg07 |= coefficient->lrck_h << 0;
165 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG07_CLK_MANAGER, reg07));
168 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG08_CLK_MANAGER, coefficient->lrck_l));
177 ES8311_ERROR_CHECK(this->
read_byte(ES8311_REG00_RESET, ®00));
179 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG00_RESET, reg00));
183 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG09_SDPIN, reg09));
187 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG0A_SDPOUT, reg0a));
194 uint8_t reg14 = 0x1A;
198 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG14_SYSTEM, reg14));
201 ES8311_ERROR_CHECK(this->
write_byte(ES8311_REG17_ADC, 0xC8));