-
Notifications
You must be signed in to change notification settings - Fork 16
update AD9152 to work with AD915x #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
IonutMuthi
wants to merge
2
commits into
master
Choose a base branch
from
add_ad915x
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,75 +1,20 @@ | ||
| classdef (Abstract) Base < ... | ||
| adi.common.RxTx & ... | ||
| matlabshared.libiio.base | ||
| classdef (Abstract) Base < adi.AD915x.Base | ||
| %AD9152 Base | ||
|
|
||
| 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 = obj@matlabshared.libiio.base(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(['AD9152 ',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 = 'AD9152'; | ||
| end | ||
|
|
||
| end | ||
| end | ||
|
|
This file contains hidden or 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
This file contains hidden or 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,65 @@ | ||
| classdef (Abstract) Base < ... | ||
| adi.common.RxTx & ... | ||
| matlabshared.libiio.base | ||
| %AD915x Base | ||
|
|
||
| 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 = obj@matlabshared.libiio.base(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 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 | ||
| end | ||
| end | ||
|
|
This file contains hidden or 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,51 @@ | ||
| classdef Tx < adi.common.Tx & adi.AD915x.Base & adi.common.DDS & adi.common.Attribute | ||
| % adi.AD915x.Tx | ||
| % | ||
| % | ||
|
|
||
| properties (Dependent) | ||
| %SamplingRate Sampling Rate | ||
| % Baseband sampling rate in Hz, specified as a scalar | ||
| % in samples per second. This value is constant | ||
| SamplingRate | ||
| end | ||
|
|
||
| properties (Hidden, Nontunable, Access = protected) | ||
| isOutput = true; | ||
| end | ||
|
|
||
| properties(Nontunable, Hidden, Constant) | ||
| Type = 'Tx'; | ||
| end | ||
|
|
||
| methods | ||
| %% Constructor | ||
| function obj = Tx(varargin) | ||
| % Returns the matlabshared.libiio.base object | ||
| coder.allowpcode('plain'); | ||
| obj = obj@adi.AD915x.Base(varargin{:}); | ||
| end | ||
|
|
||
| function value = get.SamplingRate(obj) | ||
| if obj.ConnectedToDevice | ||
| value= obj.getAttributeLongLong('voltage0','sampling_frequency',true); | ||
| else | ||
| value = NaN; | ||
| end | ||
| 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 | ||
| end | ||
| end | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.