embassy-stm32

Crates

git

Versions

stm32l4p5re

Flavors

Skip to main content

Transceiver

Struct Transceiver 

Source
pub struct Transceiver<'a, 'd, T, M, S, MODE, PS, P>{ /* private fields */ }
Expand description

Configured DFSDM data input transceiver.

Implementations§

Source§

impl<'a, 'd, T, M, S, MODE, PS> Transceiver<'a, 'd, T, M, S, MODE, PS, Enabled>

Only when enabled

Source

pub fn disable(self) -> Transceiver<'a, 'd, T, M, S, MODE, PS, Disabled>

Disables the transceiver.

Source

pub fn set_offset(&mut self, offset: u32)

Set the transceiver’s offset.

Source§

impl<'a, 'd, T, M, S, MODE, PS> Transceiver<'a, 'd, T, M, S, MODE, PS, Enabled>

Source

pub async fn wait_for_sync(&mut self)

Wait until this transceiver’s clock-absence flag clears, indicating it is synchronized. Only meaningful for externally-clocked serial modes.

Source§

impl<'a, 'd, T, M, S, MODE, PS> Transceiver<'a, 'd, T, M, S, MODE, PS, Disabled>

Only when disabled

Source

pub fn enable(self) -> Transceiver<'a, 'd, T, M, S, MODE, PS, Enabled>

Enables the transceiver.

Source

pub fn set_data_right_shift(self, shift: DataRightShift) -> Self

Set the transceiver’s right-shift factor.

Source

pub fn select_awd_filter_order(self, filter_order: AwdFilterOrder) -> Self

Set the analog watchdog filter’s order.

§Note

The valid watchdog OSR range depends on this order; set select_awd_filter_osr accordingly.

Source

pub fn select_awd_filter_osr(self, osr: AwdFilterOsr) -> Self

Set the analog watchdog filter’s OSR.

§Note

The valid OSR range depends on the order set via select_awd_filter_order.

Source

pub fn set_offset(self, offset: u32) -> Self

Set the transceiver’s offset.

Source§

impl<'a, 'd, T, M, S, PS, P> Transceiver<'a, 'd, T, M, S, ParallelStandard, PS, P>

Source

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

Pointer to the DATINR register, for feeding samples via DMA.

Use this as the destination of a memory-to-peripheral transfer (e.g. crate::dma::WritableRingBuffer); one 16-bit sample per word.

Source

pub fn write(&self, data: u16)

Write one sample into the DATINR register (Standard packing).

Loads data into INDAT0[15:0]; the upper INDAT1[15:0] field is ignored and write-protected in this mode. One 16-bit sample per write.

§Note

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

Source§

impl<'a, 'd, T, M, S, PS, P> Transceiver<'a, 'd, T, M, S, ParallelInterleaved, PS, P>

Source

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

Pointer to the DATINR register, for feeding samples via DMA.

Use this as the destination of a memory-to-peripheral transfer (e.g. crate::dma::WritableRingBuffer); two 16-bit samples per word.

Source

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

Write two samples into the DATINR register (Interleaved packing).

Loads data[0] into INDAT0[15:0] and data[1] into INDAT1[15:0]; both are read sequentially by the same filter on channel y. Two 16-bit samples per 32-bit write.

§Note

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

Source§

impl<'a, 'd, T, M, S, MODE, PS, P> Transceiver<'a, 'd, T, M, S, MODE, PS, P>

Any powerstate

Source

pub fn awd_filter_data(&self) -> u16

Read the analog watchdog data for this transceiver, converted by the watchdog filter (continuously, with limited resolution).

Source§

impl<'a, 'd, T, M, S, MODE, PS, P> Transceiver<'a, 'd, T, M, S, MODE, PS, P>

Source

pub fn skip_progress(&self) -> u8

Reads back pulses still to skip, 0 = done

Source

pub fn skip_pulses(&mut self, skips: PulsesToSkip)

Configure to skip the next skips pulses (max 63 per write).

Skipping starts immediately on write; updating mid-skip is allowed. To skip more than 63 pulses, issue repeated writes; the peripheral doesn’t track a cumulative count across writes, so the caller must.

Trait Implementations§

Source§

impl<'a, 'd, T, M, S, MODE, PS, P> Drop for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a, 'd, T, M, S, MODE, PS, P> TransceiverTrait<T, P> for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

Source§

fn index(&self) -> usize

Returns this transceiver’s channel index.

Auto Trait Implementations§

§

impl<'a, 'd, T, M, S, MODE, PS, P> !RefUnwindSafe for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

§

impl<'a, 'd, T, M, S, MODE, PS, P> !UnwindSafe for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

§

impl<'a, 'd, T, M, S, MODE, PS, P> Freeze for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

§

impl<'a, 'd, T, M, S, MODE, PS, P> Send for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

§

impl<'a, 'd, T, M, S, MODE, PS, P> Sync for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

§

impl<'a, 'd, T, M, S, MODE, PS, P> Unpin for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

§

impl<'a, 'd, T, M, S, MODE, PS, P> UnsafeUnpin for Transceiver<'a, 'd, T, M, S, MODE, PS, P>

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.