Skip to content

Commit

Permalink
try setting sample rate in the device class
Browse files Browse the repository at this point in the history
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
  • Loading branch information
threexc committed Feb 5, 2025
1 parent 15055e3 commit d217d9f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions +adi/+AD4020/Rx.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
channel_names = {'voltage0-voltage1'}
end

properties (Nontunable)
% SampleRate Sample Rate
% Baseband sampling rate in Hz, specified as a scalar
% in samples per second.
SampleRate = '1000000'
end

methods
%% Constructor
function obj = Rx(varargin)
Expand All @@ -23,5 +30,12 @@
obj.EnabledChannels = 1;
obj.BufferTypeConversionEnable = true;
end
% Check SamplingRate
function set.SampleRate(obj, value)
obj.SampleRate = value;
if obj.ConnectedToDevice
obj.setAttributeRAW('voltage0-voltage1', 'sampling_frequency', num2str(value), false);
end
end
end
end

0 comments on commit d217d9f

Please # to comment.