0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/afe/current-sense-shunt.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Current Sense Shunt
0008
0009 maintainers:
0010 - Peter Rosin <peda@axentia.se>
0011
0012 description: |
0013 When an io-channel measures the voltage over a current sense shunt,
0014 the interesting measurement is almost always the current through the
0015 shunt, not the voltage over it. This binding describes such a current
0016 sense circuit.
0017
0018 properties:
0019 compatible:
0020 const: current-sense-shunt
0021
0022 io-channels:
0023 maxItems: 1
0024 description: |
0025 Channel node of a voltage io-channel.
0026
0027 "#io-channel-cells":
0028 const: 0
0029
0030 shunt-resistor-micro-ohms:
0031 description: The shunt resistance.
0032
0033 required:
0034 - compatible
0035 - io-channels
0036 - shunt-resistor-micro-ohms
0037
0038 additionalProperties: false
0039
0040 examples:
0041 - |
0042 i2c {
0043 #address-cells = <1>;
0044 #size-cells = <0>;
0045 tiadc: adc@48 {
0046 compatible = "ti,ads1015";
0047 reg = <0x48>;
0048 #io-channel-cells = <1>;
0049
0050 #address-cells = <1>;
0051 #size-cells = <0>;
0052
0053 channel@0 { /* IN0,IN1 differential */
0054 reg = <0>;
0055 ti,gain = <1>;
0056 ti,datarate = <4>;
0057 };
0058 };
0059 };
0060 sysi {
0061 compatible = "current-sense-shunt";
0062 io-channels = <&tiadc 0>;
0063 #io-channel-cells = <0>;
0064
0065 /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
0066 shunt-resistor-micro-ohms = <3300000>;
0067 };
0068 ...