From 99c5a8ee6fbda71686130a207e9a7719146be013 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:23:40 +0000 Subject: [PATCH] feat(boards): Add BT60 Boards --- app/boards/arm/bt60/CMakeLists.txt | 8 + app/boards/arm/bt60/Kconfig | 7 + app/boards/arm/bt60/Kconfig.board | 12 ++ app/boards/arm/bt60/Kconfig.defconfig | 34 +++++ app/boards/arm/bt60/board.cmake | 5 + app/boards/arm/bt60/bt60.dtsi | 128 ++++++++++++++++ app/boards/arm/bt60/bt60_v1.dts | 113 ++++++++++++++ app/boards/arm/bt60/bt60_v1.keymap | 180 +++++++++++++++++++++++ app/boards/arm/bt60/bt60_v1.yaml | 15 ++ app/boards/arm/bt60/bt60_v1.zmk.yml | 12 ++ app/boards/arm/bt60/bt60_v1_defconfig | 24 +++ app/boards/arm/bt60/bt60_v1_hs.dts | 61 ++++++++ app/boards/arm/bt60/bt60_v1_hs.keymap | 37 +++++ app/boards/arm/bt60/bt60_v1_hs.yaml | 15 ++ app/boards/arm/bt60/bt60_v1_hs.zmk.yml | 12 ++ app/boards/arm/bt60/bt60_v1_hs_defconfig | 24 +++ 16 files changed, 687 insertions(+) create mode 100644 app/boards/arm/bt60/CMakeLists.txt create mode 100644 app/boards/arm/bt60/Kconfig create mode 100644 app/boards/arm/bt60/Kconfig.board create mode 100644 app/boards/arm/bt60/Kconfig.defconfig create mode 100644 app/boards/arm/bt60/board.cmake create mode 100644 app/boards/arm/bt60/bt60.dtsi create mode 100644 app/boards/arm/bt60/bt60_v1.dts create mode 100644 app/boards/arm/bt60/bt60_v1.keymap create mode 100644 app/boards/arm/bt60/bt60_v1.yaml create mode 100644 app/boards/arm/bt60/bt60_v1.zmk.yml create mode 100644 app/boards/arm/bt60/bt60_v1_defconfig create mode 100644 app/boards/arm/bt60/bt60_v1_hs.dts create mode 100644 app/boards/arm/bt60/bt60_v1_hs.keymap create mode 100644 app/boards/arm/bt60/bt60_v1_hs.yaml create mode 100644 app/boards/arm/bt60/bt60_v1_hs.zmk.yml create mode 100644 app/boards/arm/bt60/bt60_v1_hs_defconfig diff --git a/app/boards/arm/bt60/CMakeLists.txt b/app/boards/arm/bt60/CMakeLists.txt new file mode 100644 index 00000000..00952c30 --- /dev/null +++ b/app/boards/arm/bt60/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/bt60/Kconfig b/app/boards/arm/bt60/Kconfig new file mode 100644 index 00000000..359e237d --- /dev/null +++ b/app/boards/arm/bt60/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_BT60_V1_HS || BOARD_BT60_V1) diff --git a/app/boards/arm/bt60/Kconfig.board b/app/boards/arm/bt60/Kconfig.board new file mode 100644 index 00000000..0f0a9c6e --- /dev/null +++ b/app/boards/arm/bt60/Kconfig.board @@ -0,0 +1,12 @@ +# BT60 board configuration + +# Copyright (c) 2021 Polarity Works +# SPDX-License-Identifier: MIT + +config BOARD_BT60_V1 + bool "bt60" + depends on SOC_NRF52840_QIAA + +config BOARD_BT60_V1_HS + bool "bt60 hotswap" + depends on SOC_NRF52840_QIAA diff --git a/app/boards/arm/bt60/Kconfig.defconfig b/app/boards/arm/bt60/Kconfig.defconfig new file mode 100644 index 00000000..7e7ab124 --- /dev/null +++ b/app/boards/arm/bt60/Kconfig.defconfig @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Polarity Works +# SPDX-License-Identifier: MIT + +if BOARD_BT60_V1_HS || BOARD_BT60_V1 + +config BOARD + default "bt60" + +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 + +config ZMK_BATTERY_VOLTAGE_DIVIDER + default y + +config ZMK_KEYBOARD_NAME + default "BT60" + +endif # BOARD_BT60 diff --git a/app/boards/arm/bt60/board.cmake b/app/boards/arm/bt60/board.cmake new file mode 100644 index 00000000..fa847d50 --- /dev/null +++ b/app/boards/arm/bt60/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/bt60/bt60.dtsi b/app/boards/arm/bt60/bt60.dtsi new file mode 100644 index 00000000..48e4128b --- /dev/null +++ b/app/boards/arm/bt60/bt60.dtsi @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2021 Polarity Works +* +* SPDX-License-Identifier: MIT +*/ + +/dts-v1/; +#include +#include + +/ { + model = "BT60"; + compatible = "bt60"; + + chosen { + zephyr,code-partition = &code_partition; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder>; + }; + + + +left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "okay"; + }; + + + leds { + compatible = "gpio-leds"; + blue_led: led_0 { + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + label = "Blue LED"; + }; + }; + + vbatt { + compatible = "zmk,battery-voltage-divider"; + label = "BATTERY"; + io-channels = <&adc 2>; + output-ohms = <2000000>; + full-ohms = <(2000000 + 806000)>; + }; +}; + +&adc { + status = "okay"; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + compatible = "nordic,nrf-twi"; + sda-pin = <17>; + scl-pin = <20>; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + tx-pin = <6>; + rx-pin = <8>; +}; + +&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>; + + 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/bt60/bt60_v1.dts b/app/boards/arm/bt60/bt60_v1.dts new file mode 100644 index 00000000..83da2c07 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1.dts @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2021 Polarity Works +* +* SPDX-License-Identifier: MIT +*/ + +/dts-v1/; +#include "bt60.dtsi" + + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &ansi_transform; + }; + + ansi_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) + RC(3,0) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,13) + RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,14) + >; + }; + + hhkb_transform: keymap_transform_1 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) + RC(3,0) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) RC(3,14) + RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) + >; + }; + + iso_transform: keymap_transform_2 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13) + RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) + RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) + >; + }; + + all_1u_transform: keymap_transform_3 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) + RC(3,0) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) RC(3,13) RC(3,14) + RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,14) + >; + }; + + split_transform: keymap_transform_4 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) + RC(3,0) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) RC(3,14) + RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13) + >; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + col-gpios + = <&gpio1 13 GPIO_ACTIVE_HIGH> + , <&gpio1 10 GPIO_ACTIVE_HIGH> + , <&gpio1 11 GPIO_ACTIVE_HIGH> + , <&gpio1 15 GPIO_ACTIVE_HIGH> + , <&gpio0 3 GPIO_ACTIVE_HIGH> + , <&gpio0 2 GPIO_ACTIVE_HIGH> + , <&gpio0 28 GPIO_ACTIVE_HIGH> + , <&gpio0 29 GPIO_ACTIVE_HIGH> + , <&gpio0 30 GPIO_ACTIVE_HIGH> + , <&gpio0 31 GPIO_ACTIVE_HIGH> + , <&gpio0 5 GPIO_ACTIVE_HIGH> + , <&gpio0 7 GPIO_ACTIVE_HIGH> + , <&gpio1 9 GPIO_ACTIVE_HIGH> + , <&gpio0 12 GPIO_ACTIVE_HIGH> + , <&gpio0 23 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; diff --git a/app/boards/arm/bt60/bt60_v1.keymap b/app/boards/arm/bt60/bt60_v1.keymap new file mode 100644 index 00000000..0985a605 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1.keymap @@ -0,0 +1,180 @@ +#include +#include +#include + +#define ANSI true +//#define HHKB true +//#define ISO true +//#define ALL_1U true +//#define SPLIT_BKSP_RSHFT true + + + +/ { + chosen { + #ifdef ANSI + zmk,matrix_transform = &ansi_transform; + #elif defined(HHKB) + zmk,matrix_transform = &hhkb_transform; + #elif defined(ISO) + zmk,matrix_transform = &iso_transform; + #elif defined(ALL_1U) + zmk,matrix_transform = &all_1u_transform; + #else + zmk,matrix_transform = &split_transform; + #endif + }; + + + keymap { + compatible = "zmk,keymap"; + #ifdef ANSI + default_layer { + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | | + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | + // | CTL | WIN | ALT | SPACE | ALT | 1 | MENU | CTRL | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH + &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL &bt BT_CLR + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + raise { + // ------------------------------------------------------------------------------------------ + // |GRAVE| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | + // | TAB | Q | UP | E | R | T | Y | U | INS | O |PSCRN|SLCK |PSEBRK| RESET | + // | CAPS |LEFT |DOWN |RIGHT| F | G | H | J | K | L |HOME |PGUP | BOOTLOADER | + // | PREV |VOLUP |VOLDN|MUTE | V | B | N | M | , | END | PGDN | NEXT | + // | CTL | WIN | ALT | SPACE | ALT | 1 | MENU | BT_CLR | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL + &trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset + &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader + &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT + &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR &trans + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + #elif defined(HHKB) + default_layer { + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | BSPC | + // | CTRL | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | 1 | + // | CAPS | ALT | WIN | SPACE | WIN | ALT | CTRL | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSLH &kp GRAVE + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSPC + &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo 1 + &kp LCTRL &kp LALT &kp LGUI &kp SPACE &kp RGUI &kp RALT &kp RCTRL + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + raise { + bindings = < + &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp INS &kp DEL + &kp CLCK &bt BT_PRV &bt BT_NXT &bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &kp UP &trans &reset + &trans &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &kp LEFT &kp RIGHT &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp DOWN &trans &trans + &trans &trans &trans &bootloader &trans &trans &trans + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + #elif defined(ISO) + default_layer { + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | # | ENTER | + // | SHIFT | | | Z | X | C | V | B | N | M | , | . | / | SHIFT | + // | CTL | WIN | ALT | SPACE | ALT | 1 | MENU | CTRL | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT + &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp NON_US_HASH &kp RET + &kp LSHFT &kp NON_US_BSLH &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + raise { + bindings = < + &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL + &reset &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK + &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &trans &bootloader + &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT + &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + #elif defined(ALL_1U) + default_layer { + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" | + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHFT | UP | 1 | + // | CTL | WIN | ALT | SPACE | ALT | CTRL | LEFT | DOWN | RIGHT | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH + &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &mo 1 + &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + raise { + bindings = < + &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp F1 + &trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset + &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader + &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT + &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &trans &bt BT_CLR + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + #else + default_layer { + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BKSP| DEL | + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | 1 | + // | CTL | WIN | ALT | SPACE | ALT | 1 | CTRL | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH + &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo 1 + &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RGUI &kp C_MENU &kp RCTRL + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + raise { + bindings = < + &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL &trans + &trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset + &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader + &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT &trans + &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + #endif + }; +}; diff --git a/app/boards/arm/bt60/bt60_v1.yaml b/app/boards/arm/bt60/bt60_v1.yaml new file mode 100644 index 00000000..41fd7e40 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1.yaml @@ -0,0 +1,15 @@ +identifier: bt60_v1 +name: BT60 V1 Soldered +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog diff --git a/app/boards/arm/bt60/bt60_v1.zmk.yml b/app/boards/arm/bt60/bt60_v1.zmk.yml new file mode 100644 index 00000000..9909f191 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1.zmk.yml @@ -0,0 +1,12 @@ +file_format: "1" +id: bt60_v1 +name: BT60 V1 Soldered +type: board +arch: arm +features: + - keys + - encoder +outputs: + - usb + - ble +url: https://polarityworks.com diff --git a/app/boards/arm/bt60/bt60_v1_defconfig b/app/boards/arm/bt60/bt60_v1_defconfig new file mode 100644 index 00000000..0f13395b --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1_defconfig @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_BT60_V1=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# enable GPIO +CONFIG_GPIO=y + +# encoder +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=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 diff --git a/app/boards/arm/bt60/bt60_v1_hs.dts b/app/boards/arm/bt60/bt60_v1_hs.dts new file mode 100644 index 00000000..0e686fd9 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1_hs.dts @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2021 Polarity Works +* +* SPDX-License-Identifier: MIT +*/ + +/dts-v1/; +#include "bt60.dtsi" + + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(2,13) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) + RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) + RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(4,8) RC(4,9) RC(4,10) RC(4,11) + >; + }; + + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + col-gpios + = <&gpio1 11 GPIO_ACTIVE_HIGH> + , <&gpio1 10 GPIO_ACTIVE_HIGH> + , <&gpio1 13 GPIO_ACTIVE_HIGH> + , <&gpio1 15 GPIO_ACTIVE_HIGH> + , <&gpio0 3 GPIO_ACTIVE_HIGH> + , <&gpio0 2 GPIO_ACTIVE_HIGH> + , <&gpio0 28 GPIO_ACTIVE_HIGH> + , <&gpio0 29 GPIO_ACTIVE_HIGH> + , <&gpio0 30 GPIO_ACTIVE_HIGH> + , <&gpio0 31 GPIO_ACTIVE_HIGH> + , <&gpio0 5 GPIO_ACTIVE_HIGH> + , <&gpio0 7 GPIO_ACTIVE_HIGH> + , <&gpio1 9 GPIO_ACTIVE_HIGH> + , <&gpio0 12 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 23 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; diff --git a/app/boards/arm/bt60/bt60_v1_hs.keymap b/app/boards/arm/bt60/bt60_v1_hs.keymap new file mode 100644 index 00000000..6e62e1bb --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1_hs.keymap @@ -0,0 +1,37 @@ +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | | + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | + // | CTL | WIN | ALT | SPACE | ALT | 1 | MENU | CTRL | + // ------------------------------------------------------------------------------------------ + bindings = < + &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &bt BT_CLR + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH + &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + raise { + bindings = < + &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL &trans + &trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset + &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader + &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT + &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + }; +}; diff --git a/app/boards/arm/bt60/bt60_v1_hs.yaml b/app/boards/arm/bt60/bt60_v1_hs.yaml new file mode 100644 index 00000000..5a73753b --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1_hs.yaml @@ -0,0 +1,15 @@ +identifier: bt60_v1_hs +name: BT60 V1 Hotswap +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog diff --git a/app/boards/arm/bt60/bt60_v1_hs.zmk.yml b/app/boards/arm/bt60/bt60_v1_hs.zmk.yml new file mode 100644 index 00000000..bc9acea4 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1_hs.zmk.yml @@ -0,0 +1,12 @@ +file_format: "1" +id: bt60_v1_hs +name: BT60 V1 Hotswap +type: board +arch: arm +features: + - keys + - encoder +outputs: + - usb + - ble +url: https://polarityworks.com diff --git a/app/boards/arm/bt60/bt60_v1_hs_defconfig b/app/boards/arm/bt60/bt60_v1_hs_defconfig new file mode 100644 index 00000000..27a22490 --- /dev/null +++ b/app/boards/arm/bt60/bt60_v1_hs_defconfig @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_BT60_V1_HS=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# enable GPIO +CONFIG_GPIO=y + +# encoder +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=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