Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am supposed to write a simple write and read program for i2c but the problem is that I don't have the device at hand presently to test it so I need my code to be perfect.

I am confused about the function of the I2C_SLAVE ioctl. From what I read,this ioctl is used to set the slave address.

But we pass the slave address again when performing read/write using ioctl I2C_RDWR via Addr in the structure i2c_msg. In the linux documentation it is mentioned the address set using I2C_RDWR has precedence over address set by I2C_SLAVE.

So then,what is the function of I2C_SLAVE command? Is it required?

share|improve this question
1  
You should consider adding more information about what you tried yourself – Ivo Flipse Mar 26 '12 at 13:24

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.