ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
es8388.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
8#ifdef USE_SELECT
10#endif
11
12#include "es8388_const.h"
13
14namespace esphome {
15namespace es8388 {
16
22
28
29class ES8388 : public audio_dac::AudioDac, public Component, public i2c::I2CDevice {
30#ifdef USE_SELECT
31 SUB_SELECT(dac_output)
32 SUB_SELECT(adc_input_mic)
33#endif
34
35 public:
37 // Component overrides //
39
40 void setup() override;
41 void dump_config() override;
42
44 // AudioDac overrides //
46
50 bool set_volume(float volume) override;
51
54 float volume() override;
55
58 bool set_mute_off() override { return this->set_mute_state_(false); }
59
62 bool set_mute_on() override { return this->set_mute_state_(true); }
63
64 bool is_muted() override { return this->is_muted_; }
65
66 optional<DacOutputLine> get_dac_power();
67 optional<AdcInputMicLine> get_mic_input();
68
69 bool set_dac_output(DacOutputLine line);
70 bool set_adc_input_mic(AdcInputMicLine line);
71
72 protected:
76 bool set_mute_state_(bool mute_state);
77};
78
79} // namespace es8388
80} // namespace esphome
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:85
bool set_mute_state_(bool mute_state)
Mutes or unmutes the DAC audio out.
Definition es8388.cpp:171
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
@ ADC_INPUT_MIC_LINE1
Definition es8388.h:24
@ ADC_INPUT_MIC_DIFFERENCE
Definition es8388.h:26
@ ADC_INPUT_MIC_LINE2
Definition es8388.h:25
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7