Skip to content

Commit

Permalink
adi: adis16475: Set default trigger
Browse files Browse the repository at this point in the history
Signed-off-by: Ramona Gradinariu <[email protected]>
  • Loading branch information
rbolboac committed Apr 3, 2024
1 parent d9f5afb commit 0f8c72d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adi/adis16475.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand Down

0 comments on commit 0f8c72d

Please sign in to comment.