From 1684ba10f013f5322b20ebcaddc3c6a89ce10b3c Mon Sep 17 00:00:00 2001 From: Juraj Sadel Date: Wed, 18 Dec 2024 09:37:09 +0100 Subject: [PATCH] Rename TOUCHMODE to Tm (#2829) --- esp-hal/src/touch.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/esp-hal/src/touch.rs b/esp-hal/src/touch.rs index 81f6190ab..bc591e97c 100644 --- a/esp-hal/src/touch.rs +++ b/esp-hal/src/touch.rs @@ -85,12 +85,12 @@ pub struct TouchConfig { } /// This struct marks a successfully initialized touch peripheral -pub struct Touch<'d, TOUCHMODE: TouchMode, Dm: Mode> { +pub struct Touch<'d, Tm: TouchMode, Dm: Mode> { _inner: PeripheralRef<'d, TOUCH>, - _touch_mode: PhantomData, + _touch_mode: PhantomData, _mode: PhantomData, } -impl Touch<'_, TOUCHMODE, Dm> { +impl Touch<'_, Tm, Dm> { /// Common initialization of the touch peripheral. fn initialize_common(config: Option) { let rtccntl = unsafe { &*RTC_CNTL::ptr() }; @@ -318,9 +318,9 @@ impl<'d> Touch<'d, Continuous, Async> { } /// A pin that is configured as a TouchPad. -pub struct TouchPad { +pub struct TouchPad { pin: P, - _touch_mode: PhantomData, + _touch_mode: PhantomData, _mode: PhantomData, } impl TouchPad { @@ -362,13 +362,13 @@ impl TouchPad { .modify(|_, w| w.touch_start_en().set_bit()); } } -impl TouchPad { +impl TouchPad { /// Construct a new instance of [`TouchPad`]. /// /// ## Parameters: /// - `pin`: The pin that gets configured as touch pad /// - `touch`: The [`Touch`] struct indicating that touch is configured. - pub fn new(pin: P, _touch: &Touch<'_, TOUCHMODE, Dm>) -> Self { + pub fn new(pin: P, _touch: &Touch<'_, Tm, Dm>) -> Self { // TODO revert this on drop pin.set_touch(Internal); @@ -400,7 +400,7 @@ impl TouchPad { } } } -impl TouchPad { +impl TouchPad { /// Blocking read of the current touch pad capacitance counter. /// /// Usually a lower value means higher capacitance, thus indicating touch @@ -581,7 +581,7 @@ mod asynch { internal_disable_interrupts(); } - impl TouchPad { + impl TouchPad { /// Wait for the pad to be touched. pub async fn wait_for_touch(&mut self, threshold: u16) { self.pin.set_threshold(threshold, Internal);