All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: hdc100x driver backport
       [not found] <AMSPR07MB129D24949977B4D40F31C338F3A0@AMSPR07MB129.eurprd07.prod.outlook.com>
@ 2017-03-20 19:23 ` Alison Schofield
  0 siblings, 0 replies; only message in thread
From: Alison Schofield @ 2017-03-20 19:23 UTC (permalink / raw)
  To: De Vos, Bart (EXT - BE/Antwerp); +Cc: matt.ranostay, linux-iio

On Mon, Mar 20, 2017 at 04:54:07PM +0000, De Vos, Bart (EXT - BE/Antwerp) wrote:
> Hi,
> 
> I'm trying to backport the hdc100x driver to v3.10.
> 
> Can you elaborate on the temperature offset, especially here:
> http://lxr.linux.no/linux+v4.10/drivers/iio/humidity/hdc100x.c#L239
> 
> I see the goal is to have millidegrees, and as such I would expect an offset of -40000. I don't understand the numbers used here and the relationship between the two.
> If I read out the offset in runtime I got the value specified to 'val' on line 240.
> 
> Thanks for your feedback.
> 
> Kr,
> Bart.

Hi Bart,

Copying Matt Ranostay as he is the author/expert on this driver.

hdc100x temperature is calculated as:
(raw + offset) * scale / 1000

Here's a sample reading:
raw: 25443 scale: 2.517700195 offset: -15887.515151 resolution: 0.006350
Temperature 24057.846068

Hope that helps,
alisons


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-20 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <AMSPR07MB129D24949977B4D40F31C338F3A0@AMSPR07MB129.eurprd07.prod.outlook.com>
2017-03-20 19:23 ` hdc100x driver backport Alison Schofield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.