Skip to content

Commit 83ec62e

Browse files
author
Ionut.Muthi
committed
add streaming for AD917x board family
1 parent 00b1e74 commit 83ec62e

2 files changed

Lines changed: 110 additions & 0 deletions

File tree

+adi/+internal/+AD917x/Base.m

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
classdef (Abstract) Base < ...
2+
adi.common.RxTx & ...
3+
matlabshared.libiio.base
4+
%AD917x Base Summary of this class goes here
5+
% Detailed explanation goes here
6+
7+
properties (Nontunable)
8+
%SamplesPerFrame Samples Per Frame
9+
% Number of samples per frame, specified as an even positive
10+
% integer from 2 to 16,777,216. Using values less than 3660 can
11+
% yield poor performance.
12+
SamplesPerFrame = 2^15;
13+
end
14+
15+
properties(Nontunable, Hidden)
16+
Timeout = Inf;
17+
kernelBuffersCount = 2;
18+
dataTypeStr = 'int16';
19+
end
20+
21+
properties (Abstract, Hidden, Constant)
22+
Type
23+
end
24+
25+
properties (Hidden, Constant)
26+
ComplexData = true;
27+
end
28+
29+
methods
30+
%% Constructor
31+
function obj = Base(varargin)
32+
% Returns the matlabshared.libiio.base object
33+
coder.allowpcode('plain');
34+
obj = obj@matlabshared.libiio.base(varargin{:});
35+
end
36+
% Check SamplesPerFrame
37+
function set.SamplesPerFrame(obj, value)
38+
validateattributes( value, { 'double','single' }, ...
39+
{ 'real', 'positive','scalar', 'finite', 'nonnan', 'nonempty','integer','>',0,'<',2^20+1}, ...
40+
'', 'SamplesPerFrame');
41+
obj.SamplesPerFrame = value;
42+
end
43+
end
44+
45+
%% API Functions
46+
methods (Hidden, Access = protected)
47+
function setupInit(~)
48+
% Unused
49+
end
50+
end
51+
52+
%% External Dependency Methods
53+
methods (Hidden, Static)
54+
55+
function tf = isSupportedContext(bldCfg)
56+
tf = matlabshared.libiio.ExternalDependency.isSupportedContext(bldCfg);
57+
end
58+
59+
function updateBuildInfo(buildInfo, bldCfg)
60+
% Call the matlabshared.libiio.method first
61+
matlabshared.libiio.ExternalDependency.updateBuildInfo(buildInfo, bldCfg);
62+
end
63+
end
64+
end
65+

+adi/+internal/+AD917x/Tx.m

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
classdef Tx < adi.common.Tx & adi.AD917x.Base & adi.common.DDS
2+
% adi.AD917x.Tx
3+
%
4+
% <a href="https://www.analog.com/en/design-center/evaluation-hardware-and-software/software/AD917x-API.html#software-overview">AD917x </a>
5+
%
6+
7+
8+
properties (Constant)
9+
%SamplingRate Sampling Rate
10+
% Baseband sampling rate in Hz, specified as a scalar
11+
% in samples per second. This value is constant
12+
SamplingRate = 1e9;
13+
end
14+
15+
properties (Hidden, Nontunable, Access = protected)
16+
isOutput = true;
17+
end
18+
19+
properties(Nontunable, Hidden, Constant)
20+
Type = 'Tx';
21+
end
22+
23+
methods
24+
%% Constructor
25+
function obj = Tx(varargin)
26+
% Returns the matlabshared.libiio.base object
27+
coder.allowpcode('plain');
28+
obj = obj@adi.AD917x.Base(varargin{:});
29+
end
30+
end
31+
32+
%% External Dependency Methods
33+
methods (Hidden, Static)
34+
35+
function tf = isSupportedContext(bldCfg)
36+
tf = matlabshared.libiio.ExternalDependency.isSupportedContext(bldCfg);
37+
end
38+
39+
function updateBuildInfo(buildInfo, bldCfg)
40+
% Call the matlabshared.libiio.method first
41+
matlabshared.libiio.ExternalDependency.updateBuildInfo(buildInfo, bldCfg);
42+
end
43+
end
44+
end
45+

0 commit comments

Comments
 (0)