Skip to content

Commit

Permalink
Add support for PMW3360 trackball sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
trentrand committed May 4, 2024
1 parent aaf86a3 commit d4bfd14
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <behaviors.dtsi>
#include <behaviors/mouse_keys.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/bt.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,44 @@
, <&gpio0 9 GPIO_ACTIVE_HIGH>
;
};

&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
<NRF_PSEL(SPIM_MOSI, 0, 24)>,
<NRF_PSEL(SPIM_MISO, 1, 0)>;
};
};

spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
<NRF_PSEL(SPIM_MOSI, 0, 24)>,
<NRF_PSEL(SPIM_MISO, 1, 0)>;
low-power-enable;
};
};
};

&spi0 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;

trackball: trackball@0 {
status = "okay";
compatible = "pixart,pmw3360";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

/* optional features */
// snipe-layers = <1>;
// scroll-layers = <2 3>;
// automouse-layer = <4>;
};
};
5 changes: 4 additions & 1 deletion config/dactyl_manuform_5x7.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=900
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
CONFIG_PMW3360=y
9 changes: 7 additions & 2 deletions config/west.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
url-base: https://github.com/petejohanson
- name: trackball-driver
url-base: https://github.com/bigtree908
projects:
- name: zmk
remote: zmkfirmware
revision: main
revision: feat/pointers-move-scroll
import: app/west.yml
- name: pmw3360
remote: trackball-driver
revision: pmw3360
self:
path: config

0 comments on commit d4bfd14

Please sign in to comment.