espressif,esp32-ana-cmpr

Description

Espressif Analog Comparator (ana_cmpr)

Compares a fixed analog source GPIO pad against either an internal
(VDD-divider) or external GPIO reference voltage, and reports the
crossing as edge events via the generic comparator API.

Both the source pad and, when ref-source is "external", the reference
pad are fixed per SoC and per unit, and are not configurable via
devicetree:
  ESP32-C5 unit0: source GPIO9,  external reference GPIO8
  ESP32-H2 unit0: source GPIO11, external reference GPIO10
  ESP32-P4 unit0: source GPIO52, external reference GPIO51
  ESP32-P4 unit1: source GPIO54, external reference GPIO53

Example (internal reference at 50% VDD):

  &ana_cmpr1 {
          status = "okay";
          ref-source = "internal";
          ref-voltage = <50>;
  };

Properties

Properties not inherited from the base binding file.

Name

Type

Details

unit

int

Analog comparator unit index (0-based). Selects the fixed source and
external-reference GPIO pads for this instance; see ana_cmpr_periph.c
for the chip.

This property is required.

ref-source

string

Reference voltage source. "internal" uses a VDD-divider generated by
ref-voltage; "external" uses this unit's fixed external-reference GPIO
pad.

Default value: internal

Legal values: internal, external

ref-voltage

int

Internal reference voltage, in percent of VDD. Only used when
ref-source = "internal".

Default value: 0

Legal values: 0, 10, 20, 30, 40, 50, 60, 70

debounce-cycles

int

Debounce cycle count applied to cross detection: once a cross is
detected, the comparator waits this many PAD_COMP_CLK cycles before
confirming it, to filter out glitches.

Default value: 0