drivers: Optimized periph PWM interfaces#3644
drivers: Optimized periph PWM interfaces#3644haukepetersen wants to merge 16 commits intoRIOT-OS:masterfrom
Conversation
|
@A-Paul might be interested |
drivers/include/periph/pwm.h
Outdated
There was a problem hiding this comment.
I don't understand this.
Also found no place in your changes where it is used.
There was a problem hiding this comment.
It is not used (yet). This define provides a universal means of accessing the different PWM devices in a more programmable fashion, while still providing the possibility for each CPU to override this default behavior. Have a look at the GPIO define and it's usage in drivers/include/periph/gpio.h and how some CPUs use it (e.g. cpu/stm32f4/include/periph_cpu.h)...
|
In your change list you forgot to mention the interface change for |
9815408 to
df44dd6
Compare
|
@A-Paul: added it to the list of changes. rebased. |
|
@A-Paul ping?! |
df44dd6 to
27ef00c
Compare
|
rebased |
Huh?? |
|
@A-Paul I think @haukepetersen wants your approval. |
|
Yap, the all reoccurring question about the ack :-) But I just see, that Travis is complaining, I look into it quickly |
|
I'm kind of sorry for the latency ... |
27ef00c to
c86380c
Compare
|
No problem. Now you are assigned :-) But nevertheless, not being assigned doesn't mean you can't ack something... I reworked this PR again slightly by adding a |
|
@A-Paul I think you have the needed insights and also Travis will be your helping hand |
|
@A-Paul Don't Panic! |
|
Travis is not happy -> I will introduce a fix for that separately, so lets put this PR on hold until the fix is merged. I will update this PR then accordingly... |
|
What's the fix? Which PR is it waiting on? |
c86380c to
7ba3f04
Compare
|
Ok, added some guards to the old style PWM driver implementations, now Travis should be happy with this PR. I would propose to merge this if anyone is ok with the API changes and than introduce updated PWM drivers for the affected CPUs separately... So this PR is not waiting on any other PR anymore, all it needs is an ACK and squashing... |
|
The changes seem alright as quick as I can see. Here we can also remap the
hardware assigned channels to logic channels? The board I'm making for
example has TIM4-CH3 connected to the microbus PWM pin. So imho it would be
nice to map PWM line 0 to hardware channel 3.
Don't know if this is feasible or of this would have serious flash usage
penalties?
|
|
Not sure I understand you problem correctly. Do you mean mapping the (timerdev, cc-channel) tuple to logical lines as done in the ADC and DAC interfaces? This would IMHO not be feasible here, as the programmed resolution and freq is the same for all channels of a timer device. If you mean simple remapping of MCU timer cc-channels to logical RIOT channels (e.g. tim4-ch3 -> PWM_0-CH0), this is possible out of the box. |
|
The last one so its ok then :)
|
|
yep. |
|
@haukepetersen should this be closed in favor of #4638? |
|
yes. |
Updated the PWM interface slightly:
pwm_setpwm_initI did however not yet optimize any of the existing PWM drivers with the new possibilities...