Skip to content

Commit c3b2fdd

Browse files
it-klingerjic23
authored andcommitted
iio: adc: hx711: Add IIO driver for AVIA HX711
This is the IIO driver for AVIA HX711 ADC which is mostly used in weighting cells. The protocol is quite simple and using GPIOs: One GPIO is used as clock (SCK) while another GPIO is read (DOUT) The raw value read from the chip is delivered. To get a weight one needs to subtract the zero offset and scale it. Signed-off-by: Andreas Klinger <ak@it-klinger.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent ff1293f commit c3b2fdd

File tree

3 files changed

+552
-0
lines changed

3 files changed

+552
-0
lines changed

drivers/iio/adc/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,25 @@ config HI8435
247247
This driver can also be built as a module. If so, the module will be
248248
called hi8435.
249249

250+
config HX711
251+
tristate "AVIA HX711 ADC for weight cells"
252+
depends on GPIOLIB
253+
help
254+
If you say yes here you get support for AVIA HX711 ADC which is used
255+
for weigh cells
256+
257+
This driver uses two GPIOs, one acts as the clock and controls the
258+
channel selection and gain, the other one is used for the measurement
259+
data
260+
261+
Currently the raw value is read from the chip and delivered.
262+
To get an actual weight one needs to subtract the
263+
zero offset and multiply by a scale factor.
264+
This should be done in userspace.
265+
266+
This driver can also be built as a module. If so, the module will be
267+
called hx711.
268+
250269
config INA2XX_ADC
251270
tristate "Texas Instruments INA2xx Power Monitors IIO driver"
252271
depends on I2C && !SENSORS_INA2XX

drivers/iio/adc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ obj-$(CONFIG_ENVELOPE_DETECTOR) += envelope-detector.o
2525
obj-$(CONFIG_EXYNOS_ADC) += exynos_adc.o
2626
obj-$(CONFIG_FSL_MX25_ADC) += fsl-imx25-gcq.o
2727
obj-$(CONFIG_HI8435) += hi8435.o
28+
obj-$(CONFIG_HX711) += hx711.o
2829
obj-$(CONFIG_IMX7D_ADC) += imx7d_adc.o
2930
obj-$(CONFIG_INA2XX_ADC) += ina2xx-adc.o
3031
obj-$(CONFIG_LP8788_ADC) += lp8788_adc.o

0 commit comments

Comments
 (0)