samples: blink_led: add support for nRF boards

Add support for nRF boards by using the software-based PWM driver. The
prescaler has to be configured so that the clock runs slower in order to
make the on-board LED blink in the way it is described in the Readme.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
This commit is contained in:
Johannes Hutter 2018-09-17 21:15:08 +02:00 committed by Anas Nashif
commit 8c8de70f6e
3 changed files with 14 additions and 0 deletions

View file

@ -35,6 +35,10 @@ Hexiwear K64
No special board setup is necessary because there is an on-board RGB LED
connected to the K64 PWM.
nRF52840_PCA10056
=================
No special board setup is necessary because there is an on-board LED connected.
Building and Running
********************

View file

@ -0,0 +1,7 @@
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_SYS_LOG=y
CONFIG_SYS_LOG_PWM_LEVEL=4
CONFIG_PWM=y
CONFIG_PWM_NRF5_SW_0_CLOCK_PRESCALER=9

View file

@ -27,6 +27,9 @@
#elif defined(CONFIG_SOC_QUARK_SE_C1000) || defined(CONFIG_SOC_QUARK_D2000)
#define PWM_DRIVER CONFIG_PWM_QMSI_DEV_NAME
#define PWM_CHANNEL 0
#elif defined(CONFIG_SOC_FAMILY_NRF)
#define PWM_DRIVER CONFIG_PWM_NRF5_SW_0_DEV_NAME
#define PWM_CHANNEL LED0_GPIO_PIN
#elif defined(CONFIG_BOARD_HEXIWEAR_K64)
#define PWM_DRIVER GREEN_PWM_NAME
#define PWM_CHANNEL GREEN_PWM_CHANNEL