Wire library support for TWI General Call #49
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds TWI (I2C) "General Call" capabilities to the Wire library
General call is like a broadcast that can be received by many listeners at the same same. This is useful when you don't know the address of the device you want to talk to or it can be used as a sort of interrupt over the TWI. While it was possible to enable general call from an Arduino user program simply by setting the TWGCE bit in the TWAR, it was not possible to determine which address the data came from.
TwoWire::onReceive is overridden to add an optional second callback which will be called whenever data is received over the general call address.
This patch addresses issue 120 (http://code.google.com/p/arduino/issues/detail?id=120) and its use is reasonably well documented in the example code.
Thanks,
Ed