From 264f0ec8bd7202edbe6f620e08486b553208779e Mon Sep 17 00:00:00 2001 From: Martin Pander Date: Fri, 27 Feb 2026 22:59:31 +0100 Subject: [PATCH] Add biantin keyboard --- biantin/.gitignore | 2 + biantin/README.md | 4 + biantin/boards/arm/piantor_pro_bt/Kconfig | 7 + .../boards/arm/piantor_pro_bt/Kconfig.board | 10 ++ .../arm/piantor_pro_bt/Kconfig.defconfig | 41 +++++ biantin/boards/arm/piantor_pro_bt/board.cmake | 7 + .../piantor_pro_bt-layouts.dtsi | 120 +++++++++++++ .../arm/piantor_pro_bt/piantor_pro_bt.dtsi | 158 ++++++++++++++++++ .../arm/piantor_pro_bt/piantor_pro_bt.keymap | 127 ++++++++++++++ .../arm/piantor_pro_bt/piantor_pro_bt.yaml | 15 ++ .../arm/piantor_pro_bt/piantor_pro_bt.zmk.yml | 16 ++ .../piantor_pro_bt/piantor_pro_bt_left.dts | 85 ++++++++++ .../piantor_pro_bt_left_defconfig | 48 ++++++ .../piantor_pro_bt/piantor_pro_bt_right.dts | 93 +++++++++++ .../piantor_pro_bt_right_defconfig | 45 +++++ biantin/build.yaml | 24 +++ biantin/config/piantor_pro_bt.conf | 20 +++ biantin/config/piantor_pro_bt.json | 58 +++++++ biantin/config/piantor_pro_bt.keymap | 114 +++++++++++++ biantin/config/west.yml | 48 ++++++ biantin/flake.lock | 48 ++++++ biantin/flake.nix | 51 ++++++ biantin/zephyr/module.yml | 3 + 23 files changed, 1144 insertions(+) create mode 100644 biantin/.gitignore create mode 100644 biantin/README.md create mode 100644 biantin/boards/arm/piantor_pro_bt/Kconfig create mode 100644 biantin/boards/arm/piantor_pro_bt/Kconfig.board create mode 100644 biantin/boards/arm/piantor_pro_bt/Kconfig.defconfig create mode 100644 biantin/boards/arm/piantor_pro_bt/board.cmake create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt-layouts.dtsi create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.dtsi create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.keymap create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.yaml create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.zmk.yml create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left.dts create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left_defconfig create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right.dts create mode 100644 biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right_defconfig create mode 100644 biantin/build.yaml create mode 100644 biantin/config/piantor_pro_bt.conf create mode 100644 biantin/config/piantor_pro_bt.json create mode 100644 biantin/config/piantor_pro_bt.keymap create mode 100644 biantin/config/west.yml create mode 100644 biantin/flake.lock create mode 100644 biantin/flake.nix create mode 100644 biantin/zephyr/module.yml diff --git a/biantin/.gitignore b/biantin/.gitignore new file mode 100644 index 0000000..d5fec98 --- /dev/null +++ b/biantin/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +result diff --git a/biantin/README.md b/biantin/README.md new file mode 100644 index 0000000..c775e97 --- /dev/null +++ b/biantin/README.md @@ -0,0 +1,4 @@ +# Create firmware +``` +nix build ".#firmware" +``` diff --git a/biantin/boards/arm/piantor_pro_bt/Kconfig b/biantin/boards/arm/piantor_pro_bt/Kconfig new file mode 100644 index 0000000..3294725 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/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_PIANTOR_PRO_BT_LEFT || BOARD_PIANTOR_PRO_BT_RIGHT) diff --git a/biantin/boards/arm/piantor_pro_bt/Kconfig.board b/biantin/boards/arm/piantor_pro_bt/Kconfig.board new file mode 100644 index 0000000..adf8af7 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/Kconfig.board @@ -0,0 +1,10 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config BOARD_PIANTOR_PRO_BT_LEFT + bool "Piantor Pro BT Left" + depends on SOC_NRF52840_QIAA + +config BOARD_PIANTOR_PRO_BT_RIGHT + bool "Piantor Pro BT Right" + depends on SOC_NRF52840_QIAA diff --git a/biantin/boards/arm/piantor_pro_bt/Kconfig.defconfig b/biantin/boards/arm/piantor_pro_bt/Kconfig.defconfig new file mode 100644 index 0000000..9c61d6f --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/Kconfig.defconfig @@ -0,0 +1,41 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if BOARD_PIANTOR_PRO_BT_LEFT + +config ZMK_KEYBOARD_NAME + default "Piantor Pro BT" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif # BOARD_PIANTOR_PRO_BT_LEFT + +if BOARD_PIANTOR_PRO_BT_LEFT || BOARD_PIANTOR_PRO_BT_RIGHT + +config BOARD + default "piantor_pro_bt" + +config ZMK_SPLIT + default y + +if USB + +config USB_NRFX + default y + +config USB_DEVICE_STACK + default y + +endif # USB + +config BT_CTLR + default BT + +config I2C + default y + +config ZMK_MAX17048 + default y + +endif # BOARD_PIANTOR_PRO_BT_LEFT || BOARD_PIANTOR_PRO_BT_RIGHT diff --git a/biantin/boards/arm/piantor_pro_bt/board.cmake b/biantin/boards/arm/piantor_pro_bt/board.cmake new file mode 100644 index 0000000..c50b2d9 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/board.cmake @@ -0,0 +1,7 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + +set(OPENOCD_NRF5_SUBFAMILY nrf52) +board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt-layouts.dtsi b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt-layouts.dtsi new file mode 100644 index 0000000..378d464 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt-layouts.dtsi @@ -0,0 +1,120 @@ +#include + +/ { + piantor_position_map { + compatible = "zmk,physical-layout-position-map"; + complete; + + default_map: six_col { + physical-layout = <&default_layout>; + positions + = < 0 1 2 3 4 5 6 7 8 9 10 11> + , <12 13 14 15 16 17 18 19 20 21 22 23> + , <24 25 26 27 28 29 30 31 32 33 34 35> + , < 36 37 38 39 40 41 >; + }; + + five_col_map: five_col { + physical-layout = <&five_col_layout>; + positions + = <41 0 1 2 3 4 5 6 7 8 9 40> + , <39 10 11 12 13 14 15 16 17 18 19 38> + , <37 20 21 22 23 24 25 26 27 28 29 36> + , < 30 31 32 33 34 35 >; + }; + }; +}; + +/ { + default_layout: default_layout { + compatible = "zmk,physical-layout"; + display-name = "Default Layout"; + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 100 0 0 0> + , <&key_physical_attrs 100 100 100 100 0 0 0> + , <&key_physical_attrs 100 100 200 25 0 0 0> + , <&key_physical_attrs 100 100 300 0 0 0 0> + , <&key_physical_attrs 100 100 400 25 0 0 0> + , <&key_physical_attrs 100 100 500 35 0 0 0> + , <&key_physical_attrs 100 100 950 35 0 0 0> + , <&key_physical_attrs 100 100 1050 25 0 0 0> + , <&key_physical_attrs 100 100 1150 0 0 0 0> + , <&key_physical_attrs 100 100 1250 25 0 0 0> + , <&key_physical_attrs 100 100 1350 100 0 0 0> + , <&key_physical_attrs 100 100 1450 100 0 0 0> + , <&key_physical_attrs 100 100 0 200 0 0 0> + , <&key_physical_attrs 100 100 100 200 0 0 0> + , <&key_physical_attrs 100 100 200 125 0 0 0> + , <&key_physical_attrs 100 100 300 100 0 0 0> + , <&key_physical_attrs 100 100 400 125 0 0 0> + , <&key_physical_attrs 100 100 500 135 0 0 0> + , <&key_physical_attrs 100 100 950 135 0 0 0> + , <&key_physical_attrs 100 100 1050 125 0 0 0> + , <&key_physical_attrs 100 100 1150 100 0 0 0> + , <&key_physical_attrs 100 100 1250 125 0 0 0> + , <&key_physical_attrs 100 100 1350 200 0 0 0> + , <&key_physical_attrs 100 100 1450 200 0 0 0> + , <&key_physical_attrs 100 100 0 300 0 0 0> + , <&key_physical_attrs 100 100 100 300 0 0 0> + , <&key_physical_attrs 100 100 200 225 0 0 0> + , <&key_physical_attrs 100 100 300 200 0 0 0> + , <&key_physical_attrs 100 100 400 225 0 0 0> + , <&key_physical_attrs 100 100 500 235 0 0 0> + , <&key_physical_attrs 100 100 950 235 0 0 0> + , <&key_physical_attrs 100 100 1050 225 0 0 0> + , <&key_physical_attrs 100 100 1150 200 0 0 0> + , <&key_physical_attrs 100 100 1250 225 0 0 0> + , <&key_physical_attrs 100 100 1350 300 0 0 0> + , <&key_physical_attrs 100 100 1450 300 0 0 0> + , <&key_physical_attrs 100 100 380 360 (-500) 360 350> + , <&key_physical_attrs 100 100 510 350 500 500 350> + , <&key_physical_attrs 100 100 645 370 1500 650 350> + , <&key_physical_attrs 100 100 810 389 (-1500) 825 350> + , <&key_physical_attrs 100 100 945 360 (-500) 950 350> + , <&key_physical_attrs 100 100 1075 350 500 1075 350> + ; + }; + + five_col_layout: five_col_layout { + compatible = "zmk,physical-layout"; + display-name = "5-Col Layout"; + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 100 0 0 0> + , <&key_physical_attrs 100 100 100 25 0 0 0> + , <&key_physical_attrs 100 100 200 0 0 0 0> + , <&key_physical_attrs 100 100 300 25 0 0 0> + , <&key_physical_attrs 100 100 400 35 0 0 0> + , <&key_physical_attrs 100 100 850 35 0 0 0> + , <&key_physical_attrs 100 100 950 25 0 0 0> + , <&key_physical_attrs 100 100 1050 0 0 0 0> + , <&key_physical_attrs 100 100 1150 25 0 0 0> + , <&key_physical_attrs 100 100 1250 100 0 0 0> + , <&key_physical_attrs 100 100 0 200 0 0 0> + , <&key_physical_attrs 100 100 100 125 0 0 0> + , <&key_physical_attrs 100 100 200 100 0 0 0> + , <&key_physical_attrs 100 100 300 125 0 0 0> + , <&key_physical_attrs 100 100 400 135 0 0 0> + , <&key_physical_attrs 100 100 850 135 0 0 0> + , <&key_physical_attrs 100 100 950 125 0 0 0> + , <&key_physical_attrs 100 100 1050 100 0 0 0> + , <&key_physical_attrs 100 100 1150 125 0 0 0> + , <&key_physical_attrs 100 100 1250 200 0 0 0> + , <&key_physical_attrs 100 100 0 300 0 0 0> + , <&key_physical_attrs 100 100 100 225 0 0 0> + , <&key_physical_attrs 100 100 200 200 0 0 0> + , <&key_physical_attrs 100 100 300 225 0 0 0> + , <&key_physical_attrs 100 100 400 235 0 0 0> + , <&key_physical_attrs 100 100 850 235 0 0 0> + , <&key_physical_attrs 100 100 950 225 0 0 0> + , <&key_physical_attrs 100 100 1050 200 0 0 0> + , <&key_physical_attrs 100 100 1150 225 0 0 0> + , <&key_physical_attrs 100 100 1250 300 0 0 0> + , <&key_physical_attrs 100 100 280 360 (-500) 260 350> + , <&key_physical_attrs 100 100 410 350 500 400 350> + , <&key_physical_attrs 100 100 545 370 1500 550 350> + , <&key_physical_attrs 100 100 710 389 (-1500) 725 350> + , <&key_physical_attrs 100 100 845 360 (-500) 850 350> + , <&key_physical_attrs 100 100 975 350 500 975 350> + ; + }; +}; diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.dtsi b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.dtsi new file mode 100644 index 0000000..3f40914 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.dtsi @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2020 The ZMK Contributors +* +* SPDX-License-Identifier: MIT +*/ + +/dts-v1/; +#include +#include + +#include "piantor_pro_bt-layouts.dtsi" + +&default_layout { + transform = <&default_transform>; +}; + +&five_col_layout { + transform = <&five_col_transform>; +}; + +/ { + chosen { + zephyr,code-partition = &code_partition; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zmk,kscan = &kscan0; + zmk,battery = &fuelgauge; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <42>; + rows = <1>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,21) RC(0,22) RC(0,23) RC(0,24) RC(0,25) RC(0,26) + RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,27) RC(0,28) RC(0,29) RC(0,30) RC(0,31) RC(0,32) + RC(0,12) RC(0,13) RC(0,14) RC(0,15) RC(0,16) RC(0,17) RC(0,33) RC(0,34) RC(0,35) RC(0,36) RC(0,37) RC(0,38) + RC(0,18) RC(0,19) RC(0,20) RC(0,39) RC(0,40) RC(0,41) + >; + }; + + five_col_transform: keymap_transform_1 { + compatible = "zmk,matrix-transform"; + columns = <36>; + rows = <1>; + map = < + RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,21) RC(0,22) RC(0,23) RC(0,24) RC(0,25) + RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,27) RC(0,28) RC(0,29) RC(0,30) RC(0,31) + RC(0,13) RC(0,14) RC(0,15) RC(0,16) RC(0,17) RC(0,33) RC(0,34) RC(0,35) RC(0,36) RC(0,37) + RC(0,18) RC(0,19) RC(0,20) RC(0,39) RC(0,40) RC(0,41) + >; + }; + + // Node name must match original "EXT_POWER" label to preserve user settings. + EXT_POWER { + compatible = "zmk,ext-power-generic"; + control-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + init-delay-ms = <50>; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +zephyr_udc0: &usbd { + status = "okay"; +}; + + +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + i2c1_default: i2c1_default { + group1 { + psels = , + ; + }; + }; + + i2c1_sleep: i2c1_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +nice_view_spi: &spi0 { + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; +}; + +&i2c1 { + status = "okay"; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c1_default>; + pinctrl-1 = <&i2c1_sleep>; + pinctrl-names = "default", "sleep"; + clock-frequency = <100000>; + + fuelgauge: max17048@36 { + compatible = "zmk,maxim-max17048"; + reg = <0x36>; + }; +}; + +&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>; + }; + storage_partition: partition@ec000 { + label = "storage"; + reg = <0x000ec000 0x00008000>; + }; + boot_partition: partition@f4000 { + label = "adafruit_boot"; + reg = <0x000f4000 0x0000c000>; + }; + }; +}; diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.keymap b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.keymap new file mode 100644 index 0000000..3dc8555 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.keymap @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + +/ { + chosen { + zmk,physical-layout = &default_layout; + }; +}; + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + display-name = "QWERTY"; + // -------------------------------------------------------------------------------- + // | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPC | + // | CTRL | A | S | D | F | G | H | J | K | L | ; | ' | + // | SHFT | Z | X | C | V | B | N | M | , | . | / | ESC | + // | GUI | LWR | SPC | ENT | RSE | ALT | + bindings = < + &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &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 LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC + &kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp RALT + >; + }; + + lower_layer { + display-name = "NUMBER"; + // ----------------------------------------------------------------------------------------- + // | TAB | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BSPC | + // | CTRL | BT1 | BT2 | BT3 | BT4 | BT5 | LFT | DWN | UP | RGT | | | + // | SHFT | BTCR| RGB | RST | BOOT| Unlock| | | | | | | + // | GUI | | SPC | ENT | | ALT | + bindings = < + &kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC + &kp LCTRL &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans + &kp LSHFT &bt BT_CLR &rgb_ug RGB_TOG &sys_reset &bootloader &studio_unlock &trans &trans &trans &trans &trans &trans + &kp LGUI &trans &kp SPACE &kp LGUI &trans &kp SPACE + >; + }; + + raise_layer { + display-name = "SYMBOL"; + // ----------------------------------------------------------------------------------------- + // | TAB | ! | @ | # | $ | % | ^ | & | * | ( | ) | BSPC | + // | CTRL | | | | | | - | = | [ | ] | \ | ` | + // | SHFT | | | | | | _ | + | { | } | "|" | ~ | + // | GUI | | SPC | ENT | | ALT | + bindings = < + &kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC + &kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE + &kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE + &kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT + >; + }; + + extra_layer_1 { + display-name = "EXTRA 1"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + + extra_layer_2 { + display-name = "EXTRA 2"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + + extra_layer_3 { + display-name = "EXTRA 3"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + + extra_layer_4 { + display-name = "EXTRA 4"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + + extra_layer_5 { + display-name = "EXTRA 5"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + + extra_layer_6 { + display-name = "EXTRA 6"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.yaml b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.yaml new file mode 100644 index 0000000..ad59cf6 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.yaml @@ -0,0 +1,15 @@ +identifier: piantor_pro_bt +name: Piantor Pro BT +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.zmk.yml b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.zmk.yml new file mode 100644 index 0000000..573ea61 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt.zmk.yml @@ -0,0 +1,16 @@ +file_format: "1" +id: piantor_pro_bt +name: Piantor Pro BT +type: board +arch: arm +features: + - keys + - underglow + - studio +outputs: + - usb + - ble +url: https://keebart.com/products/piantor-wireless +siblings: + - piantor_pro_bt_left + - piantor_pro_bt_right diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left.dts b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left.dts new file mode 100644 index 0000000..c2964ed --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left.dts @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2020 The ZMK Contributors +* +* SPDX-License-Identifier: MIT +*/ + +#include "piantor_pro_bt.dtsi" +#include + +/ { + model = "piantor_pro_bt_left"; + compatible = "piantor_pro_bt_left"; + + chosen { + zmk,underglow = &led_strip; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-direct"; + wakeup-source; + input-gpios + = <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 31 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 30 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; +}; + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <21>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + color-mapping = ; + }; +}; diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left_defconfig b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left_defconfig new file mode 100644 index 0000000..f52cefb --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_left_defconfig @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_PIANTOR_PRO_BT_LEFT=y + +# Enable deep sleep +CONFIG_ZMK_SLEEP=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 + +CONFIG_ZMK_USB=y +CONFIG_ZMK_BLE=y + +# Enable I2C +CONFIG_I2C=y +CONFIG_I2C_NRFX=y +CONFIG_PINCTRL=y + +# Enable RGB underglow +CONFIG_WS2812_STRIP=y +CONFIG_ZMK_RGB_UNDERGLOW=y +CONFIG_ZMK_RGB_UNDERGLOW_BRT_MAX=20 +CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=200 +CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=98 + +# Windows Battery Reporting Fix +CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n + +# Enable ZMK Studio (alpha) +CONFIG_ZMK_STUDIO=y + +# Improved connection stability +CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right.dts b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right.dts new file mode 100644 index 0000000..3aa50db --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right.dts @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2020 The ZMK Contributors +* +* SPDX-License-Identifier: MIT +*/ + +#include "piantor_pro_bt.dtsi" +#include + +/ { + model = "piantor_pro_bt_right"; + compatible = "piantor_pro_bt_right"; + + chosen { + zmk,underglow = &led_strip; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-direct"; + wakeup-source; + input-gpios + = <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 31 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 30 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 9 (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)> + , <&gpio0 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio1 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&gpio0 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; +}; + +&default_transform { + col-offset = <21>; +}; + +&five_col_transform { + col-offset = <21>; +}; + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <21>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + color-mapping = ; + }; +}; diff --git a/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right_defconfig b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right_defconfig new file mode 100644 index 0000000..7ac4fd7 --- /dev/null +++ b/biantin/boards/arm/piantor_pro_bt/piantor_pro_bt_right_defconfig @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_PIANTOR_PRO_BT_RIGHT=y + +# Enable deep sleep +CONFIG_ZMK_SLEEP=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 + +CONFIG_ZMK_USB=y +CONFIG_ZMK_BLE=y + +# Enable I2C +CONFIG_I2C=y +CONFIG_I2C_NRFX=y +CONFIG_PINCTRL=y + +# Enable RGB underglow +CONFIG_WS2812_STRIP=y +CONFIG_ZMK_RGB_UNDERGLOW=y +CONFIG_ZMK_RGB_UNDERGLOW_BRT_MAX=20 +CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=200 +CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=98 + +# Windows Battery Reporting Fix +CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n + +# Improved connection stability +CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y diff --git a/biantin/build.yaml b/biantin/build.yaml new file mode 100644 index 0000000..359e716 --- /dev/null +++ b/biantin/build.yaml @@ -0,0 +1,24 @@ +# This file generates the GitHub Actions matrix. +# For simple board + shield combinations, add them to the top level board and +# shield arrays, for more control, add individual board + shield combinations +# to the `include` property. You can also use the `cmake-args` property to +# pass flags to the build command, `snippet` to add a Zephyr snippet, and +# `artifact-name` to assign a name to distinguish build outputs from each other: +# +--- +include: + - board: piantor_pro_bt_left + snippet: studio-rpc-usb-uart + shield: nice_view + cmake-args: -DCONFIG_ZMK_STUDIO=y + - board: piantor_pro_bt_right + shield: nice_view + snippet: studio-rpc-usb-uart + + - board: piantor_pro_bt_left + shield: settings_reset + snippet: studio-rpc-usb-uart + - board: piantor_pro_bt_right + shield: settings_reset + snippet: studio-rpc-usb-uart + diff --git a/biantin/config/piantor_pro_bt.conf b/biantin/config/piantor_pro_bt.conf new file mode 100644 index 0000000..5c62b01 --- /dev/null +++ b/biantin/config/piantor_pro_bt.conf @@ -0,0 +1,20 @@ +# Enable mouse emulation. +CONFIG_ZMK_POINTING=y +CONFIG_ZMK_POINTING_SMOOTH_SCROLLING=y + +# Change idle settings +CONFIG_ZMK_IDLE_TIMEOUT=30000 + +# Deep sleep settings +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 + +# Custom keyboard name (max. 16 characters) +CONFIG_ZMK_KEYBOARD_NAME="biantin" + +CONFIG_ZMK_BATTERY_REPORTING=y +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y + +CONFIG_ZMK_RGB_UNDERGLOW=n +CONFIG_ZMK_BACKLIGHT=n diff --git a/biantin/config/piantor_pro_bt.json b/biantin/config/piantor_pro_bt.json new file mode 100644 index 0000000..131e58d --- /dev/null +++ b/biantin/config/piantor_pro_bt.json @@ -0,0 +1,58 @@ +{ + "id": "piantor_pro_bt", + "name": "Piantor Pro BT", + "layouts": { + "default_layout": { + "name": "default_layout", + "layout": [ + { "row": 0, "col": 0, "x": 0.0, "y": 1.0 }, + { "row": 0, "col": 1, "x": 1.0, "y": 1.0 }, + { "row": 0, "col": 2, "x": 2.0, "y": 0.25 }, + { "row": 0, "col": 3, "x": 3.0, "y": 0.0 }, + { "row": 0, "col": 4, "x": 4.0, "y": 0.25 }, + { "row": 0, "col": 5, "x": 5.0, "y": 0.35 }, + { "row": 0, "col": 6, "x": 9.5, "y": 0.35 }, + { "row": 0, "col": 7, "x": 10.5, "y": 0.25 }, + { "row": 0, "col": 8, "x": 11.5, "y": 0.0 }, + { "row": 0, "col": 9, "x": 12.5, "y": 0.25 }, + { "row": 0, "col": 10, "x": 13.5, "y": 1.0 }, + { "row": 0, "col": 11, "x": 14.5, "y": 1.0 }, + + { "row": 0, "col": 12, "x": 0.0, "y": 2.0 }, + { "row": 0, "col": 13, "x": 1.0, "y": 2.0 }, + { "row": 0, "col": 14, "x": 2.0, "y": 1.25 }, + { "row": 0, "col": 15, "x": 3.0, "y": 1.0 }, + { "row": 0, "col": 16, "x": 4.0, "y": 1.25 }, + { "row": 0, "col": 17, "x": 5.0, "y": 1.35 }, + { "row": 0, "col": 18, "x": 9.5, "y": 1.35 }, + { "row": 0, "col": 19, "x": 10.5, "y": 1.25 }, + { "row": 0, "col": 20, "x": 11.5, "y": 1.0 }, + { "row": 0, "col": 21, "x": 12.5, "y": 1.25 }, + { "row": 0, "col": 22, "x": 13.5, "y": 2.0 }, + { "row": 0, "col": 23, "x": 14.5, "y": 2.0 }, + + { "row": 0, "col": 24, "x": 0.0, "y": 3.0 }, + { "row": 0, "col": 25, "x": 1.0, "y": 3.0 }, + { "row": 0, "col": 26, "x": 2.0, "y": 2.25 }, + { "row": 0, "col": 27, "x": 3.0, "y": 2.0 }, + { "row": 0, "col": 28, "x": 4.0, "y": 2.25 }, + { "row": 0, "col": 29, "x": 5.0, "y": 2.35 }, + { "row": 0, "col": 30, "x": 9.5, "y": 2.35 }, + { "row": 0, "col": 31, "x": 10.5, "y": 2.25 }, + { "row": 0, "col": 32, "x": 11.5, "y": 2.0 }, + { "row": 0, "col": 33, "x": 12.5, "y": 2.25 }, + { "row": 0, "col": 34, "x": 13.5, "y": 3.0 }, + { "row": 0, "col": 35, "x": 14.5, "y": 3.0 }, + + { "row": 0, "col": 36, "x": 3.8, "y": 3.6, "r": -5.0, "rx": 3.6, "ry": 3.5 }, + { "row": 0, "col": 37, "x": 5.1, "y": 3.5, "r": 5.0, "rx": 5.0, "ry": 3.5 }, + { "row": 0, "col": 38, "x": 6.45, "y": 3.7, "r": 15.0, "rx": 6.5, "ry": 3.5 }, + + { "row": 0, "col": 39, "x": 8.1, "y": 3.89, "r": -15.0, "rx": 8.25, "ry": 3.5 }, + { "row": 0, "col": 40, "x": 9.45, "y": 3.6, "r": -5.0, "rx": 9.5, "ry": 3.5 }, + { "row": 0, "col": 41, "x": 10.75, "y": 3.5, "r": 5.0, "rx": 10.75, "ry": 3.5 } + ] + } + }, + "sensors": [] +} diff --git a/biantin/config/piantor_pro_bt.keymap b/biantin/config/piantor_pro_bt.keymap new file mode 100644 index 0000000..775237b --- /dev/null +++ b/biantin/config/piantor_pro_bt.keymap @@ -0,0 +1,114 @@ +#include +#include +#include +#include + +/ { + chosen { zmk,physical-layout = &default_layout; }; +}; + +/ { + behaviors { + hrm: hrm { + compatible = "zmk,behavior-hold-tap"; + label = "HRM"; + bindings = <&kp>, <&kp>; + + #binding-cells = <2>; + tapping-term-ms = <150>; + quick-tap-ms = <175>; + flavor = "tap-preferred"; + }; + + backdel: backdel { + compatible = "zmk,behavior-mod-morph"; + label = "BACKDEL"; + bindings = <&kp BACKSPACE>, <&kp DELETE>; + + #binding-cells = <0>; + mods = <(MOD_LSFT)>; + }; + }; + + combos { + compatible = "zmk,combos"; + + left_bootloader { + bindings = <&bootloader>; + key-positions = <0 12 24 38>; + require-prior-idle-ms = <5000>; + }; + + right_bootloader { + bindings = <&bootloader>; + key-positions = <11 23 35 39>; + require-prior-idle-ms = <5000>; + }; + + left_reset { + bindings = <&sys_reset>; + key-positions = <0 12 24 29 17 5>; + require-prior-idle-ms = <5000>; + }; + + right_reset { + bindings = <&sys_reset>; + key-positions = <35 23 11 6 18 30>; + require-prior-idle-ms = <5000>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + base { + display-name = "qwerty"; + bindings = < +&kp ESCAPE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &backdel &kp TAB &hrm LEFT_CONTROL A &hrm LEFT_ALT S &hrm LEFT_GUI D &hrm LEFT_SHIFT F &kp G &kp H &hrm RIGHT_SHIFT J &hrm RIGHT_GUI K &hrm LEFT_ALT L &hrm RCTRL SEMICOLON &kp SQT &kp C_MENU &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp GRAVE < 5 ESCAPE < 3 SPACE < 6 TAB < 2 ESCAPE < 1 ENTER < 4 CAPS + >; + }; + + numbers { + display-name = "numbers"; + bindings = < +&kp LEFT_BRACE &kp RIGHT_BRACE &kp N7 &kp N8 &kp N9 &kp FSLH &trans &trans &trans &trans &trans &kp BACKSPACE &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp N4 &kp N5 &kp N6 &kp MINUS &trans &kp RSHFT &kp RGUI &kp LALT &kp RIGHT_SHIFT &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp N1 &kp N2 &kp N3 &kp EQUAL &trans &trans &trans &trans &trans &trans &kp COMMA &kp N0 &kp DOT &trans &trans &trans + >; + }; + + symbols { + display-name = "symbols"; + bindings = < +&none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &kp GRAVE &kp NON_US_BACKSLASH &none &none &kp RIGHT_SHIFT &kp RIGHT_GUI &kp LEFT_ALT &kp RIGHT_CONTROL &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none + >; + }; + + nav { + display-name = "nav"; + bindings = < +&trans &trans &trans &trans &trans &trans &kp HOME &kp PAGE_DOWN &kp PAGE_UP &kp END &trans &trans &trans &kp LCTRL &kp LALT &kp LGUI &kp LSHFT &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + fkeys { + display-name = "fkeys"; + bindings = < +&kp F18 &kp F15 &kp F7 &kp F8 &kp F9 &kp F12 &none &none &none &none &none &none &kp F17 &kp F14 &kp F4 &kp F5 &kp F6 &kp F11 &none &kp RIGHT_SHIFT &kp RIGHT_GUI &kp LEFT_ALT &kp RIGHT_CONTROL &none &kp F16 &kp F13 &kp F1 &kp F2 &kp F3 &kp F10 &none &none &none &none &none &none &none &none &none &none &none &none + >; + }; + + media { + display-name = "media"; + bindings = < +&bt BT_CLR &none &none &none &none &none &none &kp C_AL_IMAGE_BROWSER &kp C_BRIGHTNESS_INC &none &none &none &none &none &bt BT_SEL 3 &bt BT_SEL 4 &none &none &kp C_PREVIOUS &kp C_VOL_DN &kp C_VOLUME_UP &kp C_NEXT &none &none &studio_unlock &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &none &none &kp C_MUTE &none &none &none &none &none &none &none &kp C_STOP &kp C_PLAY &none + >; + }; + + mouse { + display-name = "mouse"; + bindings = < +&none &none &none &none &none &none &msc SCRL_LEFT &msc SCRL_DOWN &msc SCRL_UP &msc SCRL_RIGHT &none &none &none &none &none &none &none &none &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_UP &mmv MOVE_RIGHT &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &mkp RCLK &mkp LCLK &mkp MCLK + >; + }; + }; +}; + diff --git a/biantin/config/west.yml b/biantin/config/west.yml new file mode 100644 index 0000000..69716a7 --- /dev/null +++ b/biantin/config/west.yml @@ -0,0 +1,48 @@ +manifest: + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + # Additional modules containing boards/shields/custom code can be listed here as well + # See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects + projects: + - name: zmk + remote: zmkfirmware + revision: v0.3 + import: app/west.yml + self: + path: config + +# manifest: +# remotes: +# - name: zmkfirmware +# url-base: https://github.com/zmkfirmware +# projects: +# - name: zmk +# remote: zmkfirmware +# revision: ac7f75b8591d39aaf3b66b9d26f26c9ed921a009 # main +# import: app/west.yml +# - name: zephyr +# remote: zmkfirmware +# revision: ec36516990d40355238db3049bc1709191f99b4e # v4.1.0+zmk-fixes +# import: +# name-blocklist: +# - ci-tools +# - hal_altera +# - hal_cypress +# - hal_infineon +# - hal_microchip +# - hal_nxp +# - hal_openisa +# - hal_silabs +# - hal_xtensa +# - hal_st +# - hal_ti +# - loramac-node +# - mcuboot +# - mcumgr +# - net-tools +# - openthread +# - edtt +# - trusted-firmware-m +# self: +# path: config diff --git a/biantin/flake.lock b/biantin/flake.lock new file mode 100644 index 0000000..d6950cb --- /dev/null +++ b/biantin/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1772082373, + "narHash": "sha256-wySf8a6hvuqgFdwvvzPPTARBCMLDz7WFAufGkllD1M4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "26eaeac4e409d7b5a6bf6f90a2a2dc223c78d915", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "zmk-nix": "zmk-nix" + } + }, + "zmk-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771721465, + "narHash": "sha256-/47/2x3rXdbBLo5Rp1wFDqE+DBTxL9uhKnIGa+onzec=", + "owner": "lilyinstarlight", + "repo": "zmk-nix", + "rev": "c53f8e1775f9c15baa40179a4565126137940b13", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "zmk-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/biantin/flake.nix b/biantin/flake.nix new file mode 100644 index 0000000..7d50530 --- /dev/null +++ b/biantin/flake.nix @@ -0,0 +1,51 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + zmk-nix = { + url = "github:lilyinstarlight/zmk-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, zmk-nix }: let + forAllSystems = nixpkgs.lib.genAttrs (nixpkgs.lib.attrNames zmk-nix.packages); + in { + packages = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in rec { + default = firmware; + + firmware = zmk-nix.legacyPackages.${system}.buildSplitKeyboard { + name = "firmware"; + + src = nixpkgs.lib.sourceFilesBySuffices self [ "Kconfig" ".board" ".cmake" ".conf" ".defconfig" ".dts" ".dtsi" ".json" ".keymap" ".overlay" ".shield" ".yml" "_defconfig" ]; + + board = "piantor_pro_bt_%PART%"; + shield = "nice_view"; + + zephyrSnippets = [ "studio-rpc-usb-uart" ]; + extraCmakeFlags = [ "-DCONFIG_ZMK_STUDIO=y" ]; + + zephyrDepsHash = "sha256-gsqiTDJLAihVyBXVFlgXwqRmlREcFJctKpl4tEWmVlY="; + + meta = { + description = "ZMK firmware"; + license = nixpkgs.lib.licenses.mit; + platforms = nixpkgs.lib.platforms.all; + }; + + nativeBuildInputs = [ + pkgs.python3Packages.setuptools + pkgs.python3Packages.protobuf + pkgs.protobuf + ]; + }; + + flash = zmk-nix.packages.${system}.flash.override { inherit firmware; }; + update = zmk-nix.packages.${system}.update; + }); + + devShells = forAllSystems (system: { + default = zmk-nix.devShells.${system}.default; + }); + }; +} diff --git a/biantin/zephyr/module.yml b/biantin/zephyr/module.yml new file mode 100644 index 0000000..1cc2b35 --- /dev/null +++ b/biantin/zephyr/module.yml @@ -0,0 +1,3 @@ +build: + settings: + board_root: .