Skip to content

stm32: Add machine.ADC implementation for STM32L1. #17620

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

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

yn386
Copy link
Contributor

@yn386 yn386 commented Jul 5, 2025

Summary

machine.ADC needs implementation for each platform.
This PR adds implementation for STM32L1.

Testing

Tested whether machine.ADC works with NUCLEO-L152RE.

from machine import ADC

# Internal temperature sensor
adc=ADC(ADC.CORE_TEMP)
adc.read_u16()

# Internal Vrefint
adc=ADC(ADC.CORE_VREF)
adc.read_u16()

Trade-offs and Alternatives

There is no negative impact because this change affects only for STM32L1.

Copy link

github-actions bot commented Jul 5, 2025

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@yn386 yn386 force-pushed the fix-machine-adc-for-l1 branch from 1960d4c to 44d5b8b Compare July 5, 2025 23:20
Copy link
Member

@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

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

Thank you!

@dpgeorge dpgeorge force-pushed the fix-machine-adc-for-l1 branch from 44d5b8b to cc855a3 Compare July 8, 2025 04:00
Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
@dpgeorge dpgeorge force-pushed the fix-machine-adc-for-l1 branch from cc855a3 to eaffbac Compare July 8, 2025 04:01
@dpgeorge dpgeorge merged commit eaffbac into micropython:master Jul 8, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy