Browse Source

add xmkb shield and default keymap

xmkb
Julia Luna 2 years ago
parent
commit
442d9e0d0e
Signed by: xenua
GPG Key ID: 6A0C04FA9A7D7582
  1. 15
      app/boards/shields/xmkb/Kconfig.defconfig
  2. 5
      app/boards/shields/xmkb/Kconfig.shield
  3. 0
      app/boards/shields/xmkb/xmkb.conf
  4. 42
      app/boards/shields/xmkb/xmkb.dtsi
  5. 42
      app/boards/shields/xmkb/xmkb.keymap
  6. 12
      app/boards/shields/xmkb/xmkb.zmk.yml
  7. 3
      app/boards/shields/xmkb/xmkb_left.conf
  8. 23
      app/boards/shields/xmkb/xmkb_left.overlay
  9. 0
      app/boards/shields/xmkb/xmkb_right.conf
  10. 21
      app/boards/shields/xmkb/xmkb_right.overlay

15
app/boards/shields/xmkb/Kconfig.defconfig

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
if SHIELD_XMKB_LEFT
config ZMK_KEYBOARD_NAME
default "xmkb"
config ZMK_SPLIT_ROLE_CENTRAL
default y
endif
if SHIELD_XMKB_LEFT || SHIELD_XMKB_RIGHT
config ZMK_SPLIT
default y
endif

5
app/boards/shields/xmkb/Kconfig.shield

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
config SHIELD_XMKB_LEFT
def_bool $(shields_list_contains,xmkb_left)
config SHIELD_XMKB_RIGHT
def_bool $(shields_list_contains,xmkb_right)

0
app/boards/shields/xmkb/xmkb.conf

42
app/boards/shields/xmkb/xmkb.dtsi

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
#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 = <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(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(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,1) RC(3,2) RC(3,3) RC(3,4) RC(3,7) RC(3,8)
>;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
};
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
status = "disabled";
};
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
};
};

42
app/boards/shields/xmkb/xmkb.keymap

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#define DEF 0
#define LOW 1
#define HIGH 2
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp ENTER
&kp ESC &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT
&kp LCTRL &lt LOW SPACE &kp LSHIFT &kp LMETA &lt HIGH BSPC &kp LALT
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};
low_layer {
bindings = <
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0
&trans &trans &kp LBKT &kp RBKT &kp INS &kp PG_UP &kp EQUAL &kp MINUS &kp TAB &trans
&trans &kp GRAVE &kp BSLH &kp FSLH &kp DEL &kp PG_DN &kp SEMI &kp SQT &kp HOME &kp END
&trans &trans &trans &trans &trans &trans
>;
sensor-bindings = <&inc_dec_kp C_AC_SCROLL_UP C_AC_SCROLL_DOWN>;
};
high_layer {
bindings = <
&trans &kp UP &kp K_PREV &kp K_PP &kp K_NEXT &kp F1 &kp F2 &kp F3 &kp F4 &trans
&kp LEFT &kp DOWN &kp RIGHT &trans &trans &kp F5 &kp F6 &kp F7 &kp F8 &trans
&trans &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &kp F9 &kp F10 &kp F11 &kp F12 &trans
&trans &trans &trans &trans &trans &trans
>;
sensor-bindings = <&inc_dec_kp C_BRI_INC C_BRI_DEC>;
};
};
};

12
app/boards/shields/xmkb/xmkb.zmk.yml

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
file_format: "1"
id: xmkb
name: xmkb
type: shield
url: https://git.xenua.me/xenua/xmkb
requires:
- pro_micro
features:
- keys
siblings:
- xmkb_left
- xmkb_right

3
app/boards/shields/xmkb/xmkb_left.conf

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
# Uncomment to enable encoder
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

23
app/boards/shields/xmkb/xmkb_left.overlay

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
#include "xmkb.dtsi"
&kscan0 {
row-gpios
= <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // top
, <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // home
, <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // bot
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // thumb
;
col-gpios
= <&pro_micro 21 (GPIO_ACTIVE_HIGH)> // l pinky
, <&pro_micro 20 (GPIO_ACTIVE_HIGH)> // l ring
, <&pro_micro 19 (GPIO_ACTIVE_HIGH)> // l middle
, <&pro_micro 1 (GPIO_ACTIVE_HIGH)> // l index
, <&pro_micro 0 (GPIO_ACTIVE_HIGH)> // l inner
;
};
&left_encoder {
a-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
status = "okay";
};

0
app/boards/shields/xmkb/xmkb_right.conf

21
app/boards/shields/xmkb/xmkb_right.overlay

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
#include "xmkb.dtsi"
&kscan0 {
row-gpios
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // top
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // home
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // bot
, <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // thumb
;
col-gpios
= <&pro_micro 15 (GPIO_ACTIVE_HIGH)> // r inner
, <&pro_micro 18 (GPIO_ACTIVE_HIGH)> // r index
, <&pro_micro 14 (GPIO_ACTIVE_HIGH)> // r middle
, <&pro_micro 16 (GPIO_ACTIVE_HIGH)> // r ring
, <&pro_micro 10 (GPIO_ACTIVE_HIGH)> // r pinky
;
};
&default_transform {
col-offset = <5>;
};
Loading…
Cancel
Save