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

Add support for ADAQ42xx #487

Merged
merged 8 commits into from
Nov 17, 2023

Conversation

machschmitt
Copy link
Contributor

@machschmitt machschmitt commented Oct 19, 2023

Description

AD4630 and ADAQ42xx designs are very similar, differing mainly on the availability (or not) of PGIA gain.
Add input scale properties to handle ADAQ42xx PGIA control and add ADAQ4216, ADAQ4220, and ADAQ4224 to the list of supported devices.

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?

This has been tested on ZebBoard with EVAL-ADAQ4224-FMCZ (setup by @ladace).

Test Configuration:

  • Hardware: ZebBoard with EVAL-ADAQ4224-FMCZ
  • OS: Very likely Kuiper Linux

From iio_info:

	hdl_system_id: [AD463XADAQ42XXN0_CLKMODE0_NUMOFSDI1_CAPTUREZONE2_DDREN0/ad463x_adaq42xx_zed] [sys rom custom string placeholder] on [zed] git branch [dev_adaq4224_final] git [7df56bd2d04bdccc44d9bbfa94c800b828abb80f] dirty [2023-11-01 14:03:21] UTC
	hw_model: EVAL-ADAQ4224-FMCZ on Xilinx Zynq ZED
  • Test A: Ran the newly provided example for adaq4224 remotely with
    python3 examples/ad4630/ad4630_example_scale.py "ip:<address_omitted>" "adaq4224"
  • Test B: Ran the newly provided scale attribute test with
    pytest -vs --emu --custom-hw-map=test/emu/hardware_map.yml -k 'not prod' test/test_ad4630.py

Documentation

Linux kernel support has been included in PR #2262.

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

adi/ad4630.py Outdated Show resolved Hide resolved
adi/ad4630.py Outdated Show resolved Hide resolved
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.

We can get a bit better reuse on the parent class existing methods

@tfcollins tfcollins changed the base branch from master to main October 26, 2023 17:13
@machschmitt
Copy link
Contributor Author

Thank you for your review @tfcollins.

I made the changes you asked for.

Change log V1 -> V2:

  • Made compatible_parts a class attribute and used it to simplify adaq4224 subclass constructor.
  • Made adaq4224 class _channel inherit from ad4630 _channel so it reuses the methods from the parent class.

adi/ad4630.py Outdated Show resolved Hide resolved
adi/ad4630.py Outdated Show resolved Hide resolved
adi/ad4630.py Outdated Show resolved Hide resolved
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.

  • Add the necessary import in init.py
  • Include a new context file for the new system
  • Add a new test since the driver has more properties

@machschmitt
Copy link
Contributor Author

machschmitt commented Nov 1, 2023

I don't have adqa4224 but do have ad4030. I was trying to set up ad4030 with zed board to test this (even if indirectly), but something didn't work on the hdl/linux side. Will come back to this task when able to test the changes. By the way, should this PR also include a device XML file generated with xml_gen?

Change log V2 -> V3:

  • Made child constructor pass uri and device_name to super
  • Fixed codacy checks

@tfcollins
Copy link
Collaborator

I don't have adqa4224 but do have ad4030. I was trying to set up ad4030 with zed board to test this (even if indirectly), but something didn't work on the hdl/linux side. Will come back to this task when able to test the changes. By the way, should this PR also include a device XML file generated with xml_gen?

Yes for the new component

ad4630 simple plot example intended to iterate over the list of channels
but incorrect attribute name prevented it from doing so.
Use the correct channel list attribute name to iterate over
ad4630/adaq42xx channel list.

Fixes: <5cf933d91787> (Added ad4630 support)
Signed-off-by: Marcelo Schmitt <[email protected]>
AD4630 and ADAQ42xx designs are very similar, differing mainly on the
availability (or not) of PGIA gain.
Add input scale properties to handle ADAQ42xx PGIA control and add
ADAQ4216, ADAQ4220, and ADAQ4224 to the list of supported devices.

Signed-off-by: Marcelo Schmitt <[email protected]>
Add simple adaq4224 example featuring adjustable input scale.

Signed-off-by: Marcelo Schmitt <[email protected]>
We have sleep parameter for class interface tests.
Add sleep parameter for sub class inteface tests so class and sub class
tests can provide similar functionality.

Signed-off-by: Marcelo Schmitt <[email protected]>
Add short description for test sleep parameter.

Signed-off-by: Marcelo Schmitt <[email protected]>
Make attribute_multiple_values() test support sub channel attributes.
This might be useful for testing channel attributes which values must
match some available list such as scale_available,
sampling_frequency_available, etc.

Signed-off-by: Marcelo Schmitt <[email protected]>
Add adaq4224 device xml file and update hardware map with info about new
hardware emulation.

Signed-off-by: Marcelo Schmitt <[email protected]>
Add test for ADAQ4224 scale attribue.

Signed-off-by: Marcelo Schmitt <[email protected]>
@machschmitt
Copy link
Contributor Author

machschmitt commented Nov 8, 2023

Hi @tfcollins,

After testing this on ZebBoard with EVAL-ADAQ4224-FMCZ it was possible to make the code cleaner.
I updated the PR description with more detailed info about the tests.
The new example is just a modified version of ad4630_example_simple_plot.py so we can maybe merge them or drop the new one. Whatever you think is better.
Also, the related Linux kernel changes have been merged.
It is easier to squash than to split so I made the changes to attribute tests as a group of three small patches.
Do I add adaq4224 to tasks.py ignore list to pass checkparts?

Change log V3 -> V4

  • Simplified back ad4630/adaq4224 constructors
  • Fixed scale_available property which was broken
  • Fixed bug on ad4630_example_simple_plot.py
  • Added simple adaq4224 example featuring adjustable input scale.
  • Minor neats to attribute tests to enable testing multiple values of channel attributes
  • Added adaq4224 xml file
  • Added test for new scale attribute

@machschmitt machschmitt requested a review from tfcollins November 8, 2023 22:11
@tfcollins tfcollins merged commit a7c267c into analogdevicesinc:main Nov 17, 2023
21 of 22 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