Skip to content

Commit 4d70ce4

Browse files
move trackball to main file
1 parent 96a48f4 commit 4d70ce4

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

boards/shields/velvet_v3_ui/velvet_v3_ui.dtsi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <dt-bindings/zmk/matrix_transform.h>
2+
#include <zephyr/dt-bindings/input/input-event-codes.h>
23
#include "velvet_v3_ui_layout.dtsi"
34

45
/ {
@@ -43,3 +44,25 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7)
4344
status = "disabled";
4445
};
4546
};
47+
48+
&spi0 {
49+
status = "disabled";
50+
cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
51+
52+
trackball: trackball@0 {
53+
status = "disabled";
54+
compatible = "pixart,pmw3610";
55+
reg = <0>;
56+
spi-max-frequency = <2000000>;
57+
irq-gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
58+
cpi = <1000>;
59+
evt-type = <INPUT_EV_REL>;
60+
x-input-code = <INPUT_REL_X>;
61+
y-input-code = <INPUT_REL_Y>;
62+
63+
force-awake;
64+
/* keep the sensor awake while ZMK activity state is ACTIVE,
65+
fallback to normal downshift mode after ZMK goes into IDLE / SLEEP mode.
66+
thus, the sensor would be a `wakeup-source` */
67+
};
68+
};

boards/shields/velvet_v3_ui/velvet_v3_ui_right.overlay

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "velvet_v3_ui.dtsi"
2-
#include <zephyr/dt-bindings/input/input-event-codes.h>
32

43
&default_transform {
54
col-offset = <6>;
@@ -27,24 +26,10 @@
2726

2827
&spi0 {
2928
status = "okay";
30-
cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
31-
32-
trackball: trackball@0 {
33-
status = "okay";
34-
compatible = "pixart,pmw3610";
35-
reg = <0>;
36-
spi-max-frequency = <2000000>;
37-
irq-gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
38-
cpi = <1000>;
39-
evt-type = <INPUT_EV_REL>;
40-
x-input-code = <INPUT_REL_X>;
41-
y-input-code = <INPUT_REL_Y>;
29+
};
4230

43-
force-awake;
44-
/* keep the sensor awake while ZMK activity state is ACTIVE,
45-
fallback to normal downshift mode after ZMK goes into IDLE / SLEEP mode.
46-
thus, the sensor would be a `wakeup-source` */
47-
};
31+
&trackball {
32+
status = "okay";
4833
};
4934

5035
&trackball_listener {

0 commit comments

Comments
 (0)