> Why did it surprise you at first? Because it's not what I would have imagined if I wrote the lib. But I like it !
> 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. OK, we fully agree on this. > > 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... OK > I don't understand your question. My question was (kind of): when using i2c address, is it better use 8-bits long address (8th bit being ignored) or 7-bits long address ? What is the convention ? If think you've answered this in the previous paragraph. I've only used i2c with two PIC, no i2c eeprom or the like. So when I add to register SSPADD, and when I used Wouter's lib, it really confused me: the lib wants a 7 bits address, that it'll left-shift and add 0 or 1, while SSPADD requires a 8-bits long address. The fact your libs "understands" 8bits long addresses if, IMHO, far better, since it avoid confusion (at least mine). > 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. Me too, never had to use longer address (10bits IIRC from I2C specs). Thanks for your explanation. Seb -- Sébastien LELONG http://www.sirloon.net http://sirbot.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
