Struct stm32l4xx_hal::dma::CircBuffer
source · [−]pub struct CircBuffer<BUFFER, PAYLOAD> where
BUFFER: 'static, { /* private fields */ }
Implementations
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C1>> where
RxDma<PAYLOAD, C1>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C1>> where
RxDma<PAYLOAD, C1>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C2>> where
RxDma<PAYLOAD, C2>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C2>> where
RxDma<PAYLOAD, C2>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C3>> where
RxDma<PAYLOAD, C3>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C3>> where
RxDma<PAYLOAD, C3>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C4>> where
RxDma<PAYLOAD, C4>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C4>> where
RxDma<PAYLOAD, C4>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C5>> where
RxDma<PAYLOAD, C5>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C5>> where
RxDma<PAYLOAD, C5>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C6>> where
RxDma<PAYLOAD, C6>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C6>> where
RxDma<PAYLOAD, C6>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C7>> where
RxDma<PAYLOAD, C7>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C7>> where
RxDma<PAYLOAD, C7>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C1>> where
RxDma<PAYLOAD, C1>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C1>> where
RxDma<PAYLOAD, C1>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C2>> where
RxDma<PAYLOAD, C2>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C2>> where
RxDma<PAYLOAD, C2>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C3>> where
RxDma<PAYLOAD, C3>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C3>> where
RxDma<PAYLOAD, C3>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C4>> where
RxDma<PAYLOAD, C4>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C4>> where
RxDma<PAYLOAD, C4>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C5>> where
RxDma<PAYLOAD, C5>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C5>> where
RxDma<PAYLOAD, C5>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C6>> where
RxDma<PAYLOAD, C6>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C6>> where
RxDma<PAYLOAD, C6>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
sourceimpl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C7>> where
RxDma<PAYLOAD, C7>: TransferPayload,
impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C7>> where
RxDma<PAYLOAD, C7>: TransferPayload,
sourcepub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
pub fn read<T>(&mut self, buf: &mut [T]) -> Result<usize, Error> where
B: AsRef<[T]>,
T: Copy,
Reads and removes the available contents of the dma buffer into buf
.
Returns Err(Error::Overrun)
if an overrun is detected but there is no
guarantee that every overrun can be detected.
On success, returns the number of words written to buf
.
Auto Trait Implementations
impl<BUFFER, PAYLOAD> RefUnwindSafe for CircBuffer<BUFFER, PAYLOAD> where
BUFFER: RefUnwindSafe,
PAYLOAD: RefUnwindSafe,
impl<BUFFER, PAYLOAD> Send for CircBuffer<BUFFER, PAYLOAD> where
BUFFER: Send,
PAYLOAD: Send,
impl<BUFFER, PAYLOAD> Sync for CircBuffer<BUFFER, PAYLOAD> where
BUFFER: Sync,
PAYLOAD: Sync,
impl<BUFFER, PAYLOAD> Unpin for CircBuffer<BUFFER, PAYLOAD> where
PAYLOAD: Unpin,
impl<BUFFER, PAYLOAD> !UnwindSafe for CircBuffer<BUFFER, PAYLOAD>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more