HRTIM and power driver made more generic
The current HRTIM API is heavily dependent on the hardware, we need a more generic API to handle all types of board (twist, ownverter, custom). This commit introduce two modules :
- A PWM driver to initialize every timer of the HRTIM, and set parameters such as switching frequency, modulation type, adc triggers..etc.
- A power driver which is based on a device tree configuration to initialize all the timer with the parameters in the device tree, and control converter in buck or boost mode.
You can find more information on this wiki
Merge request reports
Activity
changed milestone to %Have a generic hrtim implementation
added HRTIM driver label
requested review from @cfoucher
assigned to @afarahhass
Here is a main file for test main_new_hrtim.txt
Huge work @afarahhass thanks for pulling this one out !
Minor things :
- I'm not really happy with the yaml description, we should be more verbose on what is a power leg, which is definitely not obvious for most people.
- ADC continuous/sequential property would be nice to have next to trigger event specifications
- Same for ADC decimation, would be nice if it can be specified via DT
- RollOver naming is not really appropriate IMO, it is the naming of ST, but it fails at explaining what it does.
Major doubts:
- I'm not sure the proposed dts syntax is the best. I guess child nodes would make more sense both for the ADC trigger block and for the DAC block.
- At the moment I guess that if we want a single PWM, we still have to define a power leg, and deactivate one output, that would be idling in alternate mode. It works but it is a bit twisted
- At the moment, we use the same naming for both PWM control and direct comparison (current mode) which is definitely not a PWM technic. However, I don't have any clever idea on how to sort out this naming problem.
- I'm not a huge fan of having multiple dtsi files for making a shield. I would largely prefer a single Twist.overlay file. We won't have many nodes in shields anyway. Having multiple dtsi files both for SPIN and TWIST makes it less digest IMO.
@cfoucher I guess we'll need to have a bit of a collab to finish integrate missing dt properties on ADC side as well so that we have proper child nodes for the power legs
Edited by Jean Alinei- Resolved by Clément Foucher
- Resolved by Clément Foucher
- Resolved by Clément Foucher
- Resolved by Clément Foucher
- Resolved by Clément Foucher
After discussing with @cfoucher, we had the following remarks :
- The device tree should be independent from SPIN hardware, and STM32 functions. It means that we need to replace timing unit (e.g. PWMA) with pin number (12 and 14), an DAC. We'll keep adc_trigger propriety for now and try to find a better solution to replace it.
- Replacing propriety such as phase-shift or dead-time with default-phase-shift and default-dead-time as these parameters can be modified after by user.
added 1 commit
- f308a3ca - correcting input parameters for setAllAdcDecim, adding default return for spinNumberToTu
added 1 commit
- d42e26fc - adding a function to return master timer period
- Resolved by Clément Foucher
- Resolved by Clément Foucher
- Resolved by Clément Foucher
Please register or sign in to reply