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