owntech-foundation / Core

A comprehensive API for power electronics based on Zephyr RTOS
https://www.owntech.org/
GNU Lesser General Public License v2.1
3 stars 10 forks source link

[TWIST][PWM] Make sure TWIST PWMs are linked to the shield dts file. #49

Open jalinei opened 5 months ago

jalinei commented 5 months ago

Is your feature request related to a problem? Please describe. While trying to add sync_in and sync_out subnodes to hrtim1 dts definition in spin.dts, I realized that at the moment hrtim.dtsi fragment is defined but not used. Indeed ATM, hrtim.c file redefine everything it needs to configure hrtim using LL calls, not even using zephyr pinctrl-0 property.

Describe the enhancement you'd like

It would be interesting to define child nodes to hrtim1 dts node, one per timing unit. As such we would have pinctrl-0 properties for each timing unit. Interupts properties could also be spread inside timing unit child nodes. Sync_in and Sync_out could also be defined as child nodes of hrtim1, in order to have pinctrl compatibility and suppress most of sync_master_init() / sync_slave_init() LL calls.

pinctrl-1 could be used to match different versions of shields, so that sync_in sync_out would be remapped depending on shield pinout.

Additional context Linked to old issue : https://gitlab.laas.fr/owntech/power-api/core/-/issues/68 This issue is in my opinion tightly linked with #35 discussion as we need a way to implement generic shields using .dtsi or .overlay files somehow.

jalinei commented 5 months ago

To add on top of that current hrtim.yaml does not describe hrtim.dtsi properties correctly. https://gitlab.laas.fr/owntech/power-api/core/-/issues/69

jalinei commented 2 months ago

74

Partially solve this