All newer boards are likely to have more RAM and/or faster clock, faster clock alone will mean a lot more wasted cycles on blocking calls and more functions should be made non-blocking.
There are issues with RequestFrom and EndTransmission that make it more complicated to make them non-blocvking, but it is obviously possible as many other platforms have non-blocking I2C (or SMBUS that runs over I2C) in desktop PCs so the API CAN be made non-blocking. However it is more than just callback functions that are likely to be required.
First of all error handling EndTransmission has return codes of
Missing error status
void reset(void); |
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
I tend to agree.
But to throw out a slight alternative, having dug through the AVR Wire libraries and low level drivers a lot (particularly to get low-end AVRs and TINY’s working, both as master and slave), I really question if this library is worth evolving. I agree that backward compatibility is very important, and perhaps to beginning programmers the existing Wire mindset makes sense, so I really hesitate to change it and possibly break a lot of old sketches.
It’s clear that the majority of folks on this thread have used I2C long enough to have a better feel for the inherent block/transaction orientation of I2C, and perhaps even for the challenges of trying to emulate an I2C slave. (Shudder.) Very few people need to understand the complexities of I2C stop conditions, or restart, etc. The overwhelming majority, I wager, just want a ReadNBytesFromSlaveXAddressZ, and WriteNBytestoSlaveY/WriteNBytesToSlaveYAddressZ. (yes, yes, the address could be prepended into the buffer, but why make it more complicated for the newbie?) We also have a much wider selection of CPUs being supported that we did when the Wire library was first written, everything from high-end ST32’s to low-end Tiny’s from Adafruit.
Given that, I would suggest that we look at a new architecture for the I2C library (Call it Wire2 if you like), and re-implement it from scratch using the very good suggestions for non-blocking operation, adjustable buffer sizes, and better slave emulation support. I think is this one of the rare places where Arduino really got it wrong, so let’s stop trying to contort the old interface into something it really wasn’t designed to support.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
I don’t think that works if you’re multi-master.
From: Rob Tillaart [mailto:rob.ti...@gmail.com]
Sent: Monday, March 27, 2017 4:53 AM
To: Arduino Developers <devel...@arduino.cc>
Subject: Re: [Developers] Re: Non-blocking extension to Wire library
Just a thought,
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.