Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QAZ shield: added three physical layouts #2567

Merged
merged 9 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) 2020 The ZMK Contributors
caksoylar marked this conversation as resolved.
Show resolved Hide resolved
*
* 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>

zackforbing marked this conversation as resolved.
Show resolved Hide resolved
, <&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 {
caksoylar marked this conversation as resolved.
Show resolved Hide resolved
compatible = "zmk,physical-layout-position-map";
complete;

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 33 34 35 36>
;
};

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 32 37 38 33 35 36>
;
};

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 39 32 40 41 35 36>
;
};
};
};
32 changes: 28 additions & 4 deletions app/boards/shields/qaz/qaz.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
*/

#include <dt-bindings/zmk/matrix_transform.h>
#include <qaz-layouts.dtsi>
caksoylar marked this conversation as resolved.
Show resolved Hide resolved

/ {
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)>
;
};

};
};