feat(shields): Add Studio support to boardsource3x4

This commit is contained in:
snoyer 2025-12-20 15:44:34 +04:00
parent 118359c83e
commit 312878c018
4 changed files with 86 additions and 3 deletions

View File

@ -0,0 +1,49 @@
/*
* Copyright (c) 2025 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <physical_layouts.dtsi>
/ {
horizontal_physical_layout: horizontal_physical_layout {
compatible = "zmk,physical-layout";
display-name = "Horizontal Layout";
keys
= <&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 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
;
};
vertical_physical_layout: vertical_physical_layout {
compatible = "zmk,physical-layout";
display-name = "Vertical Layout";
keys
= <&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 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 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>
;
};
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The ZMK Contributors
* Copyright (c) 2025 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
@ -37,7 +37,7 @@
bindings = <
&bt BT_CLR &none &sys_reset &bootloader
&trans &bt BT_SEL 3 &bt BT_SEL 4 &none
&none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2
&studio_unlock &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2
>;
};

View File

@ -1,14 +1,47 @@
/*
* Copyright (c) 2020 The ZMK Contributors
* Copyright (c) 2025 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
#include "boardsource3x4-layouts.dtsi"
&horizontal_physical_layout {
transform = <&default_transform>;
};
&vertical_physical_layout {
transform = <&vertical_transform>;
};
/ {
chosen {
zmk,kscan = &kscan0;
zmk,physical-layout = &horizontal_physical_layout;
};
default_transform: default_transform {
compatible = "zmk,matrix-transform";
columns = <4>;
rows = <3>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3)
RC(1,0) RC(1,1) RC(1,2) RC(1,3)
RC(2,0) RC(2,1) RC(2,2) RC(2,3)
>;
};
vertical_transform: vertical_transform {
compatible = "zmk,matrix-transform";
columns = <4>;
rows = <3>;
map = <
RC(0,3) RC(1,3) RC(2,3)
RC(0,2) RC(1,2) RC(2,2)
RC(0,1) RC(1,1) RC(2,1)
RC(0,0) RC(1,0) RC(2,0)
>;
};
kscan0: kscan {

View File

@ -6,3 +6,4 @@ url: https://boardsource.xyz/store/5ecc2008eee64242946c98c1
requires: [pro_micro]
features:
- keys
- studio