From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Joe Buehl <joe.buehl-NG4YQ/0yFAu1Z/+hSey0Gg@public.gmane.org>
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [lm-sensors] Support for non-register devices
Date: Wed, 6 Mar 2013 14:21:23 -0800 [thread overview]
Message-ID: <20130306222123.GA6123@roeck-us.net> (raw)
In-Reply-To: <5137BD01.6080905-NG4YQ/0yFAu1Z/+hSey0Gg@public.gmane.org>
On Wed, Mar 06, 2013 at 02:02:41PM -0800, Joe Buehl wrote:
> I am new to using I2C so apologies if this has already been
> addressed before.
>
> In trying to communicate with a Honeywell HIH-6130 humidity sensor
> from a RaspberryPi I ran into an apparent limitation of i2c-tools.
> There doesn't seem to be support for reading multiple bytes of data
> from a device that doesn't need a register selected before the read.
> This device is accessed by first doing a write of just the address,
> followed about 37ms later by a read of 4 bytes, as documented here
> http://www.phanderson.com/arduino/I2CCommunications.pdf. The write
> operation can be done by using write_quick(), and a subsequent
> read_byte() will get the first byte of data, but multiple calls to
> read_byte() will just get the same first byte again. Using
> read_i2c_block_data() works better, however, because it sends an
> unneeded command byte, I'm not sure the data returned is valid.
> There is a long discussion of the details in this thread
> http://www.raspberrypi.org/phpBB3/viewtopic.php?f=32&t=29454.
>
> It seems to me that what is needed is a way to optionally specify
> that no command byte should be sent in read_i2c_block_data() and
> write_i2c_block_data(). While this is not compliant with the SMBus
> protocol, this device doesn't claim to be compliant, and the purpose
> of these two functions seems to be to allow such communications. I
> don't believe this particular device is unique so there should be
> other cases where this is useful.
>
> I looked at the python wrapper code in smbusmodule.c and it looks
> easy enough to implement something like specifying a value of None
> for the cmd argument to indicate that no command byte should be
> sent, but implementation of the behavior seems to be buried
> somewhere deep in i2c-dev.c or i2c-core.c and I haven't been able to
> find it. I see that there is work being done in this project to
> clean up these drivers, so I wanted to propose this change, and also
> offer my help.
>
Redirecting to i2c-dev mailing list.
Guenter
parent reply other threads:[~2013-03-06 22:21 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <5137BD01.6080905-NG4YQ/0yFAu1Z/+hSey0Gg@public.gmane.org>]
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=20130306222123.GA6123@roeck-us.net \
--to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
--cc=joe.buehl-NG4YQ/0yFAu1Z/+hSey0Gg@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.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).