embassy-stm32

Crates

git

Versions

stm32l4p5re

Flavors

Skip to main content

ParallelPair

Struct ParallelPair 

Source
pub struct ParallelPair<'a, 'd, T, M, S, MN, SN>{
    pub even: Transceiver<'a, 'd, T, M, S, ParallelPaired, OwnPins, Enabled>,
    pub odd: Transceiver<'a, 'd, T, MN, SN, ParallelPaired, OwnPins, Enabled>,
}
Expand description

An enabled dual-mode parallel-input pair.

Fields§

§even: Transceiver<'a, 'd, T, M, S, ParallelPaired, OwnPins, Enabled>

Even transceiver (channel y), Dual packing, owns the DATINR register.

§odd: Transceiver<'a, 'd, T, MN, SN, ParallelPaired, OwnPins, Enabled>

Odd transceiver (channel y + 1), Standard packing, fed by the auto-copy.

Implementations§

Source§

impl<'a, 'd, T, M, S, MN, SN> ParallelPair<'a, 'd, T, M, S, MN, SN>

Source

pub fn write(&self, data: [u16; 2])

Write two samples: data[0] to channel y (INDAT0) and data[1] to channel y + 1 (INDAT1, copied by the hardware into the odd channel’s INDAT0).

§Note

DATINR is not buffered: samples written before the conversion starts are lost, so data must be present when the filter latches it.

Source

pub fn get_datinr_as_ptr(&self) -> *mut u32

Pointer to the even channel’s DATINR register, for feeding via DMA.

Each u32 DMA word packs two samples: (data[1] as u32) << 16 | data[0] as u32.

Source

pub fn set_offset(&mut self, offsets: [u32; 2])

Set the offset for both channels ([0] = even, [1] = odd).

Source

pub fn disable(self) -> ParallelPairDisabled<'a, 'd, T, M, S, MN, SN>

Disable both channels.

Auto Trait Implementations§

§

impl<'a, 'd, T, M, S, MN, SN> !RefUnwindSafe for ParallelPair<'a, 'd, T, M, S, MN, SN>

§

impl<'a, 'd, T, M, S, MN, SN> !UnwindSafe for ParallelPair<'a, 'd, T, M, S, MN, SN>

§

impl<'a, 'd, T, M, S, MN, SN> Freeze for ParallelPair<'a, 'd, T, M, S, MN, SN>
where Transceiver<'a, 'd, T, M, S, ParallelPaired, OwnPins, Enabled>: Freeze, Transceiver<'a, 'd, T, MN, SN, ParallelPaired, OwnPins, Enabled>: Freeze,

§

impl<'a, 'd, T, M, S, MN, SN> Send for ParallelPair<'a, 'd, T, M, S, MN, SN>
where Transceiver<'a, 'd, T, M, S, ParallelPaired, OwnPins, Enabled>: Send, Transceiver<'a, 'd, T, MN, SN, ParallelPaired, OwnPins, Enabled>: Send,

§

impl<'a, 'd, T, M, S, MN, SN> Sync for ParallelPair<'a, 'd, T, M, S, MN, SN>
where Transceiver<'a, 'd, T, M, S, ParallelPaired, OwnPins, Enabled>: Sync, Transceiver<'a, 'd, T, MN, SN, ParallelPaired, OwnPins, Enabled>: Sync,

§

impl<'a, 'd, T, M, S, MN, SN> Unpin for ParallelPair<'a, 'd, T, M, S, MN, SN>
where Transceiver<'a, 'd, T, M, S, ParallelPaired, OwnPins, Enabled>: Unpin, Transceiver<'a, 'd, T, MN, SN, ParallelPaired, OwnPins, Enabled>: Unpin,

§

impl<'a, 'd, T, M, S, MN, SN> UnsafeUnpin for ParallelPair<'a, 'd, T, M, S, MN, SN>

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 = !

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.