zephyr/drivers/sensor
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
..
adt7420 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
adxl345 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
adxl362 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
adxl372 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ak8975 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
amg88xx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ams_iAQcore drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
apds9960 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bma280 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bmc150_magn drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bme280 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bme680 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bmg160 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bmi160 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bmi270 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bmm150 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bmp388 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
bq274xx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ccs811 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
dht sensor: dht: fix code stlying 2022-10-31 09:28:05 -05:00
dps310 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ds18b20 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ens210 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
fdc2x1x drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
fxas21002 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
fxos8700 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
grove drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
hmc5883l drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
hp206c drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
hts221 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
i3g4250d drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
icm42605 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
icm42670 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
iis2dh drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
iis2dlpc drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
iis2iclx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
iis2mdc drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
iis3dhhc drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ina23x drivers: sensor: ina23x: specify current LSB in uA and fix units 2022-11-15 10:23:17 +01:00
ina219 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
isl29035 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ism330dhcx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ite_tach_it8xxx2 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ite_vcmp_it8xxx2 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lis2dh drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lis2ds12 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lis2dw12 drivers/sensor: Call the correct stmemc API to set drdy_pulsed 2022-11-08 10:45:32 +01:00
lis2mdl drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lis3mdl drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lm75 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lm77 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lps22hb drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lps22hh drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lps25hb drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lsm6ds0 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lsm6dsl drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lsm6dso drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lsm9ds0_gyro drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lsm9ds0_mfd drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
lsm303dlhc_magn drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
max6675 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
max17055 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
max17262 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
max30101 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
max31875 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
max44009 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mchp_tach_xec drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mcp9808 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mcux_acmp drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mhz19b drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mpr drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mpu6050 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
mpu9250 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ms5607 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ms5837 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
nrf5 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
nuvoton_adc_cmp_npcx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
nuvoton_tach_npcx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
nxp_kinetis_temp drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
opt3001 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
pcnt_esp32 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
pms7003 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
qdec_nrfx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
qdec_sam drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
qdec_stm32 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
sbs_gauge drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
sgp40 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
sht3xd drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
sht4x drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
shtcx drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
si7006 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
si7055 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
si7060 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
si7210 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
sm351lt drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
stm32_temp drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
stm32_vbat drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
stmemsc sensors: stmemsc: add I3C access functions 2022-09-09 17:42:33 -04:00
stts751 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
sx9500 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
th02 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ti_hdc drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
ti_hdc20xx
tmp007 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
tmp108 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
tmp112 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
tmp116 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
vcnl4040 drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
vl53l0x drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
wsen_hids drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
wsen_itds drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE 2022-10-27 09:27:14 +00:00
CMakeLists.txt drivers: sensor: adding driver for STM32 quadrature encoder 2022-10-03 10:10:31 +02:00
Kconfig drivers: sensor: Add sensor info iterable section 2022-10-31 11:21:37 +01:00
sensor_handlers.c
sensor_shell.c drivers: sensor: sensor_shell: fix channel name collision 2022-11-09 09:44:27 -06:00
shell_battery.c