[i2c] Newbie question (documentation on dev-interface)

Chuck Harrison cfharr at erols.com
Fri Oct 27 10:02:57 CEST 2006


Hi Arnold.

I also am new to i2c-dev. I just recently wrote some routines to
read and write register-based i2c devices; see attachments
(if this list accepts attachments!)

Cheers,
  Chuck


Arnold wrote:
> 
> Hi All,
> 
> Just a simple question. I am a bit confused of the
> documentation on dev-interface. If I'll use a simple
> read command and not smbus_read how do I set the
> register? It was stated there that you dont need to
> set the address byte but set it using
> ioctl(..,slave,..) but what about the register that I
> want to read? where do I set the register? in the
> first byte of the buffer in the read? If the device
> i2c address is 0x10 and the the register I want to
> read is address 0x21, how do set 0x21? I hope somebody
> could help me out with this simple question. Thank you
> very much.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-user.c.gz
Type: application/x-gzip
Size: 1709 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20061027/41a69d9a/attachment-0004.gz 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-user.h.gz
Type: application/x-gzip
Size: 684 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20061027/41a69d9a/attachment-0005.gz 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-getregs.c.gz
Type: application/x-gzip
Size: 1207 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20061027/41a69d9a/attachment-0006.gz 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-putregs.c.gz
Type: application/x-gzip
Size: 1196 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/i2c/attachments/20061027/41a69d9a/attachment-0007.gz 


More information about the i2c mailing list