diff --git a/i2c.hpp b/i2c.hpp index 0b48f40..7e9dc4f 100644 --- a/i2c.hpp +++ b/i2c.hpp @@ -25,6 +25,17 @@ struct I2c { return Driver::write(data); } + template + static bool writeBytes(const uint8_t *buffer) + { + for (size_t i = 0; i < Bytes; ++i) { + if (!write(buffer[i])) + return false; + } + + return true; + } + template static uint8_t read() {