While writing a PWM driver for the STM32s mcu family I came across the issue of 
assigning output pins for a pwm channel.

PWM output in STM32s is done by configuring a pin for "alternate functions" - 
where specific pins have specific (possible) alternate functions. In other 
words, only a very limited number of timer:channel:pin combinations are 
possible, each one requiring a very specific alternate function.

`struct pwm_chan_config` only specifies the pin number. I've been using the 
`data` member to put the burden on the application to specify the "correct" 
number for the alternate function - but I find this a little unsatisfactory.

So I was wondering if somebody has a recommendation, better approach to solving 
this issue?

Have fun,
Markus

Reply via email to