Skip to content

Commit

Permalink
Enhance ADRV9009-ZU11EG multi-class to support selective FMComms8 sup…
Browse files Browse the repository at this point in the history
…port

Signed-off-by: Travis F. Collins <travis.collins@analog.com>
  • Loading branch information
tfcollins committed Mar 11, 2024
1 parent 2061827 commit ecdc8d3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions adi/adrv9009_zu11eg_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class adrv9009_zu11eg_multi(object):
JESD object associated with primary ADRV9009-ZU11EG
secondary_jesds: type=list[adi.jesd]
JESD object(s) associated with secondary ADRV9009-ZU11EG(s)
fmcomms8: type=boolean
Boolean flag to idenify is FMComms8(s) are attached to SOMs
fmcomms8: type=boolean or list[boolean]
Boolean flag or list of boolean flags to identify is FMComms8(s) are attached to SOMs
"""

__rx_buffer_size_multi = 2 ** 14
Expand All @@ -52,6 +52,16 @@ def __init__(
if not isinstance(secondary_jesds, list):
Exception("secondary_jesds must be a list")

if isinstance(fmcomms8, list):
if len(fmcomms8) != len(secondary_uris) + 1:
raise Exception(
"fmcomms8 must be a boolean or list of booleans with the same length as secondary_uris + 1 (primary)"
)
elif not all(isinstance(x, bool) for x in fmcomms8):
raise Exception("fmcomms8 must be a boolean or list of booleans")
else:
fmcomms8 = [fmcomms8] * (len(secondary_uris) + 1)

self._dma_show_arming = False
self._jesd_show_status = False
self._jesd_fsm_show_status = False
Expand All @@ -60,7 +70,7 @@ def __init__(
self._rx_initialized = False
self._request_sysref_carrier = False
self.fmcomms8 = fmcomms8
if fmcomms8:
if fmcomms8[0]:
self.primary = adrv9009_zu11eg_fmcomms8(
uri=primary_uri, jesd_monitor=True, jesd=primary_jesd
)
Expand All @@ -72,7 +82,7 @@ def __init__(
self.samples_primary = []
self.samples_secondary = []
for i, uri in enumerate(secondary_uris):
if fmcomms8:
if fmcomms8[i + 1]:
self.secondaries.append(
adrv9009_zu11eg_fmcomms8(
uri=uri, jesd_monitor=True, jesd=secondary_jesds[i]
Expand Down

0 comments on commit ecdc8d3

Please sign in to comment.