Skip to content

Commit

Permalink
Merge pull request #513 from analogdevicesinc/tfcollins/class-fixes
Browse files Browse the repository at this point in the history
Fix AD908X static props
  • Loading branch information
tfcollins authored Jan 10, 2024
2 parents d6b9321 + 32d5947 commit 4af6978
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 20 deletions.
13 changes: 10 additions & 3 deletions adi/ad9081.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ class ad9081(rx_tx, context_manager, sync_start):
_dds_channel_names: List[str] = []
_device_name = ""

_rx_attr_only_channel_names: List[str] = []
_tx_attr_only_channel_names: List[str] = []

_path_map: Dict[str, Dict[str, Dict[str, List[str]]]] = {}

def __init__(self, uri=""):

# Reset default channel names
self._rx_channel_names = []
self._tx_channel_names = []
self._tx_control_channel_names = []
self._rx_coarse_ddc_channel_names = []
self._tx_coarse_duc_channel_names = []
self._rx_fine_ddc_channel_names = []
self._tx_fine_duc_channel_names = []
self._dds_channel_names = []

context_manager.__init__(self, uri, self._device_name)
# Default device for attribute writes
self._ctrl = self._ctx.find_device("axi-ad9081-rx-hpc")
Expand Down
12 changes: 9 additions & 3 deletions adi/ad9081_mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,20 @@ class ad9081_mc(ad9081):
_dds_channel_names: List[str] = []
_device_name = ""

_rx_attr_only_channel_names: List[str] = []
_tx_attr_only_channel_names: List[str] = []

_path_map: Dict[str, Dict[str, Dict[str, List[str]]]] = {}

def __init__(self, uri="", phy_dev_name=""):

# Reset channel names
self._rx_channel_names: List[str] = []
self._tx_channel_names: List[str] = []
self._tx_control_channel_names: List[str] = []
self._rx_coarse_ddc_channel_names: List[str] = []
self._tx_coarse_duc_channel_names: List[str] = []
self._rx_fine_ddc_channel_names: List[str] = []
self._tx_fine_duc_channel_names: List[str] = []
self._dds_channel_names: List[str] = []

context_manager.__init__(self, uri, self._device_name)

if not phy_dev_name:
Expand Down
14 changes: 11 additions & 3 deletions adi/ad9084.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,20 @@ class ad9084(rx_tx, context_manager, sync_start):
_dds_channel_names: List[str] = []
_device_name = ""

_rx_attr_only_channel_names: List[str] = []
_tx_attr_only_channel_names: List[str] = []

_path_map: Dict[str, Dict[str, Dict[str, List[str]]]] = {}

def __init__(self, uri=""):

# Reset default channel lists
self._rx_channel_names = []
self._tx_channel_names = []
self._tx_control_channel_names = []
self._rx_coarse_ddc_channel_names = []
self._tx_coarse_duc_channel_names = []
self._rx_fine_ddc_channel_names = []
self._tx_fine_duc_channel_names = []
self._dds_channel_names = []

context_manager.__init__(self, uri, self._device_name)
# Default device for attribute writes
self._ctrl = self._ctx.find_device("axi-ad9084-rx-hpc")
Expand Down
12 changes: 9 additions & 3 deletions adi/ad9084_mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,20 @@ class ad9084_mc(ad9084):
_dds_channel_names: List[str] = []
_device_name = ""

_rx_attr_only_channel_names: List[str] = []
_tx_attr_only_channel_names: List[str] = []

_path_map: Dict[str, Dict[str, Dict[str, List[str]]]] = {}

def __init__(self, uri="", phy_dev_name=""):

# Reset class variables
self._tx_channel_names: List[str] = []
self._tx_control_channel_names: List[str] = []
self._rx_coarse_ddc_channel_names: List[str] = []
self._tx_coarse_duc_channel_names: List[str] = []
self._rx_fine_ddc_channel_names: List[str] = []
self._tx_fine_duc_channel_names: List[str] = []
self._dds_channel_names: List[str] = []
self._rx_channel_names: List[str] = []

context_manager.__init__(self, uri, self._device_name)

if not phy_dev_name:
Expand Down
10 changes: 2 additions & 8 deletions adi/rx_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ class rx_core(rx_tx_common, metaclass=ABCMeta):
_rx_stack_interleaved = True # Convert from channel to sample interleaved

def __init__(self, rx_buffer_size=1024):
if self._complex_data:
N = 2
else:
N = 1
N = 2 if self._complex_data else 1
rx_enabled_channels = list(range(len(self._rx_channel_names) // N))
self._num_rx_channels = len(self._rx_channel_names)
self.rx_enabled_channels = rx_enabled_channels
Expand Down Expand Up @@ -282,10 +279,7 @@ class tx_core(dds, rx_tx_common, metaclass=ABCMeta):
_tx_cyclic_buffer = False

def __init__(self, tx_cyclic_buffer=False):
if self._complex_data:
N = 2
else:
N = 1
N = 2 if self._complex_data else 1
tx_enabled_channels = list(range(len(self._tx_channel_names) // N))
self._num_tx_channels = len(self._tx_channel_names)
self.tx_enabled_channels = tx_enabled_channels
Expand Down

0 comments on commit 4af6978

Please sign in to comment.