arch/arm64/imx9: Add SAR ADC support#18870
Open
jihonen wants to merge 1 commit into
Open
Conversation
Add support for the i.MX9 SAR ADC block. The driver provides initialization, deinitialization, channel-mask validation, and one-shot reads for the supported ADC channels. It also handles the ADC clock bring-up, power-up sequence, calibration, and raw 12-bit result extraction from the per-channel data registers. Signed-off-by: Joonas Ihonen <joonas.ihonen@tii.ae>
| #include "imx9_sar_adc.h" | ||
| #include "imx9_ccm.h" | ||
| #include "hardware/imx9_ccm.h" | ||
| #include "hardware/imx93/imx93_memorymap.h" |
Contributor
There was a problem hiding this comment.
Can you make it agnostic for the whole imx9 family, by just including hardware/imx9_memorymap.h.
xiaoxiang781216
approved these changes
May 13, 2026
acassis
reviewed
May 14, 2026
Contributor
acassis
left a comment
There was a problem hiding this comment.
@jihonen Nice work! I noticed that iMX9 family is missing a landing page: https://nuttx.apache.org/docs/latest/platforms/arm64/imx9/index.html like other chips, i.e.: https://nuttx.apache.org/docs/latest/platforms/arm/s32k1xx/index.html
Could you please just add a "Supported Modules & Peripherals" there adding ADC as Yes ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
• Add support for the i.MX9 SAR ADC block.
The driver provides initialization, de-initialization, channel-mask validation, and one-shot reads for the supported ADC channels. It also handles ADC clock bring-up, power-up, calibration, and raw 12-bit result extraction from the per-channel data registers.
Summary
Add a basic helper driver for the i.MX9 SAR ADC block in
arch/arm64/src/imx9.This adds the low-level ADC bring-up and sampling path needed for board-level analog sampling on i.MX9 systems, so board code does not need to duplicate the register setup and conversion flow.
The driver:
Impact
This change adds new runtime support in
arch/arm64/src/imx9only.Impact areas:
imx9_sar_adc.cis compiled whenCONFIG_IMX9_SAR_ADCis enabledimx9_sar_adc.hfor board/arch bring-up codeTesting
Testing performed:
listener adc_reportObserved output:
References:
Dependencies: