From 4eef566119cebd5e2fb60fc52864844a618a9f86 Mon Sep 17 00:00:00 2001 From: SrikanthPagadarai Date: Wed, 7 Aug 2019 10:32:45 -0400 Subject: [PATCH 1/2] Added Rx1-Rx2 phase inversion enable property to AD9361 system object. --- +adi/+AD9361/Rx.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/+adi/+AD9361/Rx.m b/+adi/+AD9361/Rx.m index 25887b9..10b4bf2 100644 --- a/+adi/+AD9361/Rx.m +++ b/+adi/+AD9361/Rx.m @@ -95,6 +95,12 @@ isOutput = false; end + properties (Hidden) + %EnableRx1Rx2PhaseInversion + % If enabled, RX1 and RX2 are phase aligned + EnableRx1Rx2PhaseInversion = 0; + end + properties(Nontunable, Hidden, Constant) Type = 'Rx'; channel_names = {'voltage0','voltage1','voltage2','voltage3'}; @@ -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); + end + end end %% API Functions From e72f1ee39c64490940bba10e5e001b13e1b8b2e0 Mon Sep 17 00:00:00 2001 From: SrikanthPagadarai Date: Wed, 7 Aug 2019 10:51:21 -0400 Subject: [PATCH 2/2] Updated setupInit to set debug attribute for enabling Rx1-Rx2 phase inversion in AD9361 system object. --- +adi/+AD9361/Rx.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/+adi/+AD9361/Rx.m b/+adi/+AD9361/Rx.m index 10b4bf2..eae3b32 100644 --- a/+adi/+AD9361/Rx.m +++ b/+adi/+AD9361/Rx.m @@ -286,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); + % Sample rates and RF bandwidth if ~obj.EnableCustomFilter if libisloaded('libad9361')