Wire library: wrong assert on device address

Hi,

I'm trying to interface with NXP's PCA9532, but get the following error right before sending the first byte:

assertion "(address & 0x80) == 0" failed: file "../source/twi.c", line 261, function: TWI_StartWrite

It looks like the Wire library expects the MSB of the address to be 0, whereas the PCA9532's datasheet (http://www.nxp.com/documents/data_sheet/PCA9532.pdf) clearly states that it must be 1 (it's the MSB of the fixed part, not even user configurable).

This assertion should be removed.

Thanks,

cc

The slave address is a 7-bit address which is shifted left by the TWI library. Thus it should be zero. You have to shift it right by one when calling the library.

Ahh, because the LSB in the 8-bit address determines transfer direction. Got it, thanks!