Skip to content

Commit 0a9e04f

Browse files
committed
Add workaround for HDL limitation on DMA for AD4630-24 design
Signed-off-by: tfcollins <travisfcollins@gmail.com>
1 parent 6a7f962 commit 0a9e04f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

+adi/+AD463x/Base.m

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
isOutput = false
3333
end
3434

35+
properties(Access = protected)
36+
InSetup = false;
37+
end
38+
3539
properties (Abstract, Nontunable, Hidden)
3640
Timeout
3741
kernelBuffersCount
@@ -81,8 +85,10 @@
8185
end
8286

8387
% Connects to device temporarily and fetches the channel names
88+
obj.InSetup = true;
8489
obj.setup();
8590
release(obj);
91+
obj.InSetup = false;
8692
end
8793

8894
function set.SamplesPerFrame(obj, value)
@@ -138,6 +144,14 @@ function setupInit(obj)
138144
end
139145

140146
obj.set_channel_names();
147+
if obj.InSetup
148+
obj.EnabledChannels = 1:length(obj.channel_names);
149+
else
150+
% This looks like an HDL bug, but all channels need to be
151+
% enabled or they will timeout or not correctly be configured
152+
assert(length(obj.EnabledChannels)==length(obj.channel_names), ...
153+
'All channels must be enabled for platform');
154+
end
141155

142156
end
143157

@@ -147,7 +161,7 @@ function set_channel_names(obj)
147161
chanCount = obj.iio_device_get_channels_count(phydev);
148162
for c = 1:chanCount
149163
chanPtr = obj.iio_device_get_channel(phydev, c - 1);
150-
obj.channel_names{end + 1} = obj.iio_channel_get_name(chanPtr);
164+
obj.channel_names{end + 1} = obj.iio_channel_get_id(chanPtr);
151165
end
152166
end
153167

examples/ad4630_DataCapture.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
% Only a select few channel groupings yield sensible outputs. Refer to the
1717
% Limitations section in the documentation for more details
18-
rx.EnabledChannels = [1];
18+
rx.EnabledChannels = [1,2];
1919

2020
% Capture data
2121
data = rx();

0 commit comments

Comments
 (0)