diff options
| author | xoviat <[email protected]> | 2023-05-20 10:10:21 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-05-20 10:23:57 -0500 |
| commit | 661b1f33738e56cd1b6092c0e3f014cb8e9726d3 (patch) | |
| tree | 66f270d11c83d166c4657744b1a38dfcb5552044 /embassy-stm32/src/ipcc.rs | |
| parent | d736c9205c1cfff2b4f5e83fd7d70a6e1b09a08d (diff) | |
stm32/ipcc: remove constrain
Diffstat (limited to 'embassy-stm32/src/ipcc.rs')
| -rw-r--r-- | embassy-stm32/src/ipcc.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/embassy-stm32/src/ipcc.rs b/embassy-stm32/src/ipcc.rs index 9af5f171f..2b9caf8e5 100644 --- a/embassy-stm32/src/ipcc.rs +++ b/embassy-stm32/src/ipcc.rs | |||
| @@ -35,6 +35,10 @@ pub struct Ipcc<'d> { | |||
| 35 | 35 | ||
| 36 | impl<'d> Ipcc<'d> { | 36 | impl<'d> Ipcc<'d> { |
| 37 | pub fn new(peri: impl Peripheral<P = IPCC> + 'd, _config: Config) -> Self { | 37 | pub fn new(peri: impl Peripheral<P = IPCC> + 'd, _config: Config) -> Self { |
| 38 | Self::new_inner(peri) | ||
| 39 | } | ||
| 40 | |||
| 41 | pub(crate) fn new_inner(peri: impl Peripheral<P = IPCC> + 'd) -> Self { | ||
| 38 | into_ref!(peri); | 42 | into_ref!(peri); |
| 39 | 43 | ||
| 40 | Self { _peri: peri } | 44 | Self { _peri: peri } |
| @@ -180,14 +184,3 @@ unsafe fn _configure_pwr() { | |||
| 180 | // set RF wake-up clock = LSE | 184 | // set RF wake-up clock = LSE |
| 181 | rcc.csr().modify(|w| w.set_rfwkpsel(0b01)); | 185 | rcc.csr().modify(|w| w.set_rfwkpsel(0b01)); |
| 182 | } | 186 | } |
| 183 | |||
| 184 | // TODO: if anyone has a better idea, please let me know | ||
| 185 | /// extension trait that constrains the [`Ipcc`] peripheral | ||
| 186 | pub trait IpccExt<'d> { | ||
| 187 | fn constrain(self) -> Ipcc<'d>; | ||
| 188 | } | ||
| 189 | impl<'d> IpccExt<'d> for IPCC { | ||
| 190 | fn constrain(self) -> Ipcc<'d> { | ||
| 191 | Ipcc { _peri: self.into_ref() } | ||
| 192 | } | ||
| 193 | } | ||
