Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance ADRV9009-ZU11EG multi-class to support selective FMComms8 suport #541

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading