Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:input-misc:adxl345 [16 Jan 2013 16:09] – [Example platform device initialization] Michael Hennerichresources:tools-software:linux-drivers:input-misc:adxl345 [07 Sep 2018 08:41] (current) – [Description] add adx375 link to ADI product page Alexandru Ardelean
Line 5: Line 5:
   * [[adi>ADXL345]]   * [[adi>ADXL345]]
   * [[adi>ADXL346]]   * [[adi>ADXL346]]
 +  * [[adi>ADXL375]]
  
  
Line 13: Line 14:
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
-  * [[adi>EVAL-ADXL345Z]]  +  * [[adi>EVAL-ADXL313-Z-M]] 
-  * [[adi>EVAL-ADXL346Z]] +  * [[adi>EVAL-ADXL345Z-DB]] 
 +  * [[adi>EVAL-ADXL346Z-DB]] 
 +  * [[adi>EVAL-ADXL375]]
  
 ===== Description ===== ===== Description =====
Line 30: Line 33:
 [[adi>en/mems-and-sensors/imems-accelerometers/adxl345/products/product.html|ADXL345]] - Small, Ultra Low Power, 3-Axis, ±2/4/8/16g Digital Accelerometer \\ [[adi>en/mems-and-sensors/imems-accelerometers/adxl345/products/product.html|ADXL345]] - Small, Ultra Low Power, 3-Axis, ±2/4/8/16g Digital Accelerometer \\
 [[adi>en/mems-and-sensors/imems-accelerometers/adxl346/products/product.html|ADXL346]] - Ultra Low Power, Three-Axis, +-2/4/8/16g Digital Accelerometer \\ [[adi>en/mems-and-sensors/imems-accelerometers/adxl346/products/product.html|ADXL346]] - Ultra Low Power, Three-Axis, +-2/4/8/16g Digital Accelerometer \\
 +[[adi>en/mems-and-sensors/imems-accelerometers/adxl375/products/product.html|ADXL375]] - Low Power, Three-Axis, +-200g Digital Accelerometer \\
 +
  
 {{youtube>8o_b2DO3d3E?large |iMEMS® Motion Sensors featuring the ADXL345}} {{youtube>8o_b2DO3d3E?large |iMEMS® Motion Sensors featuring the ADXL345}}
Line 96: Line 101:
 ===== Status ===== ===== Status =====
  
- Source   Mainlined?  +^ Source ^ Mainlined? ^ 
-| [[git.linux.org>drivers/input/misc/adxl34x.c|git]] |  [[git.linux.org>drivers/input/misc/adxl34x.c|Yes]]  |+| [[git.linux.org>drivers/input/misc/adxl34x.c|git]] | [[git.linux.org>drivers/input/misc/adxl34x.c|Yes]] |
  
  
Line 627: Line 632:
 </code> </code>
  
 +===== Devicetree =====
 +
 +Required devicetree properties:
 +  * compatible: Needs to be "adi," followed by the name of the device. E.g. "adi,adxl34x"
 +  * reg: The chipselect number used for the device
 +  * spi-max-frequency: Maximum SPI clock frequency
 +  * spi-cpha: Needs to be set for the correct SPI mode
 +  * spi-cpol: Needs to be set for the correct SPI mode
 +  * interrupt-parent: Specifies which IRQ controller is used
 +  * interrupts: The interrupt associated with the INT2 pin
 +
 +<code>
 +       axi_spi_1: spi@42040000 {
 +               #address-cells = <1>;
 +               #size-cells = <0>;
 +               compatible = "xlnx,axi-spi-1.02.a", "xlnx,xps-spi-2.00.a";
 +               ...
 +               
 +               adxl345@0 {
 +                       compatible = "adi,adxl34x";
 +                       reg = <0>;
 +                       spi-max-frequency = <1000000>;
 +                       spi-cpha;
 +                       spi-cpol;
 +                       interrupt-parent = <&gic>;
 +                       interrupts = < 0 32 4 >;
 +               };
 +        };
 +</code>
  
 ===== Example Platform / Board file (I2C Interface Option) ===== ===== Example Platform / Board file (I2C Interface Option) =====
Line 659: Line 693:
 arch_initcall(board_init); arch_initcall(board_init);
 </code> </code>
 +
 +===== Devicetree =====
 +
 +Required devicetree properties:
 +  * compatible: Needs to be "adi," followed by the name of the device. E.g. "adi,adxl34x"
 +  * reg: The slave address of the device
 +  * interrupt-parent: Specifies which IRQ controller is used
 +  * interrupts: The interrupt associated with the INT2 pin
 +
 +<code>
 +       axi_iic_1: i2c@41640000 {
 +               #address-cells = <1>;
 +               #size-cells = <0>;
 +               compatible = "xlnx,axi-iic-1.02.a", "xlnx,xps-iic-2.00.a";
 +               ...
 +               
 +               adxl345@0 {
 +                       compatible = "adi,adxl34x";
 +                       reg = <0x53>;
 +                       interrupt-parent = <&gic>;
 +                       interrupts = < 0 32 4 >;
 +               };
 +        };
 +</code>
 +
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
  
Line 765: Line 824:
 </xterm> </xterm>
  
-===== Use the event_test utility to test proper function =====+===== Use the evtest utility to test proper function =====
  
 <code> <code>
-root:/> event_test /dev/input/event1+root:/> evtest /dev/input/event1
 Input driver version is 1.0.0 Input driver version is 1.0.0
 Input device ID: bus 0x18 vendor 0x0 product 0x159 version 0x0 Input device ID: bus 0x18 vendor 0x0 product 0x159 version 0x0
resources/tools-software/linux-drivers/input-misc/adxl345.1358348948.txt.gz · Last modified: 16 Jan 2013 16:09 by Michael Hennerich