I2C_SLAVE ioctl in i2c linux driver
- by zac
I am supposed to write a simple write and read program for i2c but the problem is that i dont 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.
So then,what is the function of I2C_SLAVE command?Do i need to call it every time i perform a read or write operation?
Thank you in advance.