-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for dual ADC mode and injected sampling based on interrupts #4243
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
base: main
Are you sure you want to change the base?
Add support for dual ADC mode and injected sampling based on interrupts #4243
Conversation
@Dirbaio and thoughts on this? This PR was mainly done to cover the needs in the project I'm working on. I noticed that the current state of the ADC module is rather far from the capabilities of the ADC peripherals, if there is some roadmap or vision for the ADC module I could maybe help with the development. As and example the existing read function for regular ADC channels reconfigures the ADC for each read operation which is problematic in high performance or timing critical applications. |
Could we get some attention on this PR perhaps? Assuming that the merge conflict are resolved, could this be merged? |
@lulf can you please have a look at this PR given that I fix the conflicts? |
@lulf ping |
#4450 I think it would be better if the exisitng "read" method was removed as having both that one and the two new methods from that PR makes the module a bit confusing. Maybe there is a point in keeping "read" as it is for legacy reasons? Some renaming could also help In the future we may also need to extend support for auto-triggered regular conversions. #4583 Nether of those PR cover my needs tho as I need to use the injected ADC channels as the exact moment of sampling is important for my applicaiton. |
@lulf what is the idea behind the different ADC files, g4.rs, v1.rs, v2.rs etc? Is the intention to keep different versions for different processors or shall the latest vx.rs be used for all and be adapted through conditional configuration? |
The vX is intended to be a version of the peripheral that more than one stm32 family shares (often they are quite similar). Sometimes a version is just too family specific so you get things like g4. |
Add code in complementary PWM to be able to generate interrupts from the timer.
Made pac adc vals imports public to be able to re-export them to the user.