-
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
HRTIM #69
Comments
See #70 for something close to the obove |
@usbalbin does any activity on this issue? |
I have made a lot more changes in another branch. However that branch also has a lot of unrelated changes so I will at some point try to clean that up and make a new PR. Or more likely a set of new PRs since there is quite a lot hrtim stuff. |
Thank you, please don't hesitate if you have some PRs or ready to deploy features. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would there be any interest in support for the HRTIM peripheral? The peripheral is useful for things like generating PWM waveforms for powersupplies and similar. It is available in the stm32g474 and stm32g484, and some processors from stm32f3xx and stm32h7xx. I have not found a rust implementation for it yet, so as far as I know this would probably be the first?
If this is something that would be accepted as a PR, do you have any suggestions for how to think when creating an API for it?
From what I understand(correct me if I am wrong) looking at the stm32g474 and stm32g484. We have 6 timers, each timer has two outputs which may be routed to pins. So far it looks just as any other pwm timer, however the waveform for each output is defined by up to 32 event sources. Some of those are the ouput's own timer's compare registers(4) and the period wrap around(1), other than that there are lots of other sources like a selection of other timers compare registers, master timer etc. Safe to say, there is not simply one single set_duty that controls the waveform. Then there are dead time and, faults etc.
With that said perhaps it would be wise to start small with some sort of MVP. What would you think about something like splitting this in to three main types:
HrTimer
- this is where we control the period, and overall timer modes and settingsCompareRegister
- I guess this could implement the PwmPin trait even if it might not necessarily be the "duty" that is controlled withset_duty
in all casesOutput
- This is what owns an output pin, may be used for setting what events to listen to in order to form the wave form.I would imagine something roughly like this
The text was updated successfully, but these errors were encountered: