dev: init zmk files

This commit is contained in:
phiwan-dev 2025-07-11 17:38:25 +02:00
parent 5c17fd0e3f
commit f344124981
12 changed files with 214 additions and 0 deletions

View file

@ -0,0 +1,16 @@
if SHIELD_PHIBOARD_LEFT
config ZMK_KEYBOARD_NAME
default "phiboard"
config ZMK_SPLIT_ROLE_CENTRAL
default y
endif # SHIELD_PHIBOARD_LEFT
if SHIELD_PHIBOARD_LEFT || SHIELD_PHIBOARD_RIGHT
config ZMK_SPLIT
default y
endif # SHIELD_PHIBOARD_LEFT || SHIELD_PHIBOARD_RIGHT

View file

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

View file

@ -0,0 +1,23 @@
// See https://zmk.dev/docs/development/hardware-integration/physical-layouts
// for how to configure this.
#include <physical_layouts.dtsi>
/ {
default_layout: default_layout {
compatible = "zmk,physical-layout";
display-name = "Default Layout";
transform = <&default_transform>;
kscan = <&kscan>;
// Edit this to define the positions and sizes of the keys, or remove it
// if your keyboard will not support ZMK Studio.
// https://zmk.dev/docs/development/hardware-integration/physical-layouts#optional-keys-property
keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
;
};
};

View file

@ -0,0 +1,13 @@
# This file was generated from a template. Edit it to match your keyboard.
# See https://zmk.dev/docs/development/hardware-integration/new-shield for more
# instructions.
# This file will be copied into the user's config directory when they add this
# keyboard. Define any Kconfig options users may frequently want to set here,
# but leave them commented out, for example:
# Uncomment to enable the encoder
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Uncomment to enable the display
# CONFIG_ZMK_DISPLAY=y

View file

@ -0,0 +1,46 @@
// This file was generated from a template. Edit it to match your keyboard.
// See https://zmk.dev/docs/development/hardware-integration/new-shield for more
// instructions.
#include <dt-bindings/zmk/matrix_transform.h>
#include "phiboard-layouts.dtsi"
/ {
chosen {
zmk,physical-layout = &default_layout;
};
kscan: kscan {
// If the hardware does not use a switch matrix, change this to the
// appropriate driver and update the properties below to match.
// See https://zmk.dev/docs/config/kscan for supported key scan drivers.
compatible = "zmk,kscan-gpio-matrix";
// Set this to "col2row" or "row2col" to match the hardware. If using
// "row2col", change the col-gpios in the _left.overlay and _right.overlay
// files to (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN) and the row-gpios here to
// GPIO_ACTIVE_HIGH.
diode-direction = "col2row";
wakeup-source;
// Replace these comments with the GPIO pins in the matrix.
// See https://zmk.dev/docs/development/hardware-integration/new-shield#shield-overlays
row-gpios
= <&xiao_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
default_transform: default_transform {
// See https://zmk.dev/docs/development/hardware-integration/new-shield#matrix-transform
// for how to configure this
compatible = "zmk,matrix-transform";
columns = <4>;
rows = <2>;
map = <
RC(0, 0) RC(0, 1) RC(0, 2) RC(0, 3)
RC(1, 0) RC(1, 1) RC(1, 2) RC(1, 3)
>;
};
};

View file

@ -0,0 +1,20 @@
// This file was generated from a template. Edit it to match your keyboard.
// See https://zmk.dev/docs/development/hardware-integration/new-shield for more instructions.
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/ {
// Define a default keymap here.
// See https://zmk.dev/docs/development/hardware-integration/new-shield#default-keymap.
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp N1 &kp N2 &kp N3 &kp N4
&kp A &kp B &kp C &kp D
>;
};
};
};

View file

@ -0,0 +1,19 @@
# This file was generated from a template. Edit it to match your keyboard.
# See https://zmk.dev/docs/development/hardware-integration/hardware-metadata-files
# for instructions.
file_format: "1"
id: phiboard
name: phiboard
type: shield
# Set this to a URL that documents the keyboard.
url: https://example.com
# Add any features your keyboard supports here.
# See https://zmk.dev/docs/development/hardware-integration/hardware-metadata-files#features
features:
- keys
- studio # Remove this line if your keyboard will not support ZMK Studio
requires:
- seeed_xiao

View file

@ -0,0 +1,14 @@
// This file was generated from a template. Edit it to match your keyboard.
// See https://zmk.dev/docs/development/hardware-integration/new-shield for more
// instructions.
#include "phiboard.dtsi"
&kscan {
// Replace these comments with the GPIO pins in the matrix for the left side.
// See https://zmk.dev/docs/development/hardware-integration/new-shield#shield-overlays
col-gpios
= <&xiao_d 0 GPIO_ACTIVE_HIGH>
, <&xiao_d 0 GPIO_ACTIVE_HIGH>
;
};

View file

@ -0,0 +1,19 @@
// This file was generated from a template. Edit it to match your keyboard.
// See https://zmk.dev/docs/development/hardware-integration/new-shield for more
// instructions.
#include "phiboard.dtsi"
&default_transform {
// Set this to the number of columns on the left side.
col-offset = <2>;
};
&kscan {
// Replace these comments with the GPIO pins in the matrix for the right side.
// See https://zmk.dev/docs/development/hardware-integration/new-shield#shield-overlays
col-gpios
= <&xiao_d 0 GPIO_ACTIVE_HIGH>
, <&xiao_d 0 GPIO_ACTIVE_HIGH>
;
};