[i2c] Two start conditions for PCA9554

Trent Piepho xyzzy at speakeasy.org
Wed Apr 30 23:26:22 CEST 2008


On Tue, 29 Apr 2008, Hans J. Koch wrote:
> I have an embedded board with a PCA9554 on it. It's an 8-bit IO expander
> similar to the PCF8574 in mainline. One difference is that when reading
> from the inputs, you have to do the following:
>
> - start condition
> - send slave address, R/W=0
> - send command (0x00 = read input register)
> - issue another start condition (!)
> - send slave address, R/W=1
> - read data
> - stop condition
>
> Can such a protocol be handled by the i2c subsystem?

Yes.  That is a normal repeated start transaction, and AFAIK exactly what
all the other PCA, and virtually every other i2c chip for that matter, use.
The smbus read byte data function will do this for you.

If you want multiple stops in a single transaction, the i2c subsystem can't
do it, but I wrote a simple patch that allows it.



More information about the i2c mailing list