zephyr/samples/sensor
Paul Sokolovsky b7623a85b0 sensors: Redefine SENSOR_CHAN_HUMIDITY in percents, not milli-percents.
Based on the discussion in #5693, the reason why humidity was defined
in milli-percent was likely following Linux which defines it as such
in its sensor subsystem:
http://elixir.free-electrons.com/linux/latest/source/Documentation/ABI/testing/sysfs-bus-iio#L263

However, Linux defines temperature in milli-degrees either, but
Zephyr uses degrees (similarly for most other quantities). Typical
sensor resolution/precision for humidity is also on the order of 1%.

One of the existing drivers, th02.c, already returned values in
percents, and few apps showed it without conversion and/or units,
leading to confusing output to user like "54500".

So, switching units to percents, and update all the drivers and
sample apps.

For few drivers, there was also optimized conversion arithmetics
to avoid u64_t operations. (There're probably more places to
optimize it, and temperature conversion could use such optimization
too, but that's left for another patch.)

Fixes: #5693

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 14:10:39 +01:00
..
amg88xx doc: fix misspellings in boards and samples docs 2018-01-30 20:27:43 -05:00
apds9960 samples: apds9960: fix dependencies 2017-12-28 20:24:29 -05:00
bme280 samples: bme280: Add testcase filter for SPI_LEGACY_API 2018-01-11 14:35:45 -06:00
bmg160 samples: bmg160: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
bmi160 samples: bmi160: Add testcase filter for SPI_LEGACY_API 2018-01-11 14:35:45 -06:00
bmm150 samples: bmi150: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
fxas21002 samples: fxas21002: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
fxos8700 samples: fxos8700: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
hts221 sensors: Redefine SENSOR_CHAN_HUMIDITY in percents, not milli-percents. 2018-02-05 14:10:39 +01:00
magn_polling samples: magn_polling: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
max30101 samples: max30101: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
max44009 samples: remove more build_only tags 2017-12-28 20:24:29 -05:00
mcp9808 samples: mcp9808: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
sx9500 samples: sx9500: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
th02 samples: TH02: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
thermometer samples: remove more build_only tags 2017-12-28 20:24:29 -05:00
tmp112 samples: TMP112: fix dependencies and test cleanup 2017-12-28 20:24:29 -05:00
vl53l0x sample: sensor: Add vl53l0x sample application 2018-01-23 10:14:49 -06:00
sensor.rst doc: add labels to sensor sample docs for linking 2017-04-04 20:47:35 +00:00