Add General Call addressing to AVR8Bit TWI - Define backward compatible API to be used for other cores #1
Open
edbaafi wants to merge 1 commit intoWiringProject:masterfrom
Open
Add General Call addressing to AVR8Bit TWI - Define backward compatible API to be used for other cores #1edbaafi wants to merge 1 commit intoWiringProject:masterfrom
edbaafi wants to merge 1 commit intoWiringProject:masterfrom
Conversation
…ress (broadcast) in addition to its own address. TwoWire::onReceive is overridden with a second function pointer to a general call receive callback. If the second callback is ommitted, general call is not enabled. This is fully backward compatible and reasonably well documented in the example sketches.
AlexanderBrevig
pushed a commit
that referenced
this pull request
Sep 24, 2012
Add debounce time check to button library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 "General Call" capabilities to the AVR8Bit TWI (I2C) implementation.
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 (I2C). For more info on General Call, please see the I2C specs.
With this patch, the Wire library (AVR8Bit) now supports General Call by adding a second receive callback to Wire.onReceive(). This second callback will be called whenever a message is received over the general call address. If a second callback is not defined, general call addressing will not be enabled in the TWI driver (utility).
This patch and the API change is backward compatible and is reasonably well documented in the example sketch. Also see the comments re: bug uncovered while testing the example.
While this patch is generally useful, it is motivated by Modkit's work on dynamic TWI (I2C) addressing for OpenShield.
Thanks,
-Ed