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:
parent
2d5ea10f31
commit
596a11c6bd
6
samples/basic/fade_led/nrf52_pca10040.overlay
Normal file
6
samples/basic/fade_led/nrf52_pca10040.overlay
Normal file
|
@ -0,0 +1,6 @@
|
|||
&pwm0 {
|
||||
status = "ok";
|
||||
ch0-pin = <17>;
|
||||
ch0-inverted;
|
||||
ch1-pin = <18>;
|
||||
};
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue