Skip to content

Commit

Permalink
axi_ad3552r: buffer transfer for lldk design
Browse files Browse the repository at this point in the history
  • Loading branch information
PopPaul2021 committed Nov 18, 2022
1 parent 6a2e1d2 commit b9a1b8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion adi/ad3552r.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ad3552r(tx, context_manager, attribute):
def __init__(self, uri="", device_name=""):

context_manager.__init__(self, uri, self._device_name)
compatible_parts = ["ad3552r"]
compatible_parts = ["axi-ad3552r-0","axi-ad3552r-1"]

self._ctrl = None

Expand Down
19 changes: 12 additions & 7 deletions examples/ad3552r_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import adi

ad3552r = adi.ad3552r(uri="ip:analog-5.local")
ad3552r_0 = adi.ad3552r(uri="ip:10.48.65.167", device_name="axi-ad3552r-0")
ad3552r_1 = adi.ad3552r(uri="ip:10.48.65.167", device_name="axi-ad3552r-1")

ad3552r.tx_enabled_channels = [0]
ad3552r_0.tx_enabled_channels = [0]
ad3552r_0.tx_enabled_channels = [1]
ad3552r_1.tx_enabled_channels = [0]
ad3552r_1.tx_enabled_channels = [1]

# Sample rate
fs = int(ad3552r.sample_rate)
fs = int(ad3552r_0.sample_rate)
# Signal frequency
fc = 5000
# Number of samples
Expand All @@ -26,9 +30,10 @@
samples = np.uint16(samples)
# repetition of the array is needed
# as the SPI engine is ... limited
samples = np.repeat(samples, 2)

ad3552r.tx_cyclic_buffer = True
ad3552r.tx(samples)
samples = np.bitwise_xor(32768,samples)
ad3552r_0.tx_cyclic_buffer = True
ad3552r_1.tx_cyclic_buffer = True
ad3552r_0.tx(samples)
ad3552r_1.tx(samples)

input("Press Enter to stop the stream...")

0 comments on commit b9a1b8a

Please sign in to comment.