Espressif ESP32-S2 Programming Manual page 247

Table of Contents

Advertisement

Chapter 2. API Reference
Parameters
• cfg: Pointer to digital controller paramter. See dac_digi_config_t.
esp_err_t
dac_digi_start(void)
DAC digital controller start output voltage.
Return
• ESP_OK success
esp_err_t
dac_digi_stop(void)
DAC digital controller stop output voltage.
Return
• ESP_OK success
esp_err_t
dac_digi_fifo_reset(void)
Reset DAC digital controller FIFO.
Return
• ESP_OK success
esp_err_t
dac_digi_reset(void)
Reset DAC digital controller.
Return
• ESP_OK success
Header File
components/driver/include/driver/dac_common.h
Functions
esp_err_t dac_pad_get_io_num(dac_channel_t
Get the GPIO number of a specific DAC channel.
Return
• ESP_OK if success
Parameters
• channel: Channel to get the gpio number
• gpio_num: output buffer to hold the gpio number
esp_err_t dac_output_voltage(dac_channel_t
Set DAC output voltage. DAC output is 8-bit. Maximum (255) corresponds to VDD3P3_RTC.
Note Need to configure DAC pad before calling this function. DAC channel 1 is attached to GPIO25, DAC
channel 2 is attached to GPIO26
Return
• ESP_OK success
Parameters
• channel: DAC channel
• dac_value: DAC output value
esp_err_t dac_output_enable(dac_channel_t
DAC pad output enable.
Note DAC channel 1 is attached to GPIO25, DAC channel 2 is attached to GPIO26 I2S left channel will be
mapped to DAC channel 2 I2S right channel will be mapped to DAC channel 1
Parameters
• channel: DAC channel
esp_err_t dac_output_disable(dac_channel_t
DAC pad output disable.
Note DAC channel 1 is attached to GPIO25, DAC channel 2 is attached to GPIO26
Return
Espressif Systems
channel,
gpio_num_t
channel, uint8_t dac_value)
channel)
channel)
236
Submit Document Feedback
*gpio_num)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF