Replies: 3 comments
-
Agreed, the initialize methods are very confusing especially with the shared clock(s) among the ADCs. But perhaps a Thinking a little further, the problem of choosing the right ADC (instance, channel) for a pin reminds me of the DMA resource problem, where the specific optimal ADC (instance, channel) choice depends on the whole system configuration. In addition there is also the whole (semi-)automatic chained(?) conversion thing going on here, with a lot of scheduling options (interlacing, injection etc) plus DMA, which is in its complexity definitely beyond a "simple" C++ API. So the |
Beta Was this translation helpful? Give feedback.
-
I see the ADC api im modm currently being useful for most simple use-cases. Read one (or multiple) ADC channels using polling or interrupts. I like the Idea of adding a AdcCommon345::initialize<SystemClock, 1_MHz, ...>();
Adc4::initialize<...>(...);
Adc4::read(channel4, ...); |
Beta Was this translation helpful? Give feedback.
-
Agreed.
Yes, exactly! And also deals with the shared interrupts that are currently also wrongly part of the per-instance API. |
Beta Was this translation helpful? Give feedback.
-
There are currently four different ADC platform drivers for STM32 in modm.
I would like them to use the same interface to make porting easier.
What do you think about moving the clock mux configuration (which is usually shared between several instances) into the RCC or SystemClock code?
I would also suggest to remove the calibration from
initialize()
and let the user do it manually.Beta Was this translation helpful? Give feedback.
All reactions