I have an i2c master which writes to a slave (controlling the display) and reads from the same slave getting the button presses.
In idle mode the masters reads every 0.5 seconds or so and receives the following
S 01000111 0 00000001 0 00000001 0 P
Read from address: 0x23 Number of Bytes: 2
Byte 1: 0x01
Byte 2: 0x01
Pressing a button causes a read instantly giving similar to below
S 01000111 0 00000100 0 10000010 0 10010001 0 00000000 0 00000100 0 P
Read from address: 0x23 Number of Bytes: 5
Byte 1: 0x04
Byte 2: 0x82
Byte 3: 0x91
Byte 4: 0x00
Byte 5: 0x04
There is a third line in addition to SDA and SCL which is pulled low during read and write operations, i thought perhaps that the slave was pulling this low when data was available but having disconnected the master and watched this third line it is going low for three 6ms pulses every 0.5 seconds. Pressing a button has no affect on this.
I have successfully managed to write to the slave but not read. I have tried to read both 2 and 5 bytes when the third line goes low. Reading 2 will give me 0x01 0x01 as above but trying 5 will just give me 0x01 0x01 0xff 0xff 0xff with button presses having no affect on the output.
Any clues how the master might be telling when there is data to be read or what i could try?
Thanks