pub unsafe trait Buffer {
type Beat: Beat;
// Required methods
fn dma_ptr(&mut self) -> *mut Self::Beat;
fn incrementing(&self) -> bool;
fn buffer_len(&self) -> usize;
}Expand description
Buffer useable by the DMAC.
§Safety
This trait should only be implemented for valid DMAC sources/sinks. That is, you need to make sure that:
dma_ptrpoints to a valid memory location useable by the DMACincrementingis correct for the source/sink. For example, an&[u8]of size one is not incrementing.buffer_lenis correct for the source/sink.
Required Associated Types§
Required Methods§
Sourcefn dma_ptr(&mut self) -> *mut Self::Beat
fn dma_ptr(&mut self) -> *mut Self::Beat
Pointer to the buffer. If the buffer is incrementing, the address should point to one past the last beat transfer in the block.
Sourcefn incrementing(&self) -> bool
fn incrementing(&self) -> bool
Return whether the buffer pointer should be incrementing or not
Sourcefn buffer_len(&self) -> usize
fn buffer_len(&self) -> usize
Buffer length in beats