Expand description

Traits to aid the correct use of buffers in DMA abstractions.

This library provides the ReadBuffer and WriteBuffer unsafe traits to be used as bounds to buffers types used in DMA operations.

There are some subtleties to the extent of the guarantees provided by these traits, all of these subtleties are properly documented in the safety requirements in this crate. However, as a measure of redundancy, some are listed below:

  • The traits only guarantee a stable location while no &mut self methods are called upon Self (with the exception of write_buffer in our case). This is to allow types like Vec, this restriction doesn’t apply to Self::Target.

  • ReadBuffer and WriteBuffer guarantee a stable location for as long as the DMA transfer occurs. Given the intrinsics of mem::forget and the Rust language itself, a ’static lifetime is usually required.

The above list is not exhaustive, for a complete set of requirements and guarantees, the documentation of each trait and method should be analyzed.

Traits

Trait for buffers that can be given to DMA for reading.

Trait for Deref targets used by the blanket DmaReadBuffer impl.

Trait for DMA word types used by the blanket DMA buffer impls.

Trait for buffers that can be given to DMA for writing.

Trait for DerefMut targets used by the blanket DmaWriteBuffer impl.