linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dimitri Fedrau <dima.fedrau@gmail.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Nuno Sa <nuno.sa@analog.com>, Li peiyu <579lpy@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] iio: humidity: hdc3020: add threshold events support
Date: Fri, 16 Feb 2024 21:35:16 +0100	[thread overview]
Message-ID: <20240216203516.GA3873@debian> (raw)
In-Reply-To: <b159b10b-513f-4116-b2ef-faf6741dc3b6@gmail.com>

Am Thu, Feb 15, 2024 at 12:18:41AM +0100 schrieb Javier Carrasco:
> On 14.02.24 09:53, Dimitri Fedrau wrote:
> > Add threshold events support for temperature and relative humidity. To
> > enable them the higher and lower threshold registers must be programmed
> > and the higher threshold must be greater then or equal to the lower
> > threshold. Otherwise the event is disabled. Invalid hysteresis values
> > are ignored by the device. There is no further configuration possible.
> > 
> > Tested by setting thresholds/hysteresis and turning the heater on/off.
> > Used iio_event_monitor in tools/iio to catch events while constantly
> > displaying temperature and humidity values.
> > 
> > Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> > ---
> 
> Hi Dimitri,
>
Hi Javier,

> now that the decimal part is used, the resolution loss is within the
> ranges mentioned in the datasheet.
> 
> For the records: the truncated values lead to alerts slightly lower than
> the target alerts. Therefore, measured values below the "comfort zone"
> defined by the user (but close to the low alert) will not trigger
> events. The other way around is "more secure" because the target comfort
> zone is guaranteed:
> 
> -------- High val -> event (as expected)
> 
> ******** Target High Alert
> 
> -------- Meas -> **event** (still in target comfort zone)
> 
> ######## Truncated High Alert
> 
> ...
> 
> ******** Target Low Alert
> 
> -------- Meas -> **no event** (out of target comfort zone)
> 
> ######## Truncated Low Alert
> 
> -------- Meas -> event (as expected)
> 
> But as I said, the resolution loss is in the valid range anyway:
> 
> Tested-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> 
> Thank you for adding this feature.
>
thanks for testing.

Best regards,
Dimitri Fedrau

  reply	other threads:[~2024-02-16 20:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  8:53 [PATCH v4 0/3] iio: humidity: hdc3020: add threshold events support Dimitri Fedrau
2024-02-14  8:53 ` [PATCH v4 1/3] iio: humidity: hdc3020: switch to 16bit register defines Dimitri Fedrau
2024-02-14  8:53 ` [PATCH v4 2/3] dt-bindings: iio: humidity: hdc3020: add interrupt bindings in example Dimitri Fedrau
2024-02-15 15:14   ` Rob Herring
2024-02-14  8:53 ` [PATCH v4 3/3] iio: humidity: hdc3020: add threshold events support Dimitri Fedrau
2024-02-14 23:18   ` Javier Carrasco
2024-02-16 20:35     ` Dimitri Fedrau [this message]
2024-02-16 13:17 ` [PATCH v4 0/3] " Jonathan Cameron
2024-02-16 20:38   ` Dimitri Fedrau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216203516.GA3873@debian \
    --to=dima.fedrau@gmail.com \
    --cc=579lpy@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).