You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I ran into an issue while implementing a PMBus interface on an Arduino every.
PMBus derrives from SMBus which uses I2C and ultimately TWI.
From System Management Bus Specification Version 3.3:
This requires a 0 byte read or write transaction where the read is currently not possible with this implementation as the write bit is implicitly set in both cases.
Hi @tamebits ,
that piece of code is tackling one shortcomings of Wire APIs, that the only way to scan the bus is the pattern
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0) //device found
A solution would be to keep track of the user intention and just set the write bit in this particular use case.
If you want to provide a PR I'll be glad to review it!
Today I ran into an issue while implementing a PMBus interface on an Arduino every.
PMBus derrives from SMBus which uses I2C and ultimately TWI.
From System Management Bus Specification Version 3.3:
This requires a 0 byte read or write transaction where the read is currently not possible with this implementation as the write bit is implicitly set in both cases.
Both cases result in a call to
with bytes_to_write and bytes_to_read both being 0.
In this case the function always sets the write bit:
Am I missing something here? Or did somebody want to save a few lines, not having this special case in mind?
ArduinoCore-megaavr/libraries/Wire/src/utility/twi.c
Line 322 in 5e639ee
The text was updated successfully, but these errors were encountered: