embassy-stm32

Crates

git

Versions

stm32h563ii

Flavors

Channel

Struct Channel 

Source
pub struct Channel<'d> { /* private fields */ }
Expand description

DMA channel driver

Implementations§

Source§

impl<'d> Channel<'d>

Source

pub unsafe fn read<'a, W: Word>( &'a mut self, request: Request, peri_addr: *mut W, buf: &'a mut [W], options: TransferOptions, ) -> Transfer<'a>

Create a read DMA transfer (peripheral to memory).

Source

pub unsafe fn read_raw<'a, MW: Word, PW: Word>( &'a mut self, request: Request, peri_addr: *mut PW, buf: *mut [MW], options: TransferOptions, ) -> Transfer<'a>

Create a read DMA transfer (peripheral to memory), using raw pointers.

Source

pub unsafe fn read_raw_repeated<'a, MW: Word, PW: Word>( &'a mut self, request: Request, repeated: *mut MW, count: usize, peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a>

Create a read DMA transfer (peripheral to memory), writing the same value repeatedly.

Source

pub unsafe fn write<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: &'a [MW], peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a>

Create a write DMA transfer (memory to peripheral).

Source

pub unsafe fn write_raw<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: *const [MW], peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a>

Create a write DMA transfer (memory to peripheral), using raw pointers.

Source

pub unsafe fn write_repeated<'a, MW: Word, PW: Word>( &'a mut self, request: Request, repeated: &'a MW, count: usize, peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a>

Create a write DMA transfer (memory to peripheral), writing the same value repeatedly.

Source

pub unsafe fn linked_list<'a, const N: usize>( &'a mut self, table: &'a Table<N>, options: TransferOptions, ) -> LinkedListTransfer<'a>

Create a linked-list DMA transfer.

Source

pub unsafe fn restart_linked_list<const N: usize>( &self, table: &Table<N>, options: TransferOptions, )

Reconfigure and restart a linked-list transfer from item[0].

Resets the channel, clears all flags, reconfigures LBAR/BR1/LLR/CR from the table and options, and re-enables the channel. This is intended for use cases that need to restart the same linked-list chain from the beginning.

§Safety

The caller must ensure that no other code is concurrently accessing the channel registers, and that the table remains valid for the duration of the transfer.

Source§

impl<'d> Channel<'d>

Source

pub fn new<T: ChannelInstance>( _ch: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self

Create a new DMA channel driver.

Source

pub fn reborrow(&mut self) -> Channel<'_>

Reborrow the channel, allowing it to be used in multiple places.

Auto Trait Implementations§

§

impl<'d> Freeze for Channel<'d>

§

impl<'d> RefUnwindSafe for Channel<'d>

§

impl<'d> Send for Channel<'d>

§

impl<'d> Sync for Channel<'d>

§

impl<'d> Unpin for Channel<'d>

§

impl<'d> UnwindSafe for Channel<'d>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.