aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/pdm.rs
diff options
context:
space:
mode:
authorgoueslati <[email protected]>2023-06-12 14:27:53 +0100
committergoueslati <[email protected]>2023-06-12 14:27:53 +0100
commit2d89cfb18f00aefbfa108728dfea3398e80ea3e4 (patch)
tree6485dacac7e61c4378ac522e709edb0a86bd7523 /embassy-nrf/src/pdm.rs
parent2dd5ce83ec0421564e85b667f5dabd592f313e5c (diff)
parentab86b060500ceda1c80e39f35af69cb08a7b63a2 (diff)
fix merge conflict
Diffstat (limited to 'embassy-nrf/src/pdm.rs')
-rw-r--r--embassy-nrf/src/pdm.rs13
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;
6use core::sync::atomic::{compiler_fence, Ordering}; 6use core::sync::atomic::{compiler_fence, Ordering};
7use core::task::Poll; 7use core::task::Poll;
8 8
9use embassy_cortex_m::interrupt::Interrupt;
10use embassy_hal_common::drop::OnDrop; 9use embassy_hal_common::drop::OnDrop;
11use embassy_hal_common::{into_ref, PeripheralRef}; 10use embassy_hal_common::{into_ref, PeripheralRef};
12use futures::future::poll_fn; 11use futures::future::poll_fn;
@@ -14,15 +13,15 @@ use futures::future::poll_fn;
14use crate::chip::EASY_DMA_SIZE; 13use crate::chip::EASY_DMA_SIZE;
15use crate::gpio::sealed::Pin; 14use crate::gpio::sealed::Pin;
16use crate::gpio::{AnyPin, Pin as GpioPin}; 15use crate::gpio::{AnyPin, Pin as GpioPin};
17use crate::interrupt::{self}; 16use crate::interrupt::typelevel::Interrupt;
18use crate::Peripheral; 17use crate::{interrupt, Peripheral};
19 18
20/// Interrupt handler. 19/// Interrupt handler.
21pub struct InterruptHandler<T: Instance> { 20pub struct InterruptHandler<T: Instance> {
22 _phantom: PhantomData<T>, 21 _phantom: PhantomData<T>,
23} 22}
24 23
25impl<T: Instance> interrupt::Handler<T::Interrupt> for InterruptHandler<T> { 24impl<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.
275pub trait Instance: Peripheral<P = Self> + sealed::Instance + 'static + Send { 274pub 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
280macro_rules! impl_pdm { 279macro_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}