diff --git a/app/boards/arm/paw/CMakeLists.txt b/app/boards/arm/paw/CMakeLists.txt new file mode 100644 index 00000000..00952c30 --- /dev/null +++ b/app/boards/arm/paw/CMakeLists.txt @@ -0,0 +1,8 @@ +set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py + -c + -b 0x26000 + -f 0xADA52840 + -o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2 + ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin +) diff --git a/app/boards/arm/paw/Kconfig b/app/boards/arm/paw/Kconfig new file mode 100644 index 00000000..f70533d8 --- /dev/null +++ b/app/boards/arm/paw/Kconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_PAW diff --git a/app/boards/arm/paw/Kconfig.board b/app/boards/arm/paw/Kconfig.board new file mode 100644 index 00000000..c2360a5a --- /dev/null +++ b/app/boards/arm/paw/Kconfig.board @@ -0,0 +1,9 @@ +# Paw board configuration + +# Copyright (c) 2020 Taylor Glaeser +# SPDX-License-Identifier: MIT + +config BOARD_PAW + bool "Paw" + depends on SOC_NRF52840_QIAA + diff --git a/app/boards/arm/paw/Kconfig.defconfig b/app/boards/arm/paw/Kconfig.defconfig new file mode 100644 index 00000000..89c2c192 --- /dev/null +++ b/app/boards/arm/paw/Kconfig.defconfig @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Taylor Glaeser +# SPDX-License-Identifier: MIT + +if BOARD_PAW + +config BOARD + default "paw" + +if USB + +config USB_NRFX + default y + +config USB_DEVICE_STACK + default y + +endif # USB + +config BT_CTLR + default BT + +config ZMK_BLE + default y + +config ZMK_USB + default y + +endif # BOARD_PAW diff --git a/app/boards/arm/paw/board.cmake b/app/boards/arm/paw/board.cmake new file mode 100644 index 00000000..fa847d50 --- /dev/null +++ b/app/boards/arm/paw/board.cmake @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT + +board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") +include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) diff --git a/app/boards/arm/paw/paw.dts b/app/boards/arm/paw/paw.dts new file mode 100644 index 00000000..cc281ca6 --- /dev/null +++ b/app/boards/arm/paw/paw.dts @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2020 Taylor Glaeser + * + * SPDX-License-Identifier: MIT + */ + +/dts-v1/; +#include + +/ { + model = "Paw"; + compatible = "paw"; + + chosen { + zephyr,code-partition = &code_partition; + // zephyr,console = &uart0; + //zephyr,bt-mon-uart = &uart0; + //zephyr,bt-c2h-uart = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zmk,kscan = &kscan0; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-direct"; + label = "KSCAN"; + input-gpios + = <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; + + /* + leds { + compatible = "gpio-leds"; + blue_led: led_0 { + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + label = "Blue LED"; + }; + }; + */ +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + compatible = "nordic,nrf-twi"; + sda-pin = <17>; + scl-pin = <20>; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + status = "okay"; + current-speed = <115200>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; +}; + +&usbd { + status = "okay"; +}; + + +&flash0 { + /* + * For more information, see: + * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "adafruit_boot"; + reg = <0x000000000 0x0000C000>; + }; + code_partition: partition@26000 { + label = "code_partition"; + reg = <0x00026000 0x000d2000>; + }; + + /* + * The flash starting at 0x000f8000 and ending at + * 0x000fffff is reserved for use by the application. + */ + + /* + * Storage partition will be used by FCB/LittleFS/NVS + * if enabled. + */ + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 0x00008000>; + }; + }; +}; diff --git a/app/boards/arm/paw/paw.keymap b/app/boards/arm/paw/paw.keymap new file mode 100644 index 00000000..e13420d6 --- /dev/null +++ b/app/boards/arm/paw/paw.keymap @@ -0,0 +1,17 @@ +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ----------------------------------------------------------------------------------------- +// TODO: Add diagram for keymap + bindings = < + &bt BT_CLR &bt BT_SEL 1 &kp DARW &bootloader + >; + }; + }; +}; diff --git a/app/boards/arm/paw/paw.yaml b/app/boards/arm/paw/paw.yaml new file mode 100644 index 00000000..1070b33e --- /dev/null +++ b/app/boards/arm/paw/paw.yaml @@ -0,0 +1,15 @@ +identifier: paw +name: Pawww +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog diff --git a/app/boards/arm/paw/paw_defconfig b/app/boards/arm/paw/paw_defconfig new file mode 100644 index 00000000..9f2880b8 --- /dev/null +++ b/app/boards/arm/paw/paw_defconfig @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_PAW=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# enable GPIO +CONFIG_GPIO=y + +CONFIG_USE_DT_CODE_PARTITION=y + +CONFIG_MPU_ALLOW_FLASH_WRITE=y +CONFIG_NVS=y +CONFIG_SETTINGS_NVS=y +CONFIG_FLASH=y +CONFIG_FLASH_PAGE_LAYOUT=y +CONFIG_FLASH_MAP=y +CONFIG_CLOCK_CONTROL_NRF=y +CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y