|
7 | 7 |
|
8 | 8 | /dts-v1/; |
9 | 9 | #include <nordic/nrf52832_qfaa.dtsi> |
| 10 | +#include <dt-bindings/input/input-event-codes.h> |
10 | 11 | #include "nrf52dk_nrf52832-pinctrl.dtsi" |
11 | 12 |
|
12 | 13 | / { |
|
22 | 23 | zephyr,sram = &sram0; |
23 | 24 | zephyr,flash = &flash0; |
24 | 25 | zephyr,code-partition = &slot0_partition; |
| 26 | + zephyr,keyboard-scan = &kscan_adapter; |
| 27 | + }; |
| 28 | + |
| 29 | + kscan_adapter: kscan-adapter { |
| 30 | + compatible = "zephyr,kscan-adapter"; |
| 31 | + input = <&ft5336>; |
| 32 | + }; |
| 33 | + |
| 34 | + abs-to-rel { |
| 35 | + compatible = "zephyr,input-abs-to-rel"; |
| 36 | + input = <&qdec>; |
| 37 | + }; |
| 38 | + |
| 39 | + longpress { |
| 40 | + compatible = "zephyr,input-longpress"; |
| 41 | + input = <&buttons>; |
| 42 | + input-code = <INPUT_KEY_3>; |
| 43 | + short-code = <INPUT_KEY_A>; |
| 44 | + long-codes = <INPUT_KEY_B>, <INPUT_KEY_C>, <INPUT_KEY_D>; |
| 45 | + long-delays-ms = <500>, <1000>, <2000>; |
25 | 46 | }; |
26 | 47 |
|
27 | 48 | leds { |
|
51 | 72 | }; |
52 | 73 | }; |
53 | 74 |
|
54 | | - buttons { |
55 | | - compatible = "gpio-keys"; |
| 75 | + buttons: buttons { |
| 76 | + compatible = "zephyr,gpio-keys"; |
56 | 77 | button0: button_0 { |
57 | 78 | gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; |
58 | 79 | label = "Push button switch 0"; |
| 80 | + zephyr,code = <INPUT_KEY_0>; |
59 | 81 | }; |
60 | 82 | button1: button_1 { |
61 | 83 | gpios = <&gpio0 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; |
62 | 84 | label = "Push button switch 1"; |
| 85 | + zephyr,code = <INPUT_KEY_1>; |
63 | 86 | }; |
64 | 87 | button2: button_2 { |
65 | 88 | gpios = <&gpio0 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; |
66 | 89 | label = "Push button switch 2"; |
| 90 | + zephyr,code = <INPUT_KEY_2>; |
67 | 91 | }; |
68 | 92 | button3: button_3 { |
69 | 93 | gpios = <&gpio0 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; |
70 | 94 | label = "Push button switch 3"; |
| 95 | + zephyr,code = <INPUT_KEY_3>; |
71 | 96 | }; |
72 | 97 | }; |
73 | 98 |
|
|
128 | 153 | watchdog0 = &wdt0; |
129 | 154 | }; |
130 | 155 | }; |
| 156 | +&pinctrl { |
| 157 | + qdec_default: qdec_default { |
| 158 | + group1 { |
| 159 | + psels = <NRF_PSEL(QDEC_A, 0, 29)>, |
| 160 | + <NRF_PSEL(QDEC_B, 0, 31)>; |
| 161 | + }; |
| 162 | + }; |
| 163 | + |
| 164 | + qdec_sleep: qdec_sleep { |
| 165 | + group1 { |
| 166 | + psels = <NRF_PSEL(QDEC_A, 0, 29)>, |
| 167 | + <NRF_PSEL(QDEC_B, 0, 31)>; |
| 168 | + low-power-enable; |
| 169 | + }; |
| 170 | + }; |
| 171 | +}; |
| 172 | + |
| 173 | +&qdec { |
| 174 | + status = "okay"; |
| 175 | + led-pre = <0>; |
| 176 | + steps = <360>; |
| 177 | + pinctrl-0 = <&qdec_default>; |
| 178 | + pinctrl-1 = <&qdec_sleep>; |
| 179 | + pinctrl-names = "default", "sleep"; |
| 180 | +}; |
131 | 181 |
|
132 | 182 | &adc { |
133 | 183 | status = "okay"; |
@@ -156,6 +206,12 @@ arduino_i2c: &i2c0 { |
156 | 206 | pinctrl-0 = <&i2c0_default>; |
157 | 207 | pinctrl-1 = <&i2c0_sleep>; |
158 | 208 | pinctrl-names = "default", "sleep"; |
| 209 | + |
| 210 | + ft5336: ft5336@38 { |
| 211 | + compatible = "focaltech,ft5336"; |
| 212 | + reg = <0x38>; |
| 213 | + int-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; |
| 214 | + }; |
159 | 215 | }; |
160 | 216 |
|
161 | 217 | &i2c1 { |
|
0 commit comments