xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/iio/proximity/parallax-ping.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/iio/proximity/parallax-ping.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: Parallax PING))) and LaserPING range finder
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Andreas Klinger <ak@it-klinger.de>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyundescription: |
13*4882a593Smuzhiyun  Bit-banging driver using one GPIO:
14*4882a593Smuzhiyun  - ping-gpios is raised by the driver to start measurement
15*4882a593Smuzhiyun  - direction of ping-gpio is then switched into input with an interrupt
16*4882a593Smuzhiyun    for receiving distance value as PWM signal
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun  Specifications about the devices can be found at:
19*4882a593Smuzhiyun  http://parallax.com/sites/default/files/downloads/28041-LaserPING-2m-Rangefinder-Guide.pdf
20*4882a593Smuzhiyun  http://parallax.com/sites/default/files/downloads/28015-PING-Documentation-v1.6.pdf
21*4882a593Smuzhiyun
22*4882a593Smuzhiyunproperties:
23*4882a593Smuzhiyun  compatible:
24*4882a593Smuzhiyun    enum:
25*4882a593Smuzhiyun      - parallax,ping
26*4882a593Smuzhiyun      - parallax,laserping
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun  ping-gpios:
29*4882a593Smuzhiyun    description:
30*4882a593Smuzhiyun      Definition of the GPIO for the triggering and echo (output and input)
31*4882a593Smuzhiyun      This GPIO is set for about 5 us by the driver to tell the device it
32*4882a593Smuzhiyun      should initiate the measurement cycle. Afterwards the GPIO is switched
33*4882a593Smuzhiyun      to input direction with an interrupt. The device sets it and the
34*4882a593Smuzhiyun      length of the input signal corresponds to the measured distance.
35*4882a593Smuzhiyun      It needs to be an GPIO which is able to deliver an interrupt because
36*4882a593Smuzhiyun      the time between two interrupts is measured in the driver.
37*4882a593Smuzhiyun      See Documentation/devicetree/bindings/gpio/gpio.txt for information
38*4882a593Smuzhiyun      on how to specify a consumer gpio.
39*4882a593Smuzhiyun    maxItems: 1
40*4882a593Smuzhiyun
41*4882a593Smuzhiyunrequired:
42*4882a593Smuzhiyun  - compatible
43*4882a593Smuzhiyun  - ping-gpios
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunadditionalProperties: false
46*4882a593Smuzhiyun
47*4882a593Smuzhiyunexamples:
48*4882a593Smuzhiyun  - |
49*4882a593Smuzhiyun    #include <dt-bindings/gpio/gpio.h>
50*4882a593Smuzhiyun    proximity {
51*4882a593Smuzhiyun        compatible = "parallax,laserping";
52*4882a593Smuzhiyun        ping-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
53*4882a593Smuzhiyun    };
54