Skip to content

Commit

Permalink
acorn: studio support
Browse files Browse the repository at this point in the history
  • Loading branch information
numToStr committed Aug 22, 2024
1 parent 0117ae0 commit 5a9f55e
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 7 deletions.
22 changes: 21 additions & 1 deletion boards/shields/acorn/acorn.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,28 @@
&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 &kp ESC &kp SPACE &kp RET &mo 2 &kp LALT
&studio_unlock &kp ESC &kp SPACE &kp RET &mo 2 &kp LALT
>;
};

nav_layer {
display-name = "nav";
status = "reserved";
};

fn_layer {
display-name = "fn";
status = "reserved";
};

num_layer {
display-name = "num";
status = "reserved";
};

sys_layer {
display-name = "sys";
status = "reserved";
};
};
};
146 changes: 141 additions & 5 deletions boards/shields/acorn/acorn_matrix.dtsi
Original file line number Diff line number Diff line change
@@ -1,12 +1,136 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include <physical_layouts.dtsi>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,physical-layout = &default_layout;
};

kscan0: kscan {
default_layout: default_layout {
compatible = "zmk,physical-layout";
display-name = "6-col";

kscan = <&default_kscan>;
transform = <&default_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 37 0 0 0>
, <&key_physical_attrs 100 100 100 37 0 0 0>
, <&key_physical_attrs 100 100 200 12 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 12 0 0 0>
, <&key_physical_attrs 100 100 500 25 0 0 0>
, <&key_physical_attrs 100 100 900 25 0 0 0>
, <&key_physical_attrs 100 100 1000 12 0 0 0>
, <&key_physical_attrs 100 100 1100 0 0 0 0>
, <&key_physical_attrs 100 100 1200 12 0 0 0>
, <&key_physical_attrs 100 100 1300 37 0 0 0>
, <&key_physical_attrs 100 100 1400 37 0 0 0>
, <&key_physical_attrs 100 100 0 137 0 0 0>
, <&key_physical_attrs 100 100 100 137 0 0 0>
, <&key_physical_attrs 100 100 200 112 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 400 112 0 0 0>
, <&key_physical_attrs 100 100 500 125 0 0 0>
, <&key_physical_attrs 100 100 900 125 0 0 0>
, <&key_physical_attrs 100 100 1000 112 0 0 0>
, <&key_physical_attrs 100 100 1100 100 0 0 0>
, <&key_physical_attrs 100 100 1200 112 0 0 0>
, <&key_physical_attrs 100 100 1300 137 0 0 0>
, <&key_physical_attrs 100 100 1400 137 0 0 0>
, <&key_physical_attrs 100 100 0 237 0 0 0>
, <&key_physical_attrs 100 100 100 237 0 0 0>
, <&key_physical_attrs 100 100 200 212 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
, <&key_physical_attrs 100 100 400 212 0 0 0>
, <&key_physical_attrs 100 100 500 225 0 0 0>
, <&key_physical_attrs 100 100 900 225 0 0 0>
, <&key_physical_attrs 100 100 1000 212 0 0 0>
, <&key_physical_attrs 100 100 1100 200 0 0 0>
, <&key_physical_attrs 100 100 1200 212 0 0 0>
, <&key_physical_attrs 100 100 1300 237 0 0 0>
, <&key_physical_attrs 100 100 1400 237 0 0 0>
, <&key_physical_attrs 100 100 348 312 0 0 0>
, <&key_physical_attrs 100 100 348 312 1500 398 789>
, <&key_physical_attrs 100 150 348 262 3000 398 789>
, <&key_physical_attrs 100 150 1052 262 (-3000) 1102 789>
, <&key_physical_attrs 100 100 1052 312 (-1500) 1102 789>
, <&key_physical_attrs 100 100 1052 312 0 0 0>
;
};

five_column_layout: five_column_layout {
compatible = "zmk,physical-layout";
display-name = "5-col";

kscan = <&default_kscan>;
transform = <&five_column_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 37 0 0 0>
, <&key_physical_attrs 100 100 100 12 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 12 0 0 0>
, <&key_physical_attrs 100 100 400 25 0 0 0>
, <&key_physical_attrs 100 100 800 25 0 0 0>
, <&key_physical_attrs 100 100 900 12 0 0 0>
, <&key_physical_attrs 100 100 1000 0 0 0 0>
, <&key_physical_attrs 100 100 1100 12 0 0 0>
, <&key_physical_attrs 100 100 1200 37 0 0 0>
, <&key_physical_attrs 100 100 0 137 0 0 0>
, <&key_physical_attrs 100 100 100 112 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 112 0 0 0>
, <&key_physical_attrs 100 100 400 125 0 0 0>
, <&key_physical_attrs 100 100 800 125 0 0 0>
, <&key_physical_attrs 100 100 900 112 0 0 0>
, <&key_physical_attrs 100 100 1000 100 0 0 0>
, <&key_physical_attrs 100 100 1100 112 0 0 0>
, <&key_physical_attrs 100 100 1200 137 0 0 0>
, <&key_physical_attrs 100 100 0 237 0 0 0>
, <&key_physical_attrs 100 100 100 212 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 212 0 0 0>
, <&key_physical_attrs 100 100 400 225 0 0 0>
, <&key_physical_attrs 100 100 800 225 0 0 0>
, <&key_physical_attrs 100 100 900 212 0 0 0>
, <&key_physical_attrs 100 100 1000 200 0 0 0>
, <&key_physical_attrs 100 100 1100 212 0 0 0>
, <&key_physical_attrs 100 100 1200 237 0 0 0>
, <&key_physical_attrs 100 100 248 312 0 0 0>
, <&key_physical_attrs 100 100 248 312 1500 298 789>
, <&key_physical_attrs 100 150 248 262 3000 298 789>
, <&key_physical_attrs 100 150 952 262 (-3000) 1002 789>
, <&key_physical_attrs 100 100 952 312 (-1500) 1002 789>
, <&key_physical_attrs 100 100 952 312 0 0 0>
;
};

acorn_position_map {
compatible = "zmk,physical-layout-position-map";

complete;

twelve {
physical-layout = <&default_layout>;
positions
= < 1 2 3 4 5 6 7 8 9 10>
, <13 14 15 16 17 18 19 20 21 22>
, <25 26 27 28 29 30 31 32 33 34>
, < 36 37 38 39 40 41 >;
};

ten {
physical-layout = <&five_column_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 >;
};
};

default_kscan: default_kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

Expand All @@ -32,15 +156,27 @@

default_transform: default_transform {
compatible = "zmk,matrix-transform";
columns = <16>;
rows = <3>;
columns = <12>;
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(0,10) RC(0,11)
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(1,10) RC(1,11)
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(2,10) RC(2,11)
RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8)
>;
};

five_column_transform: five_column_transform {
compatible = "zmk,matrix-transform";
columns = <10>;
rows = <4>;
map = <
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(0,10)
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(1,10)
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(2,10)
RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8)
>;
};

left_encoder: left_encoder {
compatible = "alps,ec11";
Expand Down
12 changes: 11 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,14 @@ include:
shield: hana_peripheral_right
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y
artifact-name: hana_right_xiao_ble_studio
artifact-name: hana_right_xiao_ble_studio
- board: nice_nano_v2
shield: acorn_central_left
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y
artifact-name: acorn_left_xiao_ble_studio
- board: nice_nano_v2
shield: acorn_peripheral_right
snippet: studio-rpc-usb-uart
cmake-args: -DCONFIG_ZMK_STUDIO=y
artifact-name: acorn_right_xiao_ble_studio

0 comments on commit 5a9f55e

Please sign in to comment.