xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/avia-hx711.yaml (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2*c66ec88fSEmmanuel Vadot%YAML 1.2
3*c66ec88fSEmmanuel Vadot---
4*c66ec88fSEmmanuel Vadot$id: "http://devicetree.org/schemas/iio/adc/avia-hx711.yaml#"
5*c66ec88fSEmmanuel Vadot$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel Vadottitle: AVIA HX711 ADC chip for weight cells
8*c66ec88fSEmmanuel Vadot
9*c66ec88fSEmmanuel Vadotmaintainers:
10*c66ec88fSEmmanuel Vadot  - Andreas Klinger <ak@it-klinger.de>
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel Vadotdescription: |
13*c66ec88fSEmmanuel Vadot  Bit-banging driver using two GPIOs:
14*c66ec88fSEmmanuel Vadot  - sck-gpio gives a clock to the sensor with 24 cycles for data retrieval
15*c66ec88fSEmmanuel Vadot    and up to 3 cycles for selection of the input channel and gain for the
16*c66ec88fSEmmanuel Vadot    next measurement
17*c66ec88fSEmmanuel Vadot  - dout-gpio is the sensor data the sensor responds to the clock
18*c66ec88fSEmmanuel Vadot
19*c66ec88fSEmmanuel Vadot  Specifications about the driver can be found at:
20*c66ec88fSEmmanuel Vadot  http://www.aviaic.com/ENProducts.aspx
21*c66ec88fSEmmanuel Vadot
22*c66ec88fSEmmanuel Vadotproperties:
23*c66ec88fSEmmanuel Vadot  compatible:
24*c66ec88fSEmmanuel Vadot    enum:
25*c66ec88fSEmmanuel Vadot      - avia,hx711
26*c66ec88fSEmmanuel Vadot
27*c66ec88fSEmmanuel Vadot  sck-gpios:
28*c66ec88fSEmmanuel Vadot    description:
29*c66ec88fSEmmanuel Vadot      Definition of the GPIO for the clock (output). In the datasheet it is
30*c66ec88fSEmmanuel Vadot      named PD_SCK
31*c66ec88fSEmmanuel Vadot    maxItems: 1
32*c66ec88fSEmmanuel Vadot
33*c66ec88fSEmmanuel Vadot  dout-gpios:
34*c66ec88fSEmmanuel Vadot    description:
35*c66ec88fSEmmanuel Vadot      Definition of the GPIO for the data-out sent by the sensor in
36*c66ec88fSEmmanuel Vadot      response to the clock (input).
37*c66ec88fSEmmanuel Vadot      See Documentation/devicetree/bindings/gpio/gpio.txt for information
38*c66ec88fSEmmanuel Vadot      on how to specify a consumer gpio.
39*c66ec88fSEmmanuel Vadot    maxItems: 1
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel Vadot  avdd-supply:
42*c66ec88fSEmmanuel Vadot    description:
43*c66ec88fSEmmanuel Vadot      Definition of the regulator used as analog supply
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel Vadot  clock-frequency:
46*c66ec88fSEmmanuel Vadot    minimum: 20000
47*c66ec88fSEmmanuel Vadot    maximum: 2500000
48*c66ec88fSEmmanuel Vadot    default: 400000
49*c66ec88fSEmmanuel Vadot
50*c66ec88fSEmmanuel Vadotrequired:
51*c66ec88fSEmmanuel Vadot  - compatible
52*c66ec88fSEmmanuel Vadot  - sck-gpios
53*c66ec88fSEmmanuel Vadot  - dout-gpios
54*c66ec88fSEmmanuel Vadot  - avdd-supply
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel VadotadditionalProperties: false
57*c66ec88fSEmmanuel Vadot
58*c66ec88fSEmmanuel Vadotexamples:
59*c66ec88fSEmmanuel Vadot  - |
60*c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
61*c66ec88fSEmmanuel Vadot    weight {
62*c66ec88fSEmmanuel Vadot        compatible = "avia,hx711";
63*c66ec88fSEmmanuel Vadot        sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>;
64*c66ec88fSEmmanuel Vadot        dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
65*c66ec88fSEmmanuel Vadot        avdd-supply = <&avdd>;
66*c66ec88fSEmmanuel Vadot        clock-frequency = <100000>;
67*c66ec88fSEmmanuel Vadot    };
68