Skip to content

Commit

Permalink
Update charybdis_right.overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
stylustrader authored Dec 31, 2024
1 parent 4de1821 commit 2ed457e
Showing 1 changed file with 13 additions and 42 deletions.
55 changes: 13 additions & 42 deletions config/boards/shields/charybdis/charybdis_right.overlay
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/*
* Copyright (c) 2020 ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "charybdis.dtsi"
#include "charybdis_pmw3610.dtsi" // Add this line
#include "charybdis_pmw3610.dtsi"

// The matrix transform is 6 columns over because the left half is 6 columns wide.
&default_transform {
col-offset = <6>;
};
Expand All @@ -16,6 +11,8 @@
};

&kscan0 {
compatible = "zmk,kscan-gpio-matrix";

col-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
Expand All @@ -24,53 +21,27 @@
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

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

spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 17)>;
low-power-enable;
};
};
row-gpios
= <&pro_micro 18 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 9 GPIO_ACTIVE_HIGH>
;
};

&trackball {
&spi0 {
status = "okay";
};

&spi0 {
&trackball {
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,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
scroll-layers = <4>;
};
};

// https://github.com/badjeff/zmk-pmw3610-driver
/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;

};
};

0 comments on commit 2ed457e

Please sign in to comment.