2008/12/14, Sebastien LELONG <[email protected]>:
> Joep, I'm trying to migrate some of my code to jallib, using i2c_level1
> library. BTW, TX/RX buffers are quite surprising at first, but very handy
> once you get used to it.
Why did it surprise you at first?

> Can you confirm the address you pass to i2c_send_receive and others func are 8
> bits coded ? That is: addresses are 8bits long, the 8th being ignored (use
> can set it to 0 or 1) and set by the lib to either 0 or 1 whether it's a read
> or write operation. Is that right ? This is what I understand reading the
> code...
> If so, there's a big difference with the original Wouter's i2c lib, where
> addresses are 7 bits long, and the lib left-shifts the bits and add 0 or 1.

It is my intention to use the upper 7 bits and ignore the bottom one.
Maybe Wouter's approach is better from a theoretical point of view. I
choose for this approach because a lot of practical reasons:
- If an example uses an address with the highest bit set, it is
obvious (for me) that the upper bits are used.
- Most of the dozen i2c libs i've worked with use this approach.
- In the datasheets of slaves, a bit-wise representation of the first
byte with the address in the upper 7 bits is common.
- register sspadd uses this same format.

> Your lib keeps it consistent: only uses/sets a 8bits address. Is that the
> convention too ? (for instance for i2c eeprom)
Strictly speaking it's a 7 bits address...
I don't understand your question. But you want to know if I support
longer addresses, the answer is: I've never run into a situation where
127 addresses is not enough. But if you do, go figure out how longer
addressing is done and I think you can use the libs without
modification.

Joep

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to