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

Fsylvestre/ad7944 #562

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fsylvestre
Copy link

Description

  • Add adi/ad7944.py module
  • Add ad7944 to index.rst
  • Add ad7944 to supported_parts.md
  • Add ad7944 doc stub
  • Add test/ad7944.py test, xml file
  • Add ad7944 to hardware_map.xml

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this been tested?

  • Tested against AD7944, AD7986 and AD7985 eval boards attached to a zedboard.

  • Generalized manual test flow:

install pyadi-iio and dependencies in venv
Start Python interpreter
import adi
Instantiate adc object, e.g. adc = adi.ad7944(uri="ip:10.2.5.203")
Check that adc.rx() succeeds with no warnings or errors
Check sampling frequency with adc.sampling_frequency
Set sampling frequency with adc.sampling_frequency =
Check sampling frequency again with adc.sampling_frequency and confirm change successful

  • Test artifacts for pytest-libiio added as test/test_ad7944.py and run from local machine using e.g.:
    pytest --hw=ad7944 -v test/test_ad7944.py --uri=ip:10.2.5.203
    and
    pytest -v --emu --emu-xml=ad7944.xml test/test_ad7944.py

Test Configuration:

Hardware: Zedboard + EVAL-AD7944FMCZ/EVAL_AD7944_85_86FMCZ

OS:

PRETTY_NAME="Kuiper GNU/Linux 11.2 (bullseye)"
NAME="Kuiper GNU/Linux"
VERSION_ID="11.2"
VERSION="11.2 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="https://github.com/analogdevicesinc/adi-kuiper-gen"
SUPPORT_URL="https://ez.analog.com/linux-software-drivers/"

root@zed-2:~# uname -r
6.1.0-adi-22811-gd73dba4315e6

Documentation

Added:

  • doc/source/devices/adi.ad7944.rst

Updated:

  • doc/source/devices/index.rst
  • supported_parts.md

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/ad7944.py Outdated
_device_name = ""
_rx_data_type = np.uint16

_rx_channel_names = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

This need to be reset to [] in the init or just defined by the init. Class properties act like static properties, so using multiple instances will cause undesired behavior


if not self._ctrl:
raise Exception(f"Error in selecting matching device {device_name}")

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a check for self._ctrl as well

Copy link
Author

Choose a reason for hiding this comment

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

Do you mean self._trigger ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, meant self._rxadc

Copy link
Author

Choose a reason for hiding this comment

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

In this case I don't get it as self._rxadc = self._ctrl, so if self._ctrl is not None it's the same for self._rxadc. No?

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.

Generally good :) Just some minor tweaks.

Thanks for the contribution!

threexc and others added 5 commits October 11, 2024 09:50
- Add adi/ad7944.py module
- Add ad7944 to index.rst
- Add ad7944 to supported_parts.md
- Add ad7944 doc stub
- Add test/ad7944.py test, xml file
- Add ad7944 to hardware_map.xml

Signed-off-by: Trevor Gamblin <[email protected]>
Signed-off-by: Florian Sylvestre <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
Signed-off-by: Florian Sylvestre <[email protected]>

_compatible_parts = ["ad7944"]
_device_name = ""
_rx_data_type = np.uint16
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, the HDL team has decided to try to standardize on using 32-bit words for SPI offload support.

So this means that the data type will be 16-bit if not using SPI offload but 32-bit if using SPI offload.

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