ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
pcm1863.h
Go to the documentation of this file.
1#pragma once
2
6#ifdef USE_PCM1863_SELECT
8#endif
9
10#include "pcm1863_const.h"
11
12namespace esphome::pcm1863 {
13
14// Positions of the select options, in the order audio_adc.py declares them
24
25// The word length code of PCM1863_REG_PCM_CFG
32
36class PCM1863 final : public audio_adc::AudioAdc, public Component, public i2c::I2CDevice {
37#ifdef USE_PCM1863_SELECT
38 SUB_SELECT(input)
39#endif
40
41 public:
42 void setup() override;
43 void dump_config() override;
44
45 void set_bits_per_sample(PCM1863BitsPerSample bits_per_sample) { this->bits_per_sample_ = bits_per_sample; }
46
48 bool set_input(PCM1863Input input);
49
50 bool set_mic_gain(float mic_gain) override;
51 float mic_gain() override { return this->mic_gain_; }
52
53 protected:
56 bool configure_input_();
57
58 float mic_gain_{0};
61};
62
63} // namespace esphome::pcm1863
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
Texas Instruments PCM1863 stereo audio ADC for line and microphone input.
Definition pcm1863.h:36
PCM1863Input input_
Definition pcm1863.h:60
PCM1863BitsPerSample bits_per_sample_
Definition pcm1863.h:59
@ PCM1863_BITS_PER_SAMPLE_32
Definition pcm1863.h:27
@ PCM1863_BITS_PER_SAMPLE_20
Definition pcm1863.h:29
@ PCM1863_BITS_PER_SAMPLE_24
Definition pcm1863.h:28
@ PCM1863_BITS_PER_SAMPLE_16
Definition pcm1863.h:30