Skip to content

Commit eb170c9

Browse files
authored
feat(shields): Add physical layouts for tester_xiao and tester_pro_micro (zmkfirmware#2852)
feat(shields): Add tester_xiao layouts Added two layouts for the XIAO tester shield: - Keys arranged to match the XIAO pinout, viewed from the front - Single row of eleven keys These layouts are abstractions since the tester_xiao shield may be used in a situation where the "keys" are actually jumper wires on a breadboard or the like. feat(shields): Add tester_pro_micro layouts Added two layouts for the Pro Micro tester shield: - Keys arranged to match the Pro Micro pinout, viewed from the front - Single row of eighteen keys
1 parent 241ff39 commit eb170c9

File tree

4 files changed

+168
-4
lines changed

4 files changed

+168
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (c) 2025 The ZMK Contributors
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
#include <physical_layouts.dtsi>
8+
9+
/ {
10+
tester_position_map {
11+
compatible = "zmk,physical-layout-position-map";
12+
complete;
13+
14+
pinout_map: pinout_positions {
15+
physical-layout = <&physical_layout0>;
16+
positions = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17>;
17+
};
18+
inline_map: single_row_positions {
19+
physical-layout = <&physical_layout1>;
20+
positions = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17>;
21+
};
22+
};
23+
24+
physical_layout0: physical_layout_0 {
25+
compatible = "zmk,physical-layout";
26+
display-name = "Pro Micro Pinout";
27+
28+
// Map key positions to the Pro Micro pinout. The coordinate
29+
// deltas jump around a little because some of the Pro Micro
30+
// pins are out of order: D0 is "after" D1 and D16 is "before"
31+
// D14.
32+
keys // w h x y rot rx ry
33+
= <&key_physical_attrs 100 100 0 100 0 0 0> // D0
34+
, <&key_physical_attrs 100 100 0 0 0 0 0> // D1
35+
, <&key_physical_attrs 100 100 0 400 0 0 0> // D2
36+
, <&key_physical_attrs 100 100 0 500 0 0 0> // D3
37+
, <&key_physical_attrs 100 100 0 600 0 0 0> // D4
38+
, <&key_physical_attrs 100 100 0 700 0 0 0> // D5
39+
, <&key_physical_attrs 100 100 0 800 0 0 0> // D6
40+
, <&key_physical_attrs 100 100 0 900 0 0 0> // D7
41+
, <&key_physical_attrs 100 100 0 1000 0 0 0> // D8
42+
, <&key_physical_attrs 100 100 0 1100 0 0 0> // D9
43+
, <&key_physical_attrs 100 100 600 1100 0 0 0> // D10
44+
, <&key_physical_attrs 100 100 600 900 0 0 0> // D14
45+
, <&key_physical_attrs 100 100 600 800 0 0 0> // D15
46+
, <&key_physical_attrs 100 100 600 1000 0 0 0> // D16
47+
, <&key_physical_attrs 100 100 600 700 0 0 0> // D18
48+
, <&key_physical_attrs 100 100 600 600 0 0 0> // D19
49+
, <&key_physical_attrs 100 100 600 500 0 0 0> // D20
50+
, <&key_physical_attrs 100 100 600 400 0 0 0> // D21
51+
;
52+
};
53+
54+
physical_layout1: physical_layout_1 {
55+
compatible = "zmk,physical-layout";
56+
display-name = "Single Row";
57+
58+
// Single row of eighteen "keys", in ascending "Arduino" order.
59+
keys // w h x y rot rx ry
60+
= <&key_physical_attrs 100 100 0 0 0 0 0>
61+
, <&key_physical_attrs 100 100 100 0 0 0 0>
62+
, <&key_physical_attrs 100 100 200 0 0 0 0>
63+
, <&key_physical_attrs 100 100 300 0 0 0 0>
64+
, <&key_physical_attrs 100 100 400 0 0 0 0>
65+
, <&key_physical_attrs 100 100 500 0 0 0 0>
66+
, <&key_physical_attrs 100 100 600 0 0 0 0>
67+
, <&key_physical_attrs 100 100 700 0 0 0 0>
68+
, <&key_physical_attrs 100 100 800 0 0 0 0>
69+
, <&key_physical_attrs 100 100 900 0 0 0 0>
70+
, <&key_physical_attrs 100 100 1000 0 0 0 0>
71+
, <&key_physical_attrs 100 100 1100 0 0 0 0>
72+
, <&key_physical_attrs 100 100 1200 0 0 0 0>
73+
, <&key_physical_attrs 100 100 1300 0 0 0 0>
74+
, <&key_physical_attrs 100 100 1400 0 0 0 0>
75+
, <&key_physical_attrs 100 100 1500 0 0 0 0>
76+
, <&key_physical_attrs 100 100 1600 0 0 0 0>
77+
, <&key_physical_attrs 100 100 1700 0 0 0 0>
78+
;
79+
};
80+
};

app/boards/shields/tester_pro_micro/tester_pro_micro.overlay

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#include <dt-bindings/zmk/matrix_transform.h>
2+
#include "tester_pro_micro-layouts.dtsi"
3+
4+
&physical_layout0 {
5+
transform = <&transform0>;
6+
};
7+
8+
&physical_layout1 {
9+
transform = <&transform0>;
10+
};
211

312
/ {
413
chosen {
514
zmk,kscan = &kscan0;
6-
zmk,matrix-transform = &transform0;
15+
zmk,physical-layout = &physical_layout0;
716
};
817

918
kscan0: kscan {
@@ -41,4 +50,4 @@
4150
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(0,12) RC(0,13) RC(0,14) RC(0,15) RC(0,16) RC(0,17)
4251
>;
4352
};
44-
};
53+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (c) 2025 The ZMK Contributors
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
#include <physical_layouts.dtsi>
8+
9+
// The tester might not have any physical keys at all, so these
10+
// physical layouts are pretty much imaginary.
11+
12+
/ {
13+
tester_position_map {
14+
compatible = "zmk,physical-layout-position-map";
15+
complete;
16+
17+
pinout_map: pinout_positions {
18+
physical-layout = <&physical_layout0>;
19+
positions = <0 1 2 3 4 5 6 7 8 9 10>;
20+
};
21+
inline_map: single_row_positions {
22+
physical-layout = <&physical_layout1>;
23+
positions = <0 1 2 3 4 5 6 7 8 9 10>;
24+
};
25+
};
26+
27+
physical_layout0: physical_layout_0 {
28+
compatible = "zmk,physical-layout";
29+
display-name = "XIAO Pinout";
30+
31+
// Map key positions to the XIAO pinout.
32+
keys // w h x y rot rx ry
33+
= <&key_physical_attrs 100 100 0 0 0 0 0>
34+
, <&key_physical_attrs 100 100 0 100 0 0 0>
35+
, <&key_physical_attrs 100 100 0 200 0 0 0>
36+
, <&key_physical_attrs 100 100 0 300 0 0 0>
37+
, <&key_physical_attrs 100 100 0 400 0 0 0>
38+
, <&key_physical_attrs 100 100 0 500 0 0 0>
39+
, <&key_physical_attrs 100 100 0 600 0 0 0>
40+
, <&key_physical_attrs 100 100 600 600 0 0 0>
41+
, <&key_physical_attrs 100 100 600 500 0 0 0>
42+
, <&key_physical_attrs 100 100 600 400 0 0 0>
43+
, <&key_physical_attrs 100 100 600 300 0 0 0>
44+
;
45+
};
46+
47+
physical_layout1: physical_layout_1 {
48+
compatible = "zmk,physical-layout";
49+
display-name = "Single Row";
50+
51+
// Single row of eleven "keys".
52+
keys // w h x y rot rx ry
53+
= <&key_physical_attrs 100 100 0 0 0 0 0>
54+
, <&key_physical_attrs 100 100 100 0 0 0 0>
55+
, <&key_physical_attrs 100 100 200 0 0 0 0>
56+
, <&key_physical_attrs 100 100 300 0 0 0 0>
57+
, <&key_physical_attrs 100 100 400 0 0 0 0>
58+
, <&key_physical_attrs 100 100 500 0 0 0 0>
59+
, <&key_physical_attrs 100 100 600 0 0 0 0>
60+
, <&key_physical_attrs 100 100 700 0 0 0 0>
61+
, <&key_physical_attrs 100 100 800 0 0 0 0>
62+
, <&key_physical_attrs 100 100 900 0 0 0 0>
63+
, <&key_physical_attrs 100 100 1000 0 0 0 0>
64+
;
65+
};
66+
};

app/boards/shields/tester_xiao/tester_xiao.overlay

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#include <dt-bindings/zmk/matrix_transform.h>
2+
#include "tester_xiao-layouts.dtsi"
3+
4+
&physical_layout0 {
5+
transform = <&transform0>;
6+
};
7+
8+
&physical_layout1 {
9+
transform = <&transform0>;
10+
};
211

312
/ {
413
chosen {
514
zmk,kscan = &kscan0;
6-
zmk,matrix-transform = &transform0;
15+
zmk,physical-layout = &physical_layout0;
716
};
817

918
kscan0: kscan {
@@ -34,4 +43,4 @@
3443
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)
3544
>;
3645
};
37-
};
46+
};

0 commit comments

Comments
 (0)