psoc-edge: Add ADC support - #197
Open
AkshayChandra-IFX wants to merge 32 commits into
Open
Conversation
AkshayChandra-IFX
requested review from
a team,
IFX-Anusha,
NaveenChengappa-IFX,
NikhitaR-IFX and
jaenrig-ifx
July 31, 2026 11:32
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Apply reviewed ADC fixes and cleanup. - Use mapped sar_block in ADC setup and read flow. - Reload SAR config only on channel config changes. - Compute read_uv from raw 12-bit data using BSP VDDA. - Fix read_uv overflow with 64-bit intermediate arithmetic. - Remove unused ADC block capability macro generation. - Include genhdr/pins_af.h explicitly and drop broad genhdr include path. - Fix ruff formatting in make-pins.py. Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
AkshayChandra-IFX
force-pushed
the
machine_adc
branch
from
August 3, 2026 05:54
e8d0ee3 to
25b1ea8
Compare
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
IFX-Anusha
reviewed
Aug 3, 2026
IFX-Anusha
left a comment
There was a problem hiding this comment.
Nice ! some minor things to check before merge
jaenrig-ifx
reviewed
Aug 3, 2026
jaenrig-ifx
reviewed
Aug 3, 2026
jaenrig-ifx
reviewed
Aug 3, 2026
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
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.
Summary
Adds machine.ADC and machine.ADCBlock support for the PSoC Edge port. The implementation uses the PSoC Edge SAR ADC peripheral via the cy_autanalog / cy_autanalog_sar HAL drivers. BSP peripheral config, pin alternate-function CSV, and modmachine are updated accordingly. Documentation and tests are included.
Testing
Tested on KIT_PSE84_AI. A voltage divider is used as the hardware input to drive the ADC pin, enabling the test script to exercise full ADC functionality: pin read, ADCBlock channel init/deinit, read_u16(), read_uv(), and voltage conversion. All [adc.py] cases pass.
Trade-offs and Alternatives
None significant
Generative AI
I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above.