FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Abstract class to allow aggregation of several futures in relation to I2C transactions. More...
#include <fastarduino/i2c_device_utilities.h>
Protected Member Functions | |
I2CFuturesGroup (ABSTRACT_FUTURE **futures, uint8_t size, future::FutureNotification notification=future::FutureNotification::NONE) | |
Called by subclass constructor, this constructs a new I2CFuturesGroup instance with the provided list of futures . More... | |
bool | start (typename PARENT::DEVICE &device) |
Start the I2C transactions needed by this group of futures. More... | |
Abstract class to allow aggregation of several futures in relation to I2C transactions.
This allows to await()
for all futures, or query the overall status()
of the group. This enables I2C device support developers to handle complex I2C transactions where several distinct Futures must be used. Suclasses shall define all needed individual Futures as members, pass them to I2CFuturesGroup constructor and call future::AbstractFuturesGroup::init()
. In addition, subclasses may define a method get()
that will handle aggregation of results of its individual futures.
The following is en excerpt of VL53L0X showing GetGPIOSettingsFuture
future definition and its usage in get_GPIO_settings()
method:
MANAGER | the type of I2C Manager used to handle I2C communication |
Definition at line 552 of file i2c_device_utilities.h.
|
inlineprotected |
Called by subclass constructor, this constructs a new I2CFuturesGroup instance with the provided list of futures
.
futures | the array of futures to be handled by this group of futures |
size | the number of futures in futures |
notification | determines if and which notifications should be dispatched by this I2CFuturesGroup; default is none. |
Definition at line 568 of file i2c_device_utilities.h.
|
inlineprotected |
Start the I2C transactions needed by this group of futures.
This is either called by the subclass or directly by the I2C device support class (if declared friend of the subclass).
device | the i2c::I2CDevice subclass instance that shall handle I2C commands to the I2C device |
true | if the first I2C command could be launched successfully |
Definition at line 586 of file i2c_device_utilities.h.