![]() |
RSeries astromech firmware
|
#include <i2c/I2CReceiver.h>
Base template of automatic forwarder from i2c to CommandEvent.
Create an instance of this template to automatically forward i2c string commands to CommandEvent. A convenience type of I2CReceiver is provided that uses the default buffer size of 32 bytes. Only a single instance of I2CReceiver should be created per sketch.
To create a receiver with a buffer size of 42 (for example) use:
Inheritance diagram for I2CReceiverBase< bufferSize >:
Collaboration diagram for I2CReceiverBase< bufferSize >:Public Member Functions | |
| I2CReceiverBase (void(*callback)(char *)=nullptr) | |
| Constructor. More... | |
| I2CReceiverBase (byte i2caddress, void(*callback)(char *)=nullptr) | |
| Constructor. More... | |
| void | begin (byte i2caddress=0x19) |
| virtual void | animate () override |
| Dispatch any received i2c event to CommandEvent. More... | |
Public Member Functions inherited from AnimatedEvent | |
| AnimatedEvent () | |
| Default Constructor. More... | |
| void | setLoopDoneCallback (AnimatedLoopDone loopProc) |
Additional Inherited Members | |
Static Public Member Functions inherited from AnimatedEvent | |
| static void | process () |
| Calls animate() for each created AnimatedEvent subclass. More... | |
|
inline |
Constructor.
Only a single instance of I2CReceiverBase should be created per sketch.
| i2caddress | i2c address of this controller |
|
inline |
Constructor.
Only a single instance of I2CReceiverBase should be created per sketch.
| i2caddress | i2c address of this controller |
|
inlineoverridevirtual |
Dispatch any received i2c event to CommandEvent.
Implements AnimatedEvent.
|
inline |