Skip to content
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

boards/nrf52840dongle: Configure PWM to drive the LEDs #15115

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/nrf52840dongle/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ config BOARD_NRF52840DONGLE
default y
select BOARD_COMMON_NRF52
select CPU_MODEL_NRF52840XXAA
select HAS_PERIPH_PWM
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_RADIO_NRF802154
Expand Down
1 change: 1 addition & 0 deletions boards/nrf52840dongle/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CPU_MODEL = nrf52840xxaa

# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

Expand Down
15 changes: 15 additions & 0 deletions boards/nrf52840dongle/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ static const uart_conf_t uart_config[] = {
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

/**
* @name PWM configuration
*
* For the nRF52840-Dongle board, the PWM0 module is set to drive the LEDs LD1
* and the channels LD2 red, green and blue in the four channels of PWM_DEV(0);
* other PWM outputs are not configured.
*
* @{
*/
static const pwm_conf_t pwm_config[] = {
{ NRF_PWM0, { GPIO_PIN(0, 6), GPIO_PIN(0, 8), GPIO_PIN(1, 9), GPIO_PIN(0, 12) } }
};
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down