TinyClr 0.2.0 and I2C

Is it a way with tinyclr to detect error in i2c transfer ?
I’m looking to implement a scanner function to see which devices are on bus.

1 Like

@ Bauland - The WritePartial, ReadPartial, and WriteReadPartial methods return I2cTransferResult which has information on the number of bytes transfered and the transfer status (complete, partial, slave not acknowledged).

@ John - I am curious if these work because last time I tried them they didn’t but that was a while back.

@ Gus - They should. Write, Read, and WriteRead all delegate to the partial calls:


public void WriteRead(byte[] writeBuffer, byte[] readBuffer) => this.WriteReadPartial(writeBuffer, readBuffer);

@ John - they do work, I tried them. I meant the response didn’t work for me. I did a partial write to a non existing device or an existing device resulted in the same return.

@ John - They sould, but as Gary says thry don’t work as expected: if there is no device at address, status is full transfer instead of NACK.

@ Bauland - Thanks, we’ll take a look

1 Like

@ Bauland - This is fixed for the next release.

2 Likes

Good news ! I hope it is for soon. :clap:

I think you would reply on button event thread ?
That’s what I said: “I know I can use a thread to read button’s state, as read function works but it is not really a clean solution.” But thanks anyway, I hope it will be corrected soon.

Good job too. Everything’s working well now.
:clap: :clap: :clap:

1 Like