diff --git a/app/boards/arm/bluehand/Kconfig.board b/app/boards/arm/bluehand/Kconfig.board new file mode 100644 index 00000000..a54315f0 --- /dev/null +++ b/app/boards/arm/bluehand/Kconfig.board @@ -0,0 +1,8 @@ +# BlueHand board configuration + +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config BOARD_BLUEHAND + bool "BlueHand" + depends on SOC_NRF52840_QIAA diff --git a/app/boards/arm/bluehand/Kconfig.defconfig b/app/boards/arm/bluehand/Kconfig.defconfig new file mode 100644 index 00000000..8a572d49 --- /dev/null +++ b/app/boards/arm/bluehand/Kconfig.defconfig @@ -0,0 +1,27 @@ +# BlueHand keyboard configuration + +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if BOARD_BLUEHAND + +config ZMK_KEYBOARD_NAME + default "BlueHand" + +if USB_DEVICE_STACK + +config USB_NRFX + default y + +endif # USB_DEVICE_STACK + +config BT_CTLR + default BT + +config ZMK_BLE + default y + +config ZMK_USB + default y + +endif # BOARD_BLUEHAND diff --git a/app/boards/arm/bluehand/bluehand.dts b/app/boards/arm/bluehand/bluehand.dts new file mode 100644 index 00000000..e9b84a0e --- /dev/null +++ b/app/boards/arm/bluehand/bluehand.dts @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2024 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + + +/dts-v1/; +#include + +/ { + model = "BlueHand"; + compatible = "blue,hand"; + + chosen { + zephyr,code-partition = &code_partition; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &cdc_acm_uart; + zmk,kscan = &kscan0; + zmk,battery = &vbatt; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-direct"; + label = "KSCAN"; + + input-gpios + = <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; + + leds { + compatible = "gpio-leds"; + powerled: led_r { + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + label = "PWR LED"; + }; + + activityled: led_b { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + label = "Blue LED"; + }; + }; + + vbatt: vbatt { + compatible = "zmk,battery-nrf-vddh"; + }; + +}; +&adc { + status = "okay"; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&usbd { + status = "okay"; + cdc_acm_uart: cdc_acm_uart { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + sd_partition: partition@0 { + label = "softdevice"; + reg = <0x00000000 0x00026000>; + }; + code_partition: partition@26000 { + label = "code_partition"; + reg = <0x00026000 0x000c6000>; + }; + + /* + * The flash starting at 0x000ec000 and ending at + * 0x000f3fff is reserved for use by the application. + */ + + /* + * Storage partition will be used by FCB/LittleFS/NVS + * if enabled. + */ + storage_partition: partition@ec000 { + label = "storage"; + reg = <0x000ec000 0x00008000>; + }; + + boot_partition: partition@f4000 { + label = "adafruit_boot"; + reg = <0x000f4000 0x0000c000>; + }; + }; +}; diff --git a/app/boards/arm/bluehand/bluehand.keymap b/app/boards/arm/bluehand/bluehand.keymap new file mode 100644 index 00000000..006ab073 --- /dev/null +++ b/app/boards/arm/bluehand/bluehand.keymap @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + // ------------------- + // | ALT+V | F13 | F14 | ALT+A | + // | MO(1) | F15 | F16 | F17 | + // ---------------------- + bindings = < + &kp LA(V) &kp F13 &kp F14 &kp LA(A) + &mo 1 &kp F15 &kp F16 &kp F17 + >; + }; + + nav_layer { + // ----------------------- + // | F18 | F19 | F20 | F21 | + // | - | MO(2) | BT_SEL 0 | BT_SEL 1| + // ----------------------- + bindings = < + &kp F18 &kp F19 &kp F20 &kp F21 + &trans &mo 2 &bt BT_SEL 0 &bt BT_SEL 1 + >; + }; + + other_layer { + // ----------------------- + // | - | - | - | BT_CLR SEL | + // | - | - | - | - | + // ----------------------- + bindings = < + &trans &trans &trans &bt BT_CLR + &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/arm/bluehand/bluehand.yaml b/app/boards/arm/bluehand/bluehand.yaml new file mode 100644 index 00000000..6bec642e --- /dev/null +++ b/app/boards/arm/bluehand/bluehand.yaml @@ -0,0 +1,15 @@ +identifier: bluehand +name: BlueHand +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog diff --git a/app/boards/arm/bluehand/bluehand.yml b/app/boards/arm/bluehand/bluehand.yml new file mode 100644 index 00000000..2a5f1528 --- /dev/null +++ b/app/boards/arm/bluehand/bluehand.yml @@ -0,0 +1,11 @@ +file_format: "1" +id: bluehand +name: BlueHand +type: board +arch: arm +outputs: + - usb + - ble +url: https://nrf52.jpconstantineau.com/docs/macropad/bluehand/ +features: + - keys diff --git a/app/boards/arm/bluehand/bluehand_defconfig b/app/boards/arm/bluehand/bluehand_defconfig new file mode 100644 index 00000000..6698587f --- /dev/null +++ b/app/boards/arm/bluehand/bluehand_defconfig @@ -0,0 +1,22 @@ +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_BLUEHAND=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# enable GPIO +CONFIG_GPIO=y + +CONFIG_USE_DT_CODE_PARTITION=y +CONFIG_BUILD_OUTPUT_UF2=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 diff --git a/app/boards/arm/bluehand/board.cmake b/app/boards/arm/bluehand/board.cmake new file mode 100644 index 00000000..56dbae32 --- /dev/null +++ b/app/boards/arm/bluehand/board.cmake @@ -0,0 +1,6 @@ +# Copyright (c) 2024 The ZMK Contributors +# 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)