diff --git a/adi/adis16475.py b/adi/adis16475.py index ce8b5b2d6..106eb8d51 100644 --- a/adi/adis16475.py +++ b/adi/adis16475.py @@ -64,6 +64,7 @@ def __init__(self, uri="", device_name="adis16505-2"): else: self._ctrl = self._ctx.find_device(device_name) self._rxadc = self._ctx.find_device(device_name) + trigger_name = device_name + "-dev0" if self._ctrl is None: print( @@ -76,10 +77,15 @@ def __init__(self, uri="", device_name="adis16505-2"): self._rxadc = self._ctx.find_device(i) if self._ctrl is not None: print("Fond device = " + i + ". Will use this device instead.") + trigger_name = i + "-dev0" break if self._ctrl is None: raise Exception("No compatible device found") + # Set default trigger + self._trigger = self._ctx.find_device(trigger_name) + self._rxadc._set_trigger(self._trigger) + self.anglvel_x = self._channel_with_offset(self._ctrl, "anglvel_x") self.anglvel_y = self._channel_with_offset(self._ctrl, "anglvel_y") self.anglvel_z = self._channel_with_offset(self._ctrl, "anglvel_z") diff --git a/test/test_adis16475_p.py b/test/test_adis16475_p.py index 81f58a2da..ed21bcdc0 100644 --- a/test/test_adis16475_p.py +++ b/test/test_adis16475_p.py @@ -12,7 +12,7 @@ def test_adis16475_rx_data(test_dma_rx, iio_uri, classname, channel): test_dma_rx(iio_uri, classname, channel, buffer_size=16) -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) def test_adis16475_filter_low_pass_3db_frequency(iio_uri): adis16475 = adi.adis16475(uri=iio_uri) @@ -49,35 +49,35 @@ def test_adis16475_filter_low_pass_3db_frequency(iio_uri): assert adis16475.filter_low_pass_3db_frequency <= 720 -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) def test_adis16475_firmware_date(iio_uri): adis16475 = adi.adis16475(uri=iio_uri) assert adis16475.firmware_date != "00-00-0000" -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) def test_adis16475_firmware_revision(iio_uri): adis16475 = adi.adis16475(uri=iio_uri) assert adis16475.firmware_revision != "0.0" -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) def test_adis16475_product_id(iio_uri): adis16475 = adi.adis16475(uri=iio_uri) assert adis16475.product_id != 0 -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) def test_adis16475_serial_number(iio_uri): adis16475 = adi.adis16475(uri=iio_uri) assert adis16475.serial_number != "0x0000" -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) def test_adis16476_conv_data(iio_uri): adis16475 = adi.adis16475(uri=iio_uri) @@ -90,7 +90,7 @@ def test_adis16476_conv_data(iio_uri): assert adis16475.temp_conv != 0.0 -@pytest.mark.iio_hardware(hardware) +@pytest.mark.iio_hardware(hardware, True) @pytest.mark.parametrize("classname", [(classname)]) @pytest.mark.parametrize( "attr, start, stop, step, tol",