]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iio: distance: add devantech us ranger srf04
authorAndreas Klinger <ak@it-klinger.de>
Tue, 31 Jan 2017 18:03:45 +0000 (19:03 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 4 Feb 2017 12:19:20 +0000 (12:19 +0000)
commitfeda2840040fcf87d826b0aec945a98222e656ba
treef595e7b7a67b53e1c69516ad8594540263f219e4
parent2fb5904d92d42c88432cb29f567654d28f9d6411
iio: distance: add devantech us ranger srf04

This patch adds support for the ultrasonic ranger srf04 of devantech.

This device is measuring the distance of objects in a range between 1 cm
and 3 meters and a theoretical resolution of 3 mm.

There are two GPIOs used:
  - trigger: set as output to the device when the measurement should start
  - echo: set by the device when the ultrasonic wave is sent out and reset
    when the echo is recognized; this needs to be an interrupt input

The time between setting and resetting the echo pin is the time the
waveform needed for one round trip. This time is recorded in the interrupt
handler.

The distance is calculated in the read function by using the ultrasonic
speed at 20 degrees celsius which is about 343 m/s.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
MAINTAINERS
drivers/iio/proximity/Kconfig
drivers/iio/proximity/Makefile
drivers/iio/proximity/srf04.c [new file with mode: 0644]