Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I need pin interrupt support for a project and this is one way of achieving that if we don't end up supporting pin interrupts directly (latency is not a problem for this project since the signal is sent over i2c to a Raspberry Pi).
I have previously wondered if PulseIn (#1072) could be used, but I think a Counter abstraction is a much better fit and has other use cases too. Of course there's that feature creep syndrome and flash is scarce on some boards.
@tannewt was unsure about pull support:
But at least pull up is working on a samd51.
See #1415 for how this Counter can be used with async/await.
This samd-peripherals change is also necessary: https://gist.github.com/notro/2558d4fe1b0699e175c7dc33b9a74d22