Nice to see it can be useful to others
Right now, it is indeed in a “good enough for me” stage. The goal was to provide a low level implementation only, because high level considerations (emulating specific devices such as temperature sensors or whatever) have a much larger scope, beyond what I can provide and support as a hobby, and also these are (somewhat) less difficult problems to solve. But it’s open source, so anyone can expand on it. Also, that doesn’t mean I won’t try to fix the bugs that are reported, if any
I didn’t heard of Cosa, but it seems interesting, I’ll take a look, thanks.
About timing issues, I also tried with an active wait, and it was just a little bit slower, but I think it can work too. However, you really have to use 100% of the CPU to do just that, poll the pin state in a loop, and pull low as soon as you detect the edge (so you need to know if you’re going to pull low before starting the loop, to avoid too many instructions in between). So in my experience, interrupts are indeed more adequate to the task (a bit faster, and also less risk to miss an edge since the edge detection is hardware). Not sure how all these things will work (or not) on other boards though.