From 328d84fcf1ce89c3bb7495e523ce6dcf9cab7ee9 Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Fri, 7 Jul 2023 09:08:30 +0200 Subject: [PATCH] boards/nrf9160dk: enable PWM support on onboard LEDs Signed-off-by: Dylan Laduranty --- boards/nrf9160dk/Kconfig | 1 + boards/nrf9160dk/Makefile.features | 1 + boards/nrf9160dk/include/periph_conf.h | 21 ++++++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/boards/nrf9160dk/Kconfig b/boards/nrf9160dk/Kconfig index 09abc75c39..59be987652 100644 --- a/boards/nrf9160dk/Kconfig +++ b/boards/nrf9160dk/Kconfig @@ -12,6 +12,7 @@ config BOARD_NRF9160DK default y select CPU_MODEL_NRF9160 select HAS_PERIPH_I2C + select HAS_PERIPH_PWM select HAS_PERIPH_RTT select HAS_PERIPH_SPI select HAS_PERIPH_TIMER diff --git a/boards/nrf9160dk/Makefile.features b/boards/nrf9160dk/Makefile.features index 5fc79dc456..072cc8c92f 100644 --- a/boards/nrf9160dk/Makefile.features +++ b/boards/nrf9160dk/Makefile.features @@ -3,6 +3,7 @@ CPU = nrf9160 # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer diff --git a/boards/nrf9160dk/include/periph_conf.h b/boards/nrf9160dk/include/periph_conf.h index 9ad5f1f4e3..9371c17889 100644 --- a/boards/nrf9160dk/include/periph_conf.h +++ b/boards/nrf9160dk/include/periph_conf.h @@ -116,7 +116,7 @@ static const uart_conf_t uart_config[] = { #define UART_0_ISR (isr_uarte0_spim0_spis0_twim0_twis0) /**< UART0_IRQ */ #define UART_1_ISR (isr_uarte1_spim1_spis1_twim1_twis1) /**< UART1_IRQ */ -#define UART_NUMOF ARRAY_SIZE(uart_config) /**< UART confgiguration NUMOF */ +#define UART_NUMOF ARRAY_SIZE(uart_config) /**< UART configuration NUMOF */ /** @} */ /** @@ -137,6 +137,25 @@ static const uart_conf_t uart_config[] = { #endif /** @} */ +/** + * @name PWM configuration + * @{ + */ +static const pwm_conf_t pwm_config[] = { + { + .dev = NRF_PWM0_S, + .pin = { + LED0_PIN, + LED1_PIN, + LED2_PIN, + LED3_PIN + } + }, +}; + +#define PWM_NUMOF ARRAY_SIZE(pwm_config) +/** @} */ + #ifdef __cplusplus } #endif