1*c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 2*c66ec88fSEmmanuel Vadot%YAML 1.2 3*c66ec88fSEmmanuel Vadot--- 4*c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/iio/proximity/devantech-srf04.yaml# 5*c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel Vadottitle: Devantech SRF04 and Maxbotix mb1000 ultrasonic 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 two GPIOs: 14*c66ec88fSEmmanuel Vadot - trigger-gpio is raised by the driver to start sending out an ultrasonic 15*c66ec88fSEmmanuel Vadot burst 16*c66ec88fSEmmanuel Vadot - echo-gpio is held high by the sensor after sending ultrasonic burst 17*c66ec88fSEmmanuel Vadot until it is received once again 18*c66ec88fSEmmanuel Vadot 19*c66ec88fSEmmanuel Vadot Specifications about the devices can be found at: 20*c66ec88fSEmmanuel Vadot https://www.robot-electronics.co.uk/htm/srf04tech.htm 21*c66ec88fSEmmanuel Vadot 22*c66ec88fSEmmanuel Vadot https://www.maxbotix.com/documents/LV-MaxSonar-EZ_Datasheet.pdf 23*c66ec88fSEmmanuel Vadot 24*c66ec88fSEmmanuel Vadotproperties: 25*c66ec88fSEmmanuel Vadot compatible: 26*c66ec88fSEmmanuel Vadot enum: 27*c66ec88fSEmmanuel Vadot - devantech,srf04 28*c66ec88fSEmmanuel Vadot - maxbotix,mb1000 29*c66ec88fSEmmanuel Vadot - maxbotix,mb1010 30*c66ec88fSEmmanuel Vadot - maxbotix,mb1020 31*c66ec88fSEmmanuel Vadot - maxbotix,mb1030 32*c66ec88fSEmmanuel Vadot - maxbotix,mb1040 33*c66ec88fSEmmanuel Vadot 34*c66ec88fSEmmanuel Vadot trig-gpios: 35*c66ec88fSEmmanuel Vadot description: 36*c66ec88fSEmmanuel Vadot Definition of the GPIO for the triggering (output) 37*c66ec88fSEmmanuel Vadot This GPIO is set for about 10 us by the driver to tell the device it 38*c66ec88fSEmmanuel Vadot should initiate the measurement cycle. 39*c66ec88fSEmmanuel Vadot See Documentation/devicetree/bindings/gpio/gpio.txt for information 40*c66ec88fSEmmanuel Vadot on how to specify a consumer gpio. 41*c66ec88fSEmmanuel Vadot maxItems: 1 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel Vadot echo-gpios: 44*c66ec88fSEmmanuel Vadot description: 45*c66ec88fSEmmanuel Vadot Definition of the GPIO for the echo (input) 46*c66ec88fSEmmanuel Vadot This GPIO is set by the device as soon as an ultrasonic burst is sent 47*c66ec88fSEmmanuel Vadot out and reset when the first echo is received. 48*c66ec88fSEmmanuel Vadot Thus this GPIO is set while the ultrasonic waves are doing one round 49*c66ec88fSEmmanuel Vadot trip. 50*c66ec88fSEmmanuel Vadot It needs to be an GPIO which is able to deliver an interrupt because 51*c66ec88fSEmmanuel Vadot the time between two interrupts is measured in the driver. 52*c66ec88fSEmmanuel Vadot maxItems: 1 53*c66ec88fSEmmanuel Vadot 54*c66ec88fSEmmanuel Vadot power-gpios: 55*c66ec88fSEmmanuel Vadot description: 56*c66ec88fSEmmanuel Vadot Definition of the GPIO for power management of connected peripheral 57*c66ec88fSEmmanuel Vadot (output). 58*c66ec88fSEmmanuel Vadot This GPIO can be used by the external hardware for power management. 59*c66ec88fSEmmanuel Vadot When the device gets suspended it's switched off and when it resumes 60*c66ec88fSEmmanuel Vadot it's switched on again. After some period of inactivity the driver 61*c66ec88fSEmmanuel Vadot get suspended automatically (autosuspend feature). 62*c66ec88fSEmmanuel Vadot maxItems: 1 63*c66ec88fSEmmanuel Vadot 64*c66ec88fSEmmanuel Vadot startup-time-ms: 65*c66ec88fSEmmanuel Vadot description: 66*c66ec88fSEmmanuel Vadot This is the startup time the device needs after a resume to be up and 67*c66ec88fSEmmanuel Vadot running. 68*c66ec88fSEmmanuel Vadot minimum: 0 69*c66ec88fSEmmanuel Vadot maximum: 1000 70*c66ec88fSEmmanuel Vadot default: 100 71*c66ec88fSEmmanuel Vadot 72*c66ec88fSEmmanuel Vadotrequired: 73*c66ec88fSEmmanuel Vadot - compatible 74*c66ec88fSEmmanuel Vadot - trig-gpios 75*c66ec88fSEmmanuel Vadot - echo-gpios 76*c66ec88fSEmmanuel Vadot 77*c66ec88fSEmmanuel VadotadditionalProperties: false 78*c66ec88fSEmmanuel Vadot 79*c66ec88fSEmmanuel Vadotexamples: 80*c66ec88fSEmmanuel Vadot - | 81*c66ec88fSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 82*c66ec88fSEmmanuel Vadot proximity { 83*c66ec88fSEmmanuel Vadot compatible = "devantech,srf04"; 84*c66ec88fSEmmanuel Vadot trig-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; 85*c66ec88fSEmmanuel Vadot echo-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; 86*c66ec88fSEmmanuel Vadot }; 87