Skip to content
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

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Conversation

ribdp
Copy link
Contributor

@ribdp ribdp commented Nov 1, 2023

  1. Add a generic driver and example script to serve as a workaround if the part-specific MATLAB driver is missing.
  2. With the default kernelBuffersCount of 1, the driver will also work if the connected platform is tinyiiod and not ADI Linux

@CLAassistant
Copy link

CLAassistant commented Nov 1, 2023

CLA assistant check
All committers have signed the CLA.

@ribdp ribdp requested a review from tfcollins November 1, 2023 19:44
@ribdp ribdp force-pushed the tinyiiod-and-generic-driver branch from 96acc47 to 119cf34 Compare November 2, 2023 03:27
@mphalke mphalke self-requested a review November 2, 2023 05:42
@ribdp ribdp force-pushed the tinyiiod-and-generic-driver branch from 119cf34 to ca76250 Compare November 2, 2023 06:48
@ribdp
Copy link
Contributor Author

ribdp commented Nov 2, 2023

Changes:

  1. Fix typos in docstrings

Comment on lines 63 to 66
% Set device name and uri from input arguments
obj.devName = varargin{1};
obj.phyDevName = varargin{1};
obj.uri = varargin{2};
Copy link
Contributor

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

Copy link
Contributor Author

@ribdp ribdp Nov 2, 2023

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]>
@ribdp ribdp force-pushed the tinyiiod-and-generic-driver branch from ca76250 to bf7f26b Compare November 2, 2023 16:11
@ribdp
Copy link
Contributor Author

ribdp commented Nov 2, 2023

Changes:

  1. Improve input argument parsing for constructor

@ribdp ribdp requested a review from tfcollins November 2, 2023 16:14
@ribdp
Copy link
Contributor Author

ribdp commented Nov 3, 2023

@mphalke , @tfcollins - any comments/suggestions here?

% at initialization time
DeviceAttributeNames

% ChannelAttributeNames Device Attribute Names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Channel attributes names

+adi/+Generic/Rx.m Show resolved Hide resolved
+adi/+Generic/Rx.m Show resolved Hide resolved
% 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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update this

% 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
Copy link
Contributor

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?

Copy link
Contributor Author

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?

+adi/+Generic/Rx.m Outdated Show resolved Hide resolved
+adi/+Generic/Rx.m Show resolved Hide resolved
+adi/+Generic/Rx.m Show resolved Hide resolved
+adi/+Generic/Rx.m Show resolved Hide resolved
+adi/+Generic/Rx.m Show resolved Hide resolved
@mphalke
Copy link
Contributor

mphalke commented Nov 3, 2023

@mphalke , @tfcollins - any comments/suggestions 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]>
@ribdp ribdp requested a review from mphalke December 22, 2023 11:26
@ribdp ribdp merged commit 7ff284b into main Jan 5, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants