1# Copyright (c) 2020 arithmetics.io
2# SPDX-License-Identifier: Apache-2.0
3
4description: Texas Instruments FDC2X1X capacitive sensor
5
6compatible: "ti,fdc2x1x"
7
8include: [sensor-device.yaml, i2c-device.yaml]
9
10properties:
11  sd-gpios:
12    type: phandle-array
13    description: |
14      The SD pin defaults to active high when consumed by the sensor.
15      The property value should ensure the flags properly describe
16      the signal that is presented to the driver.
17
18  intb-gpios:
19    type: phandle-array
20    description: |
21      The INTB pin defaults to active low when produced by the sensor.
22      The property value should ensure the flags properly describe
23      the signal that is presented to the driver.
24
25  fdc2x14:
26    type: boolean
27    description: |
28      Set to identify the sensor as FDC2114 or FDC2214 (4-channel version)
29
30  autoscan:
31    type: boolean
32    description: |
33      Set the Auto-Scan Mode.
34
35      false = Continuous conversion on the single channel selected by
36      "active-channel" (single channel mode).
37
38      true = Auto-Scan conversions as selected by "rr-sequence"
39      (multichannel mode).
40
41  fref:
42    type: int
43    required: true
44    description: |
45      Reference frequency of the used clock source in KHz.
46      The internal clock oscillates at around 43360 KHz (43.36 MHz)
47      at 20 degrees Celsius.
48      Recommended external clock source frequency is 40000 KHz (40 MHz).
49
50  rr-sequence:
51    type: int
52    default: 0
53    description: |
54      Auto-Scan Sequence Configuration.
55      The FDC will perform a single conversion on each channel
56      in the sequence selected, and then restart the sequence continuously.
57
58      The sensor performs conversion on Channel 0 to 1 by default after
59      power-on-reset. This setting only applies if autoscan=true
60      (multichannel mode).
61
62      0 = Ch0, Ch1
63      1 = Ch0, Ch1, Ch2 (FDC2114, FDC2214 only)
64      2 = Ch0, Ch1, Ch2, Ch3 (FDC2114, FDC2214 only)
65    enum:
66      - 0
67      - 1
68      - 2
69
70  active-channel:
71    type: int
72    default: 0
73    description: |
74      Selects channel for continuous conversions.
75
76      The sensor performs continuous conversion on Channel 0 by default after
77      power-on-reset. This setting only applies if autoscan=false
78      (single channel mode).
79
80      0 = Perform continuous conversions on Channel 0
81      1 = Perform continuous conversions on Channel 1
82      2 = Perform continuous conversions on Channel 2 (FDC2114, FDC2214 only)
83      3 = Perform continuous conversions on Channel 3 (FDC2114, FDC2214 only)
84    enum:
85      - 0
86      - 1
87      - 2
88      - 3
89
90  deglitch:
91    type: int
92    required: true
93    description: |
94      Input deglitch filter bandwidth. Select the lowest setting that exceeds
95      the oscillation tank oscillation frequency.
96
97      1 = 1MHz
98      4 = 3.3MHz
99      5 = 10MHz
100      7 = 33MHz
101    enum:
102      - 1
103      - 4
104      - 5
105      - 7
106
107  sensor-activate-sel:
108    type: string
109    default: "low-power"
110    description: |
111      Sensor Activation Mode Selection.
112
113      The sensor uses low-power activation mode by default after
114      power-on-reset.
115
116      full-current = the FDC will drive maximum
117      sensor current for a shorter sensor activation time.
118
119      low-power = the FDC uses the value programmed by "idrive" during
120      sensor activation to minimize power consumption.
121    enum:
122      - "full-current"
123      - "low-power"
124
125  ref-clk-src:
126    type: string
127    default: "internal"
128    description: |
129      Select Reference Frequency Source.
130
131      The sensor uses the internal clock by default after power-on-reset.
132
133      internal = Use Internal oscillator as reference frequency
134      external = Reference frequency is provided from CLKIN pin.
135    enum:
136      - "internal"
137      - "external"
138
139  current-drive:
140    type: string
141    default: "normal"
142    description: |
143      Select Current Sensor Drive.
144
145      The sensor uses normal current drive by default after power-on-reset.
146      High current drive is not supported if autoscan=false and will default
147      to normal.
148
149      normal = The FDC will drive all channels with normal sensor current
150      (1.5mA max).
151
152      high = The FDC will drive channel 0 with current >1.5mA.
153    enum:
154      - "normal"
155      - "high"
156
157  output-gain:
158    type: int
159    default: 0
160    description: |
161      Output gain control (FDC2112, FDC2114 only)
162
163      The default output gain is 0 after power-on-reset.
164
165      0 = Gain = 1   | Effective Resolution 12 bits | 100% full scale
166      1 = Gain = 4   | Effective Resolution 14 bits | 25% full scale
167      2 = Gain = 8   | Effective Resolution 15 bits | 12.5% full scale
168      3 = Gain = 16  | Effective Resolution 16 bits | 6.25% full scale
169    enum:
170      - 0
171      - 1
172      - 2
173      - 3
174
175child-binding:
176  description: |
177    Settings for each channel 0-1 (FDC2112 and FDC2212) or
178    0-3 (FDC2114 and FDC2214)
179
180  properties:
181    rcount:
182      type: int
183      required: true
184      description: |
185        Channel X Reference Count Conversion Interval Time.
186        Valid range: 256 - 65535
187
188    offset:
189      type: int
190      default: 0
191      description: |
192        Channel X Conversion Offset (FDC2112 and FDC2212 only).
193        The default offset value after power-on-reset is 0.
194        Valid range: 0 - 65535
195
196    settlecount:
197      type: int
198      required: true
199      description: |
200        Channel X Conversion Settling.
201
202        The FDC will use this settling time to allow the LC sensor to
203        stabilize before initiation of a conversion on Channel X.
204        Valid range: 0 - 65535
205
206    fref-divider:
207      type: int
208      required: true
209      description: |
210        Channel X Reference Divider.
211
212        Sets the divider for Channel X reference.
213        Use this to scale the maximum conversion frequency.
214        Valid range: 1 - 1023
215
216    idrive:
217      type: int
218      required: true
219      description: |
220        Channel X Sensor drive current.
221
222        This field defines the Drive Current used during the settling +
223        conversion time of Channel X sensor clock.
224        Valid range: 0 - 31
225
226    fin-sel:
227      type: int
228      required: true
229      description: |
230        Channel X Sensor frequency select.
231
232        For differential sensor configuration:
233        1 = divide by 1. Choose for sensor frequencies between
234        0.01MHz and 8.75MHz
235        2 = divide by 2. Choose for sensor frequencies between 5MHz
236        and 10MHz
237
238        For single-ended sensor configuration:
239        2 = divide by 2. Choose for sensor frequencies between
240        0.01MHz and 10MHz
241      enum:
242        - 1 # Divide by 1
243        - 2 # Divide by 2
244
245    inductance:
246      type: int
247      required: true
248      description: |
249        Inductor value used on the PCB for the sensing network of the
250        specific channel, which is usually 18uH.
251