Skip to content

Commit

Permalink
add trackball support
Browse files Browse the repository at this point in the history
  • Loading branch information
tokyo2006 committed Sep 18, 2024
1 parent d98d5fc commit d9c316a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
---
include:
- board: nice_nano_v2
shield: cygnus_central_dongle dongle_display
shield: cygnus_central_dongle
artifact-name: cygnus_central_dongle
- board: nice_nano_v2
shield: cygnus_central_left
Expand Down
78 changes: 42 additions & 36 deletions config/boards/shields/cygnus/cygnus_central_dongle.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,48 @@
};
};

/* the default oled is 0.96 inch if you use 1.3 inch oled with 1106 drive you should use this definition */
&pro_micro_i2c {
status = "okay";
oled: sh1106@3c {
compatible = "sinowealth,sh1106";
reg = <0x3c>;
width = <129>;
height = <64>;
segment-offset = <1>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
segment-remap;
com-invdir;
inversion-on;
prechargep = <0x22>;
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
<NRF_PSEL(SPIM_MISO, 0, 11)>;
};
};
};

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

/*
* &pro_micro_i2c {
* status = "okay";
* oled: ssd1306@3c {
* compatible = "solomon,ssd1306fb";
* reg = <0x3c>;
* width = <128>;
* height = <64>;
* segment-offset = <0>;
* page-offset = <0>;
* display-offset = <0>;
* multiplex-ratio = <63>;
* segment-remap;
* com-invdir;
* inversion-on;
* prechargep = <0x22>;
* };
* };
*/
&spi0 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;

trackball: trackball@0 {
status = "okay";
compatible = "pixart,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
automouse-layer = <4>;
scroll-layers = <5>;
};
};

/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;

};
};
6 changes: 4 additions & 2 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ manifest:
url-base: https://github.com/petejohanson
- name: inorichi
url-base: https://github.com/inorichi
- name: kumamuk-git
url-base: https://github.com/kumamuk-git
projects:
- name: zmk
remote: zmkfirmware
revision: feat/pointers-move-scroll
import: app/west.yml
- name: zmk-pmw3610-driver
remote: inorichi
revision: main
remote: kumamuk-git
revision: change_cpi
self:
path: config

0 comments on commit d9c316a

Please sign in to comment.