FT: EVSYS peripheral implementation and pulse counting #839
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.
Summary
This PR is a Work in progress!
This adds a basic channel based implementation for the EVSYS peripheral found on SAMx controllers. Along with a new PulseCounter struct that utilizes the EVSYS, TC and EIC peripheral to count pulses on an EIC channel without any CPU intervention. I had created this in order to monitor hall effect speed sensors.
A huge benefit here is that you can use any TC to monitor any EIC Extint with this method, so the monitored pins do not have to actually be connected to a TC peripheral, making it a lot more flexible.
Apologies for some overlap with #837, as that was needed to get EIC working, but I think this PR should be aimed at reviewing the EVSYS implementation and PulseCounter.
There is still a fair bit more to add to the evsys system (Automatic path type configuration, multiple channels from 1 generator, ...)
Future plans with this