Compare commits

3 Commits

Author SHA1 Message Date
Martin Pander
bb1f0ebdfe Auto-change layers with bluetooth source 2026-02-28 20:29:20 +01:00
Martin Pander
d59d8930bb Add windows layer 2026-02-28 07:48:13 +01:00
Martin Pander
264f0ec8bd Add biantin keyboard 2026-02-27 22:59:31 +01:00
23 changed files with 1196 additions and 0 deletions

2
biantin/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.DS_Store
result

8
biantin/README.md Normal file
View File

@@ -0,0 +1,8 @@
# Create firmware
```
nix build ".#firmware"
````
# Configure
[keymap-editor](https://nickcoutsos.github.io/keymap-editor/)
```

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -0,0 +1,120 @@
#include <physical_layouts.dtsi>
/ {
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>
;
};
};

View File

@@ -0,0 +1,158 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/zmk/matrix_transform.h>
#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 = <NRF_PSEL(SPIM_SCK, 0, 17)>,
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 17)>,
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
low-power-enable;
};
};
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
<NRF_PSEL(TWIM_SCL, 0, 12)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
<NRF_PSEL(TWIM_SCL, 0, 12)>;
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>;
};
};
};

View File

@@ -0,0 +1,127 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
/ {
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
>;
};
};
};

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "piantor_pro_bt.dtsi"
#include <dt-bindings/led/led.h>
/ {
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 = <NRF_PSEL(SPIM_MOSI, 0, 26)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 26)>;
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 = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};

View File

@@ -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

View File

@@ -0,0 +1,93 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "piantor_pro_bt.dtsi"
#include <dt-bindings/led/led.h>
/ {
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 = <NRF_PSEL(SPIM_MOSI, 0, 26)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 26)>;
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 = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};

View File

@@ -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

24
biantin/build.yaml Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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": []
}

View File

@@ -0,0 +1,162 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/pointing.h>
&lt { tapping-term-ms = <150>; };
&msc { time-to-max-speed-ms = <400>; };
/ {
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 = "balanced";
};
backdel: backdel {
compatible = "zmk,behavior-mod-morph";
label = "BACKDEL";
bindings = <&kp BACKSPACE>, <&kp DELETE>;
#binding-cells = <0>;
mods = <(MOD_LSFT)>;
};
lt_caps: lt_caps {
compatible = "zmk,behavior-hold-tap";
label = "LT_CAPS";
bindings = <&mo>, <&caps_word>;
#binding-cells = <2>;
tapping-term-ms = <150>;
flavor = "tap-preferred";
};
};
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>;
};
};
macros {
bt_home: bt_mac {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&bt BT_SEL 0 &to 0>;
label = "BT_MAC";
};
bt_work: bt_work {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&bt BT_SEL 1 &to 1>;
label = "BT_WORK";
};
};
keymap {
compatible = "zmk,keymap";
mac {
display-name = "mac";
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 &lt 6 ESCAPE &lt 4 SPACE &lt_caps 7 0 &lt 3 ESCAPE &lt 2 ENTER &lt 5 CAPS
>;
};
win {
display-name = "win";
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_GUI A &hrm LEFT_ALT S &hrm LEFT_CONTROL D &hrm LEFT_SHIFT F &kp G &kp H &hrm RIGHT_SHIFT J &hrm RIGHT_CONTROL K &hrm LEFT_ALT L &hrm RIGHT_GUI 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 &lt 6 ESCAPE &lt 4 SPACE &lt_caps 8 0 &lt 3 ESCAPE &lt 2 ENTER &lt 5 CAPS
>;
};
numbers {
display-name = "numbers";
bindings = <
&kp LEFT_BRACE &kp RIGHT_BRACE &kp N7 &kp N8 &kp N9 &kp FSLH &none &none &none &none &none &trans &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp N4 &kp N5 &kp N6 &kp MINUS &none &trans &trans &trans &trans &none &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp N1 &kp N2 &kp N3 &kp EQUAL &none &none &none &none &none &none &kp COMMA &kp N0 &kp DOT &none &none &none
>;
};
symbols {
display-name = "symbols";
bindings = <
&none &none &kp SQT &kp SEMICOLON &kp LEFT_BRACKET &kp MINUS &none &none &none &none &none &none &none &none &none &kp GRAVE &kp NON_US_BACKSLASH &none &none &trans &trans &trans &trans &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none
>;
};
nav {
display-name = "nav";
bindings = <
&none &none &none &none &none &none &kp HOME &kp PAGE_DOWN &kp PAGE_UP &kp END &none &none &none &trans &trans &trans &trans &none &kp LEFT &kp DOWN &kp UP &kp RIGHT &none &none &none &none &none &none &none &none &mkp MB4 &none &none &mkp MB5 &none &none &none &none &none &none &none &none
>;
};
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 &trans &trans &trans &trans &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 &to 0 &to 1 &none &none &none &kp C_BRIGHTNESS_DEC &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_home &bt_work &bt BT_SEL 2 &none &none &kp C_MUTE &none &none &none &none &none &none &none &kp C_STOP &kp C_PLAY &none
>;
};
mouse_mac {
display-name = "mouse";
bindings = <
&none &none &none &none &none &none &msc SCRL_RIGHT &msc SCRL_UP &msc SCRL_DOWN &msc SCRL_LEFT &none &none &none &trans &trans &trans &trans &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
>;
};
mouse_win {
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 &trans &trans &trans &trans &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
>;
};
lextra1 { status = "reserved"; };
lextra2 { status = "reserved"; };
};
};

48
biantin/config/west.yml Normal file
View File

@@ -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

48
biantin/flake.lock generated Normal file
View File

@@ -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
}

51
biantin/flake.nix Normal file
View File

@@ -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;
});
};
}

View File

@@ -0,0 +1,3 @@
build:
settings:
board_root: .