The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/device-tree/Bindings/iio/afe/voltage-divider.yaml

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
    2 %YAML 1.2
    3 ---
    4 $id: http://devicetree.org/schemas/iio/afe/voltage-divider.yaml#
    5 $schema: http://devicetree.org/meta-schemas/core.yaml#
    6 
    7 title: Voltage divider
    8 
    9 maintainers:
   10   - Peter Rosin <peda@axentia.se>
   11 
   12 description: |
   13   When an io-channel measures the midpoint of a voltage divider, the
   14   interesting voltage is often the voltage over the full resistance
   15   of the divider. This binding describes the voltage divider in such
   16   a curcuit.
   17 
   18     Vin ----.
   19             |
   20          .-----.
   21          |  R  |
   22          '-----'
   23             |
   24             +---- Vout
   25             |
   26          .-----.
   27          | Rout|
   28          '-----'
   29             |
   30            GND
   31 
   32 
   33 properties:
   34   compatible:
   35     const: voltage-divider
   36 
   37   io-channels:
   38     maxItems: 1
   39     description: |
   40       Channel node of a voltage io-channel.
   41 
   42   output-ohms:
   43     description:
   44       Resistance Rout over which the output voltage is measured. See full-ohms.
   45 
   46   full-ohms:
   47     description:
   48       Resistance R + Rout for the full divider. The io-channel is scaled by
   49       the Rout / (R + Rout) quotient.
   50 
   51 required:
   52   - compatible
   53   - io-channels
   54   - output-ohms
   55   - full-ohms
   56 
   57 additionalProperties: false
   58 
   59 examples:
   60   - |
   61     #include <dt-bindings/interrupt-controller/irq.h>
   62     /*
   63      * The system voltage is circa 12V, but divided down with a 22/222
   64      * voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC.
   65      */
   66     spi {
   67         #address-cells = <1>;
   68         #size-cells = <0>;
   69         maxadc: adc@0 {
   70             compatible = "maxim,max1027";
   71             reg = <0>;
   72             #io-channel-cells = <1>;
   73             interrupt-parent = <&gpio5>;
   74             interrupts = <15 IRQ_TYPE_EDGE_RISING>;
   75             spi-max-frequency = <1000000>;
   76         };
   77     };
   78     sysv {
   79         compatible = "voltage-divider";
   80         io-channels = <&maxadc 1>;
   81 
   82         /* Scale the system voltage by 22/222 to fit the ADC range. */
   83         output-ohms = <22>;
   84         full-ohms = <222>; /* 200 + 22 */
   85     };
   86 ...

Cache object: 326c3eda3746efd7b08cbcc4ebc34999


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.