-
Notifications
You must be signed in to change notification settings - Fork 11
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
adi:Generic: Add a generic driver #13
Conversation
ribdp
commented
Nov 1, 2023
•
edited
Loading
edited
- Add a generic driver and example script to serve as a workaround if the part-specific MATLAB driver is missing.
- With the default kernelBuffersCount of 1, the driver will also work if the connected platform is tinyiiod and not ADI Linux
96acc47
to
119cf34
Compare
119cf34
to
ca76250
Compare
Changes:
|
+adi/+Generic/Rx.m
Outdated
% Set device name and uri from input arguments | ||
obj.devName = varargin{1}; | ||
obj.phyDevName = varargin{1}; | ||
obj.uri = varargin{2}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to add some explicit checks here. For example, if you don't give any arguments it will generate an odd error. It might be useful to use PV (parameter + value) pairs to its very clear on what arguments do what. This would change the API to:
rx = adi.Generic.Rx('devName','ad4630-24', 'uri','ip:analog.local', 'phyDevName', 'ad4630-24')
Note that order won't matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have addressed this now
1. Add a generic driver and example script Signed-off-by: RibhuDP <[email protected]>
ca76250
to
bf7f26b
Compare
Changes:
|
@mphalke , @tfcollins - any comments/suggestions here? |
+adi/+Generic/Rx.m
Outdated
% at initialization time | ||
DeviceAttributeNames | ||
|
||
% ChannelAttributeNames Device Attribute Names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Channel attributes names
examples/Generic_DataCapture.m
Outdated
% Instantiate the Generic Rx system object, and specify the device name and uri | ||
rx = adi.Generic.Rx('ad4630-24', 'ip:analog.local'); | ||
|
||
rx.SamplesPerFrame = 4096; % Using values less than 3660 can yield poor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should comment be at top of expression similar to other comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update this
examples/Generic_DataCapture.m
Outdated
% Instantiate the Generic Rx system object, and specify the device name and uri | ||
rx = adi.Generic.Rx('ad4630-24', 'ip:analog.local'); | ||
|
||
rx.SamplesPerFrame = 4096; % Using values less than 3660 can yield poor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious how did we come up with value 3660?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just a heuristic obtained from testing parts in the HSX/TRX toolbox, and I thought to adopt the same here. @tfcollins - is this comment valid in only specific conditions/parts? Is it okay to keep it here?
I had added some comments but looks like those were not reflected into the PR. Now did that, so those must be visible now |
1. Add docstrings for properties 2. Remove extra line 3. Fix type in docstring 4. Remove extraneous comment Signed-off-by: RibhuDP <[email protected]>