Skip to content

drivers: adc: add dma support for ambiq adc driver #90776

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlessandroLuo
Copy link
Collaborator

This commit adds dma support for ambiq adc driver

Copilot

This comment was marked as outdated.

Copilot

This comment was marked as outdated.

Copilot

This comment was marked as outdated.

@AlessandroLuo AlessandroLuo force-pushed the ambiq-adc-dma branch 3 times, most recently from 2487477 to 2ab118c Compare May 30, 2025 06:16
@AlessandroLuo AlessandroLuo requested a review from Copilot May 30, 2025 06:19
Copilot

This comment was marked as outdated.

This commit adds dma support for ambiq adc driver

Signed-off-by: Hao Luo <[email protected]>
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds DMA support to the Ambiq ADC driver. The changes include updating device tree overlays and YAML bindings to add new DMA properties, modifying the ADC driver implementation to support DMA transfers (including added DMA configuration, triggering, and completion handling), and updating related DTS and Kconfig files.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
samples/drivers/adc/adc_dt/boards/apollo510_evb.overlay Adjusted ADC channel indexes and added DMA-related properties
samples/drivers/adc/adc_dt/boards/apollo3_evb.overlay Enabled DMA mode by adding dma-mode in the overlay
dts/bindings/adc/ambiq,adc.yaml Introduced new DMA property definitions for dma-mode, dma-buffer-location, and dma-buffer-size
dts/arm/ambiq/*.dtsi Removed unused counter nodes
drivers/adc/adc_ambiq.c Added DMA configuration, updated buffer types, integrated semaphore for DMA completion, and refactored ADC initialization and ISR
drivers/adc/Kconfig.ambiq Updated configuration to conditionally select timer and cache handling options
boards//.dts Minor adjustments in pinmux and counter configurations
Comments suppressed due to low confidence (1)

drivers/adc/adc_ambiq.c:45

  • [nitpick] Ensure that changing the buffer pointer type from uint16_t to uint32_t is consistently handled in all DMA data processing and that any dependent calculations or type conversions are updated accordingly.
uint16_t *buffer;  // changed to uint32_t *buffer;

Copy link

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