flake-update-20260505
 1/*
 2 * Copyright (c) 2020 ZMK Contributors
 3 *
 4 * SPDX-License-Identifier: MIT
 5 */
 6
 7#include <input/processors.dtsi>
 8#include "keyball44.dtsi"
 9
10/* Disable I2C0/OLED on right side — SPI0 (trackball) shares the same hw peripheral */
11&i2c0 {
12    status = "disabled";
13};
14
15/ {
16    chosen {
17        /delete-property/ zephyr,display;
18    };
19};
20
21&default_transform {
22    col-offset = <6>;
23};
24
25&kscan0 {
26	col-gpios
27		= <&pro_micro 4 GPIO_ACTIVE_HIGH>
28		, <&pro_micro 5 GPIO_ACTIVE_HIGH>
29		, <&pro_micro 6 GPIO_ACTIVE_HIGH>
30		, <&pro_micro 7 GPIO_ACTIVE_HIGH>
31		, <&pro_micro 8 GPIO_ACTIVE_HIGH>
32        , <&pro_micro 9 GPIO_ACTIVE_HIGH>
33		;
34};
35
36&pinctrl {
37    spi0_default: spi0_default {
38        group1 {
39            psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
40                <NRF_PSEL(SPIM_MOSI, 0, 10)>,
41                <NRF_PSEL(SPIM_MISO, 1, 11)>;
42        };
43    };
44
45    spi0_sleep: spi0_sleep {
46        group1 {
47            psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
48                <NRF_PSEL(SPIM_MOSI, 0, 10)>,
49                <NRF_PSEL(SPIM_MISO, 1, 11)>;
50            low-power-enable;
51        };
52    };
53};
54
55&spi0 {
56    status = "okay";
57    compatible = "nordic,nrf-spim";
58    pinctrl-0 = <&spi0_default>;
59    pinctrl-1 = <&spi0_sleep>;
60    pinctrl-names = "default", "sleep";
61    cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
62
63    trackball: trackball@0 {
64        status = "okay";
65        compatible = "pixart,pmw3360";
66        reg = <0>;
67        spi-max-frequency = <2000000>;
68        irq-gpios = <&gpio0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
69    };
70};
71
72/ {
73  trackball_listener {
74    compatible = "zmk,input-listener";
75    device = <&trackball>;
76
77    /* Auto-activate mouse layer (layer 7) on trackball movement.
78     * Layer deactivates 1000ms after last movement. */
79    input-processors = <&zip_temp_layer 7 1000>;
80  };
81};