Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: CapturePin trait #176

Open
YuhanLiin opened this issue Jan 6, 2020 · 1 comment
Open

Discussion: CapturePin trait #176

YuhanLiin opened this issue Jan 6, 2020 · 1 comment

Comments

@YuhanLiin
Copy link

I'd like to propose a new CapturePin trait for representing a single input capture channel. It is to the Capture trait what PwmPin is to Pwm. Since single-channel singleton abstractions are preferable to multi-channel abstractions, a trait like CapturePin should become the recommended way to handle input capture hardware. The trait will only have the method .capture(), which has the same API as the same method in Capture trait except it doesn't pass in a channel. Since not every chip supports enabling/disabling single capture channels, the enable and disable methods are omitted (perhaps they can be a separate sub-trait). For a prototype of what the trait will look like, refer to this PR.

@ryankurte
Copy link
Contributor

hey thanks for the issue / PR! I haven't used PWM capture in some time, @rust-embedded/hal team any thoughts about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants