michallenc commented on issue #12381:
URL: https://github.com/apache/nuttx/issues/12381#issuecomment-2611881018

   I agree that creating a general API for all PWM usages is basically 
impossible. I think we should just focus on some basic capabilities like 
frequency, duty cycle, polarity etc. And other functionalities would have to be 
either in a separate drivers as FOC or configured during a compile time or with 
chip specific ioctl calls. At least for now. If make a good design for basic 
capabilities now, we can always add ioctl for other stuff later.
   
   I currently face a similar problem with SAMv7 PWM and its fault inputs. I 
would need some ioctl that would get me the status of the fault inputs and 
another that would clear them (passing a mask as an argument probably). Thought 
this could probably be a common ioctl for all PWM drivers. But still the 
configuration of these fault inputs would have to be from Kconfig (polarity, 
which input is assigned to which PWM etc.)
   
   Regarding frequency and duty cycle types: setting a unit to `mHz` or 
something like that and passing unsigned integer seems like a good option to 
have a better resolution of these.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to