2022-12-20 18:49:17 -08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 The ZMK Contributors
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <dt-bindings/zmk/matrix_transform.h>
|
|
|
|
|
|
|
|
/ {
|
|
|
|
chosen {
|
|
|
|
zmk,kscan = &kscan0;
|
2024-01-08 15:52:47 -08:00
|
|
|
zmk,matrix-transform = &default_transform;
|
2022-12-20 18:49:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
default_transform: keymap_transform_0 {
|
|
|
|
compatible = "zmk,matrix-transform";
|
|
|
|
columns = <5>;
|
|
|
|
rows = <1>;
|
|
|
|
|
|
|
|
map = <RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4)>;
|
|
|
|
};
|
|
|
|
|
|
|
|
kscan0: kscan_0 {
|
|
|
|
compatible = "zmk,kscan-gpio-matrix";
|
2024-03-29 11:15:06 -07:00
|
|
|
wakeup-source;
|
2022-12-20 18:49:17 -08:00
|
|
|
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>
|
|
|
|
;
|
|
|
|
|
|
|
|
row-gpios
|
|
|
|
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
|
|
|
encoder: encoder {
|
|
|
|
compatible = "alps,ec11";
|
|
|
|
a-gpios = <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
|
|
|
b-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
2023-10-17 19:33:03 -07:00
|
|
|
steps = <80>;
|
2022-12-20 18:49:17 -08:00
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
|
2023-10-17 19:33:03 -07:00
|
|
|
sensors: sensors {
|
2022-12-20 18:49:17 -08:00
|
|
|
compatible = "zmk,keymap-sensors";
|
|
|
|
sensors = <&encoder>;
|
2023-10-17 19:33:03 -07:00
|
|
|
triggers-per-rotation = <20>;
|
2022-12-20 18:49:17 -08:00
|
|
|
};
|
|
|
|
};
|