embassy/embassy-stm32/src/dma/mod.rs

31 lines
622 B
Rust
Raw Normal View History

2021-05-16 02:57:46 +02:00
#![macro_use]
2021-06-29 16:59:22 +02:00
#[cfg_attr(dma_v1, path = "v1.rs")]
#[cfg_attr(dma_v2, path = "v2.rs")]
2021-05-16 02:57:46 +02:00
mod _version;
#[allow(unused)]
2021-05-16 02:57:46 +02:00
pub use _version::*;
2021-06-25 20:00:11 +02:00
use core::future::Future;
2021-05-16 02:57:46 +02:00
2021-06-25 20:00:11 +02:00
pub trait WriteDma<T> {
type WriteDmaFuture<'a>: Future<Output = ()> + 'a
where
Self: 'a;
2021-05-16 02:57:46 +02:00
2021-06-25 20:00:11 +02:00
fn transfer<'a>(&'a mut self, buf: &'a [u8], dst: *mut u8) -> Self::WriteDmaFuture<'a>
where
T: 'a;
2021-05-16 02:57:46 +02:00
}
2021-06-29 16:59:22 +02:00
pub trait ReadDma<T> {
type ReadDmaFuture<'a>: Future<Output = ()> + 'a
where
Self: 'a;
fn transfer<'a>(&'a mut self, src: *const u8, buf: &'a mut [u8]) -> Self::ReadDmaFuture<'a>
where
T: 'a;
}