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:
parent
1765276000
commit
8c8de70f6e
3 changed files with 14 additions and 0 deletions
|
@ -35,6 +35,10 @@ Hexiwear K64
|
||||||
No special board setup is necessary because there is an on-board RGB LED
|
No special board setup is necessary because there is an on-board RGB LED
|
||||||
connected to the K64 PWM.
|
connected to the K64 PWM.
|
||||||
|
|
||||||
|
nRF52840_PCA10056
|
||||||
|
=================
|
||||||
|
No special board setup is necessary because there is an on-board LED connected.
|
||||||
|
|
||||||
Building and Running
|
Building and Running
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
7
samples/basic/blink_led/prj_nrf52840_pca10056.conf
Normal file
7
samples/basic/blink_led/prj_nrf52840_pca10056.conf
Normal 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
|
|
@ -27,6 +27,9 @@
|
||||||
#elif defined(CONFIG_SOC_QUARK_SE_C1000) || defined(CONFIG_SOC_QUARK_D2000)
|
#elif defined(CONFIG_SOC_QUARK_SE_C1000) || defined(CONFIG_SOC_QUARK_D2000)
|
||||||
#define PWM_DRIVER CONFIG_PWM_QMSI_DEV_NAME
|
#define PWM_DRIVER CONFIG_PWM_QMSI_DEV_NAME
|
||||||
#define PWM_CHANNEL 0
|
#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)
|
#elif defined(CONFIG_BOARD_HEXIWEAR_K64)
|
||||||
#define PWM_DRIVER GREEN_PWM_NAME
|
#define PWM_DRIVER GREEN_PWM_NAME
|
||||||
#define PWM_CHANNEL GREEN_PWM_CHANNEL
|
#define PWM_CHANNEL GREEN_PWM_CHANNEL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue