From 0f8c72d589db5f91c7dfb4b065594028bf684c50 Mon Sep 17 00:00:00 2001 From: Ramona Gradinariu Date: Wed, 3 Apr 2024 11:23:52 +0300 Subject: [PATCH] adi: adis16475: Set default trigger Signed-off-by: Ramona Gradinariu --- adi/adis16475.py | 6 ++++++ 1 file changed, 6 insertions(+) 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")