8 #include <esp32-hal-dac.h> 11 #include <driver/dac.h> 17 static const char *
const TAG =
"esp32_dac";
20 ESP_LOGCONFIG(TAG,
"Setting up ESP32 DAC Output...");
25 auto channel =
pin_->
get_pin() == 25 ? DAC_CHANNEL_1 : DAC_CHANNEL_2;
26 dac_output_enable(channel);
31 ESP_LOGCONFIG(TAG,
"ESP32 DAC:");
32 LOG_PIN(
" Pin: ", this->
pin_);
33 LOG_FLOAT_OUTPUT(
this);
43 auto channel =
pin_->
get_pin() == 25 ? DAC_CHANNEL_1 : DAC_CHANNEL_2;
44 dac_output_voltage(channel, (uint8_t) state);
void setup() override
Initialize pin.
virtual void turn_off()
Disable this binary output.
virtual uint8_t get_pin() const =0
Implementation of SPI Controller mode.
void write_state(float state) override
void dump_config() override
virtual bool is_inverted() const =0