aboutsummaryrefslogtreecommitdiff
path: root/embassy-hal-internal/src/peripheral.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-02-23 01:45:10 +0100
committerGitHub <[email protected]>2024-02-23 01:45:10 +0100
commita6a5d9913cda2ecfe89b63fa0bcf7afaebc2dac0 (patch)
tree14124a6f34d351a979cb110a0ce566b588f5d272 /embassy-hal-internal/src/peripheral.rs
parent5b7e2d88265b5633fa53047961598fbc38bffed0 (diff)
parent2855bb69680a42a721fe88168657ea1e634e8766 (diff)
Merge branch 'main' into stm32l0-reset-rtc
Diffstat (limited to 'embassy-hal-internal/src/peripheral.rs')
-rw-r--r--embassy-hal-internal/src/peripheral.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/embassy-hal-internal/src/peripheral.rs b/embassy-hal-internal/src/peripheral.rs
index 16d49edfb..f03f41507 100644
--- a/embassy-hal-internal/src/peripheral.rs
+++ b/embassy-hal-internal/src/peripheral.rs
@@ -1,5 +1,5 @@
1use core::marker::PhantomData; 1use core::marker::PhantomData;
2use core::ops::{Deref, DerefMut}; 2use core::ops::Deref;
3 3
4/// An exclusive reference to a peripheral. 4/// An exclusive reference to a peripheral.
5/// 5///
@@ -86,13 +86,6 @@ impl<'a, T> Deref for PeripheralRef<'a, T> {
86 } 86 }
87} 87}
88 88
89impl<'a, T> DerefMut for PeripheralRef<'a, T> {
90 #[inline]
91 fn deref_mut(&mut self) -> &mut Self::Target {
92 &mut self.inner
93 }
94}
95
96/// Trait for any type that can be used as a peripheral of type `P`. 89/// Trait for any type that can be used as a peripheral of type `P`.
97/// 90///
98/// This is used in driver constructors, to allow passing either owned peripherals (e.g. `TWISPI0`), 91/// This is used in driver constructors, to allow passing either owned peripherals (e.g. `TWISPI0`),
@@ -162,7 +155,7 @@ pub trait Peripheral: Sized {
162 } 155 }
163} 156}
164 157
165impl<'b, T: DerefMut> Peripheral for T 158impl<'b, T: Deref> Peripheral for T
166where 159where
167 T::Target: Peripheral, 160 T::Target: Peripheral,
168{ 161{