diff options
| -rw-r--r-- | embassy-stm32/src/tsc/mod.rs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/embassy-stm32/src/tsc/mod.rs b/embassy-stm32/src/tsc/mod.rs index 8642da0e1..ad0f1cca0 100644 --- a/embassy-stm32/src/tsc/mod.rs +++ b/embassy-stm32/src/tsc/mod.rs | |||
| @@ -5,13 +5,13 @@ | |||
| 5 | /// Enums defined for peripheral parameters | 5 | /// Enums defined for peripheral parameters |
| 6 | pub mod enums; | 6 | pub mod enums; |
| 7 | 7 | ||
| 8 | use embassy_hal_internal::{into_ref, PeripheralRef}; | ||
| 8 | pub use enums::*; | 9 | pub use enums::*; |
| 9 | 10 | ||
| 10 | use crate::gpio::{AFType, AnyPin, Pull}; | 11 | use crate::gpio::{AFType, AnyPin, Pull}; |
| 11 | use crate::pac::tsc::Tsc as Regs; | 12 | use crate::pac::tsc::Tsc as Regs; |
| 12 | use crate::rcc::RccPeripheral; | 13 | use crate::rcc::RccPeripheral; |
| 13 | use crate::{peripherals, Peripheral}; | 14 | use crate::{peripherals, Peripheral}; |
| 14 | use embassy_hal_internal::{into_ref, PeripheralRef}; | ||
| 15 | 15 | ||
| 16 | const TSC_NUM_GROUPS: u32 = 8; | 16 | const TSC_NUM_GROUPS: u32 = 8; |
| 17 | 17 | ||
| @@ -148,6 +148,7 @@ impl Default for Config { | |||
| 148 | 148 | ||
| 149 | /// Pin struct that maintains usage | 149 | /// Pin struct that maintains usage |
| 150 | #[allow(missing_docs)] | 150 | #[allow(missing_docs)] |
| 151 | #[allow(dead_code)] | ||
| 151 | pub struct TscPin<'d, T> { | 152 | pub struct TscPin<'d, T> { |
| 152 | pin: PeripheralRef<'d, T>, | 153 | pin: PeripheralRef<'d, T>, |
| 153 | role: PinType, | 154 | role: PinType, |
| @@ -174,16 +175,16 @@ pub struct PinGroup<'d, A> { | |||
| 174 | /// TSC driver | 175 | /// TSC driver |
| 175 | pub struct Tsc<'d, T: Instance> { | 176 | pub struct Tsc<'d, T: Instance> { |
| 176 | _peri: PeripheralRef<'d, T>, | 177 | _peri: PeripheralRef<'d, T>, |
| 177 | g1: Option<PinGroup<'d, AnyPin>>, | 178 | _g1: Option<PinGroup<'d, AnyPin>>, |
| 178 | g2: Option<PinGroup<'d, AnyPin>>, | 179 | _g2: Option<PinGroup<'d, AnyPin>>, |
| 179 | g3: Option<PinGroup<'d, AnyPin>>, | 180 | _g3: Option<PinGroup<'d, AnyPin>>, |
| 180 | g4: Option<PinGroup<'d, AnyPin>>, | 181 | _g4: Option<PinGroup<'d, AnyPin>>, |
| 181 | g5: Option<PinGroup<'d, AnyPin>>, | 182 | _g5: Option<PinGroup<'d, AnyPin>>, |
| 182 | g6: Option<PinGroup<'d, AnyPin>>, | 183 | _g6: Option<PinGroup<'d, AnyPin>>, |
| 183 | #[cfg(any(tsc_v2, tsc_v3))] | 184 | #[cfg(any(tsc_v2, tsc_v3))] |
| 184 | g7: Option<PinGroup<'d, AnyPin>>, | 185 | _g7: Option<PinGroup<'d, AnyPin>>, |
| 185 | #[cfg(tsc_v3)] | 186 | #[cfg(tsc_v3)] |
| 186 | g8: Option<PinGroup<'d, AnyPin>>, | 187 | _g8: Option<PinGroup<'d, AnyPin>>, |
| 187 | state: State, | 188 | state: State, |
| 188 | config: Config, | 189 | config: Config, |
| 189 | } | 190 | } |
| @@ -425,16 +426,16 @@ impl<'d, T: Instance> Tsc<'d, T> { | |||
| 425 | 426 | ||
| 426 | Self { | 427 | Self { |
| 427 | _peri: peri, | 428 | _peri: peri, |
| 428 | g1, | 429 | _g1: g1, |
| 429 | g2, | 430 | _g2: g2, |
| 430 | g3, | 431 | _g3: g3, |
| 431 | g4, | 432 | _g4: g4, |
| 432 | g5, | 433 | _g5: g5, |
| 433 | g6, | 434 | _g6: g6, |
| 434 | #[cfg(any(tsc_v2, tsc_v3))] | 435 | #[cfg(any(tsc_v2, tsc_v3))] |
| 435 | g7, | 436 | _g7: g7, |
| 436 | #[cfg(tsc_v3)] | 437 | #[cfg(tsc_v3)] |
| 437 | g8, | 438 | _g8: g8, |
| 438 | state: State::Ready, | 439 | state: State::Ready, |
| 439 | config, | 440 | config, |
| 440 | } | 441 | } |
