18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci%YAML 1.2 38c2ecf20Sopenharmony_ci--- 48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/iio/proximity/devantech-srf04.yaml# 58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml# 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_cititle: Devantech SRF04 and Maxbotix mb1000 ultrasonic range finder 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cimaintainers: 108c2ecf20Sopenharmony_ci - Andreas Klinger <ak@it-klinger.de> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_cidescription: | 138c2ecf20Sopenharmony_ci Bit-banging driver using two GPIOs: 148c2ecf20Sopenharmony_ci - trigger-gpio is raised by the driver to start sending out an ultrasonic 158c2ecf20Sopenharmony_ci burst 168c2ecf20Sopenharmony_ci - echo-gpio is held high by the sensor after sending ultrasonic burst 178c2ecf20Sopenharmony_ci until it is received once again 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci Specifications about the devices can be found at: 208c2ecf20Sopenharmony_ci https://www.robot-electronics.co.uk/htm/srf04tech.htm 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci https://www.maxbotix.com/documents/LV-MaxSonar-EZ_Datasheet.pdf 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ciproperties: 258c2ecf20Sopenharmony_ci compatible: 268c2ecf20Sopenharmony_ci enum: 278c2ecf20Sopenharmony_ci - devantech,srf04 288c2ecf20Sopenharmony_ci - maxbotix,mb1000 298c2ecf20Sopenharmony_ci - maxbotix,mb1010 308c2ecf20Sopenharmony_ci - maxbotix,mb1020 318c2ecf20Sopenharmony_ci - maxbotix,mb1030 328c2ecf20Sopenharmony_ci - maxbotix,mb1040 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci trig-gpios: 358c2ecf20Sopenharmony_ci description: 368c2ecf20Sopenharmony_ci Definition of the GPIO for the triggering (output) 378c2ecf20Sopenharmony_ci This GPIO is set for about 10 us by the driver to tell the device it 388c2ecf20Sopenharmony_ci should initiate the measurement cycle. 398c2ecf20Sopenharmony_ci See Documentation/devicetree/bindings/gpio/gpio.txt for information 408c2ecf20Sopenharmony_ci on how to specify a consumer gpio. 418c2ecf20Sopenharmony_ci maxItems: 1 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci echo-gpios: 448c2ecf20Sopenharmony_ci description: 458c2ecf20Sopenharmony_ci Definition of the GPIO for the echo (input) 468c2ecf20Sopenharmony_ci This GPIO is set by the device as soon as an ultrasonic burst is sent 478c2ecf20Sopenharmony_ci out and reset when the first echo is received. 488c2ecf20Sopenharmony_ci Thus this GPIO is set while the ultrasonic waves are doing one round 498c2ecf20Sopenharmony_ci trip. 508c2ecf20Sopenharmony_ci It needs to be an GPIO which is able to deliver an interrupt because 518c2ecf20Sopenharmony_ci the time between two interrupts is measured in the driver. 528c2ecf20Sopenharmony_ci maxItems: 1 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci power-gpios: 558c2ecf20Sopenharmony_ci description: 568c2ecf20Sopenharmony_ci Definition of the GPIO for power management of connected peripheral 578c2ecf20Sopenharmony_ci (output). 588c2ecf20Sopenharmony_ci This GPIO can be used by the external hardware for power management. 598c2ecf20Sopenharmony_ci When the device gets suspended it's switched off and when it resumes 608c2ecf20Sopenharmony_ci it's switched on again. After some period of inactivity the driver 618c2ecf20Sopenharmony_ci get suspended automatically (autosuspend feature). 628c2ecf20Sopenharmony_ci maxItems: 1 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci startup-time-ms: 658c2ecf20Sopenharmony_ci description: 668c2ecf20Sopenharmony_ci This is the startup time the device needs after a resume to be up and 678c2ecf20Sopenharmony_ci running. 688c2ecf20Sopenharmony_ci minimum: 0 698c2ecf20Sopenharmony_ci maximum: 1000 708c2ecf20Sopenharmony_ci default: 100 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_cirequired: 738c2ecf20Sopenharmony_ci - compatible 748c2ecf20Sopenharmony_ci - trig-gpios 758c2ecf20Sopenharmony_ci - echo-gpios 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ciadditionalProperties: false 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ciexamples: 808c2ecf20Sopenharmony_ci - | 818c2ecf20Sopenharmony_ci #include <dt-bindings/gpio/gpio.h> 828c2ecf20Sopenharmony_ci proximity { 838c2ecf20Sopenharmony_ci compatible = "devantech,srf04"; 848c2ecf20Sopenharmony_ci trig-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; 858c2ecf20Sopenharmony_ci echo-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; 868c2ecf20Sopenharmony_ci }; 87