espressif,esp32-dac

Description

ESP32 Digital to Analog converter (DAC)

Part of the RTC low-power domain and belongs to the SENSE
peripherals set. RTC peripherals has GPIOs controlled by the
RTCIO mux, which is separated from the main IO mux.

Two GPIO pads can only be connected to the DAC peripheral.

ESP32 pads
  - GPIO25 as DAC channel 1
  - GPIO26 as DAC channel 2

ESP32-S2 pads
  - GPIO17 as DAC channel 1
  - GPIO18 as DAC channel 2

To enable the DAC peripheral it must be enabled in the board
dts, or in subsequent overlay file.

      &dac {
          status = "okay";
      };

To specify the DAC channel to use, dts overlay must include
properties 'dac-channel-id', which uses zero based channel index.
Variable 'dac-resolution' must be also specified, although ESP32
only supported resolution is 8bits.

      / {
        zephyr,user {
          dac = <&dac>;
          dac-channel-id = <0>;
          dac-resolution = <8>;
        };
      };

NOTE: The DAC peripheral outputs are fixed to gpio pads, therefore
      it does not need to be controlled by the pinctrl node.

Properties

Top level properties

These property descriptions apply to “espressif,esp32-dac” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

Name

Type

Details

#io-channel-cells

int

This property is required.

Constant value: 1

Child node properties

Name

Type

Details

reg

array

Channel identifier.

This property is required.

See Important properties for more information.

zephyr,resolution

int

DAC resolution to be used for the channel.

zephyr,buffered

boolean

Enable output buffer for the channel.

zephyr,internal

boolean

Enable internal output path for the channel.

zephyr,vref-mv

int

This property can be used to specify the voltage (in millivolts)
of the reference selected for this channel, so that applications
can get that value if needed for some calculations.

Specifier cell names

  • io-channel cells: output