nordic,nrf-comp

Description

Nordic nRF COMP (analog COMParator)

This comparator has varying configurations which require varying properties be set in the
devicetree. Enabling the comparator node requires setting the default configuration of the
comparator.

Examples

/*
 * The following example displays the minimum node layout:
 */
comp: comp@deadbeef {
        compatible = "nordic,nrf-comp";
        reg = <0xdeadbeef 0x1000>;
        interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>;
        status = "disabled";
};

/*
 * The following example displays enabling the comparator in
 * single-ended mode, selecting an internal reference:
 */
&comp {
        status = "okay";
        main-mode = "SE";
        psel = <NRF_COMP_AIN0>;
        refsel = "INT_1V2";
        sp-mode = "NORMAL";
        th-up = <36>;
        th-down = <30>;
        isource = "DISABLED";
};

/*
 * To select an external reference, select the "AREF"
 * reference and add the external reference:
 */
&comp {
        ...
        refsel = "AREF";
        extrefsel = <NRF_COMP_AIN1>;
        ...
};

/*
 * The following example displays enabling the comparator
 * in differential mode:
 */
&comp {
        status = "okay";
        main-mode = "DIFF";
        psel = <NRF_COMP_AIN0>;
        extrefsel = <NRF_COMP_AIN1>;
        sp-mode = "NORMAL";
        enable-hyst;
        isource = "DISABLED";
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

main-mode

string

Legal values: SE, DIFF

psel

int

extrefsel

int

refsel

string

Legal values: INT_1V2, INT_1V8, INT_2V4, AVDDAO1V8, VDD, AREF

enable-hyst

boolean

sp-mode

string

Legal values: LOW, NORMAL, HIGH

th-up

int

th-down

int

isource

string

Legal values: DISABLED, 2UA5, 5UA, 10UA