Skip to content

Commit

Permalink
Add profile property
Browse files Browse the repository at this point in the history
Signed-off-by: Trisha De Vera <[email protected]>
  • Loading branch information
trishaange01 committed Oct 23, 2023
1 parent f35212a commit 684e65e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions adi/ad937x.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(
self._rxadc = self._ctx.find_device("axi-ad9371-rx-hpc")
self._rxobs = self._ctx.find_device("axi-ad9371-rx-obs-hpc")
self._txdac = self._ctx.find_device("axi-ad9371-tx-hpc")
self._ctx.set_timeout(30000) # Needed for loading profiles

if not disable_jesd_control and jesd:
self._jesd = jesd(uri, username=username, password=password)
Expand Down Expand Up @@ -324,6 +325,17 @@ def obs_rf_port_select(self, value):
def jesd204_statuses(self):
return self._jesd.get_all_statuses()

@property
def profile(self):
"""Load profile file. Provide path to profile file to attribute"""
return self._get_iio_dev_attr("profile_config")

@profile.setter
def profile(self, value):
with open(value, "r") as file:
data = file.read()
self._set_iio_dev_attr_str("profile_config", data)


class ad9375(ad9371):
""" AD9375 Transceiver """
Expand Down

0 comments on commit 684e65e

Please sign in to comment.