current-sense-amplifier

Vendor: Generic or vendor-independent

Note

An implementation of a driver matching this compatible is available in drivers/sensor/current_amp/current_amp.c.

Description

When an io-channel measures the voltage over a current sense amplifier,
the interesting measurement is almost always the current through the
sense resistor, not the voltage over it. This binding describes such a current
sense circuit.

This is based on Linux, documentation:
  https://www.kernel.org/doc/Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml

Properties

Properties not inherited from the base binding file.

Name

Type

Details

sense-resistor-milli-ohms

int

Resistance of the shunt resistor in milli-ohms.

This property is required.

sense-gain-mult

int

Amplifier gain multiplier. The default is <1>. The maximum value is <65535>.

Default value: 1

sense-gain-div

int

Amplifier gain divider. The default is <1>. The maximum value is <65535>.

Default value: 1

zero-current-voltage-mv

int

The zero-current voltage in millivolts. Defaults to <0>, with a range of <-32768> to <32767>.

Some current sense amplifiers output a voltage proportional to current, independent of a
current sense resistor (e.g., Hall-effect current sensors). These sensors often have a
nonzero offset voltage that corresponds to zero current.

To use this binding with such sensors, `sense-resistor-milli-ohms` should be set to 1.

power-gpios

phandle-array

Control power to the current amplifier.

If present the corresponding GPIO must be set to an active level
to enable the current amplifier.

enable-calibration

boolean

Enable calibration of the current sense amplifier.
This is used to calibrate the ADC prior to taking measurements.

zephyr,noise-threshold

int

Raw ADC readings below this threshold are treated as noise and
reported as 0 uA. The default value of 0 disables the threshold.

gain-extended-range

string

Alternate gain to use if primary measurement hits limit:
- ADC_GAIN_1_6: x 1/6
- ADC_GAIN_1_5: x 1/5
- ADC_GAIN_1_4: x 1/4
- ADC_GAIN_1_3: x 1/3
- ADC_GAIN_2_5: x 2/5
- ADC_GAIN_1_2: x 1/2
- ADC_GAIN_2_3: x 2/3
- ADC_GAIN_4_5: x 4/5
- ADC_GAIN_1:   x 1
- ADC_GAIN_2:   x 2
- ADC_GAIN_3:   x 3
- ADC_GAIN_4:   x 4
- ADC_GAIN_6:   x 6
- ADC_GAIN_8:   x 8
- ADC_GAIN_12:  x 12
- ADC_GAIN_16:  x 16
- ADC_GAIN_24:  x 24
- ADC_GAIN_32:  x 32
- ADC_GAIN_64:  x 64
- ADC_GAIN_128: x 128

Legal values: 'ADC_GAIN_1_6', 'ADC_GAIN_1_5', 'ADC_GAIN_1_4', 'ADC_GAIN_1_3', 'ADC_GAIN_2_5', 'ADC_GAIN_1_2', 'ADC_GAIN_2_3', 'ADC_GAIN_4_5', 'ADC_GAIN_1', 'ADC_GAIN_2', 'ADC_GAIN_3', 'ADC_GAIN_4', 'ADC_GAIN_6', 'ADC_GAIN_8', 'ADC_GAIN_12', 'ADC_GAIN_16', 'ADC_GAIN_24', 'ADC_GAIN_32', 'ADC_GAIN_64', 'ADC_GAIN_128'