You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/04/13 19:22:50 UTC
[GitHub] mlampert commented on issue #955: pwm enabled?
mlampert commented on issue #955: pwm enabled?
URL: https://github.com/apache/mynewt-core/issues/955#issuecomment-381237426
Looking at the API from a disable/stop perspective it might be
worthwhile to reflect the channel in the API name:
pwm_enable_duty_cycle -> pwm_chan_enable_duty_cycle
pwm_disable -> pwm_chan_disable
inline ...
On Fri, 13 Apr 2018 07:14:16 -0700
Miguel Azevedo <no...@github.com> wrote:
> Ok, I see 2 issues here, probably we want :
> 1 - To make pwm_disable to just stop the channel playback and not
> unconfigure it.
I like that, we could add a pwm_chan_unconfig for releasing the pin.
That would also complete the symmetry config/unconfig, enable/disable.
> 2 - Closing the device will make every channel unconfigured.
... and unconfigure the timer itself. Not sure if that is an issue in
the NRF but on STM32s it's advisable to clean up if you want to use
that timer for something else.
> 3 - pwm_is_enabled because we now can make a channel run for a number
> of cycles and may want to know if it has already been configured.
In the current api "enabled" is equivalent to "currently outputting PWM
signals". Would it make more sense to call it pwm_chan_is_configured ?
> 4 - A way to make a channel unassigned to a pin. (I'll make a
> PWM_NO_PIN macro so the user may do this via configure_channel)
see ad 1
> @mlampert do you have any input on this?
With the addition of the interrupt API it might make more sense (be
more intuitive from a user's perspective) to use "start" and "stop"
instead of "enable" and "disable":
pwm_chan_start(_duty_cycle)
pwm_chan_stop
not sure if the "_duty_cycle" is needed for pwm_chan_start. But this is
a more intrusive API change ....
HTH,
Markus
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services