示例#1
0
    def __init__(self, uri="", device_name=""):
        """Constructor for AD4110 class."""
        context_manager.__init__(self, uri, self._device_name)

        compatible_part = "ad4110"
        self._ctrl = None

        if not device_name:
            device_name = compatible_part
        else:
            if device_name != compatible_part:
                raise Exception(f"Not a compatible device: {device_name}")

        # Select the device matching device_name as working device
        for device in self._ctx.devices:
            if device.name == device_name:
                self._ctrl = device
                self._rxadc = device
                break

        if not self._ctrl:
            raise Exception("Error in selecting matching device")

        if not self._rxadc:
            raise Exception("Error in selecting matching device")

        for ch in self._ctrl.channels:
            name = ch._id
            self._rx_channel_names.append(name)
            self.channel.append(self._channel(self._ctrl, name))

        rx.__init__(self)
示例#2
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)

        self._rxadc = self._ctx.find_device("axi-ad9625-hpc")

        rx.__init__(self)
示例#3
0
    def __init__(self, uri="", device_name=""):

        context_manager.__init__(self, uri, self._device_name)

        compatible_parts = [
            "ad7605-4",
            "ad7606-4",
            "ad7606-6",
            "ad7606-8",
            "ad7606b",
            "ad7616",
        ]

        self._ctrl = None

        if not device_name:
            device_name = compatible_parts[0]
        else:
            if device_name not in compatible_parts:
                raise Exception("Not a compatible device: " + device_name)

        # Select the device matching device_name as working device
        for device in self._ctx.devices:
            if device.name == device_name:
                self._ctrl = device
                self._rxadc = device
                break

        for ch in self._ctrl._channels:
            name = ch._id
            self._rx_channel_names.append(name)
            self.channel.append(self._channel(self._ctrl, name))

        rx.__init__(self)
示例#4
0
    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)
示例#5
0
    def __init__(self, uri="", device_name=""):
        """Constructor for AD719x class."""
        context_manager.__init__(self, uri, self._device_name)

        compatible_parts = ["ad7190", "ad7192", "ad7193", "ad7195"]

        self._ctrl = None

        if not device_name:
            device_name = compatible_parts[0]
        else:
            if device_name not in compatible_parts:
                raise Exception("Not a compatible device: " + device_name)

        # Select the device matching device_name as working device
        for device in self._ctx.devices:
            if device.name == device_name:
                self._ctrl = device
                self._rxadc = device
                break

        if not self._ctrl:
            raise Exception("Error in selecting matching device")

        if not self._rxadc:
            raise Exception("Error in selecting matching device")

        for ch in self._ctrl.channels:
            name = ch._id
            self._rx_channel_names.append(name)
            self.channel.append(self._channel(self._ctrl, name))

        rx.__init__(self)
示例#6
0
    def __init__(self, uri=""):
        """adxl313 class constructor."""
        context_manager.__init__(self, uri)

        compatible_parts = [
            "ADXL312",
            "ADXL313",
            "ADXL314",
        ]

        self._ctrl = None

        # Select the device matching device_name as working device
        for device in self._ctx.devices:
            if device.name in compatible_parts:
                print("Found device {}".format(device.name))
                self._ctrl = device
                self._rxadc = device
                self._device_name = device.name
                break

        if self._ctrl is None:
            raise Exception("No compatible device found")

        self.accel_x = self._channel(self._ctrl, "accel_x")
        self.accel_y = self._channel(self._ctrl, "accel_y")
        self.accel_z = self._channel(self._ctrl, "accel_z")
        self._rx_channel_names = ["accel_x", "accel_y", "accel_z"]
        rx.__init__(self)
示例#7
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)

        self._rxadc = self._ctx.find_device("ada4961")

        rx.__init__(self)
示例#8
0
    def __init__(self, uri="", device_index=0):

        context_manager.__init__(self, uri, self._device_name)

        compatible_parts = ["ad7124-8", "ad7124-4"]

        self._ctrl = None
        index = 0

        # Selecting the device_index-th device from the 7124 family as working device.
        for device in self._ctx.devices:
            if device.name in compatible_parts:
                if index == device_index:
                    self._ctrl = device
                    self._rxadc = device
                    break
                else:
                    index += 1

        # dynamically get channels and sorting them after the index of the first voltage channel
        self._ctrl.channels.sort(key=lambda x: int(x.id[7 : x.id.find("-")]))

        for ch in self._ctrl._channels:
            name = ch._id
            self._rx_channel_names.append(name)
            self.channel.append(self._channel(self._ctrl, name))
        rx.__init__(self)
示例#9
0
    def __init__(self, uri="", device_name="ad4630-24"):

        context_manager.__init__(self, uri, self._device_name)

        compatible_parts = ["ad4630-24", "ad4030-24", "ad4630-16"]

        if device_name not in compatible_parts:
            raise Exception(
                "Not a compatible device: "
                + str(device_name)
                + ". Please select from "
                + str(compatible_parts)
            )
        else:
            self._ctrl = self._ctx.find_device(device_name)
            self._rxadc = self._ctx.find_device(device_name)

        _channels = []
        self.output_bits = []
        for ch in self._ctrl.channels:
            self.output_bits.append(ch.data_format.bits)
            self._rx_channel_names.append(ch.id)
            if "differential" in ch.name:
                _channels.append((ch.id, self._diff_channel(self._ctrl, ch.id)))
                if "0" in ch.name:
                    self.chan0 = self._diff_channel(self._ctrl, ch.name)
                if "1" in ch.name:
                    self.chan1 = self._diff_channel(self._ctrl, ch.name)

        rx.__init__(self)
示例#10
0
    def __init__(self, uri="", device_index=0):
        """ADPD188 class constructor."""
        context_manager.__init__(self, uri, self._device_name)

        compatible_parts = ["adpd188"]

        self._ctrl = None
        index = 0

        # Selecting the device_index-th device from the adpd188 family as working device.
        for device in self._ctx.devices:
            if device.name in compatible_parts:
                if index == device_index:
                    self._ctrl = device
                    self._rxadc = device
                    break
                else:
                    index += 1

        # dynamically get channels and sorting them after the color
        # self._ctrl.channels.sort(key=lambda x: str(x.id[14:]))

        for ch in self._ctrl._channels:
            name = ch._id
            self._rx_channel_names.append(name)
            self.channel.append(self._channel(self._ctrl, name))
        rx.__init__(self)
        self.rx_buffer_size = 16
示例#11
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)

        self._ctrl = self._ctx.find_device("adis16460")
        self._rxadc = self._ctx.find_device("adis16460")
        rx.__init__(self)
        self.rx_buffer_size = 16  # Make default buffer smaller
示例#12
0
    def __init__(self, uri="", username="******", password="******"):

        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)
示例#13
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)

        self._rxadc = self._ctx.find_device("axi-ad9083-rx-hpc")
        if not self._rxadc:
            raise Exception("Cannot find device axi-ad9083-rx-hpc")

        rx.__init__(self)
示例#14
0
 def __init__(self, uri, phy, rxdev):
     context_manager.__init__(self, uri, self._device_name)
     self._rxadc = self._ctx.find_device(rxdev)
     assert self._rxadc, "Device not found: " + rxdev
     # Set channels
     for chan in self._rxadc.channels:
         if chan.scan_element:
             self._rx_channel_names.append(chan.id)
     rx.__init__(self)
示例#15
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)

        self._rxadc = self._ctx.find_device("ad7768-1")
        self._ltc2606 = self._ctx.find_device("ltc2606")
        self._gpio = self._ctx.find_device("one-bit-adc-dac")
        self._ltc2308 = self._ctx.find_device("ltc2308")

        rx.__init__(self)
示例#16
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)
        self._ctrl = self._ctx.find_device("adxrs290")
        self.anglvel_x = self._channel(self._ctrl, "anglvel_x")
        self.anglvel_y = self._channel(self._ctrl, "anglvel_y")
        self.temp = self._channel(self._ctrl, "temp")
        self._rxadc = self._ctx.find_device("adxrs290")
        self._rx_channel_names = ["anglvel_x", "anglvel_y"]
        rx.__init__(self)
示例#17
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)
        self._ctrl = self._ctx.find_device("adxl345")
        self.accel_x = self._channel(self._ctrl, "accel_x")
        self.accel_y = self._channel(self._ctrl, "accel_y")
        self.accel_z = self._channel(self._ctrl, "accel_z")
        self._rxadc = self._ctx.find_device("adxl345")
        self._rx_channel_names = ["accel_x", "accel_y", "accel_z"]
        rx.__init__(self)
示例#18
0
    def __init__(self, uri=""):
        context_manager.__init__(self, uri, self._device_name)
        self._ctrl = self._ctx.find_device("max31855")

        if self._ctrl is None:
            raise Exception("No device found")

        self.temp_i = self._channel(self._ctrl, "i_temp")
        self.temp_t = self._channel(self._ctrl, "t_temp")
        self._rx_channel_names = ["t_temp", "i_temp"]
        rx.__init__(self)
示例#19
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)
        self._ctrl = self._ctx.find_device("ad7124-8")
        self._rxadc = self._ctx.find_device("ad7124-8")

        # dynamically get channels
        for ch in self._ctrl._channels:
            name = ch._id
            self._rx_channel_names.append(name)
            self.channel.append(self._channel(self._ctrl, name))
        rx.__init__(self)
示例#20
0
    def __init__(
        self, uri="", imu_dev_name="adis16507-3", trigger_name="adis16507-3-dev0"
    ):

        context_manager.__init__(self, uri, self._device_name)

        self._ctrl = self._ctx.find_device(imu_dev_name)
        self._rxadc = self._ctx.find_device(imu_dev_name)
        # Set default trigger
        self._trigger = self._ctx.find_device(trigger_name)
        self._rxadc._set_trigger(self._trigger)
        rx.__init__(self)
        self.rx_buffer_size = 16  # Make default buffer smaller
示例#21
0
    def __init__(self, uri=""):
        context_manager.__init__(self, uri, self._device_name)
        self._ctrl = self._ctx.find_device("ltc2983")
        self._rxadc = self._ctx.find_device("ltc2983")

        # dynamically get channels
        _channels = []
        for ch in self._ctrl.channels:
            self._rx_channel_names.append(ch.id)
            _channels.append((ch.id, self._channel(self._ctrl, ch.id)))
        self.channel = OrderedDict(_channels)

        rx.__init__(self)
示例#22
0
    def __init__(self, uri=""):

        context_manager.__init__(self, uri, self._device_name)

        self._rxadc = self._ctx.find_device("axi-ad9083-rx-hpc")
        if not self._rxadc:
            raise Exception("Cannot find device axi-ad9083-rx-hpc")

        for ch in self._rxadc.channels:
            if ch.scan_element and not ch.output:
                self._rx_channel_names.append(ch._id)

        for name in self._rx_channel_names:
            if "_i" or "_q" in name:
                self._complex_data = True

        rx.__init__(self)
示例#23
0
    def __init__(self, uri="", name="adis16495-3"):
        """Initialize an adis16495 object.

        parameters:
            uri: type=string
                URI of IIO context with adis16495.
            name: type=string
                Name of the device. Set to adis16495-3
                by default.
        """
        trigger_name = name + "-dev0"
        context_manager.__init__(self, uri, self._device_name)

        self._ctrl = self._ctx.find_device(name)
        self._rxadc = self._ctx.find_device(name)
        # Set default trigger
        self._trigger = self._ctx.find_device(trigger_name)
        self._rxadc._set_trigger(self._trigger)
        rx.__init__(self)
        self.rx_buffer_size = 16  # Make default buffer smaller
示例#24
0
    def __init__(self, uri="", device_name=""):

        context_manager.__init__(self, uri, self._device_name)

        compatible_parts = [
            "ad7745",
            "ad7746",
            "ad7747",
        ]

        self._ctrl = None

        if device_name not in compatible_parts:
            raise Exception("Not a compatible device: " + device_name)

        # Select the device matching device_name as working device
        for device in self._ctx.devices:
            print("Found device {}".format(device.name))
            if device.name == device_name:
                self._ctrl = device
                self._rxadc = device
                break
        # dynamically get channels
        _channels = []
        for ch in self._ctrl.channels:
            self._rx_channel_names.append(ch.id)
            if "capacitance" in ch.id:
                _channels.append((ch.id, self._cap_channel(self._ctrl, ch.id)))
                continue
            if "temp" in ch.id:
                _channels.append((ch.id, self._temp_channel(self._ctrl, ch.id)))
                continue
            if "voltage" in ch.id:
                _channels.append((ch.id, self._volt_channel(self._ctrl, ch.id)))
                continue
        self.channel = OrderedDict(_channels)

        rx.__init__(self)
示例#25
0
    def __init__(self, uri=""):

        device_name = "ad5940"
        context_manager.__init__(self, uri, self._device_name)

        self._ctrl = None

        # Select the device matching device_name as working device
        for device in self._ctx.devices:
            if device.name == device_name:
                self._ctrl = device
                self._rxadc = device
                break
        # dynamically get channels
        _channels = []
        for ch in self._ctrl.channels:
            self._rx_channel_names.append(ch.id)
            if ch.name == "bia":
                _channels.append(
                    (ch.id, self._bia_channel(self, self._ctrl, ch.id)))
                continue
        self.channel = OrderedDict(_channels)

        rx.__init__(self)
 def __init__(self, ctx, obs_dev, channel_names):
     self._ctx = ctx
     self._rxadc = obs_dev
     self._rx_channel_names = channel_names
     rx.__init__(self)
示例#27
0
文件: obs.py 项目: ekigwana/pyadi-iio
 def __init__(self, ctx, obs_dev, channel_names, complex_data=True):
     self._ctx = ctx
     self._rxadc = obs_dev
     self._rx_channel_names = channel_names
     self._complex_data = complex_data
     rx.__init__(self)