scan mode for STM32's adc #973
Replies: 2 comments
-
Sure, particularly since the ADC is so different even within a device family, we don't have a particularly fixed API for it. We generally add functions whenever we need them for a specific use-case and then after a while refactor the spaghetti code into something more structured. So, feel free to add what you need! |
Beta Was this translation helpful? Give feedback.
-
I actually found a bug on my implementation for yesterday in particular for STM32F3 family, they don't have a hardware scan mode, i.e. If they have more than one conversion set on SQR1 register (L bits) they should be already do the scan. Since the SQR1 L bits are already handled by the the AddChannel method. I think it would be better to set the hardware bit on that method. I have already created pull request #977 deleting the methods from yesterday and modifying AddChannel. |
Beta Was this translation helpful? Give feedback.
-
Hello There,
I am studying to use modm in one of our projects and I noted that there is no obvious way to set the ADC in scan mode, i.e set the 8th bit on ADC's CR1 register, although there is an option to add channels to the ADC. Since I couldn't find any examples of the adc using the scan mode, I made a little extension to adc.hpp class implementing the scan mode.
If welcome, I would gladly create a pull request incorporating those methods on adc.hpp and adc_impl.hpp
Beta Was this translation helpful? Give feedback.
All reactions