esphome / esphome/feature-requests

Implement control of esp32 DAC built-in cosine waveform generator

Open
#2,439 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

The esp32 DAC has a built-in cosine waveform generator, not yet accessible or supported in esphome DAC configuration. This seems simple enough to implement, please. Can this be done via lambda and direct register access? I don't want to create the wave from calculations or lookup tables, for slow waveform output, taking up all chip resources when this is already built in to the chip to work on its own. Please implement control of the DAC's built in cosine generator here: (calling it with at least the parameters of Frequency, On, OFF or start/stop)

output:
- platform: esp32_dac
pin: GPIO25
id: dac_output

reference https://github.com/krzychb/dac-cosine

**Please describe your use case for this integration and alternatives you've tried:**

I'm hoping to use this for on-the-fly signal generation, where I can change at least the frequency to control frequency controlled devices, or for clock generation, all without using program / chip cycle time. Also for inter-device state communication via specific frequency. Audible tone generation for audible state / status would be useful to the blind or for everyone not looking at a screen or LED for status. R2D2 communicates via audible tones. Hey if it's a feature of esp32, I'd like to control it via esphome.

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the ESPHome `esp32_dac` output configuration and compare its available controls with the referenced `dac-cosine` implementation. Define how frequency and on/off or start/stop controls should appear in the configuration, then verify that the built-in cosine generator can be controlled without calculated waveforms or lookup tables.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.