embassy-stm32

Crates

git

Versions

stm32u545ve

Flavors

Cordic32

Struct Cordic32 

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

q1.31 related

Implementations§

Source§

impl<'d, 'a, T: Instance> Cordic32<'d, 'a, T>

Source

pub fn set_access_counts( &mut self, arg_count: AccessCount, res_count: AccessCount, )

Change arg_count and res_count without resetting ARG2.

This is a lightweight CSR update for switching between 1-arg and 2-arg modes within the same function configuration (e.g. after an initial 2-arg call sets ARG2, switch to 1-arg mode for the hot loop).

Source

pub fn blocking_calc( &mut self, arg: &[Q32<31>], res: &mut [Q32<31>], ) -> Result<usize, CordicError>

Run a blocking CORDIC calculation in q1.31 format.

Uses arg_count and res_count from the current Config. If arg_count is One, ARG2 must have been set to the desired value beforehand (e.g. via a prior Two-arg call or [Self::reconfigure]).

Source

pub async fn async_calc<'b, W, R>( &mut self, write_dma: Peri<'b, W>, read_dma: Peri<'b, R>, irq: impl Binding<W::Interrupt, InterruptHandler<W>> + Binding<R::Interrupt, InterruptHandler<R>> + 'b, arg: &[Q32<31>], res: &mut [Q32<31>], ) -> Result<usize, CordicError>
where W: WriteDma<T>, R: ReadDma<T>,

Run an async CORDIC calculation in q1.31 format.

Uses arg_count and res_count from the current Config. If arg_count is One, ARG2 must have been set to the desired value beforehand (e.g. via a prior Two-arg call or [Self::reconfigure]).

Auto Trait Implementations§

§

impl<'d, 'a, T> Freeze for Cordic32<'d, 'a, T>

§

impl<'d, 'a, T> RefUnwindSafe for Cordic32<'d, 'a, T>
where T: RefUnwindSafe,

§

impl<'d, 'a, T> Send for Cordic32<'d, 'a, T>
where T: Send,

§

impl<'d, 'a, T> Sync for Cordic32<'d, 'a, T>
where T: Sync,

§

impl<'d, 'a, T> Unpin for Cordic32<'d, 'a, T>

§

impl<'d, 'a, T> !UnwindSafe for Cordic32<'d, 'a, 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, 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.