Skip to content

Commit

Permalink
Specify proper devicetree for latest PMW3360 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
trentrand committed Jun 3, 2024
1 parent bb27ca4 commit 87205f8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
CONFIG_PMW3360=y
CONFIG_PMW3360_LOG_LEVEL_DBG=y
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_PMW3610=y
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,60 @@

&kscan0 {
row-gpios
= <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
= <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>,
<&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

col-gpios
= <&gpio0 29 GPIO_ACTIVE_HIGH>
, <&gpio0 2 GPIO_ACTIVE_HIGH>
, <&gpio1 15 GPIO_ACTIVE_HIGH>
, <&gpio1 13 GPIO_ACTIVE_HIGH>
, <&gpio1 11 GPIO_ACTIVE_HIGH>
, <&gpio0 10 GPIO_ACTIVE_HIGH>
, <&gpio0 9 GPIO_ACTIVE_HIGH>
;
= <&gpio0 29 GPIO_ACTIVE_HIGH>,
<&gpio0 2 GPIO_ACTIVE_HIGH>,
<&gpio1 15 GPIO_ACTIVE_HIGH>,
<&gpio1 13 GPIO_ACTIVE_HIGH>,
<&gpio1 11 GPIO_ACTIVE_HIGH>,
<&gpio0 10 GPIO_ACTIVE_HIGH>,
<&gpio0 9 GPIO_ACTIVE_HIGH>;
};

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

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

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

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

/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;
device = <&pmw3610>;
};
};
1 change: 0 additions & 1 deletion boards/shields/dactyl_manuform_5x7/mouse.dtsi
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
#define ZMK_MOUSE_DEFAULT_SCRL_VAL 20 // 10
3 changes: 0 additions & 3 deletions config/dactyl_manuform_5x7.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ CONFIG_BT_BUF_ACL_TX_COUNT=32
CONFIG_BT_L2CAP_TX_BUF_COUNT=32

CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y
CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512

CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=2000

CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_PM=y
6 changes: 3 additions & 3 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ manifest:
- name: pmw3360-driver
url-base: https://github.com/trentrand
projects:
- name: zmk-pmw3360-driver
remote: pmw3360-driver
revision: main
- name: zmk
remote: zmkfirmware
revision: feat/pointers-move-scroll
import: app/west.yml
- name: zmk-pmw3360-driver
remote: pmw3360-driver
revision: main
self:
path: config

0 comments on commit 87205f8

Please sign in to comment.