Skip to content

Commit

Permalink
add central trackball without making any changes to peripheral trackb…
Browse files Browse the repository at this point in the history
…all code
  • Loading branch information
RealET committed Jan 9, 2025
1 parent 1e2b0eb commit ac5fef9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
4 changes: 0 additions & 4 deletions boards/shields/imprint/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ config ZMK_POINTING
config ZMK_SPLIT
default y

endif

if SHIELD_IMPRINT_RIGHT

config SPI
default y

Expand Down
5 changes: 5 additions & 0 deletions boards/shields/imprint/imprint.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,9 @@ RC(2,6) RC(2,5) RC(2,4) RC(2,3) RC(2,2) RC(2,1) RC(9,1) RC(9,2)
status = "disabled";
device = <&trackball_split>;
};

trackball_central_listener: trackball_central_listener {
compatible = "zmk,input-listener";
status = "disabled";
};
};
9 changes: 9 additions & 0 deletions boards/shields/imprint/imprint_left.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
CONFIG_PMW3610=y
# CONFIG_PMW3610_SWAP_XY=y
# CONFIG_PMW3610_INVERT_X=y
# CONFIG_PMW3610_INVERT_Y=y
# CONFIG_PMW3610_REPORT_INTERVAL_MIN=12
# CONFIG_PMW3610_LOG_LEVEL_DBG=y
23 changes: 23 additions & 0 deletions boards/shields/imprint/imprint_left.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,27 @@

&trackball_listener {
status = "okay";
};

#include <zephyr/dt-bindings/input/input-event-codes.h>
&spi1 {
cs-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;

trackball_central: trackball_central@0 {
status = "okay";
compatible = "pixart,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
cpi = <600>;
evt-type = <INPUT_EV_REL>;
x-input-code = <INPUT_REL_X>;
y-input-code = <INPUT_REL_Y>;
};
};

// Overrides for the input listener node
&trackball_central_listener {
status = "okay";
device = <&trackball_central>;
};

0 comments on commit ac5fef9

Please sign in to comment.