1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-07 21:51:00 +00:00

Fix and add to test4

This commit is contained in:
Jesse Hills 2022-06-13 12:39:55 +12:00
parent 9fa057eae8
commit bfc55beedc
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
2 changed files with 26 additions and 23 deletions

View File

@ -8,45 +8,45 @@ void ES8388Component::setup() {
this->power_pin_->digital_write(false); this->power_pin_->digital_write(false);
// reset // reset
this->write_bytes(0x00, {0x80}, 1); this->write_bytes(0x00, {0x80});
this->write_bytes(0x00, {0x00}, 1); this->write_bytes(0x00, {0x00});
// mute // mute
this->write_bytes(0x19, {0x04}, 1); this->write_bytes(0x19, {0x04});
this->write_bytes(0x01, {0x50}, 1); this->write_bytes(0x01, {0x50});
// powerup // powerup
this->write_bytes(0x02, {0x00}, 1); this->write_bytes(0x02, {0x00});
// slave mode // slave mode
this->write_bytes(0x08, {0x00}, 1); this->write_bytes(0x08, {0x00});
// DAC powerdown // DAC powerdown
this->write_bytes(0x04, {0xC0}, 1); this->write_bytes(0x04, {0xC0});
// vmidsel/500k ADC/DAC idem // vmidsel/500k ADC/DAC idem
this->write_bytes(0x00, {0x12}, 1); this->write_bytes(0x00, {0x12});
this->write_bytes(0x01, {0x00}, 1); this->write_bytes(0x01, {0x00});
// i2s 16 bits // i2s 16 bits
this->write_bytes(0x17, {0x18}, 1); this->write_bytes(0x17, {0x18});
// sample freq 256 // sample freq 256
this->write_bytes(0x18, {0x02}, 1); this->write_bytes(0x18, {0x02});
// LIN2/RIN2 for mixer // LIN2/RIN2 for mixer
this->write_bytes(0x26, {0x09}, 1); this->write_bytes(0x26, {0x09});
// left DAC to left mixer // left DAC to left mixer
this->write_bytes(0x27, {0x90}, 1); this->write_bytes(0x27, {0x90});
// right DAC to right mixer // right DAC to right mixer
this->write_bytes(0x2A, {0x90}, 1); this->write_bytes(0x2A, {0x90});
// DACLRC ADCLRC idem // DACLRC ADCLRC idem
this->write_bytes(0x2B, {0x80}, 1); this->write_bytes(0x2B, {0x80});
this->write_bytes(0x2D, {0x00}, 1); this->write_bytes(0x2D, {0x00});
// DAC volume max // DAC volume max
this->write_bytes(0x1B, {0x00}, 1); this->write_bytes(0x1B, {0x00});
this->write_bytes(0x1A, {0x00}, 1); this->write_bytes(0x1A, {0x00});
this->write_bytes(0x02, {0xF0}, 1); this->write_bytes(0x02, {0xF0});
this->write_bytes(0x02, {0x00}, 1); this->write_bytes(0x02, {0x00});
this->write_bytes(0x1D, {0x1C}, 1); this->write_bytes(0x1D, {0x1C});
// DAC power-up LOUT1/ROUT1 enabled // DAC power-up LOUT1/ROUT1 enabled
this->write_bytes(0x04, {0x30}, 1); this->write_bytes(0x04, {0x30});
// unmute // unmute
this->write_bytes(0x19, {0x00}, 1); this->write_bytes(0x19, {0x00});
// Turn on amplifier // Turn on amplifier
this->power_pin_->digital_write(true); this->power_pin_->digital_write(true);

View File

@ -716,3 +716,6 @@ voice_assistant:
- logger.log: - logger.log:
format: "Voice assistant error - code %s, message: %s" format: "Voice assistant error - code %s, message: %s"
args: [code.c_str(), message.c_str()] args: [code.c_str(), message.c_str()]
es8388:
power_pin: GPIO21