-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from analogdevicesinc/ad9208_streaming
streaming for AD9208
- Loading branch information
Showing
2 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
classdef (Abstract) Base < ... | ||
adi.common.RxTx & ... | ||
matlabshared.libiio.base | ||
%AD9208 Base Class | ||
|
||
properties (Nontunable) | ||
%SamplesPerFrame Samples Per Frame | ||
% Number of samples per frame, specified as an even positive | ||
% integer from 2 to 16,777,216. Using values less than 3660 can | ||
% yield poor performance. | ||
SamplesPerFrame = 2^15; | ||
end | ||
|
||
properties(Nontunable, Hidden) | ||
Timeout = Inf; | ||
kernelBuffersCount = 2; | ||
dataTypeStr = 'int16'; | ||
end | ||
|
||
properties (Abstract, Hidden, Constant) | ||
Type | ||
end | ||
|
||
properties (Hidden, Constant) | ||
ComplexData = false; | ||
end | ||
|
||
methods | ||
%% Constructor | ||
function obj = Base(varargin) | ||
% Returns the matlabshared.libiio.base object | ||
coder.allowpcode('plain'); | ||
obj = [email protected](varargin{:}); | ||
end | ||
% Check SamplesPerFrame | ||
function set.SamplesPerFrame(obj, value) | ||
validateattributes( value, { 'double','single' }, ... | ||
{ 'real', 'positive','scalar', 'finite', 'nonnan', 'nonempty','integer','>',0,'<',2^20+1}, ... | ||
'', 'SamplesPerFrame'); | ||
obj.SamplesPerFrame = value; | ||
end | ||
end | ||
|
||
%% API Functions | ||
methods (Hidden, Access = protected) | ||
|
||
function icon = getIconImpl(obj) | ||
icon = sprintf(['AD9208 ',obj.Type]); | ||
end | ||
|
||
function setupInit(~) | ||
% Unused | ||
end | ||
|
||
end | ||
|
||
%% External Dependency Methods | ||
methods (Hidden, Static) | ||
|
||
function tf = isSupportedContext(bldCfg) | ||
tf = matlabshared.libiio.ExternalDependency.isSupportedContext(bldCfg); | ||
end | ||
|
||
function updateBuildInfo(buildInfo, bldCfg) | ||
% Call the matlabshared.libiio.method first | ||
matlabshared.libiio.ExternalDependency.updateBuildInfo(buildInfo, bldCfg); | ||
end | ||
|
||
function bName = getDescriptiveName(~) | ||
bName = 'AD9208'; | ||
end | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
classdef Rx < adi.common.Rx & adi.AD9208.Base | ||
% adi.AD9208.Rx Receive data from the AD9208 high speed multi-channel ADC | ||
% The adi.AD9208.Rx System object is a signal source that can receive | ||
% data from the AD9208. | ||
% | ||
% rx = adi.AD9208.Rx; | ||
% rx = adi.AD9208.Rx('uri','192.168.2.1'); | ||
% | ||
% <a href="http://www.analog.com/media/en/technical-documentation/data-sheets/AD9208.pdf">AD9208 Datasheet</a> | ||
% | ||
|
||
properties (Constant) | ||
%SamplingRate Sampling Rate | ||
% Baseband sampling rate in Hz, specified as a scalar | ||
% in samples per second. This value is constant | ||
SamplingRate = 125e6; | ||
end | ||
properties (Hidden, Nontunable, Access = protected) | ||
isOutput = false; | ||
end | ||
|
||
properties(Nontunable, Hidden, Constant) | ||
Type = 'Rx'; | ||
end | ||
|
||
properties (Nontunable, Hidden) | ||
devName = 'axi-AD9208-rx-hpc'; | ||
channel_names = {... | ||
'voltage0',... | ||
'voltage1',... | ||
}; | ||
end | ||
|
||
methods | ||
%% Constructor | ||
function obj = Rx(varargin) | ||
% Returns the matlabshared.libiio.base object | ||
coder.allowpcode('plain'); | ||
obj = [email protected](varargin{:}); | ||
end | ||
end | ||
|
||
%% External Dependency Methods | ||
methods (Hidden, Static) | ||
|
||
function tf = isSupportedContext(bldCfg) | ||
tf = matlabshared.libiio.ExternalDependency.isSupportedContext(bldCfg); | ||
end | ||
|
||
function updateBuildInfo(buildInfo, bldCfg) | ||
% Call the matlabshared.libiio.method first | ||
matlabshared.libiio.ExternalDependency.updateBuildInfo(buildInfo, bldCfg); | ||
end | ||
|
||
function bName = getDescriptiveName(~) | ||
bName = 'AD9208'; | ||
end | ||
|
||
end | ||
end | ||
|