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

AD7944: Add support for AD7944/85/86 devices #635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

threexc
Copy link
Contributor

@threexc threexc commented Feb 6, 2025

Description

This is the (final) PR for supporting the AD7944, AD7985, and AD7986 devices in pyadi-iio. It features a somewhat new approach to testing the sampling_frequency attribute and some variable logic depending on whether or not SPI offload is enabled in the driver.

Note that it supersedes the work done in #562.

As of right now, new emulation files still need to be added for the AD7944 and AD7986, so it's marked as a draft.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Tested on a Zedboard running Linux with the AD7944/85/86 driver loaded, using pyadi-iio to interact with the device remotely.
  • Tested against emulated targets.

Test Configuration:

  • Hardware: Zedboard with EVAL-AD7985FMCZ
  • OS: Kuiper Linux with custom kernel

Documentation

Documentation is included to reflect the new devices and their functionality.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have signed off all commits and they contain "Signed-off by: "
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@threexc
Copy link
Contributor Author

threexc commented Feb 6, 2025

@tfcollins I think this is mostly ready to squash, do any extra pre-commit cleanups on, etc. (once I get the ad7944 and ad7986 emulation files updated), but I have a question about tests:

This device's data type and sampling_frequency range both change depending on whether or not SPI offload is configured in the kernel (this is the only way to achieve the maximum sample rate). Right now, everything works only in offload mode, since that's what we expect most users are going to want for best performance. This means that if someone were to try using the code with a non-offload kernel, they'd probably find it doesn't work (as of right now I'm getting timeouts when trying to read data).

Given that the non-offload version also requires a hrtimer trigger to be configured on the host system, it may not be reasonable to include support for that mode. I'm still experimenting...

Is this a problem from a pyadi-iio perspective, if it's documented?

@threexc threexc marked this pull request as ready for review February 11, 2025 15:33
@tfcollins tfcollins self-requested a review February 17, 2025 19:33
Copy link
Collaborator

@tfcollins tfcollins left a comment

Choose a reason for hiding this comment

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

Code is fine. Just need to fix lint errors

@threexc
Copy link
Contributor Author

threexc commented Feb 18, 2025

Updated!

@threexc threexc closed this Feb 18, 2025
@threexc
Copy link
Contributor Author

threexc commented Feb 18, 2025

Accidentally hit close. Should be ready to go now.

@threexc threexc reopened this Feb 18, 2025
@threexc threexc requested a review from tfcollins February 20, 2025 14:52
- Add adi/ad7944.py module
- Add ad7944 to index.rst
- Add ad7944/85/86 to supported_parts.md
- Add ad7944 doc stub
- Add test/ad7944/85/86.py test, xml file
- Add ad7944/85/86 to hardware_map.xml

Signed-off-by: Florian Sylvestre <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
@threexc
Copy link
Contributor Author

threexc commented Feb 25, 2025

@tfcollins FYI the XML was updated, but I don't have merge permission.

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