1# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  Zephyr input touch sensor parent node
6
7  This defines a group of touch sensors that can generate input events. Each touch
8  sensor is defined in a child node of the touch-sensor node and defines a specific key
9  code.
10
11  For example:
12
13  #include <zephyr/dt-bindings/input/input-event-codes.h>
14  #include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
15
16  &touch {
17         compatible = "espressif,esp32-touch";
18         status = "okay";
19
20         debounce-interval-ms = <30>;
21         href-microvolt = <27000000>;
22         lref-microvolt = <500000>;
23         href-atten-microvolt = <1000000>;
24         filter-mode = <ESP32_TOUCH_FILTER_MODE_IIR_16>;
25         filter-debounce-cnt = <1>;
26         filter-noise-thr = <ESP32_TOUCH_FILTER_NOISE_THR_4_8TH>;
27         filter-jitter-step = <4>;
28         filter-smooth-level = <ESP32_TOUCH_FILTER_SMOOTH_MODE_IIR_2>;
29
30         touch_sensor_0 {
31                 channel_num = <1>;
32                 channel_sens = <20>;
33                 zephyr,code = <INPUT_KEY_0>;
34         };
35  };
36
37
38compatible: "espressif,esp32-touch"
39
40include: base.yaml
41
42properties:
43  debounce-interval-ms:
44    type: int
45    default: 30
46    description: Debouncing interval time in milliseconds.
47
48  href-microvolt:
49    type: int
50    enum:
51      - 2400000
52      - 2500000
53      - 2500000
54      - 2700000
55    default: 2700000
56    description: Touch sensor high reference voltage.
57
58  lref-microvolt:
59    type: int
60    enum:
61      - 500000
62      - 600000
63      - 700000
64      - 800000
65    default: 500000
66    description: Touch sensor low reference voltage.
67
68  href-atten-microvolt:
69    type: int
70    enum:
71      - 1500000
72      - 1000000
73      - 500000
74      - 0
75    default: 1000000
76    description: Touch sensor high reference attenuation voltage.
77
78  filter-mode:
79    type: int
80    default: 2
81    description: |
82       Touch sensor IIR filter coefficient.
83       If not specified defaults to ESP32_TOUCH_FILTER_MODE_IIR_16.
84
85  filter-debounce-cnt:
86    type: int
87    default: 1
88    description: |
89       Touch sensor debounce count.
90       If not specified defaults to 1.
91
92  filter-noise-thr:
93    type: int
94    default: 0
95    description: |
96       Touch sensor noise threshold coefficient.
97       If not specified defaults to ESP32_TOUCH_FILTER_NOISE_THR_4_8TH.
98
99  filter-jitter-step:
100    type: int
101    default: 4
102    description: |
103       Touch sensor jitter filter step size.
104       If not specified defaults to 4.
105
106  filter-smooth-level:
107    type: int
108    default: 1
109    description: |
110       Touch sensor level of filter applied on the original data against large noise interference.
111       If not specified defaults to ESP32_TOUCH_FILTER_SMOOTH_MODE_IIR_2.
112
113child-binding:
114  description: Touch sensor child node
115  properties:
116    channel-num:
117      type: int
118      required: true
119      description: Touch sensor channel number
120
121    channel-sens:
122      type: int
123      default: 20
124      description: |
125         Touch sensor channel sensibility in 100th.
126         If not specified defaults to 20.
127
128    zephyr,code:
129      type: int
130      required: true
131      description: Key code to emit.
132