Skip to content

Commit

Permalink
[ADRV9002] Add hooks to expose API and profile info
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Sep 30, 2024
1 parent a09366e commit cb0a4f7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions adi/adrv9002.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ def write_stream(self, value):
attr_encode = "stream_config".encode("ascii")
iio._d_write_attr(self._ctrl._device, attr_encode, data)

# we cannot really get the profile. The driver will just throw EPERM
profile = property(None, write_profile)
@property
def profile(self):
profile_data = self._get_iio_dev_attr_str("profile_config")
return dict(x.split(": ") for x in profile_data.split("\n"))

# we cannot really get the stream. The driver will just throw EPERM
stream = property(None, write_stream)

@property
Expand Down Expand Up @@ -719,3 +723,8 @@ def tx1_lo(self):
@tx1_lo.setter
def tx1_lo(self, value):
self._set_iio_attr("altvoltage3", "frequency", True, value)

@property
def api_version(self):
"""api_version: Get the version of the API"""
return self._get_iio_debug_attr_str("api_version")

0 comments on commit cb0a4f7

Please sign in to comment.