I'm using Raspberry Pi along with library WiringPi to gather data from CIS scanner. As A/D converter I use ADC081C021 with I2C connection. According to datasheet to put converter into High Speed mode I must send Hs master code (00001XXX) before master device sends slave address. My problem is - I send slave address selecting slave device:
if ((fd = open (device, O_RDWR)) < 0)
return wiringPiFailure (WPI_ALMOST, "Unable to open I2C device: %s\n", strerror (errno)) ;
if(i2c_smbus_access (fd, I2C_SMBUS_WRITE, 0b00001000, I2C_SMBUS_BYTE, NULL)) ;
return wiringPiFailure (WPI_ALMOST, "Unable to select High Speed mode: %s\n", strerror (errno)) ;
if (ioctl (fd, I2C_SLAVE, devId) < 0)
return wiringPiFailure (WPI_ALMOST, "Unable to select I2C device: %s\n", strerror (errno)) ;
When I try sending address before that (yellow part above) I got input/output error. Can anybody help, or show me error of my thinking?