ESPHome  2025.2.0
es7243e.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace es7243e {
9 
10 class ES7243E : public audio_adc::AudioAdc, public Component, public i2c::I2CDevice {
11  /* Class for configuring an ES7243E ADC for microphone input.
12  * Based on code from:
13  * - https://github.com/espressif/esp-adf/ (accessed 20250116)
14  */
15  public:
16  void setup() override;
17  float get_setup_priority() const override { return setup_priority::DATA; }
18  void dump_config() override;
19 
20  bool set_mic_gain(float mic_gain) override;
21 
22  float mic_gain() override { return this->mic_gain_; };
23 
24  protected:
28  uint8_t es7243e_gain_reg_value_(float mic_gain);
29 
30  bool configure_mic_gain_();
31 
32  bool setup_complete_{false};
33  float mic_gain_{0};
34 };
35 
36 } // namespace es7243e
37 } // namespace esphome
bool set_mic_gain(float mic_gain) override
Definition: es7243e.cpp:92
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
void setup() override
Definition: es7243e.cpp:36
float mic_gain() override
Definition: es7243e.h:22
float get_setup_priority() const override
Definition: es7243e.h:17
void dump_config() override
Definition: es7243e.cpp:27
uint8_t es7243e_gain_reg_value_(float mic_gain)
Convert floating point mic gain value to register value.
Definition: es7243e.cpp:109
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133