Skip to content

Commit

Permalink
boards/nrf5340dk: 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 Jun 30, 2023
1 parent c12e866 commit b711d7e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards/nrf5340dk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config BOARD_NRF5340DK
bool
default y
select CPU_MODEL_NRF5340
select HAS_PERIPH_PWM
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_UART_HW_FC
Expand Down
1 change: 1 addition & 0 deletions boards/nrf5340dk/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CPU_MODEL = nrf5340
CPU = nrf53

# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_uart_hw_fc
19 changes: 19 additions & 0 deletions boards/nrf5340dk/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@
extern "C" {
#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)
/** @} */

/**
* @name Timer configuration
* @{
Expand Down

0 comments on commit b711d7e

Please sign in to comment.