aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/adc/injected.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-stm32/src/adc/injected.rs')
-rw-r--r--embassy-stm32/src/adc/injected.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/adc/injected.rs b/embassy-stm32/src/adc/injected.rs
index 1af055644..029722b84 100644
--- a/embassy-stm32/src/adc/injected.rs
+++ b/embassy-stm32/src/adc/injected.rs
@@ -4,18 +4,18 @@ use core::sync::atomic::{Ordering, compiler_fence};
4#[allow(unused_imports)] 4#[allow(unused_imports)]
5use embassy_hal_internal::Peri; 5use embassy_hal_internal::Peri;
6 6
7use super::{AnyAdcChannel, SampleTime}; 7use super::{AdcRegs, AnyAdcChannel, SampleTime};
8use crate::adc::Adc;
8#[allow(unused_imports)] 9#[allow(unused_imports)]
9use crate::adc::Instance; 10use crate::adc::Instance;
10use crate::adc::{Adc, AnyInstance};
11 11
12/// Injected ADC sequence with owned channels. 12/// Injected ADC sequence with owned channels.
13pub struct InjectedAdc<'a, T: Instance, const N: usize> { 13pub struct InjectedAdc<'a, T: Instance<Regs = crate::pac::adc::Adc>, const N: usize> {
14 _channels: [(AnyAdcChannel<'a, T>, SampleTime); N], 14 _channels: [(AnyAdcChannel<'a, T>, SampleTime); N],
15 _phantom: PhantomData<T>, 15 _phantom: PhantomData<T>,
16} 16}
17 17
18impl<'a, T: Instance, const N: usize> InjectedAdc<'a, T, N> { 18impl<'a, T: Instance<Regs = crate::pac::adc::Adc>, const N: usize> InjectedAdc<'a, T, N> {
19 pub(crate) fn new(channels: [(AnyAdcChannel<'a, T>, SampleTime); N]) -> Self { 19 pub(crate) fn new(channels: [(AnyAdcChannel<'a, T>, SampleTime); N]) -> Self {
20 Self { 20 Self {
21 _channels: channels, 21 _channels: channels,
@@ -36,9 +36,9 @@ impl<'a, T: Instance, const N: usize> InjectedAdc<'a, T, N> {
36 } 36 }
37} 37}
38 38
39impl<'a, T: Instance + AnyInstance, const N: usize> Drop for InjectedAdc<'a, T, N> { 39impl<'a, T: Instance<Regs = crate::pac::adc::Adc>, const N: usize> Drop for InjectedAdc<'a, T, N> {
40 fn drop(&mut self) { 40 fn drop(&mut self) {
41 T::stop(); 41 T::regs().stop();
42 compiler_fence(Ordering::SeqCst); 42 compiler_fence(Ordering::SeqCst);
43 } 43 }
44} 44}