2009-08-08 12:31:44 TWI driver doubts
Harbhajan Singh (INDIA)
Message: 78537
Hi,
I am working with uClinux distribution 2009R1-RC1 custom board with BF527 processor.
on the custom board three i2c devices are connected to BF527 TWI.
I have opened the i2c driver in the following method.
i2c_fd = open("dev/i2c-0", O_RDWR);
if ( (ret = ioctl(i2c_fd,I2C_SLAVE,addr)) < 0) {
i2c_debug("slave with address = 0x%02x is not found \\n",addr<<1);
return -1;
}
for controlling the individual device i will change the SLAVE ADDR(I2C_SLAVE) like in the above ioctl call and then control the device from the user appplication.
Is this method is correct or will it create any problem.
Please provide your suggestion.
Thank you.
QuoteReplyEditDelete
2009-08-09 23:27:36 Re: TWI driver doubts
Sonic Zhang (CHINA)
Message: 78540
Yes, correct.