brintos

brintos / linux-shallow public Read only

0
0
Text · 4.8 KiB · 6f70b49 Raw
140 lines · plain
1.. SPDX-License-Identifier: GPL-2.0-only2 3=============4AD7380 driver5=============6 7ADC driver for Analog Devices Inc. AD7380 and similar devices. The module name8is ``ad7380``.9 10 11Supported devices12=================13 14The following chips are supported by this driver:15 16* `AD7380 <https://www.analog.com/en/products/ad7380.html>`_17* `AD7381 <https://www.analog.com/en/products/ad7381.html>`_18* `AD7383 <https://www.analog.com/en/products/ad7383.html>`_19* `AD7384 <https://www.analog.com/en/products/ad7384.html>`_20* `AD7386 <https://www.analog.com/en/products/ad7386.html>`_21* `AD7387 <https://www.analog.com/en/products/ad7387.html>`_22* `AD7388 <https://www.analog.com/en/products/ad7388.html>`_23* `AD7380-4 <https://www.analog.com/en/products/ad7380-4.html>`_24* `AD7381-4 <https://www.analog.com/en/products/ad7381-4.html>`_25* `AD7383-4 <https://www.analog.com/en/products/ad7383-4.html>`_26* `AD7384-4 <https://www.analog.com/en/products/ad7384-4.html>`_27* `AD7386-4 <https://www.analog.com/en/products/ad7386-4.html>`_28* `AD7387-4 <https://www.analog.com/en/products/ad7387-4.html>`_29* `AD7388-4 <https://www.analog.com/en/products/ad7388-4.html>`_30 31 32Supported features33==================34 35SPI wiring modes36----------------37 38ad738x ADCs can output data on several SDO lines (1/2/4). The driver currently39supports only 1 SDO line.40 41Reference voltage42-----------------43 44ad7380-445~~~~~~~~46 47ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be48declared in the device tree as ``refin-supply``.49 50All other devices from ad738x family51~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~52 53All other devices from ad738x support 2 possible reference voltage sources:54 55- Internal reference (2.5V)56- External reference (2.5V to 3.3V)57 58The source is determined by the device tree. If ``refio-supply`` is present,59then it is used as external reference, else the internal reference is used.60 61Oversampling and resolution boost62---------------------------------63 64This family supports 2 types of oversampling: normal average and rolling65average. Only normal average is supported by the driver, as rolling average can66be achieved by processing a captured data buffer. The following ratios are67available: 1 (oversampling disabled)/2/4/8/16/32.68 69When the on-chip oversampling function is enabled the performance of the ADC can70exceed the default resolution. To accommodate the performance boost achievable,71it is possible to enable an additional two bits of resolution. Because the72resolution boost feature can only be enabled when oversampling is enabled and73oversampling is not as useful without the resolution boost, the driver74automatically enables the resolution boost if and only if oversampling is75enabled.76 77Since the resolution boost feature causes 16-bit chips to now have 18-bit data78which means the storagebits has to change from 16 to 32 bits, we use the new79ext_scan_type feature to allow changing the scan_type at runtime. Unfortunately80libiio does not support it. So when enabling or disabling oversampling, user81must restart iiod using the following command:82 83.. code-block:: bash84 85	root:~# systemctl restart iiod86 87Channel selection and sequencer (single-end chips only)88-------------------------------------------------------89 90Single-ended chips of this family (ad7386/7/8(-4)) have a 2:1 multiplexer in91front of each ADC. They also include additional configuration registers that92allow for either manual selection or automatic switching (sequencer mode), of93the multiplexer inputs.94 95From an IIO point of view, all inputs are exported, i.e ad7386/7/896export 4 channels and ad7386-4/7-4/8-4 export 8 channels.97 98Inputs ``AinX0`` of multiplexers correspond to the first half of IIO channels (i.e990-1 or 0-3) and inputs ``AinX1`` correspond to second half (i.e 2-3 or 4-7).100Example for AD7386/7/8 (2 channels parts):101 102.. code-block::103 104	   IIO   | AD7386/7/8105	         |         +----------------------------106	         |         |     _____        ______107	         |         |    |     |      |      |108	voltage0 | AinA0 --|--->|     |      |      |109	         |         |    | mux |----->| ADCA |---110	voltage2 | AinA1 --|--->|     |      |      |111	         |         |    |_____|      |_____ |112	         |         |     _____        ______113	         |         |    |     |      |      |114	voltage1 | AinB0 --|--->|     |      |      |115	         |         |    | mux |----->| ADCB |---116	voltage3 | AinB1 --|--->|     |      |      |117	         |         |    |_____|      |______|118	         |         |119	         |         +----------------------------120 121 122When enabling sequencer mode, the effective sampling rate is divided by two.123 124Unimplemented features125----------------------126 127- 2/4 SDO lines128- Rolling average oversampling129- Power down mode130- CRC indication131- Alert132 133 134Device buffers135==============136 137This driver supports IIO triggered buffers.138 139See :doc:`iio_devbuf` for more information.140