5#if defined(USE_ESP32_VARIANT_ESP32) || defined(USE_ESP32_VARIANT_ESP32S2)
10#ifdef USE_ESP32_VARIANT_ESP32S2
11static constexpr uint8_t DAC0_PIN = 17;
13static constexpr uint8_t DAC0_PIN = 25;
16static const char *
const TAG =
"esp32_dac";
22 const dac_channel_t channel = this->
pin_->
get_pin() == DAC0_PIN ? DAC_CHAN_0 : DAC_CHAN_1;
23 const dac_oneshot_config_t oneshot_cfg{channel};
24 dac_oneshot_new_channel(&oneshot_cfg, &this->
dac_handle_);
30 ESP_LOGCONFIG(TAG,
"ESP32 DAC:");
31 LOG_PIN(
" Pin: ", this->
pin_);
32 LOG_FLOAT_OUTPUT(
this);
41 dac_oneshot_output_voltage(this->
dac_handle_, state);
virtual uint8_t get_pin() const =0
virtual bool is_inverted() const =0
void on_safe_shutdown() override
dac_oneshot_handle_t dac_handle_
void write_state(float state) override
void setup() override
Initialize pin.
void dump_config() override
virtual void turn_off()
Disable this binary output.
Providing packet encoding functions for exchanging data with a remote host.