aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/timer
diff options
context:
space:
mode:
authorBrian Schwind <[email protected]>2025-09-29 21:17:15 +0900
committerBrian Schwind <[email protected]>2025-09-29 21:19:32 +0900
commita791e9f1fc17eda2b05df97a72b94264ee6a4c12 (patch)
treefe8d3c2066aa74bae38249ec7c5a293f6bc5f363 /embassy-stm32/src/timer
parent1fe05cfedbcfb35dba3bee3ed6b7f4f293e9bb78 (diff)
Remove the QeiPin struct
Diffstat (limited to 'embassy-stm32/src/timer')
-rw-r--r--embassy-stm32/src/timer/qei.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/embassy-stm32/src/timer/qei.rs b/embassy-stm32/src/timer/qei.rs
index d63a2b45d..25e8c3705 100644
--- a/embassy-stm32/src/timer/qei.rs
+++ b/embassy-stm32/src/timer/qei.rs
@@ -1,7 +1,5 @@
1//! Quadrature decoder using a timer. 1//! Quadrature decoder using a timer.
2 2
3use core::marker::PhantomData;
4
5use stm32_metapac::timer::vals; 3use stm32_metapac::timer::vals;
6 4
7use super::low_level::Timer; 5use super::low_level::Timer;
@@ -19,27 +17,6 @@ pub enum Direction {
19 Downcounting, 17 Downcounting,
20} 18}
21 19
22/// Wrapper for using a pin with QEI.
23pub struct QeiPin<'d, T, Channel, #[cfg(afio)] A> {
24 #[allow(unused)]
25 pin: Peri<'d, AnyPin>,
26 phantom: PhantomData<if_afio!((T, Channel, A))>,
27}
28
29impl<'d, T: GeneralInstance4Channel, C: QeiChannel, #[cfg(afio)] A> if_afio!(QeiPin<'d, T, C, A>) {
30 /// Create a new QEI pin instance.
31 pub fn new(pin: Peri<'d, if_afio!(impl TimerPin<T, C, A>)>) -> Self {
32 critical_section::with(|_| {
33 pin.set_low();
34 set_as_af!(pin, AfType::input(Pull::None));
35 });
36 QeiPin {
37 pin: pin.into(),
38 phantom: PhantomData,
39 }
40 }
41}
42
43trait SealedQeiChannel: TimerChannel {} 20trait SealedQeiChannel: TimerChannel {}
44 21
45/// Marker trait for a timer channel eligible for use with QEI. 22/// Marker trait for a timer channel eligible for use with QEI.