162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/iio/proximity/devantech-srf04.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Devantech SRF04 and Maxbotix mb1000 ultrasonic range finder
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Andreas Klinger <ak@it-klinger.de>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cidescription: |
1362306a36Sopenharmony_ci  Bit-banging driver using two GPIOs:
1462306a36Sopenharmony_ci  - trigger-gpio is raised by the driver to start sending out an ultrasonic
1562306a36Sopenharmony_ci    burst
1662306a36Sopenharmony_ci  - echo-gpio is held high by the sensor after sending ultrasonic burst
1762306a36Sopenharmony_ci    until it is received once again
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci  Specifications about the devices can be found at:
2062306a36Sopenharmony_ci  https://www.robot-electronics.co.uk/htm/srf04tech.htm
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci  https://www.maxbotix.com/documents/LV-MaxSonar-EZ_Datasheet.pdf
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciproperties:
2562306a36Sopenharmony_ci  compatible:
2662306a36Sopenharmony_ci    enum:
2762306a36Sopenharmony_ci      - devantech,srf04
2862306a36Sopenharmony_ci      - maxbotix,mb1000
2962306a36Sopenharmony_ci      - maxbotix,mb1010
3062306a36Sopenharmony_ci      - maxbotix,mb1020
3162306a36Sopenharmony_ci      - maxbotix,mb1030
3262306a36Sopenharmony_ci      - maxbotix,mb1040
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci  trig-gpios:
3562306a36Sopenharmony_ci    description:
3662306a36Sopenharmony_ci      Definition of the GPIO for the triggering (output)
3762306a36Sopenharmony_ci      This GPIO is set for about 10 us by the driver to tell the device it
3862306a36Sopenharmony_ci      should initiate the measurement cycle.
3962306a36Sopenharmony_ci      See Documentation/devicetree/bindings/gpio/gpio.txt for information
4062306a36Sopenharmony_ci      on how to specify a consumer gpio.
4162306a36Sopenharmony_ci    maxItems: 1
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci  echo-gpios:
4462306a36Sopenharmony_ci    description:
4562306a36Sopenharmony_ci      Definition of the GPIO for the echo (input)
4662306a36Sopenharmony_ci      This GPIO is set by the device as soon as an ultrasonic burst is sent
4762306a36Sopenharmony_ci      out and reset when the first echo is received.
4862306a36Sopenharmony_ci      Thus this GPIO is set while the ultrasonic waves are doing one round
4962306a36Sopenharmony_ci      trip.
5062306a36Sopenharmony_ci      It needs to be an GPIO which is able to deliver an interrupt because
5162306a36Sopenharmony_ci      the time between two interrupts is measured in the driver.
5262306a36Sopenharmony_ci    maxItems: 1
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci  power-gpios:
5562306a36Sopenharmony_ci    description:
5662306a36Sopenharmony_ci      Definition of the GPIO for power management of connected peripheral
5762306a36Sopenharmony_ci      (output).
5862306a36Sopenharmony_ci      This GPIO can be used by the external hardware for power management.
5962306a36Sopenharmony_ci      When the device gets suspended it's switched off and when it resumes
6062306a36Sopenharmony_ci      it's switched on again. After some period of inactivity the driver
6162306a36Sopenharmony_ci      get suspended automatically (autosuspend feature).
6262306a36Sopenharmony_ci    maxItems: 1
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci  startup-time-ms:
6562306a36Sopenharmony_ci    description:
6662306a36Sopenharmony_ci      This is the startup time the device needs after a resume to be up and
6762306a36Sopenharmony_ci      running.
6862306a36Sopenharmony_ci    minimum: 0
6962306a36Sopenharmony_ci    maximum: 1000
7062306a36Sopenharmony_ci    default: 100
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_cirequired:
7362306a36Sopenharmony_ci  - compatible
7462306a36Sopenharmony_ci  - trig-gpios
7562306a36Sopenharmony_ci  - echo-gpios
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ciadditionalProperties: false
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ciexamples:
8062306a36Sopenharmony_ci  - |
8162306a36Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
8262306a36Sopenharmony_ci    proximity {
8362306a36Sopenharmony_ci        compatible = "devantech,srf04";
8462306a36Sopenharmony_ci        trig-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
8562306a36Sopenharmony_ci        echo-gpios = <&gpio2  6 GPIO_ACTIVE_HIGH>;
8662306a36Sopenharmony_ci    };
87