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:iio-adc:ad7192 [08 Feb 2019 14:25] – [Device tree support] Mircea Caprioruresources:tools-software:linux-drivers:iio-adc:ad7192 [08 Feb 2019 14:51] (current) – [Device tree support] Mircea Caprioru
Line 133: Line 133:
 </code> </code>
  
 +====== Device tree support ======
 +Device tree is the new method for describing non-discoverable hardware in Linux. This replaces former structure based method. For configuring a device using this drivers please follow the example bellow: 
 +
 +<code>
 +/dts-v1/;
 +/plugin/;
 +
 +/ {
 +
 + fragment@0 {
 + target-path = "/";
 + dvdd: fixedregulator@0 {
 + compatible = "regulator-fixed";
 + regulator-name = "fixed-supply";
 + regulator-min-microvolt = <3300000>;
 + regulator-max-microvolt = <3300000>;
 + regulator-boot-on;
 + };
 + };
 +
 + fragment@1 {
 + target-path = "/";
 + avdd: fixedregulator@1 {
 + compatible = "regulator-fixed";
 + regulator-name = "fixed-supply2";
 + regulator-min-microvolt = <3300000>;
 + regulator-max-microvolt = <3300000>;
 + regulator-boot-on;
 + };
 + };
 +
 + fragment@3 {
 + target = <&spi0>;
 + #address-cells = <1>;
 + #size-cells = <0>;
 + status = "okay";
 +
 + ad7190@0 {
 + compatible = "adi,ad7190";
 + reg = <0>;
 + spi-max-frequency = <1000000>;
 + spi-cpol;
 + spi-cpha;
 + #interrupt-cells = <2>;
 + interrupts = <25 0x2>;
 + interrupt-parent = <&gpio>;
 + dvdd-supply = <&dvdd>;
 + avdd-supply = <&avdd>;
 +
 + adi,reference-voltage-mv = /bits/ 16  <3300>;
 + adi,clock-source-select = [02];
 + adi,refin2-pins-enable;
 + adi,rejection-60-Hz-enable;
 + adi,chop-enable;
 + adi,buffer-enable;
 + adi,burnout-currents-enable;
 + adi,sinc3-filter-enable;
 + adi,unipolar-enable;
 + };
 + };
 +};
 +</code>
 +
 +<note important> Interrupt pin connection - interrupts = <25 0x2>; this line means that gpio pin 25 is used for the interrupt and it must be connect to the DOUT/RDY pin of AD7192 along with the SPI MISO.  
 + </note>
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
  
resources/tools-software/linux-drivers/iio-adc/ad7192.1549632316.txt.gz · Last modified: 08 Feb 2019 14:25 by Mircea Caprioru