Skip to content

Commit

Permalink
boards/nrf9160dk: enable PWM support on onboard LEDs
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
  • Loading branch information
dylad committed Jul 8, 2023
1 parent d0322bb commit fb297a9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions boards/nrf9160dk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions boards/nrf9160dk/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion boards/nrf9160dk/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/** @} */

/**
Expand All @@ -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
Expand Down

0 comments on commit fb297a9

Please sign in to comment.