diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-03-26 16:01:37 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-03-27 15:18:06 +0100 |
| commit | d41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch) | |
| tree | 678b6fc732216e529dc38e6f65b72a309917ac32 /embassy-rp/src/rtc/mod.rs | |
| parent | 9edf5b7f049f95742b60b041e4443967d8a6b708 (diff) | |
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'embassy-rp/src/rtc/mod.rs')
| -rw-r--r-- | embassy-rp/src/rtc/mod.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/embassy-rp/src/rtc/mod.rs b/embassy-rp/src/rtc/mod.rs index 2ce7ac645..63cf91d28 100644 --- a/embassy-rp/src/rtc/mod.rs +++ b/embassy-rp/src/rtc/mod.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | //! RTC driver. | 1 | //! RTC driver. |
| 2 | mod filter; | 2 | mod filter; |
| 3 | 3 | ||
| 4 | use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; | 4 | use embassy_hal_internal::{Peri, PeripheralType}; |
| 5 | 5 | ||
| 6 | pub use self::filter::DateTimeFilter; | 6 | pub use self::filter::DateTimeFilter; |
| 7 | 7 | ||
| @@ -14,7 +14,7 @@ use crate::clocks::clk_rtc_freq; | |||
| 14 | 14 | ||
| 15 | /// A reference to the real time clock of the system | 15 | /// A reference to the real time clock of the system |
| 16 | pub struct Rtc<'d, T: Instance> { | 16 | pub struct Rtc<'d, T: Instance> { |
| 17 | inner: PeripheralRef<'d, T>, | 17 | inner: Peri<'d, T>, |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | impl<'d, T: Instance> Rtc<'d, T> { | 20 | impl<'d, T: Instance> Rtc<'d, T> { |
| @@ -23,9 +23,7 @@ impl<'d, T: Instance> Rtc<'d, T> { | |||
| 23 | /// # Errors | 23 | /// # Errors |
| 24 | /// | 24 | /// |
| 25 | /// Will return `RtcError::InvalidDateTime` if the datetime is not a valid range. | 25 | /// Will return `RtcError::InvalidDateTime` if the datetime is not a valid range. |
| 26 | pub fn new(inner: impl Peripheral<P = T> + 'd) -> Self { | 26 | pub fn new(inner: Peri<'d, T>) -> Self { |
| 27 | into_ref!(inner); | ||
| 28 | |||
| 29 | // Set the RTC divider | 27 | // Set the RTC divider |
| 30 | inner.regs().clkdiv_m1().write(|w| w.set_clkdiv_m1(clk_rtc_freq() - 1)); | 28 | inner.regs().clkdiv_m1().write(|w| w.set_clkdiv_m1(clk_rtc_freq() - 1)); |
| 31 | 29 | ||
| @@ -194,7 +192,7 @@ trait SealedInstance { | |||
| 194 | 192 | ||
| 195 | /// RTC peripheral instance. | 193 | /// RTC peripheral instance. |
| 196 | #[allow(private_bounds)] | 194 | #[allow(private_bounds)] |
| 197 | pub trait Instance: SealedInstance {} | 195 | pub trait Instance: SealedInstance + PeripheralType {} |
| 198 | 196 | ||
| 199 | impl SealedInstance for crate::peripherals::RTC { | 197 | impl SealedInstance for crate::peripherals::RTC { |
| 200 | fn regs(&self) -> crate::pac::rtc::Rtc { | 198 | fn regs(&self) -> crate::pac::rtc::Rtc { |
