-
Notifications
You must be signed in to change notification settings - Fork 48
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
Timer driven Events #98
Comments
Thanks :) Here is one way in my very much work in progress hrtim PR. :) |
Is that sort of API something we want to use for most event based things? Just to summarize:Avoid enums for representing event sources in the user facing api by instead letting them use the relevant object itself directly (or a reference to it). This also has the side effects that the event source needs to be setup before the consumer starts listening. For example:let (timer, (cr1, ..), (mut out1, mut out2)) = dp
.HRTIM_TIMA
.pwm_advanced((pin_a, pin_b), &mut rcc)
[...]
.finalize(&mut hr_control);
//Good
out1.enable_rst_event(&cr1); // Set low on compare match with cr1
out1.enable_set_event(&timer); // Set high at new period
// Bad
out1.enable_rst_event(HrTimerEvent::Cr1); // Set low on compare match with cr1
out1.enable_set_event(HrTimerEvent::Period); // Set high at new period Incomplete list of vaguely similar things:
|
So implementation wise that would mean that enums are avoided and instead traits are used with member const that are used to configure the listener. Does this make sense? If so, would you like me to update #96 to follow that pattern? Or does anyone have other thoughts? :) |
There aren't any way to setup run ADC from any timer or other event.
Also there aren't any functions to create chain of timers.
@usbalbin if you have some future PR's or any ideas, code snippets, welcome to the discussion.
The text was updated successfully, but these errors were encountered: