• For I2C, yes - that's pretty much the idea. The API used in the example looks different to the one I use (eg https://github.com/espruino/Espruino/blo­b/ab227f54ad5585d5ceaa7cfd6b54634ee0dc60­9d/targets/stm32/jshardware.c#L2338) but it's the same idea (also I'd have to make sure the code for I2C master still worked :).

    Having said that, if you're doing it for yourself then yeah, just try it and see :)

    You could have a callback for a read - the only issue is if you waited for the response. I think a lot of devices wouldn't be willing to wait for long enough so you'd really need to at least offer a solution that just pushed the data ASAP.

About

Avatar for Gordon @Gordon started