RSeries astromech firmware
I2CReceiverBase< bufferSize > Class Template Reference

#include <i2c/I2CReceiver.h>

Detailed Description

template<int bufferSize = 32>
class I2CReceiverBase< bufferSize >

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.

I2CReceiver i2cReceiver(0x19);

To create a receiver with a buffer size of 42 (for example) use:

I2CReceiverBase<42> i2cReceiver(0x19);
+ 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...
 

Constructor & Destructor Documentation

◆ I2CReceiverBase() [1/2]

template<int bufferSize = 32>
I2CReceiverBase< bufferSize >::I2CReceiverBase ( void(*)(char *)  callback = nullptr)
inline

Constructor.

Only a single instance of I2CReceiverBase should be created per sketch.

Parameters
i2caddressi2c address of this controller

◆ I2CReceiverBase() [2/2]

template<int bufferSize = 32>
I2CReceiverBase< bufferSize >::I2CReceiverBase ( byte  i2caddress,
void(*)(char *)  callback = nullptr 
)
inline

Constructor.

Only a single instance of I2CReceiverBase should be created per sketch.

Parameters
i2caddressi2c address of this controller

Member Function Documentation

◆ animate()

template<int bufferSize = 32>
virtual void I2CReceiverBase< bufferSize >::animate ( )
inlineoverridevirtual

Dispatch any received i2c event to CommandEvent.

Implements AnimatedEvent.

◆ begin()

template<int bufferSize = 32>
void I2CReceiverBase< bufferSize >::begin ( byte  i2caddress = 0x19)
inline

The documentation for this class was generated from the following file:
I2CReceiver
Default instantiation of automatic forwarder from i2c to CommandEvent.
I2CReceiverBase
Base template of automatic forwarder from i2c to CommandEvent.
Definition: I2CReceiver.h:34
I2CReceiver.h