linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Frey <dpfrey@gmail.com>
To: linux-iio <linux-iio@vger.kernel.org>
Subject: bme680 gas sensor channel attributes
Date: Tue, 12 Feb 2019 08:53:46 -0800	[thread overview]
Message-ID: <c8ffa8de-ecc2-e9e4-0043-67fc54ca4740@gmail.com> (raw)

Hi,

I would like to enhance the gas sensor support in the bme680 driver, but
I'm not sure how to fit the enhancement into IIO.

The bme680 has the following registers:
idac_heat_0 to 9 at 0x50..0x59 - initial current applied to heater
res_heat_0 to 9 at 0x5A..0x63 - target temperature of heater
gas_wait_0 to 9 at 0x64..0x6D - heater on duration

The ctrl_gas_1 register has an nb_conv<3:0> field which selects which of
the settings (0 to 9) to use for the gas sensor.

Currently, the driver just hard codes some values into res_heat_0 and
gas_wait_0.  idac_heat_0 is not written, but the datasheet says this is
optional.  I think it would be good if the user could configure these
parameters.  At a minimum it would be nice to expose one set of the
three values, but if I'm going to expose one, it seems like I might as
well expose all 10 and also allow the user to select which setting group
is active.

The current version of the driver has this for the gas channel definition:
{
	.type = IIO_RESISTANCE,
	.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
},

Other channels of the device (such as temperature) support an
oversampling ratio, and are defined like this:

{
	.type = IIO_TEMP,
	.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED) |
			      BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO),
},

I checked enum iio_chan_info_enum and there is no IIO_CHAN_INFO_
definition which seems applicable to "initial current", "target
temperature" or "heater duration".  How can I add these configuration
parameters in an idiomatic way?

Thanks,
David

             reply	other threads:[~2019-02-12 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 16:53 David Frey [this message]
2019-02-20 12:07 ` bme680 gas sensor channel attributes Jonathan Cameron

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=c8ffa8de-ecc2-e9e4-0043-67fc54ca4740@gmail.com \
    --to=dpfrey@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    /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).