Skip to contentSkip to conversation

iio: ping: add parallax ping sensors

PATCH Applied Andreas Klinger 2 participants 2 messages Nov 18, 2019 – Nov 23, 2019

Subsystems (2)

v3 of 4 Applied Latest is v4 →

lore
Share & tools
lore

Andreas Klinger

author maintainer
#0 lore raw

PATCH v3 3/4 iio: ping: add parallax ping sensors

Add support for parallax ping and laser ping sensors with just one pin for trigger and echo signal.

This driver is based on srf04. In contrast to it it's necessary to change direction of the pin and to request the irq just for the period when the echo is rising and falling. Because this adds a lot of cases there is this individual driver for handling this type of sensors.

Add a new configuration variable CONFIG_PING to Kconfig and Makefile.

---
 drivers/iio/proximity/Kconfig  |  15 ++
 drivers/iio/proximity/Makefile |   1 +
 drivers/iio/proximity/ping.c   | 333 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 349 insertions(+)
 create mode 100644 drivers/iio/proximity/ping.c
drivers/iio/proximity/Kconfig +15 -0
index d53601447da4..37606d400805 100644
@@ -58,6 +58,21 @@ config MB1232
 	  To compile this driver as a module, choose M here: the
 	  module will be called mb1232.
 
+config PING
+	tristate "Parallax GPIO bitbanged ranger sensors"
+	depends on GPIOLIB
+	help
+	  Say Y here to build a driver for GPIO bitbanged ranger sensors
+	  with just one GPIO for the trigger and echo. This driver can be
+	  used to measure the distance of objects.
+
+	  Actually supported are:
+	  - Parallax PING))) (ultrasonic)
+	  - Parallax LaserPING (time-of-flight)
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ping.
+
 config RFD77402
 	tristate "RFD77402 ToF sensor"
 	depends on I2C
drivers/iio/proximity/Makefile +1 -0
index 0bb5f9de13d6..c591b019304e 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_AS3935)		+= as3935.o
 obj-$(CONFIG_ISL29501)		+= isl29501.o
 obj-$(CONFIG_LIDAR_LITE_V2)	+= pulsedlight-lidar-lite-v2.o
 obj-$(CONFIG_MB1232)		+= mb1232.o
+obj-$(CONFIG_PING)		+= ping.o
 obj-$(CONFIG_RFD77402)		+= rfd77402.o
 obj-$(CONFIG_SRF04)		+= srf04.o
 obj-$(CONFIG_SRF08)		+= srf08.o
drivers/iio/proximity/ping.c new file +333 -0

333 lines not on this page · raw message

Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 11 lines · On Mon, 18 Nov 2019 08:36:30 +0100 Andreas Klinger <[email protected]> wrote:

Add support for parallax ping and laser ping sensors with just one pin for trigger and echo signal.

This driver is based on srf04. In contrast to it it's necessary to change direction of the pin and to request the irq just for the period when the echo is rising and falling. Because this adds a lot of cases there is this individual driver for handling this type of sensors.

Add a new configuration variable CONFIG_PING to Kconfig and Makefile.

Applied,

Thanks,

Jonathan