- Added support for TMP117 in existing driver for TMP116
The Texas Instruments TMP117 is a higher precision upgrade
from TMP116. It shares most functionality, but has a
differing device ID.
This patch will run with the hardware IDs of both devices.
- Fixed an int promote issue in tmp116_channel_get
Negative temperature values in drv_data->sample were not
processed correctly.
The error occured during integer promotion from u16_t to s32_t
in this code line:
tmp = (s32_t)drv_data->sample * TMP116_RESOLUTION;
By first promoting to s16_t, the correct result is obtained:
tmp = (s16_t)drv_data->sample * (s32_t)TMP116_RESOLUTION;
- Made temperature resolution compatible to sensor API
The fractional part of the temperature was returned as a
multiple of 10^-7 deg.Celsius.
This differs from the resolution sugegsted by the sensor API,
which is 10^-6.
The driver is now returning temperature readings with
a resolution of 10^-6 deg. Celsius.
- The changed driver was tested using following hardware:
TMP117 attached to disco_l475_iot1 via i2c1
Signed-off-by: Hans Wilmers <hans@wilmers.no>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Defining a symbol with 'menuconfig' just tells the menuconfig to display
any dependent symbols that immediately follow it in a separate menu.
'menuconfig' has no effect on symbol values.
Making a symbol that doesn't have any dependent symbols after it a
'menuconfig' should be avoided, because then you end up with an empty
menu, which is shown as e.g.
[*] Enable foo ---
This is how it would be shown if there were children but they all
happened to be invisible as well.
With a regular 'config', it turns into
[*] Enable foo
Change all pointless 'menuconfig's to 'config's.
See the section on 'menuconfig' on the Kconfig - Tips and Best Practices
page as well.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>