renesas,ra-acmphs

Vendor: Renesas Electronics Corporation

Note

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

Description

Renesas RA ACMPHS (High-Speed Analog COMParator) Controller

The following example displays the minimum node layout:

  acmphs_global: acmphs_global@deadbeef {
          ...

          acmphs0: acmphs0 {
                  compatible = "renesas,ra-acmphs";
                  channel = <0>;
                  status = "disabled";
          };
  };

Enabling the comparator controller node requires setting the minimum
default configuration of the comparator. This includes selecting the
positive and negative inputs, and routing them using pinctrl:

Note: A set of pinctrl for the default comparator controller node is
already defined on each board that supported comparator. Please check
the board’s pinctrl before defining it.

&pinctrl {
        acmphs_ivref0: acmphs_ivref0 {
                group1 {
                        /* IVREF0 */
                        psels = <RA_PSEL(RA_PSEL_ACMPHS, ..., ...)>;
                        renesas,analog-enable;
                };
        };

        acmphs0_ivcmp0: acmphs0_ivcmp0 {
                group1 {
                        /* CH0 IVCMP0 */
                        psels = <RA_PSEL(RA_PSEL_ACMPHS, ..., ...)>;
                        renesas,analog-enable;
                };
        };
};

&acmphs_global {
        status = "okay";

        acmphs0 {
                pinctrl-0 = <&acmphs_ivref0 &acmphs0_ivcmp0>;
                pinctrl-names = "default";
                interrupts = <90 12>;
                interrupt-names = "hs";
                reference-input-source = "ivref0";
                compare-input-source = "ivcmp0";
                status = "okay";
        };
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

channel

int

This property is required.

reference-input-source

string

Select the Analog reference voltage source.
Note: ivref2 is connected to Vref
      ivref3 is connected to DA0 (DAC)
      If either of these is selected, there is no need to configure pinsel for pinctrl.

This property is required.

Legal values: 'ivref0', 'ivref1', 'ivref2', 'ivref3'

compare-input-source

string

Select the Analog compare voltage source.
Note: ivcmp1 is connected to DA0 (DAC)
      If ivcmp1 is selected, there is no need to configure pinsel for pinctrl.

This property is required.

Legal values: 'ivcmp0', 'ivcmp1', 'ivcmp2', 'ivcmp3'

noise-filter

int

Select the PCLK divisor for the hardware digital debounce filter.
Larger divisors provide a longer debounce and take longer for the output to update.

Default value: 32

Legal values: 1, 8, 16, 32

output-invert-polarity

boolean

When enabled comparator output is inverted.

pin-output-enable

boolean

Turn this on to enable the CMPOUTn signal for this channel.
The CMPOUTn signal for each channel is OR'd together and the result is output to VCOUT.

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.