18c2ecf20Sopenharmony_ciCurrent Sense Shunt
28c2ecf20Sopenharmony_ci===================
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciWhen an io-channel measures the voltage over a current sense shunt,
58c2ecf20Sopenharmony_cithe interesting measurement is almost always the current through the
68c2ecf20Sopenharmony_cishunt, not the voltage over it. This binding describes such a current
78c2ecf20Sopenharmony_cisense circuit.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciRequired properties:
108c2ecf20Sopenharmony_ci- compatible : "current-sense-shunt"
118c2ecf20Sopenharmony_ci- io-channels : Channel node of a voltage io-channel.
128c2ecf20Sopenharmony_ci- shunt-resistor-micro-ohms : The shunt resistance in microohms.
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciExample:
158c2ecf20Sopenharmony_ciThe system current is measured by measuring the voltage over a
168c2ecf20Sopenharmony_ci3.3 ohms shunt resistor.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cisysi {
198c2ecf20Sopenharmony_ci	compatible = "current-sense-shunt";
208c2ecf20Sopenharmony_ci	io-channels = <&tiadc 0>;
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	/* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
238c2ecf20Sopenharmony_ci	shunt-resistor-micro-ohms = <3300000>;
248c2ecf20Sopenharmony_ci};
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci&i2c {
278c2ecf20Sopenharmony_ci	tiadc: adc@48 {
288c2ecf20Sopenharmony_ci		compatible = "ti,ads1015";
298c2ecf20Sopenharmony_ci		reg = <0x48>;
308c2ecf20Sopenharmony_ci		#io-channel-cells = <1>;
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci		#address-cells = <1>;
338c2ecf20Sopenharmony_ci		#size-cells = <0>;
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci		channel@0 { /* IN0,IN1 differential */
368c2ecf20Sopenharmony_ci			reg = <0>;
378c2ecf20Sopenharmony_ci			ti,gain = <1>;
388c2ecf20Sopenharmony_ci			ti,datarate = <4>;
398c2ecf20Sopenharmony_ci		};
408c2ecf20Sopenharmony_ci	};
418c2ecf20Sopenharmony_ci};
42