Expand channel trait

This commit is contained in:
Joshua Salzedo 2021-09-28 15:59:11 -07:00 committed by Dario Nieuwenhuis
parent c574b0eb73
commit 3272987d92

View File

@ -9,6 +9,7 @@ mod dmamux;
pub use dmamux::*; pub use dmamux::*;
use core::future::Future; use core::future::Future;
use core::task::Waker;
use embassy::util::Unborrow; use embassy::util::Unborrow;
#[cfg(any(bdma_v2, dma_v2, dmamux))] #[cfg(any(bdma_v2, dma_v2, dmamux))]
@ -50,6 +51,12 @@ pub trait Channel: sealed::Channel {
num: usize, num: usize,
dst: *mut u8, dst: *mut u8,
) -> Self::WriteFuture<'a>; ) -> Self::WriteFuture<'a>;
fn stop<'a>(&'a mut self);
fn is_stopped<'a>(&self) -> bool;
fn remaining_transfers<'a>(&'a mut self) -> usize;
fn set_waker(&mut self, waker: &Waker);
} }
pub struct NoDma; pub struct NoDma;