Improve ADC configuration options

This commit is contained in:
chemicstry
2022-07-27 01:17:26 +03:00
parent 84cffc751a
commit 046778fc53
4 changed files with 68 additions and 34 deletions

View File

@ -28,11 +28,11 @@ async fn main(_spawner: Spawner, mut p: Peripherals) {
adc.set_sample_time(SampleTime::Cycles32_5);
let mut vref_channel = adc.enable_vref();
let mut vrefint_channel = adc.enable_vrefint();
loop {
let vref = adc.read_internal(&mut vref_channel);
info!("vref: {}", vref);
let vrefint = adc.read_internal(&mut vrefint_channel);
info!("vrefint: {}", vrefint);
let measured = adc.read(&mut p.PC0);
info!("measured: {}", measured);
Timer::after(Duration::from_millis(500)).await;