-
-
Notifications
You must be signed in to change notification settings - Fork 27
libraries/Wire: Add support for target mode. #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ff1f3e5
to
99eede3
Compare
9ce1ca5
to
e4ed02a
Compare
42f0d54
to
b8bbabb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iabdalkader I've tested this PR on a Nano 33 BLE sense Rev2 and I2C controller mode is not working anymore.
I've used this example.
With the released core i get this output:
15:12:48.431 -> Pressure = 100.55 kPa
15:12:48.431 -> Temperature = 28.37 C
15:12:48.431 ->
15:12:49.428 -> Pressure = 100.54 kPa
15:12:49.428 -> Temperature = 28.35 C
using this PR instead i get this:
Failed to initialize pressure sensor!
I think it would be better to split this commit an put the "Fix buffer overflows, bad return values etc.." in a separate commit /PR because i suspect something in those changes has break I2C controller mode.
That's not possible, the changes are required for Target mode. |
The issue is now vl5xl1x library works because is not checking the return value but other libraries do it |
Used by Wire. Signed-off-by: iabdalkader <[email protected]>
b8bbabb
to
7bd0a5b
Compare
Except that doesn't specify what to return if it fails to read. Also, the return is unsigned so we can't return -1. I fixed it anyway, but now it's not possible to know if it failed or the buffer is just full. |
I guess 0 is the only option we have to point out an error, considering a request of 0 bytes an edge case. |
7bd0a5b
to
c085f17
Compare
- Add support for I2C target mode. - Fix buffer overflows, bad return values etc.. Signed-off-by: iabdalkader <[email protected]>
Enable target support for Giga R1. Signed-off-by: iabdalkader <[email protected]>
Enable target support for Giga R1. Signed-off-by: iabdalkader <[email protected]>
c085f17
to
a18719b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I2CSCanner 👍
LPS22HB ReadPressure 👍
I2CMasterReader/I2CSlaveWriter 👍
I2CMasterWriter/I2CSlaveReceiver 👍
Test sketch:
Retested master mode with VL53L1X and target mode with bus pirate: