Skip to content

ad9213 dev pyadi - #770

Open
TudorAndreiTicudean wants to merge 5 commits into
mainfrom
ad9213_dev_pyadi
Open

ad9213 dev pyadi#770
TudorAndreiTicudean wants to merge 5 commits into
mainfrom
ad9213_dev_pyadi

Conversation

@TudorAndreiTicudean

Copy link
Copy Markdown
Collaborator

Description

Add PyADI support for ad9213 based on already-existing: https://github.com/analogdevicesinc/pyadi-iio/tree/ad9213_dev

Fixes # (issue)

Type of change

  • Bug fix
  • New device class interface
  • New feature on an existing class
  • Breaking change
  • Documentation only
  • Test or CI only

How has this been tested?

State explicitly whether this was tested against real hardware, an emulated context (iio-emu), or not run. Name the part(s) and the context URI or board used.

  • Hardware / emulation: Real hardware - AD9213 on VCU118. Also verified against emulated context via iio-emu with ad9213.xml.
  • Commands run (e.g. python3 -m pytest -k ad4080 --adi-hw-map):
    -- pytest test/test_ad9213.py -v
    -- python3 examples/ad9213_example.py
  • Result: Test passed. Example ran successfully, register read/write and RX buffer capture confirmed working.

Test configuration

  • Kernel / libiio version: 6.12.0-26956-g8edd67c2e728 / libiio 0.25
  • OS: Linux buildroot (target), WSL2 Ubuntu (host)
  • FPGA carrier (if applicable): VCU118

Documentation

  • No documentation change needed
  • Updated existing docs under doc/source/
  • Added a new device page and linked it from the relevant toctree

New device class interfaces

Skip this section if the PR does not add a new device class.

  • Class extends one of the common base classes in adi.device_base (rx_chan_comp, tx_chan_comp, or a _no_buff variant). If not, explain why in the description. See the Device Base Classes developer doc page.
  • compatible_parts lists every part number this class supports
  • Part numbers added to supported_parts.md (verify with invoke checkparts)
  • Emulation context (xml_gen, not iio_genxml) added under test/emu/ and referenced from a test
  • Tests added that run against the emulation context in CI

Checklist

  • invoke precommit passes locally
  • All commits are signed off (Signed-off-by: Name <email>)
  • No new warnings from the build or doc generation
  • Dependent changes in libiio, kernel, or HDL are merged and referenced

PopPaul2021 and others added 2 commits May 10, 2024 13:59
Signed-off-by: PopPaul2021 <Paul.Pop@analog.com>
Finished adding pyadi-iio support for ad9213. The branch was created
based on: https://github.com/analogdevicesinc/pyadi-iio/tree/ad9213_dev

Signed-off-by: Tudor-andrei-Ticudean_adi <Tudor-andrei.Ticudean@analog.com>
Keep validated ad9213 driver implementation based on real hardware
(iio_info from VCU118 + AD9213).

Main had an unvalidated stub using rx_def and axi-ad9213-rx-hpc which does
not exist on actual hardware.

Signed-off-by: Tudor-andrei-Ticudean <Tudor-andrei.Ticudean@analog.com>
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Test Results

2 047 tests  +1     754 ✅ ±0   4m 14s ⏱️ -8s
    1 suites ±0   1 293 💤 +1 
    1 files   ±0       0 ❌ ±0 

Results for commit 3e2b354. ± Comparison against base commit 696c4b0.

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown

IIO Context Coverage Report

New device classes in this PR: (adis16375, adis16480, adis16485, adis16488

Minimum required total coverage: 75.0%

Summary

Hardware Device Attr Coverage Channel Attr Coverage Total Coverage Status
adis16480 0/4 (0.0%) 0/49 (0.0%) 0/53 (0.0%)
Untested attributes (click to expand)

adis16480

  • adis16480 device attrs untested: current_timestamp_clock, sampling_frequency
  • null device attrs untested: add_trigger, remove_trigger
  • adis16480 input ch accel_x untested: calibbias, calibscale, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch accel_y untested: calibbias, calibscale, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch accel_z untested: calibbias, calibscale, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch anglvel_x untested: calibbias, calibscale, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch anglvel_y untested: calibbias, calibscale, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch anglvel_z untested: calibbias, calibscale, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch magn_x untested: calibbias, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch magn_y untested: calibbias, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch magn_z untested: calibbias, filter_low_pass_3db_frequency, raw, scale
  • adis16480 input ch pressure0 untested: calibbias, raw, scale
  • adis16480 input ch temp0 untested: offset, raw, scale
  • rpi_volt input ch in0 untested: lcrit_alarm

Coverage check failed. The following new parts are below the 75.0% minimum total coverage: adis16480.


Generated by IIO Context Coverage workflow

@github-actions

Copy link
Copy Markdown

Generated documentation for this PR is available at Link

Signed-off-by: Tudor-andrei-Ticudean <Tudor-andrei.Ticudean@analog.com>
@tfcollins

Copy link
Copy Markdown
Collaborator

The driver naming here of ad9213 is non-standard. We always use a convention axi-<part>-rx-hpc. I guess this is a devicetree naming bug?

@tfcollins
tfcollins self-requested a review July 1, 2026 17:12

@tfcollins tfcollins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The driver naming seems off. Please consult with the Linux team here.

@TudorAndreiTicudean

TudorAndreiTicudean commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

The driver naming here of ad9213 is non-standard. We always use a convention axi-<part>-rx-hpc. I guess this is a devicetree naming bug?

Checked the ADI Linux dev branch ad9213_check, in drivers/iio/adc/ad9213.c the device name is hardcoded as "ad9213" (line 692) and the DT compatible is "adi,ad9213". Note this branch is still in development and not yet upstream. I think this might follow the SPI device convention rather than the AXI core axi--rx-hpc naming, but I'm not sure, happy to update if needed or ask the Linux team.

Update: I asked the person that created the PR about the naming. From what I understand it should be parsed from device tree and not hardcoded.

Update 2: Person answered: The ad9213 does not use "axi_adc", it uses "iio_backend" so the naming should be correct in this case. Maybe it could be named to "ad9213_phy" to be more precise.

@tfcollins tfcollins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can to address the inheritance usage question of rx vs rx_def

Comment thread adi/ad9213.py Outdated

from adi.context_manager import context_manager
from adi.rx_tx import rx_def
from adi.rx_tx import rx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Keep rx_def. It has more supported features

Comment thread adi/ad9213.py Outdated
"""sampling_frequency: Sample rate of the ADC in Hz."""
return self._get_iio_attr("voltage0", "sampling_frequency", False, self._rxadc)

def ad9213_register_read(self, reg):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should be called just register_read. We already know its a ad9213

Comment thread adi/ad9213.py Outdated

class ad9213(rx_def, context_manager):
""" AD9213 High-Speed ADC """
class ad9213(rx, context_manager):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are you using the rx class directly here vs the rx_def? rx_def would give you more functionality.

Signed-off-by: Tudor-andrei-Ticudean <Tudor-andrei.Ticudean@analog.com>
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.

3 participants