Skip to content

Commit

Permalink
feat(shields): QAZ: added three physical layouts
Browse files Browse the repository at this point in the history
* added three physical layouts

---------

Co-authored-by: Zack Forbing <[email protected]>
Co-authored-by: Cem Aksoylar <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent 8756a06 commit 200d98f
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 4 deletions.
186 changes: 186 additions & 0 deletions app/boards/shields/qaz/qaz-layouts.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
/*
* Copyright (c) 2024 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <physical_layouts.dtsi>

/ {
split_big_bar_layout: split_big_bar_layout {
compatible = "zmk,physical-layout";
display-name = "Split Big Bar";
transform = <&split_big_bar_transform>;
kscan = <&kscan0>;
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 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 0 0 0 0>
, <&key_physical_attrs 100 100 500 0 0 0 0>
, <&key_physical_attrs 100 100 600 0 0 0 0>
, <&key_physical_attrs 100 100 700 0 0 0 0>
, <&key_physical_attrs 100 100 800 0 0 0 0>
, <&key_physical_attrs 125 100 900 0 0 0 0>

, <&key_physical_attrs 125 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 125 100 0 0 0>
, <&key_physical_attrs 100 100 225 100 0 0 0>
, <&key_physical_attrs 100 100 325 100 0 0 0>
, <&key_physical_attrs 100 100 425 100 0 0 0>
, <&key_physical_attrs 100 100 525 100 0 0 0>
, <&key_physical_attrs 100 100 625 100 0 0 0>
, <&key_physical_attrs 100 100 725 100 0 0 0>
, <&key_physical_attrs 100 100 825 100 0 0 0>
, <&key_physical_attrs 100 100 925 100 0 0 0>

, <&key_physical_attrs 175 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 175 200 0 0 0>
, <&key_physical_attrs 100 100 275 200 0 0 0>
, <&key_physical_attrs 100 100 375 200 0 0 0>
, <&key_physical_attrs 100 100 475 200 0 0 0>
, <&key_physical_attrs 100 100 575 200 0 0 0>
, <&key_physical_attrs 100 100 675 200 0 0 0>
, <&key_physical_attrs 100 100 775 200 0 0 0>
, <&key_physical_attrs 150 100 875 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 325 100 200 300 0 0 0>
, <&key_physical_attrs 300 100 525 300 0 0 0>
, <&key_physical_attrs 100 100 825 300 0 0 0>
, <&key_physical_attrs 100 100 925 300 0 0 0>
;
};

split_bar_layout: split_bar_layout {
compatible = "zmk,physical-layout";
display-name = "Split Bar";
transform = <&split_bar_transform>;
kscan = <&kscan0>;
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 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 0 0 0 0>
, <&key_physical_attrs 100 100 500 0 0 0 0>
, <&key_physical_attrs 100 100 600 0 0 0 0>
, <&key_physical_attrs 100 100 700 0 0 0 0>
, <&key_physical_attrs 100 100 800 0 0 0 0>
, <&key_physical_attrs 125 100 900 0 0 0 0>

, <&key_physical_attrs 125 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 125 100 0 0 0>
, <&key_physical_attrs 100 100 225 100 0 0 0>
, <&key_physical_attrs 100 100 325 100 0 0 0>
, <&key_physical_attrs 100 100 425 100 0 0 0>
, <&key_physical_attrs 100 100 525 100 0 0 0>
, <&key_physical_attrs 100 100 625 100 0 0 0>
, <&key_physical_attrs 100 100 725 100 0 0 0>
, <&key_physical_attrs 100 100 825 100 0 0 0>
, <&key_physical_attrs 100 100 925 100 0 0 0>

, <&key_physical_attrs 175 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 175 200 0 0 0>
, <&key_physical_attrs 100 100 275 200 0 0 0>
, <&key_physical_attrs 100 100 375 200 0 0 0>
, <&key_physical_attrs 100 100 475 200 0 0 0>
, <&key_physical_attrs 100 100 575 200 0 0 0>
, <&key_physical_attrs 100 100 675 200 0 0 0>
, <&key_physical_attrs 100 100 775 200 0 0 0>
, <&key_physical_attrs 150 100 875 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 300 0 0 0>
, <&key_physical_attrs 225 100 300 300 0 0 0>
, <&key_physical_attrs 200 100 525 300 0 0 0>
, <&key_physical_attrs 100 100 725 300 0 0 0>
, <&key_physical_attrs 100 100 825 300 0 0 0>
, <&key_physical_attrs 100 100 925 300 0 0 0>
;
};

big_bar_layout: big_bar_layout {
compatible = "zmk,physical-layout";
display-name = "Big Bar";
transform = <&big_bar_transform>;
kscan = <&kscan0>;
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 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 0 0 0 0>
, <&key_physical_attrs 100 100 500 0 0 0 0>
, <&key_physical_attrs 100 100 600 0 0 0 0>
, <&key_physical_attrs 100 100 700 0 0 0 0>
, <&key_physical_attrs 100 100 800 0 0 0 0>
, <&key_physical_attrs 125 100 900 0 0 0 0>

, <&key_physical_attrs 125 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 125 100 0 0 0>
, <&key_physical_attrs 100 100 225 100 0 0 0>
, <&key_physical_attrs 100 100 325 100 0 0 0>
, <&key_physical_attrs 100 100 425 100 0 0 0>
, <&key_physical_attrs 100 100 525 100 0 0 0>
, <&key_physical_attrs 100 100 625 100 0 0 0>
, <&key_physical_attrs 100 100 725 100 0 0 0>
, <&key_physical_attrs 100 100 825 100 0 0 0>
, <&key_physical_attrs 100 100 925 100 0 0 0>

, <&key_physical_attrs 175 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 175 200 0 0 0>
, <&key_physical_attrs 100 100 275 200 0 0 0>
, <&key_physical_attrs 100 100 375 200 0 0 0>
, <&key_physical_attrs 100 100 475 200 0 0 0>
, <&key_physical_attrs 100 100 575 200 0 0 0>
, <&key_physical_attrs 100 100 675 200 0 0 0>
, <&key_physical_attrs 100 100 775 200 0 0 0>
, <&key_physical_attrs 150 100 875 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 625 100 200 300 0 0 0>
, <&key_physical_attrs 100 100 825 300 0 0 0>
, <&key_physical_attrs 100 100 925 300 0 0 0>
;
};

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

complete;

split_big_bar_posmap {
physical-layout = <&split_big_bar_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 35 31 36 33 34 32>
;
};

split_bar_posmap {
physical-layout = <&split_bar_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 34 35 36 33>
;
};

big_bar_posmap {
physical-layout = <&big_bar_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 35 34 36 32 33 31>
;
};
};
};
32 changes: 28 additions & 4 deletions app/boards/shields/qaz/qaz.overlay
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*
* Copyright (c) 2020 The ZMK Contributors
* Copyright (c) 2024 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <dt-bindings/zmk/matrix_transform.h>
#include "qaz-layouts.dtsi"

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
zmk,physical-layout = &split_bar_layout;
};

default_transform: keymap_transform_0 {
split_bar_transform: split_bar_transform {
compatible = "zmk,matrix-transform";
columns = <7>;
rows = <6>;
Expand All @@ -24,6 +25,30 @@
>;
};

split_big_bar_transform: split_big_bar_transform {
compatible = "zmk,matrix-transform";
columns = <7>;
rows = <6>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(4,0) RC(4,1) RC(4,2)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(5,0) RC(5,1) RC(5,2)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(4,3) RC(5,3)
RC(3,0) RC(3,1) RC(3,2) RC(3,5) RC(3,6) RC(4,4)
>;
};

big_bar_transform: big_bar_transform {
compatible = "zmk,matrix-transform";
columns = <7>;
rows = <6>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(4,0) RC(4,1) RC(4,2)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(5,0) RC(5,1) RC(5,2)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(4,3) RC(5,3)
RC(3,0) RC(3,1) RC(3,4) RC(3,6) RC(4,4)
>;
};


kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
Expand All @@ -49,5 +74,4 @@
, <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

};

0 comments on commit 200d98f

Please sign in to comment.