ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
es9038q2m_katana.h
Go to the documentation of this file.
1#pragma once
2
7
9
10// DSP program numbers of the Katana control interface; there is no program 5.
20
27
28// Boards that expose an ES9038Q2M through the Allo Katana control logic at I2C address 0x30.
29// Ported from the Linux driver sound/soc/bcm/allo-katana-codec.c; the DAC's own registers
30// are never written, the control logic applies the configuration itself.
32 public:
33 void setup() override;
34 void dump_config() override;
35
36 // Cubic below 50%, then 0.5 dB per 1% above, meeting at -25 dB.
37 // Zero selects full attenuation (-127.5 dB).
38 bool set_volume(float volume) override;
39 float volume() override;
40 bool set_mute_off() override { return this->set_mute_state_(false); }
41 bool set_mute_on() override { return this->set_mute_state_(true); }
42 bool is_muted() override { return this->is_muted_; }
43
44 void set_filter_shape(FilterShape shape) { this->filter_shape_ = shape; }
45 void set_format(uint8_t format) { this->format_ = format; }
47 void set_dop_enabled(bool enabled) { this->dop_enabled_ = enabled; }
48
49 protected:
50 bool set_mute_state_(bool mute_state);
51 bool write_volume_();
52 bool check_write_(bool ok);
53
56 uint8_t format_{0};
57 // Attenuation in 0.5 dB steps: 0 is loudest, 255 quietest. Starts 20 dB down.
58 uint8_t volume_reg_{0x28};
59 bool dop_enabled_{false};
60};
61
62} // namespace esphome::es9038q2m_katana
BedjetMode mode
BedJet operating mode.
void set_deemphasis_mode(DeemphasisMode mode)
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
const char * format