[i2c] I2C User Application

Mark M. Hoffman mhoffman at lightlink.com
Sat Oct 28 15:27:03 CEST 2006


Hello Satendra:

* Satendra Pratap <spgroups at gmail.com> [2006-10-28 15:28:00 +0530]:
> I have doubt on a point that when the slave address is using ioctl (
> ioctl(file,I2C_SLAVE,addr); Say device addres is 0x50 )
> 
> and after it we have written the data using write ( write(file,buf,3); )
> then if one wants to read the data back using read then should one need to
> pass the device read 0x51 or the Driver will take care of it ?

In Linux, the I2C address is the most significant 7 bits, right justified.
I.e. if the datasheet for your device instructs you to write on 0x50 and
read on 0x51, then in Linux the address for reading and writing is 0x28.

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com




More information about the i2c mailing list