#include "I2CCommander.hpp"
Public Member Functions | |
I2CCommanderClass () | |
void | begin (uint8_t inI2CSlaveID) |
unsigned long | loop () |
void | printCommander () |
Static Public Member Functions | |
static I2CCommanderClass & | GetCurrent () |
This Commanders receive orders from I2C bus, and translate it into Commanders events.
On an I2C bus, there is one and only one master, and one or more slaves. In Commanders implementation, only one slave can be defined. The master send messages to a specific slave, defined by a number: the slave ID.
A sample of the library give a master, sender of events to Commanders.
To work, the master must send a message with the form of
IIIIEDD
where IIII is an unsigned long (four bytes) for the event id, E is the event type (see values of COMMANDERS_EVENT_TYPE), and DD the associated data.
Events thrown:
reason | id | type | data |
---|---|---|---|
message received | id | type | data |
Definition at line 37 of file I2CCommander.hpp.
|
inline |
Default constructor.
Definition at line 45 of file I2CCommander.hpp.
void I2CCommanderClass::begin | ( | uint8_t | inI2CSlaveID | ) |
Initialize the instance.
inI2CSlaveID | I2C Slave ID. This Id must be unique on all connected devices to the I2C master. |
Definition at line 55 of file I2CCommander.cpp.
|
inlinestatic |
Get the current instance of DccCommanderClass
Definition at line 59 of file I2CCommander.hpp.
|
virtual |
void I2CCommanderClass::printCommander | ( | ) |
Print this Commander on the console.
Definition at line 76 of file I2CCommander.cpp.