ad7380.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. .. SPDX-License-Identifier: GPL-2.0-only
  2. =============
  3. AD7380 driver
  4. =============
  5. ADC driver for Analog Devices Inc. AD7380 and similar devices. The module name
  6. is ``ad7380``.
  7. Supported devices
  8. =================
  9. The following chips are supported by this driver:
  10. * `AD7380 <https://www.analog.com/en/products/ad7380.html>`_
  11. * `AD7381 <https://www.analog.com/en/products/ad7381.html>`_
  12. * `AD7383 <https://www.analog.com/en/products/ad7383.html>`_
  13. * `AD7384 <https://www.analog.com/en/products/ad7384.html>`_
  14. * `AD7386 <https://www.analog.com/en/products/ad7386.html>`_
  15. * `AD7387 <https://www.analog.com/en/products/ad7387.html>`_
  16. * `AD7388 <https://www.analog.com/en/products/ad7388.html>`_
  17. * `AD7380-4 <https://www.analog.com/en/products/ad7380-4.html>`_
  18. * `AD7381-4 <https://www.analog.com/en/products/ad7381-4.html>`_
  19. * `AD7383-4 <https://www.analog.com/en/products/ad7383-4.html>`_
  20. * `AD7384-4 <https://www.analog.com/en/products/ad7384-4.html>`_
  21. * `AD7386-4 <https://www.analog.com/en/products/ad7386-4.html>`_
  22. * `AD7387-4 <https://www.analog.com/en/products/ad7387-4.html>`_
  23. * `AD7388-4 <https://www.analog.com/en/products/ad7388-4.html>`_
  24. Supported features
  25. ==================
  26. SPI wiring modes
  27. ----------------
  28. ad738x ADCs can output data on several SDO lines (1/2/4). The driver currently
  29. supports only 1 SDO line.
  30. Reference voltage
  31. -----------------
  32. ad7380-4
  33. ~~~~~~~~
  34. ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be
  35. declared in the device tree as ``refin-supply``.
  36. All other devices from ad738x family
  37. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. All other devices from ad738x support 2 possible reference voltage sources:
  39. - Internal reference (2.5V)
  40. - External reference (2.5V to 3.3V)
  41. The source is determined by the device tree. If ``refio-supply`` is present,
  42. then it is used as external reference, else the internal reference is used.
  43. Oversampling and resolution boost
  44. ---------------------------------
  45. This family supports 2 types of oversampling: normal average and rolling
  46. average. Only normal average is supported by the driver, as rolling average can
  47. be achieved by processing a captured data buffer. The following ratios are
  48. available: 1 (oversampling disabled)/2/4/8/16/32.
  49. When the on-chip oversampling function is enabled the performance of the ADC can
  50. exceed the default resolution. To accommodate the performance boost achievable,
  51. it is possible to enable an additional two bits of resolution. Because the
  52. resolution boost feature can only be enabled when oversampling is enabled and
  53. oversampling is not as useful without the resolution boost, the driver
  54. automatically enables the resolution boost if and only if oversampling is
  55. enabled.
  56. Since the resolution boost feature causes 16-bit chips to now have 18-bit data
  57. which means the storagebits has to change from 16 to 32 bits, we use the new
  58. ext_scan_type feature to allow changing the scan_type at runtime. Unfortunately
  59. libiio does not support it. So when enabling or disabling oversampling, user
  60. must restart iiod using the following command:
  61. .. code-block:: bash
  62. root:~# systemctl restart iiod
  63. Channel selection and sequencer (single-end chips only)
  64. -------------------------------------------------------
  65. Single-ended chips of this family (ad7386/7/8(-4)) have a 2:1 multiplexer in
  66. front of each ADC. They also include additional configuration registers that
  67. allow for either manual selection or automatic switching (sequencer mode), of
  68. the multiplexer inputs.
  69. From an IIO point of view, all inputs are exported, i.e ad7386/7/8
  70. export 4 channels and ad7386-4/7-4/8-4 export 8 channels.
  71. Inputs ``AinX0`` of multiplexers correspond to the first half of IIO channels (i.e
  72. 0-1 or 0-3) and inputs ``AinX1`` correspond to second half (i.e 2-3 or 4-7).
  73. Example for AD7386/7/8 (2 channels parts):
  74. .. code-block::
  75. IIO | AD7386/7/8
  76. | +----------------------------
  77. | | _____ ______
  78. | | | | | |
  79. voltage0 | AinA0 --|--->| | | |
  80. | | | mux |----->| ADCA |---
  81. voltage2 | AinA1 --|--->| | | |
  82. | | |_____| |_____ |
  83. | | _____ ______
  84. | | | | | |
  85. voltage1 | AinB0 --|--->| | | |
  86. | | | mux |----->| ADCB |---
  87. voltage3 | AinB1 --|--->| | | |
  88. | | |_____| |______|
  89. | |
  90. | +----------------------------
  91. When enabling sequencer mode, the effective sampling rate is divided by two.
  92. Unimplemented features
  93. ----------------------
  94. - 2/4 SDO lines
  95. - Rolling average oversampling
  96. - Power down mode
  97. - CRC indication
  98. - Alert
  99. Device buffers
  100. ==============
  101. This driver supports IIO triggered buffers.
  102. See :doc:`iio_devbuf` for more information.