Skip to content

Commit

Permalink
Attempt new PMW33xx driver configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
trentrand committed May 8, 2024
1 parent 833982f commit 04de794
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 45 deletions.
40 changes: 0 additions & 40 deletions boards/shields/dactyl_manuform_5x7/dactyl_manuform_5x7.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -30,44 +30,4 @@

diode-direction = "col2row";
};

trackballs {
compatible = "zmk,keymap-trackballs";
trackballs = <&trackball>;
label = "PMW33xx";
};
};

&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";
cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;

trackball: pmw33xx@0 {
compatible = "pixart,pmw33xx";
label = "PMW33xx";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
motswk-gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
cpi = <1000>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y

CONFIG_PMW33XX=y
CONFIG_PMW33XX_3360=y
CONFIG_PMW33XX_TRIGGER_GLOBAL_THREAD=y
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,48 @@
, <&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";

trackball: trackball@0 {
status = "okay";
compatible = "pixart,pmw33xx";
reg = <0>;
spi-max-frequency = <2000000>;
label = "TRACKBALL";
cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
cpi = <1000>;
motswk-gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};

/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;
};
};
17 changes: 12 additions & 5 deletions config/dactyl_manuform_5x7.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=900
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_USB_LOGGING=y
CONFIG_ZMK_USB=y
CONFIG_PMW33XX=y
CONFIG_PMW33XX_3360=y

CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
CONFIG_BT_PERIPHERAL_PREF_LATENCY=16
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

0 comments on commit 04de794

Please sign in to comment.