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

TIMG timers should support period mode #123

Closed
bjoernQ opened this issue Jul 27, 2022 · 7 comments
Closed

TIMG timers should support period mode #123

bjoernQ opened this issue Jul 27, 2022 · 7 comments
Assignees

Comments

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 27, 2022

Currently we only support target mode.

Period mode could be potentially useful e.g. esp-wifi currently uses period mode of SYSTIMER and since the HAL lacks that functionality it accesses the registers directly.

@bjoernQ bjoernQ changed the title SYSTIMER should support period mode SYSTIMER and TIMG timers should support period mode Jul 29, 2022
@jessebraham jessebraham moved this to Todo in esp-rs Aug 3, 2022
@MabezDev MabezDev self-assigned this Aug 8, 2022
@jessebraham jessebraham added this to the v0.2.0 milestone Aug 25, 2022
@jessebraham jessebraham removed this from the v0.2.0 milestone Sep 13, 2022
@jessebraham jessebraham changed the title SYSTIMER and TIMG timers should support period mode TIMG timers should support period mode Oct 27, 2022
@MabezDev MabezDev assigned JurajSadel and unassigned MabezDev Nov 11, 2022
@MabezDev
Copy link
Member

@bjoernQ I think this is already done for TIMG timers? When used with the e-h timer traits they are used in periodic mode? Please correct me if I'm wrong :D.

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Nov 15, 2022

🤔 seems you are right 👀 .... but probably it shouldn't be like that?

i.e. by default, it should be one-shot and we should have an "into_periodic" function (like systimer) to turn it into periodic mode?

@MabezDev
Copy link
Member

I think that's just the way the e-h traits work, we implement periodic on the timer which has a cancel method to stop the timer at any point - i.e after one iteration.

I guess we could still have the into_periodic function on the timer, and implement the periodic trait on that type 🤔

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Nov 15, 2022

Sounds like the best way to go - then it's aligned with systimer 👍

@MabezDev
Copy link
Member

We might struggle here, TimerGroup contains two timers (on most chips). We can't use into_periodic(self) on the timers inside, because we can't move the timers out of TimerGroup :/

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Nov 15, 2022

Ohh you are right

@MabezDev
Copy link
Member

I think with that in mind lets close this for now. If the need for something like this pops up again, we can look at changing the whole TimerGroup struct

Repository owner moved this from Todo to Done in esp-rs Nov 15, 2022
Repository owner moved this from Todo to Done in Async support in esp-hal Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants