18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/iio/proximity/parallax-ping.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Parallax PING))) and LaserPING range finder
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Andreas Klinger <ak@it-klinger.de>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |
138c2ecf20Sopenharmony_ci  Bit-banging driver using one GPIO:
148c2ecf20Sopenharmony_ci  - ping-gpios is raised by the driver to start measurement
158c2ecf20Sopenharmony_ci  - direction of ping-gpio is then switched into input with an interrupt
168c2ecf20Sopenharmony_ci    for receiving distance value as PWM signal
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci  Specifications about the devices can be found at:
198c2ecf20Sopenharmony_ci  http://parallax.com/sites/default/files/downloads/28041-LaserPING-2m-Rangefinder-Guide.pdf
208c2ecf20Sopenharmony_ci  http://parallax.com/sites/default/files/downloads/28015-PING-Documentation-v1.6.pdf
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciproperties:
238c2ecf20Sopenharmony_ci  compatible:
248c2ecf20Sopenharmony_ci    enum:
258c2ecf20Sopenharmony_ci      - parallax,ping
268c2ecf20Sopenharmony_ci      - parallax,laserping
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci  ping-gpios:
298c2ecf20Sopenharmony_ci    description:
308c2ecf20Sopenharmony_ci      Definition of the GPIO for the triggering and echo (output and input)
318c2ecf20Sopenharmony_ci      This GPIO is set for about 5 us by the driver to tell the device it
328c2ecf20Sopenharmony_ci      should initiate the measurement cycle. Afterwards the GPIO is switched
338c2ecf20Sopenharmony_ci      to input direction with an interrupt. The device sets it and the
348c2ecf20Sopenharmony_ci      length of the input signal corresponds to the measured distance.
358c2ecf20Sopenharmony_ci      It needs to be an GPIO which is able to deliver an interrupt because
368c2ecf20Sopenharmony_ci      the time between two interrupts is measured in the driver.
378c2ecf20Sopenharmony_ci      See Documentation/devicetree/bindings/gpio/gpio.txt for information
388c2ecf20Sopenharmony_ci      on how to specify a consumer gpio.
398c2ecf20Sopenharmony_ci    maxItems: 1
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cirequired:
428c2ecf20Sopenharmony_ci  - compatible
438c2ecf20Sopenharmony_ci  - ping-gpios
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciadditionalProperties: false
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciexamples:
488c2ecf20Sopenharmony_ci  - |
498c2ecf20Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
508c2ecf20Sopenharmony_ci    proximity {
518c2ecf20Sopenharmony_ci        compatible = "parallax,laserping";
528c2ecf20Sopenharmony_ci        ping-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
538c2ecf20Sopenharmony_ci    };
54