esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
417 stars 26 forks source link

Implement control of esp32 DAC built-in cosine waveform generator #2439

Open terren272 opened 12 months ago

terren272 commented 12 months ago

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:

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

nagyrobi commented 12 months ago

inter-device state communication via specific frequency

How do you want to implement that?

terren272 commented 12 months ago

That use case isn't relevant. I just need to control and set the frequency of the esp32 DAC built-in cosine waveform generator from esphome. Frequency generation would be very useful to many, I would think, for many use cases.

nagyrobi commented 12 months ago

That use case isn't relevant.

It is, for many people, and since you mentioned it, why not share the idea?

terren272 commented 12 months ago

The IDEA here is to convince ESPhome to provide configuration access and control of esp32 DAC built-in cosine waveform generator.

All use cases are irrelevant if they cannot be implemented, because as far as I know, we don't currently have control of this built-in chip feature.

terren272 commented 9 months ago

PLEASE implement support for esp32 Cosine Wave Generator

"The ESP32 DAC has a single Cosine Wave Generator, whose output can be sent to one or both DAC channels. The user has control over the frequency, amplitude, and phase of the cosine wave."