152f171abSAndreas Klinger# SPDX-License-Identifier: GPL-2.0
252f171abSAndreas Klinger%YAML 1.2
352f171abSAndreas Klinger---
452f171abSAndreas Klinger$id: http://devicetree.org/schemas/iio/proximity/devantech-srf04.yaml#
552f171abSAndreas Klinger$schema: http://devicetree.org/meta-schemas/core.yaml#
652f171abSAndreas Klinger
7d6edf95aSAndreas Klingertitle: Devantech SRF04 and Maxbotix mb1000 ultrasonic range finder
852f171abSAndreas Klinger
952f171abSAndreas Klingermaintainers:
1052f171abSAndreas Klinger  - Andreas Klinger <ak@it-klinger.de>
1152f171abSAndreas Klinger
1252f171abSAndreas Klingerdescription: |
1352f171abSAndreas Klinger  Bit-banging driver using two GPIOs:
1452f171abSAndreas Klinger  - trigger-gpio is raised by the driver to start sending out an ultrasonic
1552f171abSAndreas Klinger    burst
1652f171abSAndreas Klinger  - echo-gpio is held high by the sensor after sending ultrasonic burst
1752f171abSAndreas Klinger    until it is received once again
1852f171abSAndreas Klinger
19d6edf95aSAndreas Klinger  Specifications about the devices can be found at:
205a6b56deSAlexander A. Klimov  https://www.robot-electronics.co.uk/htm/srf04tech.htm
2152f171abSAndreas Klinger
225a6b56deSAlexander A. Klimov  https://www.maxbotix.com/documents/LV-MaxSonar-EZ_Datasheet.pdf
23d6edf95aSAndreas Klinger
2452f171abSAndreas Klingerproperties:
2552f171abSAndreas Klinger  compatible:
26d6edf95aSAndreas Klinger    enum:
27d6edf95aSAndreas Klinger      - devantech,srf04
28d6edf95aSAndreas Klinger      - maxbotix,mb1000
29d6edf95aSAndreas Klinger      - maxbotix,mb1010
30d6edf95aSAndreas Klinger      - maxbotix,mb1020
31d6edf95aSAndreas Klinger      - maxbotix,mb1030
32d6edf95aSAndreas Klinger      - maxbotix,mb1040
3352f171abSAndreas Klinger
3452f171abSAndreas Klinger  trig-gpios:
3552f171abSAndreas Klinger    description:
36d6edf95aSAndreas Klinger      Definition of the GPIO for the triggering (output)
37d6edf95aSAndreas Klinger      This GPIO is set for about 10 us by the driver to tell the device it
38d6edf95aSAndreas Klinger      should initiate the measurement cycle.
39d6edf95aSAndreas Klinger      See Documentation/devicetree/bindings/gpio/gpio.txt for information
40d6edf95aSAndreas Klinger      on how to specify a consumer gpio.
4152f171abSAndreas Klinger    maxItems: 1
4252f171abSAndreas Klinger
4352f171abSAndreas Klinger  echo-gpios:
4452f171abSAndreas Klinger    description:
4552f171abSAndreas Klinger      Definition of the GPIO for the echo (input)
4652f171abSAndreas Klinger      This GPIO is set by the device as soon as an ultrasonic burst is sent
4752f171abSAndreas Klinger      out and reset when the first echo is received.
4852f171abSAndreas Klinger      Thus this GPIO is set while the ultrasonic waves are doing one round
4952f171abSAndreas Klinger      trip.
5052f171abSAndreas Klinger      It needs to be an GPIO which is able to deliver an interrupt because
5152f171abSAndreas Klinger      the time between two interrupts is measured in the driver.
5252f171abSAndreas Klinger    maxItems: 1
5352f171abSAndreas Klinger
5466053d5dSAndreas Klinger  power-gpios:
5566053d5dSAndreas Klinger    description:
5666053d5dSAndreas Klinger      Definition of the GPIO for power management of connected peripheral
5766053d5dSAndreas Klinger      (output).
5866053d5dSAndreas Klinger      This GPIO can be used by the external hardware for power management.
5966053d5dSAndreas Klinger      When the device gets suspended it's switched off and when it resumes
6066053d5dSAndreas Klinger      it's switched on again. After some period of inactivity the driver
6166053d5dSAndreas Klinger      get suspended automatically (autosuspend feature).
6266053d5dSAndreas Klinger    maxItems: 1
6366053d5dSAndreas Klinger
6466053d5dSAndreas Klinger  startup-time-ms:
6566053d5dSAndreas Klinger    description:
6666053d5dSAndreas Klinger      This is the startup time the device needs after a resume to be up and
6766053d5dSAndreas Klinger      running.
6866053d5dSAndreas Klinger    minimum: 0
6966053d5dSAndreas Klinger    maximum: 1000
7066053d5dSAndreas Klinger    default: 100
7166053d5dSAndreas Klinger
7252f171abSAndreas Klingerrequired:
7352f171abSAndreas Klinger  - compatible
7452f171abSAndreas Klinger  - trig-gpios
7552f171abSAndreas Klinger  - echo-gpios
7652f171abSAndreas Klinger
777f464532SRob HerringadditionalProperties: false
787f464532SRob Herring
7952f171abSAndreas Klingerexamples:
8052f171abSAndreas Klinger  - |
8152f171abSAndreas Klinger    #include <dt-bindings/gpio/gpio.h>
8252f171abSAndreas Klinger    proximity {
8352f171abSAndreas Klinger        compatible = "devantech,srf04";
8452f171abSAndreas Klinger        trig-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
8552f171abSAndreas Klinger        echo-gpios = <&gpio2  6 GPIO_ACTIVE_HIGH>;
8652f171abSAndreas Klinger    };
87