Skip to content

Conversation

@machschmitt
Copy link
Contributor

@machschmitt machschmitt commented Oct 7, 2025

Description

Update AD4630 pyadi-iio class to support AD4632-16/32 and to use supported Linux kernel interfaces for AD4630 and similar ADCs.
Also, update AD4630 example to use argparse, making the example more flexible with respect to command-line arguments.

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 with ADAQ4216 remote setup.

Test Configuration:

  • Hardware: ADAQ4216

  • OS: Linux kernel 6.17-rc3

Documentation

No documentation changes are needed.

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

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.

Can you provide a context file for emulation testing?


@property
def sample_averaging(self):
"""Get the sample averaging. Only available in 30bit averaged mode."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the docstring and property name still correct? Does this apply to all supported parts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @tfcollins
All parts are supported by the same drivers both in Linux and No-OS.
The IIO ABI used for controlling the sample averaging is oversampling_ratio. That applies to all supported parts.
The docstring abstracts the oversampling_ratio interface and presents it to users in terms of data sheet nomenclature (which is sample averaging). Should we update the docstrigs to match the underlying interfaces?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you be more descriptive on what this means. sample_averaging seems to be a boolean but oversampling_ratio would be an integer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sample_averaging should be an integer, not a boolean.
It is set in AD4630 averaging mode register 1 as an integer. The oversampling_ratio ABI 2 is the one that matches the sample_averaging device functionality 3. The use of oversampling_ratio is also documented within the IIO documentation 4.


@property
def sample_averaging_avail(self):
"""Get list of all the sample averaging values available. Only available in 30bit averaged mode."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as below comment

"ad4630-16",
"ad4630-24",
"ad4632-16",
"ad4632-24",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update supported parts MD

AD4632-16 and AD4632-24 are now support in Linux.
Add AD4632-16 and AD4632-24 to the list of supported/compatible parts.
Also add those to the list of supported parts.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Use python argparse [1] to handle command-line arguments thus making the
example more flexible with respect to its input arguments.
This also extends the example to work with other ADCs that belong to the
AD4000 series by enabling a device argument and using it to instantiate
the correct ADC object.

[1]: https://docs.python.org/3/library/argparse.html

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
In Linux, sample averaging for AD4630 and similar ADCs is supported through
oversampling ratio attributes. Use the supported interfaces to handle
sample averaging.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Add label to AD4630 plot axes to make it easier to understand data.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Add ADAQ4216 context file for emulation testing.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
@machschmitt machschmitt force-pushed the ad4630-example-improve branch from 1a16f30 to d74a7c7 Compare October 16, 2025 13:17
@machschmitt
Copy link
Contributor Author

Change log v1 -> v2:

  • Added newly supported parts to supported_parts.md.
  • Added ADAQ4216 context file for emulation testing.

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