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: Refactor AD4170 and add AD4190 support #48

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

jansunil
Copy link
Collaborator

@jansunil jansunil commented Feb 3, 2025

Restructured the AD4170 driver to use a base class

Added support to AD4190 device

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation by running /docs/source/reference_api/gen_sysobj_doc.m script locally, if applies.

Copy link
Collaborator

@SaikiranGudla SaikiranGudla left a comment

Choose a reason for hiding this comment

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

Can we also add the parts to docs/source/index.rst?

+adi/+AD4170/Base.m Outdated Show resolved Hide resolved
Comment on lines 85 to 88
obj.setAttributeRAW('voltage0', 'fs', value, false, obj.iioDev);
obj.setAttributeRAW('voltage1', 'fs', value, false, obj.iioDev);
obj.setAttributeRAW('voltage2', 'fs', value, false, obj.iioDev);
obj.setAttributeRAW('voltage3', 'fs', value, false, obj.iioDev);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Shall we implement in this way in a loop?

for i=1:length(obj.channel_names)

Similar comment for setupInit() function

properties (Hidden, Constant)
ComplexData = false
channel_names = {'voltage0','voltage1','voltage2'...
'voltage3','voltage4'};
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the base class, we've setters till channel 3 only. Should we also add ch4 there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd limit it to channel3- as the default configurations in the FW are only till ch4

Restructured the AD4170 driver to use a base class

Added support to AD4190 device

Signed-off-by: Janani Sunil <[email protected]>
@jansunil jansunil force-pushed the refactor-ad4170-driver branch from e8c64e9 to 20bd2d4 Compare February 3, 2025 13:01
@jansunil jansunil merged commit 488496c into main Feb 3, 2025
3 of 5 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.

2 participants