Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Added Rx1-Rx2 phase inversion enable enhancement to AD9361 system object. #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion +adi/+AD9361/Rx.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
isOutput = false;
end

properties (Hidden)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a logical

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And probably nontunable

%EnableRx1Rx2PhaseInversion
% If enabled, RX1 and RX2 are phase aligned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend being more specific with this comment. Since it might give a wrong impression

EnableRx1Rx2PhaseInversion = 0;
end

properties(Nontunable, Hidden, Constant)
Type = 'Rx';
channel_names = {'voltage0','voltage1','voltage2','voltage3'};
Expand Down Expand Up @@ -239,6 +245,15 @@
obj.setDebugAttributeLongLong('loopback',value);
end
end
function set.EnableRx1Rx2PhaseInversion(obj, value)
validateattributes( value, { 'double','single', 'uint32' }, ...
{ 'real', 'nonnegative','scalar', 'finite', 'nonnan', 'nonempty','integer','>=',0,'<=',1}, ...
'', 'EnableRx1Rx2PhaseInversion');
obj.EnableRx1Rx2PhaseInversion = value;
if obj.ConnectedToDevice
obj.setDebugAttributeLongLong('adi,rx1-rx2-phase-inversion-enable',value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this won't actually update the part unless initialize is called

end
end
end

%% API Functions
Expand Down Expand Up @@ -271,7 +286,9 @@ function setupInit(obj)
obj.setAttributeLongLong(id,'frequency',obj.CenterFrequency ,true,4);
% Loopback Mode
obj.setDebugAttributeLongLong('loopback', obj.LoopbackMode);

% Enable Rx1-Rx2 Phase Inversion
obj.setDebugAttributeLongLong('adi,rx1-rx2-phase-inversion-enable', obj.EnableRx1Rx2PhaseInversion);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't do anything unless CustomAGC is enabled


% Sample rates and RF bandwidth
if ~obj.EnableCustomFilter
if libisloaded('libad9361')
Expand Down