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