zephyr/drivers/sensor/ina23x
Gerard Marull-Paretas d5734bc003 drivers: sensor: ina23x: specify current LSB in uA and fix units
Specify the units of the current LSB in microamperes, so that we can
measure low maximum currents. Right now it was specified in
milliamperes, but ignored and always hardcoded to 1mA in the driver.
This makes the driver pretty much useless when the maximum current to be
measured is in a range of e.g. 20-50mA.

This patch also removes some unnecessary ifdeffery: since we write the
calibration register, we can always provice measurements with the right
units. It is also wrong to provide sensor readings that do not match
with the units specified by the channel. After this change voltage is
always reported in V, current in A and power in W.

Note that power measurement had the current LSB hardcoded in the
calculation (assuming 1mA/LSB), this has been fixed as well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-15 10:23:17 +01:00
..
CMakeLists.txt drivers: sensor: ina237: add support for triggered mode 2022-08-22 19:38:06 +02:00
Kconfig drivers: sensor: Convert Kconfig bus 'depends on' to 'select' 2022-08-08 06:58:18 +01:00
ina23x_common.c drivers: ina23x: fix includes 2022-11-15 10:23:17 +01:00
ina23x_common.h drivers: ina23x: fix includes 2022-11-15 10:23:17 +01:00
ina23x_trigger.c drivers: ina23x: fix includes 2022-11-15 10:23:17 +01:00
ina23x_trigger.h include: add missing kernel.h include 2022-10-11 18:05:17 +02:00
ina230.c drivers: sensor: ina23x: specify current LSB in uA and fix units 2022-11-15 10:23:17 +01:00
ina230.h drivers: sensor: ina23x: specify current LSB in uA and fix units 2022-11-15 10:23:17 +01:00
ina230_trigger.c drivers: ina23x: fix includes 2022-11-15 10:23:17 +01:00
ina237.c drivers: sensor: ina23x: specify current LSB in uA and fix units 2022-11-15 10:23:17 +01:00
ina237.h drivers: sensor: ina23x: specify current LSB in uA and fix units 2022-11-15 10:23:17 +01:00