zmk: prepare move to new repository

This commit is contained in:
phiwan-dev 2026-01-11 19:49:45 +01:00
parent dac2bab0c1
commit a86d22bd87
13 changed files with 0 additions and 466 deletions

View file

@ -1,13 +0,0 @@
#! /usr/bin/env bash
rm -rf left.uf2 right.uf2
if [ "$1" == "--cached" ] || [ "$1" == "-c" ]; then
devcontainer exec --workspace-folder ./zmk /bin/bash phiboard-build-cached.sh
else
devcontainer up --workspace-folder ./zmk
devcontainer exec --workspace-folder ./zmk /bin/bash phiboard-build.sh
fi
cp zmk/app/build/left/zephyr/zmk.uf2 left.uf2
cp zmk/app/build/right/zephyr/zmk.uf2 right.uf2

Binary file not shown.

View file

@ -1,52 +0,0 @@
#! /usr/bin/env bash
# clean up any existing containers or volumes
# ignore errors if they do not exist
docker container stop zmk-devcontainer || true
docker container rm zmk-devcontainer || true
docker volume rm zmk-config || true
if [ -d ./zmk ]; then
echo zmk directory already exists, removing it...
sudo rm -rf zmk
fi
git clone https://github.com/zmkfirmware/zmk.git
# add naming the docker container and run it
cp zmk/.devcontainer/devcontainer.json zmk/.devcontainer/devcontainer.json.bak
sed -i 's#"runArgs": \["--security-opt", "label=disable"\],#"runArgs": \["--security-opt", "label=disable", "--name", "zmk-devcontainer"\],#g' zmk/.devcontainer/devcontainer.json
docker volume create --driver local -o o=bind -o type=none -o device="$(pwd)/zmk-config" zmk-config
devcontainer up --workspace-folder ./zmk
devcontainer exec --workspace-folder ./zmk west init -l ./app/
devcontainer exec --workspace-folder ./zmk west update
# create a build scripts for the zmk app
echo "
#! /bin/bash
echo doing a clean build...
(
rm -rf build/
cd app/
echo == building left half ==
west build -p -d build/left -b seeeduino_xiao_ble -- -DSHIELD=phiboard_left -DZMK_CONFIG="/workspaces/zmk-config"
echo == building right half ==
west build -p -d build/right -b seeeduino_xiao_ble -- -DSHIELD=phiboard_right -DZMK_CONFIG="/workspaces/zmk-config"
echo
echo == clean build completed ==
echo future builds can be done with the --cached option
)
" > zmk/phiboard-build.sh
chmod +x zmk/phiboard-build.sh
echo "
#! /bin/bash
echo doing a successive build...
(
cd app/
echo == building left half ==
west build -d build/left
echo == building right half ==
west build -d build/right
)
" > zmk/phiboard-build-cached.sh
chmod +x zmk/phiboard-build-cached.sh

View file

@ -1,48 +0,0 @@
if SHIELD_PHIBOARD_RIGHT
# Name must be less than 16 characters long!
config ZMK_KEYBOARD_NAME
default "phiboard"
config USB_DEVICE_MANUFACTURER
default "phiwan"
config ZMK_SPLIT_ROLE_CENTRAL
default y
endif
# for Debugging purposes, should never advertise itself
if SHIELD_PHIBOARD_LEFT
config ZMK_KEYBOARD_NAME
default "phiboard slave"
endif
if SHIELD_PHIBOARD_LEFT || SHIELD_PHIBOARD_RIGHT
config ZMK_SPLIT
default y
if ZMK_DISPLAY
config I2C
default y
config SSD1306
default y
endif # ZMK_DISPLAY
if LVGL
config LV_Z_VDB_SIZE
default 64
config LV_DPI_DEF
default 148
config LV_Z_BITS_PER_PIXEL
default 1
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
endchoice
endif # LVGL
endif

View file

@ -1,5 +0,0 @@
config SHIELD_PHIBOARD_LEFT
def_bool $(shields_list_contains,phiboard_left)
config SHIELD_PHIBOARD_RIGHT
def_bool $(shields_list_contains,phiboard_right)

View file

@ -1,21 +0,0 @@
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <10>;
rows = <4>;
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(3,0) 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(3,9)
RC(3,1) 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(3,8)
RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)
>;
};
};

View file

@ -1,12 +0,0 @@
file_format: "1"
id: phiboard
name: phiboard
type: shield
url: https://github.com/phiwan-dev/phiboard
requires:
- seeeduino_xiao_ble
features:
- keys
siblings:
- phiboard_left
- phiboard_right

View file

@ -1,54 +0,0 @@
#include "phiboard.dtsi"
/ {
chosen {
zmk,kscan = &kscan0;
zephyr,display = &oled_left;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
wakeup-source;
col-gpios
= <&xiao_d 10 GPIO_ACTIVE_HIGH>
, <&xiao_d 9 GPIO_ACTIVE_HIGH>
, <&xiao_d 8 GPIO_ACTIVE_HIGH>
, <&xiao_d 7 GPIO_ACTIVE_HIGH>
, <&xiao_d 6 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&xiao_d 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
, <&xiao_d 1 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
, <&xiao_d 2 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
, <&xiao_d 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
;
};
};
&xiao_i2c {
status = "okay";
oled_left: ssd1306@3c {
status = "okay";
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
inversion-on;
prechargep = <0x22>;
};
};

View file

@ -1,59 +0,0 @@
#include "phiboard.dtsi"
/ {
chosen {
zmk,kscan = &kscan0;
zephyr,display = &oled_right;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
wakeup-source;
col-gpios
= <&xiao_d 6 GPIO_ACTIVE_HIGH>
, <&xiao_d 7 GPIO_ACTIVE_HIGH>
, <&xiao_d 8 GPIO_ACTIVE_HIGH>
, <&xiao_d 9 GPIO_ACTIVE_HIGH>
, <&xiao_d 10 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&xiao_d 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
, <&xiao_d 1 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
, <&xiao_d 2 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
, <&xiao_d 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
;
};
};
&default_transform {
col-offset = <5>;
};
&xiao_i2c {
status = "okay";
oled_right: ssd1306@3c {
status = "okay";
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
inversion-on;
prechargep = <0x22>;
};
};

View file

@ -1,18 +0,0 @@
# Enable deep sleep and timeouts
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_TIMEOUT=30000
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
# Debounce ?
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=10
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=10
CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_WIDGET_LAYER_STATUS=y
CONFIG_ZMK_WIDGET_BATTERY_STATUS=y
CONFIG_ZMK_WIDGET_OUTPUT_STATUS=y # Shows if USB/BLE is active
#CONFIG_ZMK_DISPLAY_INVERT=n
#CONFIG_ZMK_WIDGET_WPM_STATUS=y
#CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y

View file

@ -1,52 +0,0 @@
{
"id": "phiboard",
"name": "phiboard",
"layouts": {
"default_layout": {
"name": "default_layout",
"layout": [
{ "row": 0, "col": 0, "x": 0, "y": 0 },
{ "row": 0, "col": 1, "x": 1, "y": 0 },
{ "row": 0, "col": 2, "x": 2, "y": 0 },
{ "row": 0, "col": 3, "x": 3, "y": 0 },
{ "row": 0, "col": 4, "x": 4, "y": 0 },
{ "row": 0, "col": 5, "x": 5, "y": 0 },
{ "row": 0, "col": 6, "x": 6, "y": 0 },
{ "row": 0, "col": 7, "x": 7, "y": 0 },
{ "row": 0, "col": 8, "x": 8, "y": 0 },
{ "row": 0, "col": 9, "x": 9, "y": 0 },
{ "row": 1, "col": 0, "x": 0, "y": 1 },
{ "row": 1, "col": 1, "x": 1, "y": 1 },
{ "row": 1, "col": 2, "x": 2, "y": 1 },
{ "row": 1, "col": 3, "x": 3, "y": 1 },
{ "row": 1, "col": 4, "x": 4, "y": 1 },
{ "row": 1, "col": 5, "x": 5, "y": 1 },
{ "row": 1, "col": 6, "x": 6, "y": 1 },
{ "row": 1, "col": 7, "x": 7, "y": 1 },
{ "row": 1, "col": 8, "x": 8, "y": 1 },
{ "row": 1, "col": 9, "x": 9, "y": 1 },
{ "row": 2, "col": 0, "x": 0, "y": 2 },
{ "row": 2, "col": 1, "x": 1, "y": 2 },
{ "row": 2, "col": 2, "x": 2, "y": 2 },
{ "row": 2, "col": 3, "x": 3, "y": 2 },
{ "row": 2, "col": 4, "x": 4, "y": 2 },
{ "row": 2, "col": 5, "x": 5, "y": 2 },
{ "row": 2, "col": 6, "x": 6, "y": 2 },
{ "row": 2, "col": 7, "x": 7, "y": 2 },
{ "row": 2, "col": 8, "x": 8, "y": 2 },
{ "row": 2, "col": 9, "x": 9, "y": 2 },
{ "row": 3, "col": 1, "x": 1, "y": 3 },
{ "row": 3, "col": 2, "x": 2, "y": 3 },
{ "row": 3, "col": 3, "x": 3, "y": 3 },
{ "row": 3, "col": 4, "x": 4, "y": 3 },
{ "row": 3, "col": 5, "x": 5, "y": 3 },
{ "row": 3, "col": 6, "x": 6, "y": 3 },
{ "row": 3, "col": 7, "x": 7, "y": 3 },
{ "row": 3, "col": 8, "x": 8, "y": 3 }
]
}
}
}

View file

@ -1,121 +0,0 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/bt.h>
/ {
keymap {
compatible = "zmk,keymap";
base {
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&kp ESCAPE &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp RBKT &kp BSPC
&kp LSHIFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp PERIOD &kp FSLH &kp ENTER
&mo 1 &mo 2 &kp SPACE &none &mo 3 &none
>;
};
// For the German keyboard layout
// % / { } ~
// & = ( ) # DEL
// | $ [ ] \ ENTER
special_char {
bindings = <
&kp GRAVE &kp EQUAL &none &none &none &kp LS(N5) &kp LS(N7) &kp RA(N7) &kp RA(N0) &kp RA(RBKT)
&kp TAB &none &kp LS(N2) &kp LS(MINUS) &kp LS(N1) &none &kp LS(N6) &kp LS(N0) &kp LS(N8) &kp LS(N9) &kp BSLH &kp DEL
&kp LSHIFT &kp NUBS &kp LS(NUBS) &none &none &none &kp RA(NUBS) &kp LS(N4) &kp RA(N8) &kp RA(N9) &kp RA(MINUS) &kp ENTER
&none &none &kp SPACE &none &trans &none
>;
};
num_fun {
bindings = <
&kp F9 &kp F10 &kp F11 &kp F12 &none &none &kp N7 &kp N8 &kp N9 &none
&kp TAB &kp F5 &kp F6 &kp F7 &kp F8 &none &none &kp N4 &kp N5 &kp N6 &kp RBKT &kp DEL
&kp LSHIFT &kp F1 &kp F2 &kp F3 &kp F4 &none &kp N0 &kp N1 &kp N2 &kp N3 &kp FSLH &kp ENTER
&none &none &kp SPACE &none &none &kp N0
>;
};
nav_umlaut {
bindings = <
&none &none &out OUT_USB &out OUT_BLE &bt BT_CLR_ALL &none &kp LBKT &none &kp SEMI &none
&kp TAB &kp SQT &kp MINUS &none &none &none &kp LEFT &kp DOWN &kp UP &kp RIGHT &none &kp DEL
&kp LSHIFT &none &none &none &none &none &none &none &none &none &none &kp ENTER
&none &none &kp SPACE &none &none &none
>;
};
};
combos {
compatible = "zmk,combos";
// left home row combos
combo_LSHIFT {
key-positions = <13 14>;
bindings = <&sk LSHIFT>;
timeout-ms = <50>;
slow-release;
};
combo_LCTRL {
key-positions = <12 14>;
bindings = <&sk LCTRL>;
timeout-ms = <50>;
slow-release;
};
combo_LMETA {
key-positions = <12 13>;
bindings = <&sk LMETA>;
timeout-ms = <50>;
slow-release;
};
combo_LALT {
key-positions = <11 14>;
bindings = <&sk LALT>;
timeout-ms = <50>;
slow-release;
};
// right home row combos
combo_RSHIFT {
key-positions = <17 18>;
bindings = <&sk RSHIFT>;
timeout-ms = <50>;
slow-release;
};
combo_RCTRL {
key-positions = <17 19>;
bindings = <&sk RCTRL>;
timeout-ms = <50>;
slow-release;
};
combo_RMETA {
key-positions = <18 19>;
bindings = <&sk RMETA>;
timeout-ms = <50>;
slow-release;
};
combo_RALT {
key-positions = <17 20>;
bindings = <&sk RALT>;
timeout-ms = <50>;
slow-release;
};
};
};

View file

@ -1,11 +0,0 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
self:
path: config