1# Copyright (c) 2020 Richard Osterloh
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5    VCNL4040 proximity and ambient light sensor.  See datasheet at
6    https://www.vishay.com/docs/84274/vcnl4040.pdf
7
8compatible: "vishay,vcnl4040"
9
10include: [sensor-device.yaml, i2c-device.yaml]
11
12properties:
13  int-gpios:
14    type: phandle-array
15    description: |
16      The INT pin signals that a programmable interrupt function
17      for ALS and PS with upper and lower thresholds has been
18      triggered. The sensor generates an active-low level signal
19      which remains asserted until the data is read.
20
21  led-current:
22    type: int
23    default: 50
24    # default of 50 mA is POR (0b000) for PS_MS[LED_I] register
25    description: LED current in mA
26    enum:
27      - 50
28      - 75
29      - 100
30      - 120
31      - 140
32      - 160
33      - 180
34      - 200
35
36  led-duty-cycle:
37    type: int
38    default: 40
39    # default of 40 Hz is POR (0b00) for PS_CONF1[PS_Duty] register
40    description: LED duty cycle in Hz
41    enum:
42      - 40
43      - 80
44      - 160
45      - 320
46
47  proximity-it:
48    type: string
49    default: "1"
50    # default of 1 is POR (0b000) for PS_CONF2[PS_IT] register
51    description: Proximity integration time in T
52    enum:
53      - "1"
54      - "1.5"
55      - "2"
56      - "2.5"
57      - "3"
58      - "3.5"
59      - "4"
60      - "8"
61
62  proximity-trigger:
63    type: string
64    default: "disabled"
65    # default of "disabled" is POR (0b00) for PS_CONF2[PS_INT] register
66    description: Proximity trigger type
67    enum:
68      - "disabled"
69      - "close"
70      - "away"
71      - "close-away"
72
73  als-it:
74    type: int
75    default: 80
76    # default of 80 is POR (0b00) for ALS_CONF[ALS_IT] register
77    description: ALS integration time in ms
78    enum:
79      - 80
80      - 160
81      - 320
82      - 640
83