Skip to content

Commit b4a148c

Browse files
committed
adi:ad5592r: Added Rx method
Added rx method for data capture Signed-off-by: Disha D <[email protected]>
1 parent 4beb33a commit b4a148c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

adi/ad5592r.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
from adi.attribute import attribute
66
from adi.context_manager import context_manager
7+
from adi.rx_tx import rx
78

8-
9-
class ad5592r(context_manager):
9+
class ad5592r(rx,context_manager):
1010
"""AD5592R and AD5593R SPI / I2C interface, 8-channel, 12-bit Confiburable ADC/DAC, digital GPIO
1111
1212
Analog I/O pins are configured in the device tree and can be ADC, DAC, or both. Channel attributes are as follows, where X corresponds to device channel number:
@@ -25,6 +25,8 @@ class ad5592r(context_manager):
2525
"""
2626

2727
_device_name = ""
28+
_complex_data = False
29+
channel = []
2830

2931
def __repr__(self):
3032
retstr = f"""
@@ -56,11 +58,16 @@ def __init__(self, uri="", device_name=""):
5658
for device in self._ctx.devices:
5759
if device.name in device_name:
5860
self._ctrl = device
61+
self._rxadc = device
5962
break
6063

64+
self.channel =[]
65+
self._rx_channel_names = []
66+
6167
# Dynamically get channels after the index
6268
for ch in self._ctrl.channels:
6369
name = ch._id
70+
print(name)
6471
output = ch._output
6572
if name == "temp":
6673
setattr(self, name, self.channel_temp(self._ctrl, name, output))
@@ -70,9 +77,12 @@ def __init__(self, uri="", device_name=""):
7077
self, name + "_dac", self.channel_dac(self._ctrl, name, output)
7178
)
7279
else:
80+
self._rx_channel_names.append(name)
81+
self.channel.append(self.channel_adc(self._ctrl, name, output))
7382
setattr(
7483
self, name + "_adc", self.channel_adc(self._ctrl, name, output)
7584
)
85+
rx.__init__(self)
7686

7787
class channel_adc(attribute):
7888
"""AD5592R Input Voltage Channels"""

0 commit comments

Comments
 (0)