Skip to content

Commit

Permalink
Merge pull request #17 from decaday/feat/adc-v2
Browse files Browse the repository at this point in the history
Fix adc example and readme
  • Loading branch information
decaday authored Nov 26, 2024
2 parents e977f1b + d2288cd commit 542af37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ For a full list of chip capabilities and peripherals, check the [py32-data](http
| USART | ||| |
| I2C | ||| |
| SPI | | | | |
| ADC | | ✅+ | | |
| ADC | | ✅+ | | |
| RTC | | | | |
| Timer(PWM) | ||| |
| USB/OTG | N/A | N/A | | |
Expand Down
4 changes: 3 additions & 1 deletion examples/py32f072/src/bin/blocking_adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use embassy_executor::Spawner;
use embassy_time::Timer;
use py32_hal::rcc::{Pll, PllSource, Sysclk, PllMul};
use py32_hal::time::Hertz;
use py32_hal::adc::{Adc, SampleTime, Prescaler};
use py32_hal::adc::{Adc, SampleTime};
use {defmt_rtt as _, panic_probe as _};

#[embassy_executor::main]
Expand All @@ -25,6 +25,8 @@ async fn main(_spawner: Spawner) {

// Automatically calculate the minimum prescaler using PCLK.
let mut adc = Adc::new(p.ADC);

// use py32_hal::adc::Prescaler;
// let mut adc = Adc::new_with_prediv(p.ADC, Prescaler::Div4);

// The minimum conversion time for each resolution is as follows (sampling time + conversion time):
Expand Down

0 comments on commit 542af37

Please sign in to comment.