drivers: pwm: nrf: Modify fade_led PWM example, use new HW drv

1. Modified fade_led PWM example to include
   nRF HW PWM option.
2. Added fade_led nrf52_pca10040.overlay
   in order to enable PWM node and choose
   output PWM GPIO for channel 0. Channel 1
   GPIO enable but not used in sample src.

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
This commit is contained in:
Gaute Gamnes 2018-12-04 17:52:40 +01:00 committed by Carles Cufí
parent 2d5ea10f31
commit 596a11c6bd
2 changed files with 10 additions and 0 deletions

View file

@ -0,0 +1,6 @@
&pwm0 {
status = "ok";
ch0-pin = <17>;
ch0-inverted;
ch1-pin = <18>;
};

View file

@ -25,7 +25,11 @@
#define PWM_DRIVER CONFIG_PWM_QMSI_DEV_NAME
#define PWM_CHANNEL 0
#elif defined(CONFIG_SOC_FAMILY_NRF)
#if defined(CONFIG_PWM_NRF5_SW)
#define PWM_DRIVER CONFIG_PWM_NRF5_SW_0_DEV_NAME
#else
#define PWM_DRIVER CONFIG_PWM_0_NAME
#endif /* CONFIG_PWM_NRF5_SW */
#define PWM_CHANNEL LED0_GPIO_PIN
#elif defined(CONFIG_SOC_ESP32)
#define PWM_DRIVER CONFIG_PWM_LED_ESP32_DEV_NAME_0