zmk/app/boards/shields/reviung34/reviung34.overlay
yekingyan 0a6c6a1856
feat(boards): add physical layout for reviung34 (#3351)
* feat(boards): add physical layout for reviung34

Add physical layout support for the REVIUNG34 keyboard:
- Dual 1U (34-key) layout
- Single 2U (33-key) layout
- Position map for layout switching

Coordinates extracted from the original KiCad PCB (gtips/reviung).
Closes #2536

* Update app/boards/shields/reviung34/reviung34-layouts.dtsi

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>

* Update app/boards/shields/reviung34/reviung34-layouts.dtsi

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>

* Update app/boards/shields/reviung34/reviung34-layouts.dtsi

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>

* Update app/boards/shields/reviung34/reviung34-layouts.dtsi

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>

* Update app/boards/shields/reviung34/reviung34-layouts.dtsi

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>

* fix: wrap negative numbers in parentheses for DTS syntax

---------

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>
2026-06-20 06:25:02 +02:00

74 lines
2.2 KiB
Text

/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
#include "reviung34-layouts.dtsi"
&reviung34_dual_1u_layout {
transform = <&dual_1u_transform>;
};
&reviung34_single_2u_layout {
transform = <&single_2u_transform>;
};
/ {
chosen {
zmk,kscan = &kscan0;
zmk,physical-layout = &reviung34_dual_1u_layout;
};
dual_1u_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <9>;
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(3,5)
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(3,6)
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(3,7)
RC(3,2) RC(3,3) RC(3,4) RC(3,8)
>;
};
single_2u_transform: keymap_transform_1 {
compatible = "zmk,matrix-transform";
columns = <9>;
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(3,5)
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(3,6)
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(3,7)
RC(3,2) RC(3,4) RC(3,8)
>;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row";
col-gpios
= <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
, <&pro_micro 16 GPIO_ACTIVE_HIGH>
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};