diff --git a/adi/__init__.py b/adi/__init__.py index cf128653f..28fc3f9f0 100644 --- a/adi/__init__.py +++ b/adi/__init__.py @@ -63,12 +63,28 @@ from adi.ad9152 import ad9152 +from adi.ad9250 import ad9250 + +from adi.ad9265 import ad9265 + +from adi.ad9434 import ad9434 + +from adi.ad9467 import ad9467 + +from adi.ad9625 import ad9625 + +from adi.ada4961 import ada4961 + from adi.cn0532 import cn0532 from adi.daq2 import DAQ2 from adi.daq3 import DAQ3 +from adi.fmcadc3 import fmcadc3 + +from adi.fmcjesdadc1 import fmcjesdadc1 + from adi.adis16460 import adis16460 from adi.adis16495 import adis16495 diff --git a/adi/ad9250.py b/adi/ad9250.py new file mode 100644 index 000000000..091fdf679 --- /dev/null +++ b/adi/ad9250.py @@ -0,0 +1,68 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.context_manager import context_manager +from adi.jesd import jesd +from adi.rx_tx import rx + + +class ad9250(rx, context_manager): + + """ AD9250 High-Speed ADC """ + + _complex_data = False + _rx_channel_names = ["voltage0", "voltage1"] + _device_name = "" + + def __init__(self, uri="", username="root", password="analog"): + + context_manager.__init__(self, uri, self._device_name) + + self._rxadc = self._ctx.find_device("axi-ad9250-hpc") + self._jesd = jesd(uri, username=username, password=password) + + rx.__init__(self) + + @property + def test_mode(self): + """test_mode: Select Test Mode. Options are: + off midscale_short pos_fullscale neg_fullscale checkerboard pn_long pn_short one_zero_toggle user ramp""" + return self._get_iio_attr("voltage0", "test_mode", False) + + @test_mode.setter + def test_mode(self, value): + self._set_iio_attr("voltage0", "test_mode", False, value, self._rxadc) + + @property + def jesd204_statuses(self): + return self._jesd.get_all_statuses() diff --git a/adi/ad9265.py b/adi/ad9265.py new file mode 100644 index 000000000..46461b727 --- /dev/null +++ b/adi/ad9265.py @@ -0,0 +1,62 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.context_manager import context_manager +from adi.rx_tx import rx + + +class ad9265(rx, context_manager): + + """ AD9265 High-Speed ADC """ + + _complex_data = False + _rx_channel_names = ["voltage0"] + _device_name = "" + + def __init__(self, uri=""): + + context_manager.__init__(self, uri, self._device_name) + + self._rxadc = self._ctx.find_device("axi-ad9265-core-lpc") + + rx.__init__(self) + + @property + def test_mode(self): + """test_mode: Select Test Mode. Options are: + off midscale_short pos_fullscale neg_fullscale checkerboard pn_long pn_short one_zero_toggle user ramp""" + return self._get_iio_attr("voltage0", "test_mode", False) + + @test_mode.setter + def test_mode(self, value): + self._set_iio_attr("voltage0", "test_mode", False, value, self._rxadc) diff --git a/adi/ad9434.py b/adi/ad9434.py new file mode 100644 index 000000000..1921358f3 --- /dev/null +++ b/adi/ad9434.py @@ -0,0 +1,62 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.context_manager import context_manager +from adi.rx_tx import rx + + +class ad9434(rx, context_manager): + + """ AD9434 High-Speed ADC """ + + _complex_data = False + _rx_channel_names = ["voltage0"] + _device_name = "" + + def __init__(self, uri=""): + + context_manager.__init__(self, uri, self._device_name) + + self._rxadc = self._ctx.find_device("axi-ad9434-core-lpc") + + rx.__init__(self) + + @property + def test_mode(self): + """test_mode: Select Test Mode. Options are: + off midscale_short pos_fullscale neg_fullscale checkerboard pn_long pn_short one_zero_toggle user""" + return self._get_iio_attr("voltage0", "test_mode", False) + + @test_mode.setter + def test_mode(self, value): + self._set_iio_attr("voltage0", "test_mode", False, value, self._rxadc) diff --git a/adi/ad9467.py b/adi/ad9467.py new file mode 100644 index 000000000..3535b7291 --- /dev/null +++ b/adi/ad9467.py @@ -0,0 +1,62 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.context_manager import context_manager +from adi.rx_tx import rx + + +class ad9467(rx, context_manager): + + """ AD9467 High-Speed ADC """ + + _complex_data = False + _rx_channel_names = ["voltage0", "voltage1"] + _device_name = "" + + def __init__(self, uri=""): + + context_manager.__init__(self, uri, self._device_name) + + self._rxadc = self._ctx.find_device("cf-ad9467-core-lpc") + + rx.__init__(self) + + @property + def test_mode(self): + """test_mode: Select Test Mode. Options are: + off midscale_short pos_fullscale neg_fullscale checkerboard pn_long pn_short one_zero_toggle user ramp""" + return self._get_iio_attr("voltage0", "test_mode", False) + + @test_mode.setter + def test_mode(self, value): + self._set_iio_attr("voltage0", "test_mode", False, value, self._rxadc) diff --git a/adi/ad9625.py b/adi/ad9625.py new file mode 100644 index 000000000..648301a4d --- /dev/null +++ b/adi/ad9625.py @@ -0,0 +1,62 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.context_manager import context_manager +from adi.rx_tx import rx + + +class ad9625(rx, context_manager): + + """ AD9625 High-Speed ADC """ + + _complex_data = False + _rx_channel_names = ["voltage0", "voltage1"] + _device_name = "" + + def __init__(self, uri=""): + + context_manager.__init__(self, uri, self._device_name) + + self._rxadc = self._ctx.find_device("axi-ad9625-hpc") + + rx.__init__(self) + + @property + def test_mode(self): + """test_mode: Select Test Mode. Options are: + off midscale""" + return self._get_iio_attr("voltage0", "test_mode", False) + + @test_mode.setter + def test_mode(self, value): + self._set_iio_attr("voltage0", "test_mode", False, value, self._rxadc) diff --git a/adi/ada4961.py b/adi/ada4961.py new file mode 100644 index 000000000..06190e845 --- /dev/null +++ b/adi/ada4961.py @@ -0,0 +1,62 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.context_manager import context_manager +from adi.rx_tx import rx + + +class ada4961(rx, context_manager): + + """ Low Distortion, 3.2 GHz, RF DGA """ + + _complex_data = False + _rx_channel_names = ["voltage0"] + _device_name = "" + + def __init__(self, uri=""): + + context_manager.__init__(self, uri, self._device_name) + + self._rxadc = self._ctx.find_device("ada4961") + + rx.__init__(self) + + @property + def hardwaregain(self): + """hardwaregain: Set hardware gain. Options are: + up to 15 dB""" + return self._get_iio_attr("voltage0", "hardwaregain", False) + + @hardwaregain.setter + def hardwaregain(self, value): + self._set_iio_attr("voltage0", "hardwaregain", False, value, self._rxadc) diff --git a/adi/fmcadc3.py b/adi/fmcadc3.py new file mode 100644 index 000000000..0ad43f436 --- /dev/null +++ b/adi/fmcadc3.py @@ -0,0 +1,45 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.ad9625 import ad9625 +from adi.ada4961 import ada4961 + + +class fmcadc3(ad9625, ada4961): + + """ FMCADC3 High-Speed Data Aquistion Device """ + + def __init__(self, uri=""): + + ad9625.__init__(self, uri=uri) + ada4961.__init__(self, uri=uri) diff --git a/adi/fmcjesdadc1.py b/adi/fmcjesdadc1.py new file mode 100644 index 000000000..de273fa2e --- /dev/null +++ b/adi/fmcjesdadc1.py @@ -0,0 +1,79 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from adi.ad9250 import ad9250 +from adi.context_manager import context_manager +from adi.jesd import jesd +from adi.rx_tx import rx + + +class fmcjesdadc1(ad9250): + + """FMCJESDADC1 Four-Channel High Speed Data Acquisition FMC Board""" + + _split_cores = True + _rx_channel_names = ["voltage0", "voltage1"] # Recheck RX Channel Names + _device_name = "" + + def __init__(self, uri="", username="root", password="analog"): + context_manager.__init__(self, uri, self._device_name) + + self._jesd = jesd(uri, username=username, password=password) + self._rxadc = self._ctx.find_device("axi-ad9250-hpc-0") + self._rxadc_chip_b = self._ctx.find_device("axi-ad9250-hpc-1") + + rx.__init__(self) + + @property + def test_mode_chan0(self): + """test_mode_chan0: Select Test Mode. Options are: + off midscale_short pos_fullscale neg_fullscale checkerboard pn_long pn_short one_zero_toggle user ramp""" + return self._get_iio_attr("voltage0", "test_mode", False) + + @test_mode_chan0.setter + def test_mode_chan0(self, value): + self._set_iio_attr("voltage0", "test_mode", False, value, self._rxadc) + + @property + def test_mode_chan1(self): + """test_mode_chan1: Select Test Mode. Options are: + off midscale_short pos_fullscale neg_fullscale checkerboard pn_long pn_short one_zero_toggle user ramp""" + return self._get_iio_attr("voltage1", "test_mode", False) + + @test_mode_chan1.setter + def test_mode_chan1(self, value): + self._set_iio_attr("voltage1", "test_mode", False, value, self._rxadc) + + @property + def jesd204_statuses(self): + return self._jesd.get_all_statuses() diff --git a/doc/source/devices/adi.ad9250.rst b/doc/source/devices/adi.ad9250.rst new file mode 100644 index 000000000..dc00de214 --- /dev/null +++ b/doc/source/devices/adi.ad9250.rst @@ -0,0 +1,7 @@ +adi.ad9250 module +================= + +.. automodule:: adi.ad9250 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.ad9265.rst b/doc/source/devices/adi.ad9265.rst new file mode 100644 index 000000000..50f5c3878 --- /dev/null +++ b/doc/source/devices/adi.ad9265.rst @@ -0,0 +1,7 @@ +adi.ad9265 module +================= + +.. automodule:: adi.ad9265 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.ad9434.rst b/doc/source/devices/adi.ad9434.rst new file mode 100644 index 000000000..bed22e8aa --- /dev/null +++ b/doc/source/devices/adi.ad9434.rst @@ -0,0 +1,7 @@ +adi.ad9434 module +================= + +.. automodule:: adi.ad9434 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.ad9467.rst b/doc/source/devices/adi.ad9467.rst new file mode 100644 index 000000000..927067324 --- /dev/null +++ b/doc/source/devices/adi.ad9467.rst @@ -0,0 +1,7 @@ +adi.ad9467 module +================= + +.. automodule:: adi.ad9467 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.ad9625.rst b/doc/source/devices/adi.ad9625.rst new file mode 100644 index 000000000..5390922ad --- /dev/null +++ b/doc/source/devices/adi.ad9625.rst @@ -0,0 +1,7 @@ +adi.ad9625 module +================= + +.. automodule:: adi.ad9625 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.ada4961.rst b/doc/source/devices/adi.ada4961.rst new file mode 100644 index 000000000..a85a9a68f --- /dev/null +++ b/doc/source/devices/adi.ada4961.rst @@ -0,0 +1,7 @@ +adi.ada4961 module +================== + +.. automodule:: adi.ada4961 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.fmcadc3.rst b/doc/source/devices/adi.fmcadc3.rst new file mode 100644 index 000000000..8594f24c9 --- /dev/null +++ b/doc/source/devices/adi.fmcadc3.rst @@ -0,0 +1,7 @@ +adi.fmcadc3 module +================== + +.. automodule:: adi.fmcadc3 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/adi.fmcjesdadc1.rst b/doc/source/devices/adi.fmcjesdadc1.rst new file mode 100644 index 000000000..6e42c65ff --- /dev/null +++ b/doc/source/devices/adi.fmcjesdadc1.rst @@ -0,0 +1,7 @@ +adi.fmcjesdadc1 module +====================== + +.. automodule:: adi.fmcjesdadc1 + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/devices/index.rst b/doc/source/devices/index.rst index 77f6a9dda..c7ba0f821 100644 --- a/doc/source/devices/index.rst +++ b/doc/source/devices/index.rst @@ -23,10 +23,16 @@ Supported Devices adi.ad9136 adi.ad9144 adi.ad9152 + adi.ad9250 + adi.ad9265 adi.ad936x adi.ad9371 + adi.ad9434 + adi.ad9467 + adi.ad9625 adi.ad9680 adi.ad9739a + adi.ada4961 adi.adar1000 adi.adf4159 adi.adf4371 @@ -52,6 +58,8 @@ Supported Devices adi.daq2 adi.daq3 adi.fmc_vna + adi.fmcadc3 + adi.fmcjesdadc1 adi.fmclidar1 adi.fmcomms5 adi.gen_mux diff --git a/examples/ad9265.py b/examples/ad9265.py new file mode 100644 index 000000000..6172d2772 --- /dev/null +++ b/examples/ad9265.py @@ -0,0 +1,110 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import time + +import adi +import matplotlib.pyplot as plt +import numpy as np +from scipy import signal + +# Create radio +rx = adi.ad9265(uri="ip:localhost") +tx = adi.Pluto() + +# Configure tx properties +tx.tx_lo = 2000000000 +tx.tx_cyclic_buffer = True +tx.tx_hardwaregain_chan0 = -30 +tx.gain_control_mode_chan0 = "slow_attack" + +# Create a sinewave waveform +fs = int(tx.sample_rate) +N = 1024 +fc = int(3000000 / (fs / N)) * (fs / N) +ts = 1 / float(fs) +t = np.arange(0, N * ts, ts) +i = np.cos(2 * np.pi * t * fc) * 2 ** 14 +q = np.sin(2 * np.pi * t * fc) * 2 ** 14 +iq = i + 1j * q + +# Send data +tx.tx(iq) + +# Collect data +for r in range(20): + x = rx.rx() + f, Pxx_den = signal.periodogram(x, fs) + plt.clf() + plt.semilogy(f, Pxx_den) + plt.ylim([1e-7, 1e2]) + plt.xlabel("frequency [Hz]") + plt.ylabel("PSD [V**2/Hz]") + plt.draw() + plt.pause(0.05) + time.sleep(0.1) + +plt.show() diff --git a/examples/ad9434.py b/examples/ad9434.py new file mode 100644 index 000000000..dec9296fd --- /dev/null +++ b/examples/ad9434.py @@ -0,0 +1,110 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import time + +import adi +import matplotlib.pyplot as plt +import numpy as np +from scipy import signal + +# Create radio +rx = adi.ad9434(uri="ip:localhost") +tx = adi.Pluto() + +# Configure tx properties +tx.tx_lo = 2000000000 +tx.tx_cyclic_buffer = True +tx.tx_hardwaregain_chan0 = -30 +tx.gain_control_mode_chan0 = "slow_attack" + +# Create a sinewave waveform +fs = int(tx.sample_rate) +N = 1024 +fc = int(3000000 / (fs / N)) * (fs / N) +ts = 1 / float(fs) +t = np.arange(0, N * ts, ts) +i = np.cos(2 * np.pi * t * fc) * 2 ** 14 +q = np.sin(2 * np.pi * t * fc) * 2 ** 14 +iq = i + 1j * q + +# Send data +tx.tx(iq) + +# Collect data +for r in range(20): + x = rx.rx() + f, Pxx_den = signal.periodogram(x, fs) + plt.clf() + plt.semilogy(f, Pxx_den) + plt.ylim([1e-7, 1e2]) + plt.xlabel("frequency [Hz]") + plt.ylabel("PSD [V**2/Hz]") + plt.draw() + plt.pause(0.05) + time.sleep(0.1) + +plt.show() diff --git a/examples/ad9467.py b/examples/ad9467.py new file mode 100644 index 000000000..80a92c836 --- /dev/null +++ b/examples/ad9467.py @@ -0,0 +1,77 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import time + +import adi +import matplotlib.pyplot as plt +import numpy as np +from scipy import signal + +# Create radio +rx = adi.ad9467(uri="ip:analog") +tx = adi.Pluto() + +# Configure tx properties +tx.tx_lo = 2000000000 +tx.tx_cyclic_buffer = True +tx.tx_hardwaregain_chan0 = -30 +tx.gain_control_mode_chan0 = "slow_attack" + +# Create a sinewave waveform +fs = int(tx.sample_rate) +N = 1024 +fc = int(3000000 / (fs / N)) * (fs / N) +ts = 1 / float(fs) +t = np.arange(0, N * ts, ts) +i = np.cos(2 * np.pi * t * fc) * 2 ** 14 +q = np.sin(2 * np.pi * t * fc) * 2 ** 14 +iq = i + 1j * q + +# Send data +tx.tx(iq) + +# Collect data +for r in range(20): + x = rx.rx() + f, Pxx_den = signal.periodogram(x, fs) + plt.clf() + plt.semilogy(f, Pxx_den) + plt.ylim([1e-7, 1e2]) + plt.xlabel("frequency [Hz]") + plt.ylabel("PSD [V**2/Hz]") + plt.draw() + plt.pause(0.05) + time.sleep(0.1) + +plt.show() diff --git a/examples/fmcadc3.py b/examples/fmcadc3.py new file mode 100644 index 000000000..8b48e325e --- /dev/null +++ b/examples/fmcadc3.py @@ -0,0 +1,80 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import time + +import adi +import matplotlib.pyplot as plt +import numpy as np +from scipy import signal + +# Create radio +rx = adi.fmcadc3(uri="ip:analog") +tx = adi.Pluto() + +# Configure rx properties +rx.hardwaregain = 10 + +# Configure tx properties +tx.tx_lo = 2000000000 +tx.tx_cyclic_buffer = True +tx.tx_hardwaregain_chan0 = -30 +tx.gain_control_mode_chan0 = "slow_attack" + +# Create a sinewave waveform +fs = int(tx.sample_rate) +N = 1024 +fc = int(3000000 / (fs / N)) * (fs / N) +ts = 1 / float(fs) +t = np.arange(0, N * ts, ts) +i = np.cos(2 * np.pi * t * fc) * 2 ** 14 +q = np.sin(2 * np.pi * t * fc) * 2 ** 14 +iq = i + 1j * q + +# Send data +tx.tx(iq) + +# Collect data +for r in range(20): + x = rx.rx() + f, Pxx_den = signal.periodogram(x, fs) + plt.clf() + plt.semilogy(f, Pxx_den) + plt.ylim([1e-7, 1e2]) + plt.xlabel("frequency [Hz]") + plt.ylabel("PSD [V**2/Hz]") + plt.draw() + plt.pause(0.05) + time.sleep(0.1) + +plt.show() diff --git a/examples/fmcjesdadc1.py b/examples/fmcjesdadc1.py new file mode 100644 index 000000000..61ce8462a --- /dev/null +++ b/examples/fmcjesdadc1.py @@ -0,0 +1,110 @@ +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Copyright (C) 2019 Analog Devices, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# - Neither the name of Analog Devices, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# - The use of this software may or may not infringe the patent rights +# of one or more patent holders. This license does not release you +# from the requirement that you obtain separate licenses from these +# patent holders to use this software. +# - Use of the software either in source or binary form, must be run +# on or directly connected to an Analog Devices Inc. component. +# +# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. +# +# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY +# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import time + +import adi +import matplotlib.pyplot as plt +import numpy as np +from scipy import signal + +# Create radio +rx = adi.fmcjesdadc1(uri="ip:analog") +tx = adi.Pluto() + +# Configure tx properties +tx.tx_lo = 2000000000 +tx.tx_cyclic_buffer = True +tx.tx_hardwaregain_chan0 = -30 +tx.gain_control_mode_chan0 = "slow_attack" + +# Create a sinewave waveform +fs = int(tx.sample_rate) +N = 1024 +fc = int(3000000 / (fs / N)) * (fs / N) +ts = 1 / float(fs) +t = np.arange(0, N * ts, ts) +i = np.cos(2 * np.pi * t * fc) * 2 ** 14 +q = np.sin(2 * np.pi * t * fc) * 2 ** 14 +iq = i + 1j * q + +# Send data +tx.tx(iq) + +# Collect data +for r in range(20): + x = rx.rx() + f, Pxx_den = signal.periodogram(x, fs) + plt.clf() + plt.semilogy(f, Pxx_den) + plt.ylim([1e-7, 1e2]) + plt.xlabel("frequency [Hz]") + plt.ylabel("PSD [V**2/Hz]") + plt.draw() + plt.pause(0.05) + time.sleep(0.1) + +plt.show() diff --git a/supported_parts.md b/supported_parts.md index b6af0623d..42db5e212 100644 --- a/supported_parts.md +++ b/supported_parts.md @@ -50,11 +50,17 @@ - AD9136 - AD9144 - AD9152 +- AD9250 +- AD9265 - AD936X (Pluto, FMComms2/3/4/5, ADRV936X) - AD9371 - AD9375 +- AD9434 +- AD9467 +- AD9625 - AD9680 - AD9739A +- ADA4961 - ADAR1000 - ADF4159 - ADF4371 @@ -79,6 +85,8 @@ - CN0549 - DAQ2 - DAQ3 +- FMCADC3 +- FMCJESDADC1 - FMCLIDAR1 - FMComms8 - LTC2314-14 diff --git a/test/test_ad9265.py b/test/test_ad9265.py new file mode 100644 index 000000000..f2444ea40 --- /dev/null +++ b/test/test_ad9265.py @@ -0,0 +1,12 @@ +import pytest + +hardware = ["ad9265"] +classname = ["adi.ad9265"] + + +######################################### +@pytest.mark.iio_hardware(hardware, True) +@pytest.mark.parametrize("classname", [(classname)]) +@pytest.mark.parametrize("channel", [0]) +def test_ad9265_rx_data(test_dma_rx, iio_uri, classname, channel): + test_dma_rx(iio_uri, classname, channel) diff --git a/test/test_ad9434.py b/test/test_ad9434.py new file mode 100644 index 000000000..8fb04a2b5 --- /dev/null +++ b/test/test_ad9434.py @@ -0,0 +1,12 @@ +import pytest + +hardware = ["ad9434"] +classname = ["adi.ad9434"] + + +######################################### +@pytest.mark.iio_hardware(hardware, True) +@pytest.mark.parametrize("classname", [(classname)]) +@pytest.mark.parametrize("channel", [0]) +def test_ad9434_rx_data(test_dma_rx, iio_uri, classname, channel): + test_dma_rx(iio_uri, classname, channel) diff --git a/test/test_ad9467.py b/test/test_ad9467.py new file mode 100644 index 000000000..d362c5b9b --- /dev/null +++ b/test/test_ad9467.py @@ -0,0 +1,12 @@ +import pytest + +hardware = ["ad9467"] +classname = ["adi.ad9467"] + + +######################################### +@pytest.mark.iio_hardware(hardware, True) +@pytest.mark.parametrize("classname", [(classname)]) +@pytest.mark.parametrize("channel", [0]) +def test_ad9467_rx_data(test_dma_rx, iio_uri, classname, channel): + test_dma_rx(iio_uri, classname, channel) diff --git a/test/test_fmcadc3.py b/test/test_fmcadc3.py new file mode 100644 index 000000000..8158c6dc9 --- /dev/null +++ b/test/test_fmcadc3.py @@ -0,0 +1,12 @@ +import pytest + +hardware = ["fmcadc3"] +classname = ["adi.fmcadc3"] + + +######################################### +@pytest.mark.iio_hardware(hardware, True) +@pytest.mark.parametrize("classname", [(classname)]) +@pytest.mark.parametrize("channel", [0]) +def test_fmcadc3_rx_data(test_dma_rx, iio_uri, classname, channel): + test_dma_rx(iio_uri, classname, channel) diff --git a/test/test_fmcjesdadc1.py b/test/test_fmcjesdadc1.py new file mode 100644 index 000000000..b3613b831 --- /dev/null +++ b/test/test_fmcjesdadc1.py @@ -0,0 +1,12 @@ +import pytest + +hardware = ["fmcjesdadc1"] +classname = ["adi.fmcjesdadc1"] + + +######################################### +@pytest.mark.iio_hardware(hardware, True) +@pytest.mark.parametrize("classname", [(classname)]) +@pytest.mark.parametrize("channel", [0, 1, [0, 1]]) +def test_fmcjesdadc1_rx_data(test_dma_rx, iio_uri, classname, channel): + test_dma_rx(iio_uri, classname, channel)