silabs,acmp

Vendor: Silicon Laboratories

Note

An implementation of a driver matching this compatible is available in drivers/comparator/comparator_silabs_acmp.c.

Description

Silabs ACMP (Analog Comparator)

The minimal default configuration for the silabs acmp node is as follows:

  #include <zephyr/dt-bindings/comparator/silabs-acmp.h>

  &acmp0 {
         status = "okay";

         input-positive = <ACMP_INPUT_VSENSE01DIV4>;
         input-negative = <ACMP_INPUT_VREFDIVAVDD>;
  };

Note that there are bindings to retrieve the values for `input-positive` and
`input-negative` properties. See the included bindings in the example above.

When using the minimal default configuration in the snippet above, some
properties will be implicitly configured with default values. An equivalent
device tree node is therefore as follows:

  #include <zephyr/dt-bindings/comparator/silabs-acmp.h>

  &acmp0 {
          status = "okay";

          bias = <0>;
          hysteresis-mode = "disabled";
          accuracy-mode = "low";
          input-range = "full";
          input-positive = <ACMP_INPUT_VSENSE01DIV4>;
          input-negative = <ACMP_INPUT_VREFDIVAVDD>;
          vref-divider = <63>;
  };

It is also possible to select a GPIO pin for either/both of the
`input-positive` or `input-negative` properties. In those cases, the
`pinctrl` driver must be configured to allocate an analog bus corresponding
to the port and pin of each GPIO input selected. The following is an example
of how that can be configured:

  #include <zephyr/dt-bindings/comparator/silabs-acmp.h>
  #include <zephyr/dt-bindings/pinctrl/silabs/xg24-pinctrl.h>

  &pinctrl {
          acmp0_default: acmp0_default {
                  group0 {
                          silabs,analog-bus = <ABUS_CDODD0_ACMP0>;
                  };
          };
  };

  &acmp0 {
          pinctrl-0 = <&acmp0_default>;
          pinctrl-names = "default";
          status = "okay";

          bias = <0>;
          hysteresis-mode = "disabled";
          accuracy-mode = "low";
          input-range = "full";
          input-positive = <ACMP_INPUT_PC3>;
          input-negative = <ACMP_INPUT_VREFDIV1V25>;
          vref-divider = <63>;
  };

In the above example, note that the device specific bindings for pinctrl
were included. This header defines the set of analog bus allocations possible
for xg24 parts, and similar headers exist for other parts.

Properties

Properties not inherited from the base binding file.

Name

Type

Details

bias

int

hysteresis-mode

string

Default value: disabled

Legal values: 'disabled', 'sym10mv', 'sym20mv', 'sym30mv', 'pos10mv', 'pos20mv', 'pos30mv', 'neg10mv', 'neg20mv', 'neg30mv'

accuracy-mode

string

Default value: low

Legal values: 'low', 'high'

input-range

string

Default value: full

Legal values: 'full', 'reduced'

input-positive

int

This property is required.

input-negative

int

This property is required.

vref-divider

int

Default value: 63

pinctrl-0

phandles

Pin configuration/s for the first state. Content is specific to the
selected pin controller driver implementation.

pinctrl-1

phandles

Pin configuration/s for the second state. See pinctrl-0.

pinctrl-2

phandles

Pin configuration/s for the third state. See pinctrl-0.

pinctrl-3

phandles

Pin configuration/s for the fourth state. See pinctrl-0.

pinctrl-4

phandles

Pin configuration/s for the fifth state. See pinctrl-0.

pinctrl-names

string-array

Names for the provided states. The number of names needs to match the
number of states.