boards/nrf52840dongle: Configure PWM to drive the LEDs #15115
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
The nRF52840-Donle board has hardware that lends itself to PWM driving, but did not configure a default PWM setting.
This adds a single PWM peripheral that is configured for the LEDs LD1, LD2#red, LD2#green and LD2#blue.
Testing procedure
and watch the green LED and the roughly-white-appearing RGB LED fade in unison.
The LEDs are driven active-low, which is of no concern to the PWM module but will help understand the values when you test that the documented assignment ("is set to drive the LEDs LD1 and the channels LD2 red, green and blue in the four channels of PWM_DEV(0)") matches:
Issues/PRs references
This is done a) because it's a peripheral that can reasonably expected to be wired, and b) as a test case for #15106.