embassy-stm32

Crates

git

Versions

stm32c551ve

Flavors

LinkedListItem

Trait LinkedListItem 

Source
pub trait LinkedListItem:
    Copy
    + Default
    + Sized {
    type Config: Default + Copy;

    const IS_2D: bool;

    // Required methods
    unsafe fn new_read<MW: Word, PW: Word>(
        request: Request,
        peri_addr: *mut PW,
        buf: &mut [MW],
        config: Self::Config,
    ) -> Self;
    unsafe fn new_write<MW: Word, PW: Word>(
        request: Request,
        buf: &[MW],
        peri_addr: *mut PW,
        config: Self::Config,
    ) -> Self;
    fn link_to(&mut self, next: u16);
    fn unlink(&mut self);
    fn transfer_count(&self) -> usize;
}
Expand description

Trait for linked-list item types usable in a generic Table.

Required Associated Constants§

Source

const IS_2D: bool

Whether this item type requires a 2D-capable channel.

Required Associated Types§

Source

type Config: Default + Copy

Per-item configuration passed at construction time.

Required Methods§

Source

unsafe fn new_read<MW: Word, PW: Word>( request: Request, peri_addr: *mut PW, buf: &mut [MW], config: Self::Config, ) -> Self

Create a new read DMA transfer item (peripheral to memory).

§Safety

The caller must ensure addresses and buffer remain valid for the transfer duration.

Source

unsafe fn new_write<MW: Word, PW: Word>( request: Request, buf: &[MW], peri_addr: *mut PW, config: Self::Config, ) -> Self

Create a new write DMA transfer item (memory to peripheral).

§Safety

The caller must ensure addresses and buffer remain valid for the transfer duration.

Link to the next item at the given offset address.

Unlink the next item (disables channel update bits).

Source

fn transfer_count(&self) -> usize

The item’s transfer count in number of destination words.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§