Skip to content

feat: add AD9629 register definitions - #207

Draft
IM-TechieScientist wants to merge 3 commits into
fossasia:dev26from
IM-TechieScientist:ad9629-platform-driver
Draft

feat: add AD9629 register definitions #207
IM-TechieScientist wants to merge 3 commits into
fossasia:dev26from
IM-TechieScientist:ad9629-platform-driver

Conversation

@IM-TechieScientist

@IM-TechieScientist IM-TechieScientist commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Adds the initial AD9629 platform driver files for #201. PR is dependent on #206.

  • Adds src/platform/ad9629.h and src/platform/ad9629.c.
  • Defines AD9629 register addresses from the datasheet memory map.
  • Adds bit masks for SPI config, modes, clock divide, test mode, BIST, output mode, output adjust, output phase, output delay, OR/MODE select and USR2.
  • Adds typed enums for speed grade, power mode, clock divide, output format, output drive, DCO polarity, test modes, user pattern modes and output delay steps.
  • Adds the public AD9629 control API scaffold for register access, reset/probe, output configuration, test patterns, BIST and lowrate GCLK/SDIO controls.

Summary by Sourcery

Introduce an ADC frontend abstraction layer and scaffold AD9629 external ADC support while migrating DSO and mixed-signal instruments to the new interface.

New Features:

  • Add a generic ADC frontend interface with backend selection, capability querying, and capture orchestration.
  • Add an internal ADC frontend backend that wraps the existing adc_capture implementation.
  • Add AD9629 platform driver and public control API with register definitions and typed configuration/controls for the external parallel ADC.

Enhancements:

  • Update DSO and mixed-signal instruments to use the ADC frontend interface and backend capabilities instead of direct adc_capture constants.

Build:

  • Wire new ADC frontend and AD9629 driver sources into the CMake build and register the internal ADC frontend during platform initialization.

@sourcery-ai

sourcery-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a generic ADC frontend abstraction with an internal backend driver, migrates DSO and mixed-signal instruments to this interface, and scaffolds a new AD9629 external ADC register/control driver with typed configuration and API but stubbed hardware operations.

File-Level Changes

Change Details Files
Add AD9629 external ADC register map, configuration types, and control API with stubbed implementations.
  • Define AD9629 register addresses, bit masks, enums, and configuration/handle types for SPI control and output/test features.
  • Implement default configuration, init/deinit, and placeholder functions for all AD9629 register access and control operations that currently return false.
  • Document that commit only scaffolds the control plane and leaves actual SPI transactions for later work.
src/platform/ad9629.h
src/platform/ad9629.c
Introduce an ADC frontend abstraction layer and register an internal backend that adapts the existing adc_capture implementation.
  • Define AdcFrontendBackend, capabilities, config, capture info, driver vtable, and frontend API for registering drivers, selecting backends, and performing captures.
  • Implement adc_frontend.c with driver registry, active-backend selection, capture orchestration (run/arm/start/wait/abort), capability queries, and a completion callback mechanism.
  • Add internal_adc_frontend adapter that wraps adc_capture into an AdcFrontendDriver, mapping configs and capture info and exposing capabilities and operations.
  • Register the internal ADC frontend driver during platform initialization and wire new sources into the build system.
src/system/instrument/adc_frontend.h
src/system/instrument/adc_frontend.c
src/platform/internal_adc_frontend.h
src/platform/internal_adc_frontend.c
src/platform/platform.c
CMakeLists.txt
Refactor DSO and mixed-signal instrument code to use the new ADC frontend interface instead of adc_capture directly.
  • Replace adc_capture includes with adc_frontend where appropriate and update comments to reference the ADC frontend interface.
  • Use adc_frontend_get_capabilities to validate channels and sample rates dynamically rather than static ADC_CAPTURE_* constants.
  • Update configuration and capture flows in dso and mixed_signal modules to use AdcFrontendConfig, AdcFrontendCaptureInfo, and adc_frontend_* functions for init/configure/run/arm/start/wait/read_once/is_busy and GPIO mapping.
  • Add small helper functions for reusing capability queries and remove redundant "!initialized" checks now handled by adc_frontend_configure/apply_config.
src/system/instrument/dso.c
src/system/instrument/mixed_signal.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

1 participant