[i2c] Newbie question (documentation on dev-interface)
Till Harbaum
lists at harbaum.org
Fri Oct 27 09:30:24 CEST 2006
Hi,
the addressing of chip internal registers is not part of the generic i2c framework but
device dependant. So your address probably goes somewhere inside a i2c message.
How this exactly works depends on the device you are using (some of them don't even
have mutiple registers at all and don't need any further addressing).
So there's no generic answer to your question. There's however a typical way this
is handled. This is that you have to write the address with the address being the data
being written and then e.g. write the actual data with the subsequent bytes. E.g.
you write A, B , C where A is the address and B and C are the data to be written. Reading
works with using a re-start condition after writing the address.
But again: This is device dependant. So the datasheet of the chip you are going to
address will give you all the necessary details.
Till
----- original Nachricht --------
Betreff: [i2c] Newbie question (documentation on dev-interface)
Gesendet: Fr, 27. Okt 2006
Von: "Arnold" <abo_gwapo at yahoo.com>
> 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.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> i2c mailing list
> i2c at lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/i2c
>
--- original Nachricht Ende ----
More information about the i2c
mailing list