Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/accel/adi,adxl345.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
0008 
0009 maintainers:
0010   - Michael Hennerich <michael.hennerich@analog.com>
0011 
0012 description: |
0013   Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
0014   both I2C & SPI interfaces.
0015     https://www.analog.com/en/products/mems/accelerometers/adxl345.html
0016     https://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
0017 
0018 properties:
0019   compatible:
0020     oneOf:
0021       - items:
0022           - const: adi,adxl346
0023           - const: adi,adxl345
0024       - enum:
0025           - adi,adxl345
0026           - adi,adxl375
0027 
0028   reg:
0029     maxItems: 1
0030 
0031   spi-cpha: true
0032 
0033   spi-cpol: true
0034 
0035   spi-max-frequency: true
0036 
0037   interrupts:
0038     maxItems: 1
0039 
0040 required:
0041   - compatible
0042   - reg
0043   - interrupts
0044 
0045 additionalProperties: false
0046 
0047 examples:
0048   - |
0049     #include <dt-bindings/gpio/gpio.h>
0050     #include <dt-bindings/interrupt-controller/irq.h>
0051     i2c0 {
0052         #address-cells = <1>;
0053         #size-cells = <0>;
0054 
0055         /* Example for a I2C device node */
0056         accelerometer@2a {
0057             compatible = "adi,adxl345";
0058             reg = <0x2a>;
0059             interrupt-parent = <&gpio0>;
0060             interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
0061         };
0062     };
0063   - |
0064     #include <dt-bindings/gpio/gpio.h>
0065     #include <dt-bindings/interrupt-controller/irq.h>
0066     spi0 {
0067         #address-cells = <1>;
0068         #size-cells = <0>;
0069 
0070         /* Example for a SPI device node */
0071         accelerometer@0 {
0072             compatible = "adi,adxl345";
0073             reg = <0>;
0074             spi-max-frequency = <5000000>;
0075             spi-cpol;
0076             spi-cpha;
0077             interrupt-parent = <&gpio0>;
0078             interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
0079         };
0080     };