Skip to content

nrfx PWM driver breaking API contract #10035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JoeHut opened this issue Sep 17, 2018 · 0 comments
Closed

nrfx PWM driver breaking API contract #10035

JoeHut opened this issue Sep 17, 2018 · 0 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@JoeHut
Copy link
Contributor

JoeHut commented Sep 17, 2018

The nrfx shim introduced for PWM seems to break the API. While the older pwm_nrf5_sw driver and afaics all other pwm drivers comply to the API documentation of the second parameter in pwm_pin_set_cycles and pwm_pin_set_usec to pass the pin where pwm should be applied, pwm_nrfx actually passes the number of the channel. The actual pin that is mapped to this channel is configured via Kconfig. Therefore users have to fix the call when switching between drivers. I also didn't find documentation for this behavior.

On a side note, the usage of -1 in Kconfig to indicate that a channel is not used is inconsistent with how the rest of Zephyr handles those things. Usually I see a dedicated boolean config to en-/disable functionality.

@nashif nashif added the bug The issue is a bug, or the PR is fixing a bug label Sep 17, 2018
@nashif nashif added the priority: medium Medium impact/importance bug label Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants