Skip to content
Open
1 change: 1 addition & 0 deletions adi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
from adi.adrf5720 import adrf5720
from adi.adrv9002 import adrv9002
from adi.adrv9009 import adrv9008_1, adrv9008_2, adrv9009
from adi.adrv9002_multi import adrv9002_multi
from adi.adrv9009_zu11eg import adrv9009_zu11eg
from adi.adrv9009_zu11eg_fmcomms8 import adrv9009_zu11eg_fmcomms8
from adi.adrv9009_zu11eg_multi import adrv9009_zu11eg_multi
Expand Down
25 changes: 23 additions & 2 deletions adi/adrv9002.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ def write_stream_profile(self, stream, profile):
iio._d_write_attr(self._ctrl._device, attr_encode, data)
with open(profile, "r") as file:
data = file.read()
self._set_iio_dev_attr_str("profile_config", data)
for t in range(3):
try:
self._set_iio_dev_attr_str("profile_config", data)
break
except Exception as e:
print("#" + str(t) + "profile load failed")
if t == 2:
raise Exception("Failed to load profile")
print(e)

def write_profile(self, value):
"""Load a new profile on the device
Expand All @@ -107,7 +115,15 @@ def write_profile(self, value):
"""
with open(value, "r") as file:
data = file.read()
self._set_iio_dev_attr_str("profile_config", data)
for t in range(3):
try:
self._set_iio_dev_attr_str("profile_config", data)
break
except Exception as e:
print("#" + str(t) + "profile load failed")
if t == 2:
raise Exception("Failed to load profile")
print(e)

def write_stream(self, value):
"""Load a new stream on the device
Expand Down Expand Up @@ -148,6 +164,11 @@ def tx_dma_mode(self):
"""
return self._tx_dma_mode

@property
def temperature(self):
"""temperature: Get temperature of the device"""
return self._get_iio_attr("temp0", "input", False)

@property
def rx_ensm_mode_chan0(self):
"""rx_ensm_mode_chan0: RX Enable State Machine State Channel 0. Options are:
Expand Down
Loading
Loading