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.
I'd like to propose a new
CapturePin
trait for representing a single input capture channel. It is to theCapture
trait whatPwmPin
is toPwm
. Since single-channel singleton abstractions are preferable to multi-channel abstractions, a trait likeCapturePin
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 inCapture
trait except it doesn't pass in a channel. Since not every chip supports enabling/disabling single capture channels, theenable
anddisable
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.