forked from sirocominfo/zmk-config-KimiBoard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkimiboard.overlay
More file actions
106 lines (91 loc) · 2.94 KB
/
Copy pathkimiboard.overlay
File metadata and controls
106 lines (91 loc) · 2.94 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <dt-bindings/zmk/matrix_transform.h>
#include <physical_layouts.dtsi>
/ {
chosen {
zmk,physical-layout = &physical_layout0;
};
physical_layout0: physical_layout_0 {
compatible = "zmk,physical-layout";
display-name = "Default Layout";
kscan = <&kscan0>;
transform = <&default_transform>;
keys =
// w h x y rot rx ry
<&key_physical_attrs 50 100 0 0 0 0 0> // SW4 (reset button)
, <&key_physical_attrs 100 100 120 0 0 0 0> // SW3 (left button)
, <&key_physical_attrs 100 100 240 0 0 0 0> // SW2 (center button)
, <&key_physical_attrs 100 100 360 0 0 0 0> // SW1 (right button)
;
};
default_transform: keymap_transform0 {
compatible = "zmk,matrix-transform";
rows = <4>;
columns = <5>;
map = <
RC(3,3) RC(2,2) RC(1,1) RC(0,0) // SW4 to SW1 (SW4 is the reset switch)
>;
};
kscan0: kscan0 {
compatible = "zmk,kscan-gpio-matrix";
diode-direction = "col2row";
col-gpios
= <&xiao_d 10 GPIO_ACTIVE_HIGH>
, <&xiao_d 9 GPIO_ACTIVE_HIGH>
, <&xiao_d 8 GPIO_ACTIVE_HIGH>
, <&xiao_d 7 GPIO_ACTIVE_HIGH>
, <&gpio0 10 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};
/ {
trackball_listener: trackball_listener {
status = "okay";
compatible = "zmk,input-listener";
device = <&trackball>;
};
};
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 5)>,
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
<NRF_PSEL(SPIM_MISO, 0, 4)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 5)>,
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
<NRF_PSEL(SPIM_MISO, 0, 4)>;
low-power-enable;
};
};
};
&xiao_serial { status = "disabled"; };
&spi0 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
trackball: trackball@0 {
status = "okay";
compatible = "pixart,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
motion-gpios = <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
zephyr,axis-x = <INPUT_REL_Y>;
zephyr,axis-y = <INPUT_REL_X>;
res-cpi = <400>;
smart-mode;
invert-x;
};
};