devantech-srf04.yaml 2.5 KB

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