ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
es7243.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ESP32
4
9
10namespace esphome::es7243 {
11
14class ES7243 final : public audio_adc::AudioAdc, public Component, public i2c::I2CDevice {
15 public:
16 explicit ES7243(const i2s_audio::I2SAudioComponent *i2s) : i2s_(i2s) {}
17
18 void setup() override;
19 void dump_config() override;
20 // Before i2s_audio (DATA) routes the MCLK pin to the I2S peripheral, after the I2C bus
21 float get_setup_priority() const override { return setup_priority::HARDWARE; }
22
23 bool set_mic_gain(float mic_gain) override;
24 float mic_gain() override;
25
26 protected:
27 bool write_mic_gain_();
28
30 uint8_t gain_index_{0}; // into GAIN_TABLE in the .cpp
31 bool setup_complete_{false};
32};
33
34} // namespace esphome::es7243
35
36#endif // USE_ESP32
ES7243 microphone ADC.
Definition es7243.h:14
void dump_config() override
Definition es7243.cpp:68
float get_setup_priority() const override
Definition es7243.h:21
ES7243(const i2s_audio::I2SAudioComponent *i2s)
Definition es7243.h:16
const i2s_audio::I2SAudioComponent * i2s_
Definition es7243.h:29
float mic_gain() override
Definition es7243.cpp:76
void setup() override
Definition es7243.cpp:45
bool set_mic_gain(float mic_gain) override
Definition es7243.cpp:78
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:43