infineon,autanalog-ptcomp-comp

Description

Infineon AutAnalog PTComp comparator.

Each node represents one of the two comparators (Comp0 or Comp1) within
a PTComp block. The comparator compares the voltage on the non-inverting
input to the voltage on the inverting input and produces a digital output.

Input routing is configured via positive-mux and negative-mux properties
using the cy_en_autanalog_ptcomp_comp_mux_t values:
  0  = CTB0 Pin 1            8  = CTB0 OA0 output
  1  = CTB0 Pin 4            9  = CTB0 OA1 output
  2  = CTB0 Pin 6           10  = CTB1 OA0 output
  3  = CTB0 Pin 7           11  = CTB1 OA1 output
  4  = CTB1 Pin 1           12  = DAC0 (VREF0)
  5  = CTB1 Pin 4           13  = DAC1 (VREF1)
  6  = CTB1 Pin 6           14  = PRB OUT0 (VREF2)
  7  = CTB1 Pin 7           15  = PRB OUT1 (VREF3)
  16-23 = SAR/PTC GPIO Pin 0-7

The parent node must have compatible "infineon,autanalog-ptcomp".

Examples

/*
 * Use constants from <dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
 */
ptcomp0: ptcomp@0 {
    compatible = "infineon,autanalog-ptcomp";
    status = "okay";

    comp0: comp@0 {
        compatible = "infineon,autanalog-ptcomp-comp";
        reg = <0>;
        power-mode = <IFX_AUTANALOG_PTCOMP_PWR_NORMAL>;
        interrupt-mode = <IFX_AUTANALOG_PTCOMP_INT_EDGE_RISING>;
        positive-mux = <IFX_AUTANALOG_PTCOMP_MUX_GPIO2>;
        negative-mux = <IFX_AUTANALOG_PTCOMP_MUX_PRB_OUT0>;
    };
};

/*
 * Advanced mode: 2 dynamic mux config slots on comp@0.
 * Each child node is one slot with named properties.
 */
ptcomp0: ptcomp@0 {
    compatible = "infineon,autanalog-ptcomp";
    status = "okay";

    comp0: comp@0 {
        compatible = "infineon,autanalog-ptcomp-comp";
        reg = <0>;
        power-mode = <IFX_AUTANALOG_PTCOMP_PWR_NORMAL>;
        interrupt-mode = <IFX_AUTANALOG_PTCOMP_INT_EDGE_RISING>;
        positive-mux = <IFX_AUTANALOG_PTCOMP_MUX_GPIO2>;
        negative-mux = <IFX_AUTANALOG_PTCOMP_MUX_PRB_OUT0>;

        dyn-cfg-0 {
            positive-mux = <IFX_AUTANALOG_PTCOMP_MUX_GPIO2>;
            negative-mux = <IFX_AUTANALOG_PTCOMP_MUX_PRB_OUT0>;
        };

        dyn-cfg-1 {
            positive-mux = <IFX_AUTANALOG_PTCOMP_MUX_GPIO2>;
            negative-mux = <IFX_AUTANALOG_PTCOMP_MUX_DAC0>;
        };
    };
};

Properties

Top level properties

These property descriptions apply to “infineon,autanalog-ptcomp-comp” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

Name

Type

Details

power-mode

int

Comparator power mode.
Use IFX_AUTANALOG_PTCOMP_PWR_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_PWR_OFF    (0) - Off
  IFX_AUTANALOG_PTCOMP_PWR_ULP    (1) - Ultra-low power (< 300nA, 7us)
  IFX_AUTANALOG_PTCOMP_PWR_LP     (2) - Low power (< 10uA, 1us)
  IFX_AUTANALOG_PTCOMP_PWR_NORMAL (3) - Normal (< 150uA, 0.1us)

This property is required.

Legal values: 0, 1, 2, 3

hysteresis

boolean

Enable 30mV input hysteresis for the comparator.

interrupt-mode

int

Edge detection mode for comparator interrupts.
Use IFX_AUTANALOG_PTCOMP_INT_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_INT_DISABLED     (0) - Disabled
  IFX_AUTANALOG_PTCOMP_INT_EDGE_RISING  (1) - Rising edge
  IFX_AUTANALOG_PTCOMP_INT_EDGE_FALLING (2) - Falling edge
  IFX_AUTANALOG_PTCOMP_INT_EDGE_BOTH    (3) - Both edges

Default value: 0

positive-mux

int

Non-inverting (positive) input mux selector.
Use IFX_AUTANALOG_PTCOMP_MUX_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>, values 0-23.

This property is required.

negative-mux

int

Inverting (negative) input mux selector.
Use IFX_AUTANALOG_PTCOMP_MUX_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>, values 0-23.

This property is required.

pp-input-source

int

Post-processing input source.
Use IFX_AUTANALOG_PTCOMP_PP_SRC_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_PP_SRC_DISABLED (0)
  IFX_AUTANALOG_PTCOMP_PP_SRC_COMP0    (1)
  IFX_AUTANALOG_PTCOMP_PP_SRC_COMP1    (2)

Default value: 0

Legal values: 0, 1, 2

pp-input-type

int

Post-processing edge/level sensing type.
Use IFX_AUTANALOG_PTCOMP_PP_TYPE_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_PP_TYPE_LEVEL        (0)
  IFX_AUTANALOG_PTCOMP_PP_TYPE_EDGE_RISING  (1)
  IFX_AUTANALOG_PTCOMP_PP_TYPE_EDGE_FALLING (2)
  IFX_AUTANALOG_PTCOMP_PP_TYPE_EDGE_BOTH    (3)

Default value: 0

Legal values: 0, 1, 2, 3

pp-count-mode

int

Post-processing counter mode.
Use IFX_AUTANALOG_PTCOMP_PP_MODE_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_PP_MODE_DIRECT (0) - Count events, reset on condition
  IFX_AUTANALOG_PTCOMP_PP_MODE_FRAME  (1) - Count events within a frame period
  IFX_AUTANALOG_PTCOMP_PP_MODE_WINDOW (2) - Sliding window counter

Default value: 0

Legal values: 0, 1, 2

pp-data-function

int

Post-processing LUT boolean function combining both comp outputs.
Use IFX_AUTANALOG_PTCOMP_PP_FUNC_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>, values 0-13.

Default value: 0

pp-window-size

int

Post-processing window size for WINDOW mode.
Use IFX_AUTANALOG_PTCOMP_PP_WIN_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_PP_WIN_2   (0)
  IFX_AUTANALOG_PTCOMP_PP_WIN_4   (1)
  IFX_AUTANALOG_PTCOMP_PP_WIN_8   (2)
  IFX_AUTANALOG_PTCOMP_PP_WIN_16  (3)
  IFX_AUTANALOG_PTCOMP_PP_WIN_32  (4)
  IFX_AUTANALOG_PTCOMP_PP_WIN_64  (5)
  IFX_AUTANALOG_PTCOMP_PP_WIN_128 (6)

Default value: 0

Legal values: 0, 1, 2, 3, 4, 5, 6

pp-period

int

Post-processing frame period in clock cycles (FRAME mode).

Default value: 0

pp-limit-condition

int

Post-processing counter limit condition.
Use IFX_AUTANALOG_PTCOMP_PP_COND_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.
  IFX_AUTANALOG_PTCOMP_PP_COND_BELOW   (0) - Below threshold-low
  IFX_AUTANALOG_PTCOMP_PP_COND_INSIDE  (1) - Between low and high
  IFX_AUTANALOG_PTCOMP_PP_COND_ABOVE   (2) - Above threshold-high
  IFX_AUTANALOG_PTCOMP_PP_COND_OUTSIDE (3) - Below low or above high

Default value: 0

Legal values: 0, 1, 2, 3

pp-threshold-low

int

Post-processing low threshold for counter range detection.

Default value: 0

pp-threshold-high

int

Post-processing high threshold for counter range detection.

Default value: 0

Child node properties

Name

Type

Details

positive-mux

int

Non-inverting (positive) input mux selector.
Use IFX_AUTANALOG_PTCOMP_MUX_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.

Default value: 0

negative-mux

int

Inverting (negative) input mux selector.
Use IFX_AUTANALOG_PTCOMP_MUX_* constants from
<dt-bindings/comparator/infineon-autanalog-ptcomp.h>.

Default value: 0