162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 262306a36Sopenharmony_ci%YAML 1.2 362306a36Sopenharmony_ci--- 462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/iio/proximity/parallax-ping.yaml# 562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml# 662306a36Sopenharmony_ci 762306a36Sopenharmony_cititle: Parallax PING))) and LaserPING range finder 862306a36Sopenharmony_ci 962306a36Sopenharmony_cimaintainers: 1062306a36Sopenharmony_ci - Andreas Klinger <ak@it-klinger.de> 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_cidescription: | 1362306a36Sopenharmony_ci Bit-banging driver using one GPIO: 1462306a36Sopenharmony_ci - ping-gpios is raised by the driver to start measurement 1562306a36Sopenharmony_ci - direction of ping-gpio is then switched into input with an interrupt 1662306a36Sopenharmony_ci for receiving distance value as PWM signal 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci Specifications about the devices can be found at: 1962306a36Sopenharmony_ci http://parallax.com/sites/default/files/downloads/28041-LaserPING-2m-Rangefinder-Guide.pdf 2062306a36Sopenharmony_ci http://parallax.com/sites/default/files/downloads/28015-PING-Documentation-v1.6.pdf 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ciproperties: 2362306a36Sopenharmony_ci compatible: 2462306a36Sopenharmony_ci enum: 2562306a36Sopenharmony_ci - parallax,ping 2662306a36Sopenharmony_ci - parallax,laserping 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci ping-gpios: 2962306a36Sopenharmony_ci description: 3062306a36Sopenharmony_ci Definition of the GPIO for the triggering and echo (output and input) 3162306a36Sopenharmony_ci This GPIO is set for about 5 us by the driver to tell the device it 3262306a36Sopenharmony_ci should initiate the measurement cycle. Afterwards the GPIO is switched 3362306a36Sopenharmony_ci to input direction with an interrupt. The device sets it and the 3462306a36Sopenharmony_ci length of the input signal corresponds to the measured distance. 3562306a36Sopenharmony_ci It needs to be an GPIO which is able to deliver an interrupt because 3662306a36Sopenharmony_ci the time between two interrupts is measured in the driver. 3762306a36Sopenharmony_ci See Documentation/devicetree/bindings/gpio/gpio.txt for information 3862306a36Sopenharmony_ci on how to specify a consumer gpio. 3962306a36Sopenharmony_ci maxItems: 1 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_cirequired: 4262306a36Sopenharmony_ci - compatible 4362306a36Sopenharmony_ci - ping-gpios 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ciadditionalProperties: false 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ciexamples: 4862306a36Sopenharmony_ci - | 4962306a36Sopenharmony_ci #include <dt-bindings/gpio/gpio.h> 5062306a36Sopenharmony_ci proximity { 5162306a36Sopenharmony_ci compatible = "parallax,laserping"; 5262306a36Sopenharmony_ci ping-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; 5362306a36Sopenharmony_ci }; 54