diff --git a/esp-hal/src/peripheral.rs b/esp-hal/src/peripheral.rs index eb28f3ed8fb..abcc2bb5f9e 100644 --- a/esp-hal/src/peripheral.rs +++ b/esp-hal/src/peripheral.rs @@ -182,6 +182,16 @@ where } impl crate::private::Sealed for &mut T where T: crate::private::Sealed {} +impl crate::private::Sealed for PeripheralRef<'_, T> where T: crate::private::Sealed {} + +impl Peripheral for PeripheralRef<'_, T> { + type P = T::P; + + #[inline] + unsafe fn clone_unchecked(&self) -> Self::P { + T::clone_unchecked(self) + } +} mod peripheral_macros { #[doc(hidden)]