I2C timeout implementation

I understand that setWireTimeout() in the Wire library has only been implemented for some platforms, but I don't understand how to tell which platforms. I'm using a NRF52480 and would ideally like to add a timeout as a failsafe. Is this currently only available for AVRs?

You can test is the method in the Wire.h library source for your platform.

How would I do that? I don't receive any errors when I call the method, but I'm not sure if it does anything. I don't see anything in the library that is hardware-specific, but in the description on the Arduino site it says "This function was not available in the original version of the Wire library and might still not be available on all platforms".

Try disconnecting the I2C device and see if a read or write times out. Or look at the Wire library code for the nRF52480 and see if a timeout is implemented.

I see, I didn't realize that there were different versions of the library for each platform-- I was looking at the library for AVR. It doesn't appear that timeout has been implemented for NRF. Thanks for your help!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.