FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Generic Future that can be used to write to several I2C device registers. More...
#include <fastarduino/i2c_device_utilities.h>
Public Member Functions | |
TWriteMultiRegisterFuture (std::initializer_list< T > values, future::FutureNotification notification=future::FutureNotification::NONE) | |
Create a TWriteMultiRegisterFuture future. More... | |
Static Public Attributes | |
static constexpr uint8_t | NUM_WRITES = sizeof...(REGISTERS) |
Number of write commands to use inside the complete I2C transaction in order to perform this multiple registers write. More... | |
static constexpr uint8_t | WRITE_SIZE = sizeof(T) + 1 |
The number of bytes to write for each register command in the I2C transaction. More... | |
Generic Future that can be used to write to several I2C device registers.
Most I2C devices have registers, accessible by a byte address; register values may be one or more bytes long; these may be integral types or not. TWriteMultiRegisterFuture can be used in any I2C device supporting class (subclass of i2c::I2CDevice
) in almost all situations where you need to write to several registers, whatever their address on the device.
MANAGER | the type of I2C Manager used to handle I2C communication |
T | the type of all registers to write to (all registers must be the same type) |
REGISTERS | the address of all registers to write in the I2C device |
Definition at line 359 of file i2c_device_utilities.h.
|
inlineexplicit |
Create a TWriteMultiRegisterFuture future.
This future can then be used to write values to all registers for this instance.
values | the values to write to the registers in the I2C device; all values must be the same type T and the list must contains the same number of values as there are registers for this instance. |
notification | determines if and which notifications should be dispatched by this TWriteMultiRegisterFuture; default is none. |
Definition at line 392 of file i2c_device_utilities.h.
|
staticconstexpr |
Number of write commands to use inside the complete I2C transaction in order to perform this multiple registers write.
Definition at line 374 of file i2c_device_utilities.h.
|
staticconstexpr |
The number of bytes to write for each register command in the I2C transaction.
Definition at line 380 of file i2c_device_utilities.h.