aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32c0/src/bin/adc.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-03-26 16:01:37 +0100
committerDario Nieuwenhuis <[email protected]>2025-03-27 15:18:06 +0100
commitd41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch)
tree678b6fc732216e529dc38e6f65b72a309917ac32 /examples/stm32c0/src/bin/adc.rs
parent9edf5b7f049f95742b60b041e4443967d8a6b708 (diff)
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'examples/stm32c0/src/bin/adc.rs')
-rw-r--r--examples/stm32c0/src/bin/adc.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/stm32c0/src/bin/adc.rs b/examples/stm32c0/src/bin/adc.rs
index 10481f4d2..1f54b0b18 100644
--- a/examples/stm32c0/src/bin/adc.rs
+++ b/examples/stm32c0/src/bin/adc.rs
@@ -36,7 +36,8 @@ async fn main(_spawner: Spawner) {
36 ); 36 );
37 37
38 let channels_seqence: [&mut AnyAdcChannel<ADC1>; 3] = [&mut vref, &mut temp, &mut pin0]; 38 let channels_seqence: [&mut AnyAdcChannel<ADC1>; 3] = [&mut vref, &mut temp, &mut pin0];
39 adc.read(&mut dma, channels_seqence.into_iter(), &mut read_buffer).await; 39 adc.read(dma.reborrow(), channels_seqence.into_iter(), &mut read_buffer)
40 .await;
40 // Values are ordered according to hardware ADC channel number! 41 // Values are ordered according to hardware ADC channel number!
41 info!( 42 info!(
42 "DMA ADC read in set: vref = {}, temp = {}, pin0 = {}.", 43 "DMA ADC read in set: vref = {}, temp = {}, pin0 = {}.",
@@ -45,7 +46,7 @@ async fn main(_spawner: Spawner) {
45 46
46 let hw_channel_selection: u32 = 47 let hw_channel_selection: u32 =
47 (1 << temp.get_hw_channel()) + (1 << vref.get_hw_channel()) + (1 << pin0.get_hw_channel()); 48 (1 << temp.get_hw_channel()) + (1 << vref.get_hw_channel()) + (1 << pin0.get_hw_channel());
48 adc.read_in_hw_order(&mut dma, hw_channel_selection, Scandir::UP, &mut read_buffer) 49 adc.read_in_hw_order(dma.reborrow(), hw_channel_selection, Scandir::UP, &mut read_buffer)
49 .await; 50 .await;
50 info!( 51 info!(
51 "DMA ADC read in hardware order: vref = {}, temp = {}, pin0 = {}.", 52 "DMA ADC read in hardware order: vref = {}, temp = {}, pin0 = {}.",