|
1 | | -/* |
2 | | - * Copyright (c) 2020 ZMK Contributors |
3 | | - * |
4 | | - * SPDX-License-Identifier: MIT |
5 | | - */ |
6 | | - |
7 | 1 | #include "charybdis.dtsi" |
| 2 | +#include <input/processors.dtsi> |
| 3 | +#include <dt-bindings/zmk/input_transform.h> |
8 | 4 |
|
9 | 5 | &default_transform { |
10 | 6 | col-offset = <6>; |
|
55 | 51 | reg = <0>; |
56 | 52 | spi-max-frequency = <2000000>; |
57 | 53 | irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; |
58 | | - scroll-layers = <3>; |
59 | | - //snipe-layers = <2>; |
60 | | - // automouse-layer = <3>; |
| 54 | + cpi = <1000>; |
| 55 | + evt-type = <INPUT_EV_REL>; |
| 56 | + x-input-code = <INPUT_REL_X>; |
| 57 | + y-input-code = <INPUT_REL_Y>; |
| 58 | + |
| 59 | + force-awake; |
| 60 | + /* keep the sensor awake while ZMK activity state is ACTIVE, |
| 61 | + fallback to normal downshift mode after ZMK goes into IDLE / SLEEP mode. |
| 62 | + thus, the sensor would be a `wakeup-source` */ |
| 63 | + |
| 64 | + force-awake-4ms-mode; |
| 65 | + /* while force-awake is acitvated, enable this mode to force sampling per |
| 66 | + 4ms, where the default sampling rate is 8ms. */ |
| 67 | + /* NOTE: apply this mode if you need 250Hz with direct USB connection. */ |
61 | 68 | }; |
62 | 69 | }; |
63 | 70 |
|
64 | 71 | / { |
65 | | - trackball_listener { |
66 | | - compatible = "zmk,input-listener"; |
67 | | - device = <&trackball>; |
68 | | - }; |
69 | | -}; |
| 72 | + trackball_listener { |
| 73 | + compatible = "zmk,input-listener"; |
| 74 | + device = <&trackball>; |
70 | 75 |
|
71 | | -//RGB bus |
72 | | -//&pinctrl { |
73 | | -// spi3_default: spi3_default { |
74 | | -// group1 { |
75 | | -// psels = <NRF_PSEL(SPIM_MOSI, 0, 10)>; |
76 | | -// }; |
77 | | -// }; |
78 | | -// |
79 | | -// spi3_sleep: spi3_sleep { |
80 | | -// group1 { |
81 | | -// psels = <NRF_PSEL(SPIM_MOSI, 0, 10)>; |
82 | | -// low-power-enable; |
83 | | -// }; |
84 | | -// }; |
85 | | -//}; |
86 | | -// |
87 | | -//&spi3 { |
88 | | -// compatible = "nordic,nrf-spim"; |
89 | | -// status = "okay"; |
90 | | -// |
91 | | -// pinctrl-0 = <&spi3_default>; |
92 | | -// pinctrl-1 = <&spi3_sleep>; |
93 | | -// pinctrl-names = "default", "sleep"; |
94 | | -// |
95 | | -// led_strip: ws2812@0 { |
96 | | -// compatible = "worldsemi,ws2812-spi"; |
97 | | -// |
98 | | -// /* SPI */ |
99 | | -// reg = <0>; /* ignored, but necessary for SPI bindings */ |
100 | | -// spi-max-frequency = <4000000>; |
101 | | -// |
102 | | -// /* WS2812 */ |
103 | | -// chain-length = <27>; /* number of LEDs */ |
104 | | -// spi-one-frame = <0x70>; |
105 | | -// spi-zero-frame = <0x40>; |
106 | | -// color-mapping = <LED_COLOR_ID_GREEN |
107 | | -// LED_COLOR_ID_RED |
108 | | -// LED_COLOR_ID_BLUE>; |
109 | | -// }; |
110 | | -//}; |
111 | | -// |
| 76 | + scroller { |
| 77 | + layers = <3>; |
| 78 | + input-processors = < |
| 79 | + &zip_xy_to_scroll_mapper |
| 80 | + &zip_scroll_scaler 1 4 |
| 81 | + &zip_xy_transform INPUT_TRANSFORM_Y_INVERT |
| 82 | + >; |
| 83 | + }; |
| 84 | + }; |
| 85 | +}; |
0 commit comments