Hi markus, > `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. That sounds a lot driver/hw specific. Can you show us the code for that?
Thanks, Miguel On Wed, Feb 28, 2018 at 9:57 PM, markus <mar...@bibi.ca> wrote: > 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 -- -- Miguel Azevedo