diff options
Diffstat (limited to 'nrf528xx')
-rw-r--r-- | nrf528xx/CMakeLists.txt | 7 | ||||
-rw-r--r-- | nrf528xx/main.c | 0 | ||||
-rw-r--r-- | nrf528xx/prj.conf | 1 | ||||
-rw-r--r-- | nrf528xx/readme.md | 22 | ||||
-rw-r--r-- | nrf528xx/src/main.c | 13 |
5 files changed, 41 insertions, 2 deletions
diff --git a/nrf528xx/CMakeLists.txt b/nrf528xx/CMakeLists.txt new file mode 100644 index 0000000..5265fc3 --- /dev/null +++ b/nrf528xx/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(NONE) + +target_sources(app PRIVATE src/main.c) + diff --git a/nrf528xx/main.c b/nrf528xx/main.c deleted file mode 100644 index e69de29..0000000 --- a/nrf528xx/main.c +++ /dev/null diff --git a/nrf528xx/prj.conf b/nrf528xx/prj.conf new file mode 100644 index 0000000..91c3c15 --- /dev/null +++ b/nrf528xx/prj.conf @@ -0,0 +1 @@ +CONFIG_GPIO=y diff --git a/nrf528xx/readme.md b/nrf528xx/readme.md index 77ea509..c54c54e 100644 --- a/nrf528xx/readme.md +++ b/nrf528xx/readme.md @@ -1,4 +1,22 @@ # nrf528xx subdirectory -- compatible with nrf52833 and nrf52840 -- west for building and flashing +## building + +```bash +# build for big dev board +west build -b nrf52833dk_nrf52833 + +# build for usb dongle +west build -b nrf52840dongle_nrf52840 +``` + +## flashing + +```bash +# incremental flash +west flash + +# force erase flash first +west flash --erase +``` + diff --git a/nrf528xx/src/main.c b/nrf528xx/src/main.c new file mode 100644 index 0000000..649af38 --- /dev/null +++ b/nrf528xx/src/main.c @@ -0,0 +1,13 @@ +#include <zephyr/zephyr.h> +#include <zephyr/drivers/gpio.h> + +static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); + +void main() { + gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); + + while (1) { + gpio_pin_toggle_dt(&led); + k_msleep(1000); + } +} |