embassy-stm32

Crates

git

Versions

stm32u545ce

Flavors

Fmac

Struct Fmac 

Source
pub struct Fmac<'d, T: Instance> { /* private fields */ }
Expand description

FMAC driver

Implementations§

Source§

impl<'d, T: Instance> Fmac<'d, T>

Source

pub fn fir( peri: Peri<'d, T>, config: Config, input: Option<&[Q16<15>]>, feedforward: &[Q16<15>], gain: Gain, ) -> Self

Convolution/FIR filter

y = gain * (feedforward ⋅ input)

Note: The 0th elements are the newest, and the n-1nth is the oldest

Source

pub fn iir( peri: Peri<'d, T>, config: Config, input: Option<&[Q16<15>]>, feedforward: &[Q16<15>], feedback: &[Q16<15>], output: Data<'_>, gain: Gain, ) -> Self

IIR filter

y = gain * (feedforward ⋅ input) + (feedback ⋅ previous_outputs)

Note: The 0th elements are the newest, and the n-1nth is the oldest

Source

pub fn controller_2p2z( peri: Peri<'d, T>, config: Config, input: Option<&[Q16<15>; 3]>, a: [Q16<15>; 2], b: [Q16<15>; 3], output: Option<[Q16<15>; 2]>, gain: Gain, ) -> Self

2p2z controller

Source

pub fn controller_3p3z( peri: Peri<'d, T>, config: Config, input: Option<&[Q16<15>; 4]>, a: [Q16<15>; 3], b: [Q16<15>; 4], output: Option<[Q16<15>; 3]>, gain: Gain, ) -> Self

3p3z controller

Source

pub fn read(&mut self) -> Option<Q16<15>>

Read output value

Source

pub fn write(&mut self, x: Q16<15>) -> Result<(), ErrorInputFull>

Write input

Auto Trait Implementations§

§

impl<'d, T> Freeze for Fmac<'d, T>
where T: Freeze,

§

impl<'d, T> RefUnwindSafe for Fmac<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> Send for Fmac<'d, T>
where T: Send,

§

impl<'d, T> Sync for Fmac<'d, T>
where T: Sync,

§

impl<'d, T> Unpin for Fmac<'d, T>
where T: Unpin,

§

impl<'d, T> !UnwindSafe for Fmac<'d, T>

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> ToMutAligned for T
where T: ?Sized,

Source§

type Element = T

Element
Source§

fn to_mut_aligned<A>(&mut self) -> &mut Aligned<A, <T as ToMutAligned>::Element>
where A: Alignment,

Create a type-checked aligned value from a value that is aligned.
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.