[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46389801aeb20f18affed86d979aff7a62cf36d5.camel@gmail.com>
Date: Fri, 15 Mar 2024 00:22:50 +0100
From: Angel Iglesias <ang.iglesiasg@...il.com>
To: Vasileios Amoiridis <vassilisamir@...il.com>, Jonathan Cameron
<jic23@...nel.org>
Cc: lars@...afoo.de, andriy.shevchenko@...ux.intel.com,
mazziesaccount@...il.com, ak@...klinger.de, petre.rodan@...dimension.ro,
linus.walleij@...aro.org, phil@...pberrypi.com, 579lpy@...il.com,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/6] iio: pressure: Simplify and make more clear
temperature readings
On Thu, 2024-03-14 at 21:17 +0100, Vasileios Amoiridis wrote:
> On Thu, Mar 14, 2024 at 03:09:59PM +0000, Jonathan Cameron wrote:
> > On Wed, 13 Mar 2024 18:40:05 +0100
> > Vasileios Amoiridis <vassilisamir@...il.com> wrote:
> >
> > > The read_press/read_humid functions need the updated t_fine value
> > > in order to calculate the current pressure/humidity. Temperature
> > > reads should be removed from the read_press/read_humid functions
> > > and should be placed in the oneshot captures before the pressure
> > > and humidity reads. This makes the code more intuitive.
> > >
> > > Signed-off-by: Vasileios Amoiridis <vassilisamir@...il.com>
> >
> > To me this makes the use of these calls less obvious than they were
> > previously. The calls are made close to where t_fine is used and
> > don't have to go via the indirection of chip_info.
> >
> > So I disagree. I think this change makes the code a lot less
> > clear.
> >
>
> This was mainly driven by the fact that I wanted to avoid reading
> the temperature 3 times in case temp, press and humid are enabled
> and there are consecutive buffer readings. But thank you for the
> proposal I really appreciate it!
>
Hi, just a side note reflecting on this. Depending on your sampling frequency
and registers data shadowing, to avoid compensating with different samples
between readings, we should be doing burst readings to get a bundle of the
temperature+pressure and/or humidity.
On the bmp/bme280 and bmp380 this can be done as registers are contiguous on the
memory. On the bmp580 this is not a problem as the values are already
compensated, you`ll get always the latest reading.
Kind regard,
Angel
Powered by blists - more mailing lists