arduino/Arduino — pull request #49 by edbaafi (2011-11-11 07:17:27+00:00)
Title: Wire library support for TWI General Call

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