20 ESP_LOGCONFIG(TAG,
"Setting up ES8156...");
22 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG02_SCLK_MODE, 0x04));
23 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG20_ANALOG_SYS1, 0x2A));
24 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG21_ANALOG_SYS2, 0x3C));
25 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG22_ANALOG_SYS3, 0x00));
26 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG24_ANALOG_LP, 0x07));
27 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG23_ANALOG_SYS4, 0x00));
29 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG0A_TIME_CONTROL1, 0x01));
30 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG0B_TIME_CONTROL2, 0x01));
31 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG11_DAC_SDP, 0x00));
32 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG19_EQ_CONTROL1, 0x20));
34 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG0D_P2S_CONTROL, 0x14));
35 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG09_MISC_CONTROL2, 0x00));
36 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG18_MISC_CONTROL3, 0x00));
37 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG08_CLOCK_ON_OFF, 0x3F));
38 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG00_RESET, 0x02));
39 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG00_RESET, 0x03));
40 ES8156_ERROR_FAILED(this->
write_byte(ES8156_REG25_ANALOG_SYS5, 0x20));
70 if (!this->
read_byte(ES8156_REG13_DAC_MUTE, ®13)) {
74 ESP_LOGV(TAG,
"Read ES8156_REG13_DAC_MUTE: %u", reg13);
77 reg13 |= BIT(1) | BIT(2);
79 reg13 &= ~(BIT(1) | BIT(2));
82 ESP_LOGV(TAG,
"Setting ES8156_REG13_DAC_MUTE to %u (muted: %s)", reg13, YESNO(mute_state));
83 return this->
write_byte(ES8156_REG13_DAC_MUTE, reg13);