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

Add ETM tasks and events for timers #1274

Closed
sisoteuz opened this issue Mar 13, 2024 · 2 comments · Fixed by #1287
Closed

Add ETM tasks and events for timers #1274

sisoteuz opened this issue Mar 13, 2024 · 2 comments · Fixed by #1287

Comments

@sisoteuz
Copy link
Contributor

I'd be happy to contribute implementing ETM tasks and events for timers. I've got a personal project going on an esp32-c6 dev kit for which I'd like to experiment with timers ETM.

As far as my seach has gone, I couldn't find such implementation in the HAL yet.

@bjoernQ
Copy link
Contributor

bjoernQ commented Mar 13, 2024

Such a contribution would be very welcome!

We currently have support for SYSTIMER events and GPIO tasks and events.

Looking into those implementations should give you hints on how to implement the tasks and events for the general-purpose timers

@sisoteuz
Copy link
Contributor Author

sisoteuz commented Mar 13, 2024

I've got a first draft that compiles for esp32-c6. There are some rough edges that I would be happy to receive feedback about.

I went with adding a const parameter to TimerGroupInstance that identifies the timer group number. This is used in the TimerEtmTasks and TimerEtmEvents to reduce code duplication and derive the channel number based on the timer group number.

I'm not entirely happy with that as it arguably introduces some breaking changes in other parts of the codebase, so I'm open to any suggestions, as I couldn't see any other alternative with my knowledge of rust.

I also added the example etm_timer.rs to showcase how all of this works.

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

Successfully merging a pull request may close this issue.

3 participants