FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Class to allow dynamic creation of futures from values stored in flash memory, leading to launch of I2C transactions. More...
#include <fastarduino/i2c_device_utilities.h>
Public Member Functions | |
I2CSameFutureGroup (uint16_t address, uint8_t size, future::FutureNotification notification=future::FutureNotification::NONE) | |
Construct a new I2CSameFutureGroup from an array of bytes stored in flash memory. More... | |
bool | start (typename PARENT::DEVICE &device) |
Start the I2C transactions needed by this group of futures. More... | |
Friends | |
DECL_FUTURE_LISTENERS_FRIEND friend bool | await_same_future_group (I2CDevice< MANAGER > &, const uint8_t *, uint8_t) |
Helper function that creates a I2CSameFutureGroup instance for the provided flash array, launches its I2C transactions on the provided I2C device, and waits for the transaction to finish. More... | |
Class to allow dynamic creation of futures from values stored in flash memory, leading to launch of I2C transactions.
Generated Futures are of type WriteRegisterFuture
, in order to write one byte to one register (or a sequence of 2 bytes) of the I2C device. This allows to await()
for all futures, or query the overall status()
of the group. This is particularly useful with complex I2C devices that require heavy setup procedures, such as VL53L0X.
MANAGER | the type of I2C Manager used to handle I2C communication |
Definition at line 689 of file i2c_device_utilities.h.
|
inline |
Construct a new I2CSameFutureGroup from an array of bytes stored in flash memory.
address | address in flash space of the first byte to write to the I2C device |
size | size in bytes of the array at address |
notification | determines if and which notifications should be dispatched by this I2CSameFutureGroup; default is none. |
Definition at line 708 of file i2c_device_utilities.h.
|
inline |
Start the I2C transactions needed by this group of futures.
This is either called by the I2C device support class or by the helper function await_same_future_group()
.
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 737 of file i2c_device_utilities.h.
|
friend |
Helper function that creates a I2CSameFutureGroup
instance for the provided flash array, launches its I2C transactions on the provided I2C device, and waits for the transaction to finish.
MANAGER | the type of I2C Manager used to handle I2C communication |
device | the i2c::I2CDevice subclass instance that shall handle I2C commands to the I2C device |
buffer | pointer, in flash storage space, to the first byte to write to the I2C device |
size | size in bytes of the buffer array |
true | if the whole I2C transactions could be completely performed successfully |
Definition at line 819 of file i2c_device_utilities.h.