diff options
Diffstat (limited to 'embassy-nrf/src/pdm.rs')
| -rw-r--r-- | embassy-nrf/src/pdm.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/embassy-nrf/src/pdm.rs b/embassy-nrf/src/pdm.rs index 9df685a26..0e30f7002 100644 --- a/embassy-nrf/src/pdm.rs +++ b/embassy-nrf/src/pdm.rs | |||
| @@ -6,7 +6,6 @@ use core::marker::PhantomData; | |||
| 6 | use core::sync::atomic::{compiler_fence, Ordering}; | 6 | use core::sync::atomic::{compiler_fence, Ordering}; |
| 7 | use core::task::Poll; | 7 | use core::task::Poll; |
| 8 | 8 | ||
| 9 | use embassy_cortex_m::interrupt::Interrupt; | ||
| 10 | use embassy_hal_common::drop::OnDrop; | 9 | use embassy_hal_common::drop::OnDrop; |
| 11 | use embassy_hal_common::{into_ref, PeripheralRef}; | 10 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 12 | use futures::future::poll_fn; | 11 | use futures::future::poll_fn; |
| @@ -14,15 +13,15 @@ use futures::future::poll_fn; | |||
| 14 | use crate::chip::EASY_DMA_SIZE; | 13 | use crate::chip::EASY_DMA_SIZE; |
| 15 | use crate::gpio::sealed::Pin; | 14 | use crate::gpio::sealed::Pin; |
| 16 | use crate::gpio::{AnyPin, Pin as GpioPin}; | 15 | use crate::gpio::{AnyPin, Pin as GpioPin}; |
| 17 | use crate::interrupt::{self}; | 16 | use crate::interrupt::typelevel::Interrupt; |
| 18 | use crate::Peripheral; | 17 | use crate::{interrupt, Peripheral}; |
| 19 | 18 | ||
| 20 | /// Interrupt handler. | 19 | /// Interrupt handler. |
| 21 | pub struct InterruptHandler<T: Instance> { | 20 | pub struct InterruptHandler<T: Instance> { |
| 22 | _phantom: PhantomData<T>, | 21 | _phantom: PhantomData<T>, |
| 23 | } | 22 | } |
| 24 | 23 | ||
| 25 | impl<T: Instance> interrupt::Handler<T::Interrupt> for InterruptHandler<T> { | 24 | impl<T: Instance> interrupt::typelevel::Handler<T::Interrupt> for InterruptHandler<T> { |
| 26 | unsafe fn on_interrupt() { | 25 | unsafe fn on_interrupt() { |
| 27 | T::regs().intenclr.write(|w| w.end().clear()); | 26 | T::regs().intenclr.write(|w| w.end().clear()); |
| 28 | T::state().waker.wake(); | 27 | T::state().waker.wake(); |
| @@ -53,7 +52,7 @@ impl<'d, T: Instance> Pdm<'d, T> { | |||
| 53 | /// Create PDM driver | 52 | /// Create PDM driver |
| 54 | pub fn new( | 53 | pub fn new( |
| 55 | pdm: impl Peripheral<P = T> + 'd, | 54 | pdm: impl Peripheral<P = T> + 'd, |
| 56 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 55 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 57 | clk: impl Peripheral<P = impl GpioPin> + 'd, | 56 | clk: impl Peripheral<P = impl GpioPin> + 'd, |
| 58 | din: impl Peripheral<P = impl GpioPin> + 'd, | 57 | din: impl Peripheral<P = impl GpioPin> + 'd, |
| 59 | config: Config, | 58 | config: Config, |
| @@ -274,7 +273,7 @@ pub(crate) mod sealed { | |||
| 274 | /// PDM peripheral instance. | 273 | /// PDM peripheral instance. |
| 275 | pub trait Instance: Peripheral<P = Self> + sealed::Instance + 'static + Send { | 274 | pub trait Instance: Peripheral<P = Self> + sealed::Instance + 'static + Send { |
| 276 | /// Interrupt for this peripheral. | 275 | /// Interrupt for this peripheral. |
| 277 | type Interrupt: Interrupt; | 276 | type Interrupt: interrupt::typelevel::Interrupt; |
| 278 | } | 277 | } |
| 279 | 278 | ||
| 280 | macro_rules! impl_pdm { | 279 | macro_rules! impl_pdm { |
| @@ -289,7 +288,7 @@ macro_rules! impl_pdm { | |||
| 289 | } | 288 | } |
| 290 | } | 289 | } |
| 291 | impl crate::pdm::Instance for peripherals::$type { | 290 | impl crate::pdm::Instance for peripherals::$type { |
| 292 | type Interrupt = crate::interrupt::$irq; | 291 | type Interrupt = crate::interrupt::typelevel::$irq; |
| 293 | } | 292 | } |
| 294 | }; | 293 | }; |
| 295 | } | 294 | } |
