The SAMD10 goes to sleep and is woken up by I2C on address match. I am just wondering if there is a way to set up the communication so I can send multiple data bytes without having to wake up the device until the transaction is over. So for example now I have this on the master side (arduino):
typedef union test{
uint32_t toSend;
uint8_t mBytes[sizeof(uint32_t)];
}test;
for(uint8_t i = 0; i < sizeof(uint32_t); ++i){
Wire.beginTransmission(0x29); // transmit address
Wire.write(t.mBytes[i]); // sends refresh time in ms
Wire.endTransmission();
}
So everytime I want to send data to the device I need to send the address first and then check on the slave check if all bytes have been received. I would like to make the master code look like this:
Wire.beginTransmission(0x29); // transmit address
for(uint8_t i = 0; i < sizeof(uint32_t); ++i){
// or something like
Wire.write(t.mBytes[i]); // sends refresh time in ms
}
Wire.endTransmission();