diff options
Diffstat (limited to 'embassy-stm32/src/usb_otg')
| -rw-r--r-- | embassy-stm32/src/usb_otg/mod.rs | 10 | ||||
| -rw-r--r-- | embassy-stm32/src/usb_otg/usb.rs | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/embassy-stm32/src/usb_otg/mod.rs b/embassy-stm32/src/usb_otg/mod.rs index 193e0df0d..317264cbb 100644 --- a/embassy-stm32/src/usb_otg/mod.rs +++ b/embassy-stm32/src/usb_otg/mod.rs | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | use embassy_cortex_m::interrupt::Interrupt; | ||
| 2 | |||
| 3 | use crate::peripherals; | ||
| 4 | use crate::rcc::RccPeripheral; | 1 | use crate::rcc::RccPeripheral; |
| 2 | use crate::{interrupt, peripherals}; | ||
| 5 | 3 | ||
| 6 | #[cfg(feature = "nightly")] | 4 | #[cfg(feature = "nightly")] |
| 7 | mod usb; | 5 | mod usb; |
| @@ -25,7 +23,7 @@ pub(crate) mod sealed { | |||
| 25 | } | 23 | } |
| 26 | 24 | ||
| 27 | pub trait Instance: sealed::Instance + RccPeripheral { | 25 | pub trait Instance: sealed::Instance + RccPeripheral { |
| 28 | type Interrupt: Interrupt; | 26 | type Interrupt: interrupt::typelevel::Interrupt; |
| 29 | } | 27 | } |
| 30 | 28 | ||
| 31 | // Internal PHY pins | 29 | // Internal PHY pins |
| @@ -109,7 +107,7 @@ foreach_interrupt!( | |||
| 109 | } | 107 | } |
| 110 | 108 | ||
| 111 | impl Instance for peripherals::USB_OTG_FS { | 109 | impl Instance for peripherals::USB_OTG_FS { |
| 112 | type Interrupt = crate::interrupt::$irq; | 110 | type Interrupt = crate::interrupt::typelevel::$irq; |
| 113 | } | 111 | } |
| 114 | }; | 112 | }; |
| 115 | 113 | ||
| @@ -161,7 +159,7 @@ foreach_interrupt!( | |||
| 161 | } | 159 | } |
| 162 | 160 | ||
| 163 | impl Instance for peripherals::USB_OTG_HS { | 161 | impl Instance for peripherals::USB_OTG_HS { |
| 164 | type Interrupt = crate::interrupt::$irq; | 162 | type Interrupt = crate::interrupt::typelevel::$irq; |
| 165 | } | 163 | } |
| 166 | }; | 164 | }; |
| 167 | ); | 165 | ); |
diff --git a/embassy-stm32/src/usb_otg/usb.rs b/embassy-stm32/src/usb_otg/usb.rs index e602bcb70..16cbf1a95 100644 --- a/embassy-stm32/src/usb_otg/usb.rs +++ b/embassy-stm32/src/usb_otg/usb.rs | |||
| @@ -3,7 +3,6 @@ use core::marker::PhantomData; | |||
| 3 | use core::task::Poll; | 3 | use core::task::Poll; |
| 4 | 4 | ||
| 5 | use atomic_polyfill::{AtomicBool, AtomicU16, Ordering}; | 5 | use atomic_polyfill::{AtomicBool, AtomicU16, Ordering}; |
| 6 | use embassy_cortex_m::interrupt::Interrupt; | ||
| 7 | use embassy_hal_common::{into_ref, Peripheral}; | 6 | use embassy_hal_common::{into_ref, Peripheral}; |
| 8 | use embassy_sync::waitqueue::AtomicWaker; | 7 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | use embassy_usb_driver::{ | 8 | use embassy_usb_driver::{ |
| @@ -15,6 +14,7 @@ use futures::future::poll_fn; | |||
| 15 | use super::*; | 14 | use super::*; |
| 16 | use crate::gpio::sealed::AFType; | 15 | use crate::gpio::sealed::AFType; |
| 17 | use crate::interrupt; | 16 | use crate::interrupt; |
| 17 | use crate::interrupt::typelevel::Interrupt; | ||
| 18 | use crate::pac::otg::{regs, vals}; | 18 | use crate::pac::otg::{regs, vals}; |
| 19 | use crate::rcc::sealed::RccPeripheral; | 19 | use crate::rcc::sealed::RccPeripheral; |
| 20 | use crate::time::Hertz; | 20 | use crate::time::Hertz; |
| @@ -24,7 +24,7 @@ pub struct InterruptHandler<T: Instance> { | |||
| 24 | _phantom: PhantomData<T>, | 24 | _phantom: PhantomData<T>, |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | impl<T: Instance> interrupt::Handler<T::Interrupt> for InterruptHandler<T> { | 27 | impl<T: Instance> interrupt::typelevel::Handler<T::Interrupt> for InterruptHandler<T> { |
| 28 | unsafe fn on_interrupt() { | 28 | unsafe fn on_interrupt() { |
| 29 | trace!("irq"); | 29 | trace!("irq"); |
| 30 | let r = T::regs(); | 30 | let r = T::regs(); |
| @@ -291,7 +291,7 @@ impl<'d, T: Instance> Driver<'d, T> { | |||
| 291 | /// Endpoint allocation will fail if it is too small. | 291 | /// Endpoint allocation will fail if it is too small. |
| 292 | pub fn new_fs( | 292 | pub fn new_fs( |
| 293 | _peri: impl Peripheral<P = T> + 'd, | 293 | _peri: impl Peripheral<P = T> + 'd, |
| 294 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 294 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 295 | dp: impl Peripheral<P = impl DpPin<T>> + 'd, | 295 | dp: impl Peripheral<P = impl DpPin<T>> + 'd, |
| 296 | dm: impl Peripheral<P = impl DmPin<T>> + 'd, | 296 | dm: impl Peripheral<P = impl DmPin<T>> + 'd, |
| 297 | ep_out_buffer: &'d mut [u8], | 297 | ep_out_buffer: &'d mut [u8], |
| @@ -322,7 +322,7 @@ impl<'d, T: Instance> Driver<'d, T> { | |||
| 322 | /// Endpoint allocation will fail if it is too small. | 322 | /// Endpoint allocation will fail if it is too small. |
| 323 | pub fn new_hs_ulpi( | 323 | pub fn new_hs_ulpi( |
| 324 | _peri: impl Peripheral<P = T> + 'd, | 324 | _peri: impl Peripheral<P = T> + 'd, |
| 325 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 325 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 326 | ulpi_clk: impl Peripheral<P = impl UlpiClkPin<T>> + 'd, | 326 | ulpi_clk: impl Peripheral<P = impl UlpiClkPin<T>> + 'd, |
| 327 | ulpi_dir: impl Peripheral<P = impl UlpiDirPin<T>> + 'd, | 327 | ulpi_dir: impl Peripheral<P = impl UlpiDirPin<T>> + 'd, |
| 328 | ulpi_nxt: impl Peripheral<P = impl UlpiNxtPin<T>> + 'd, | 328 | ulpi_nxt: impl Peripheral<P = impl UlpiNxtPin<T>> + 'd, |
