1# Copyright (c) 2023 Phytec Messtechnik GmbH
2# SPDX-License-Identifier: Apache-2.0
3
4description: OSRAM ams TMD2620 Proximity Sensor
5
6compatible: "ams,tmd2620"
7
8include: [sensor-device.yaml, i2c-device.yaml]
9
10properties:
11  int-gpios:
12    type: phandle-array
13    required: true
14    description: |
15      The interrupt pin of TMD2620 is open-drain, active low.
16      If connected directly the MCU, the pin should be configured
17      as pull-up, active low.
18
19  proximity-gain:
20    type: int
21    required: true
22    description: Proximity detection gain of the sensor
23    enum:
24      - 1
25      - 2
26      - 4
27      - 8
28
29  proximity-pulse-length:
30    type: int
31    required: true
32    description: IR led pulse length in ms
33    enum:
34      - 4
35      - 8
36      - 16
37      - 32
38
39  proximity-pulse-count:
40    type: int
41    required: true
42    description: count of IR led pulses (min. 1; max. 64)
43
44  proximity-high-threshold:
45    type: int
46    description: high threshold for interrupt. (min. 0; max. 255)
47
48  proximity-low-threshold:
49    type: int
50    description: low threshold for interrupt. (min. 0; max. 255)
51
52  proximity-led-drive-strength:
53    type: int
54    required: true
55    description: |
56      LED drive strength in multiples of 6mA (min. 0; max. 31)
57
58  proximity-interrupt-filter:
59    type: int
60    description: |
61      filters proximity interrupt. (min. 0; max. 15)
62
63      0-> every cycle fires an interrupt
64      1-> 1 consecutive proximity value out of threshold range fires an interrupt
65      2-> 2 consecutive proximity values out of threshold range fires an interrupt
66      ...
67
68  enable-wait-mode:
69    type: boolean
70    description: Enables wait mode
71
72  wait-time-factor:
73    type: int
74    description: |
75      time the sensor waits between proximity cycles. (min. 0; max 255).
76      given in multiples of 2.81 starting at 0 for 2.81ms wait time.
77
78  wait-long:
79    type: boolean
80    description: increases the wait time by a factor of x12
81