pub struct Cordic<'d, T: Instance> { /* private fields */ }
Expand description
CORDIC driver
Implementations§
source§impl<'d, T: Instance> Cordic<'d, T>
impl<'d, T: Instance> Cordic<'d, T>
sourcepub fn new(peri: impl Peripheral<P = T> + 'd, config: Config) -> Self
pub fn new(peri: impl Peripheral<P = T> + 'd, config: Config) -> Self
Create a Cordic driver instance
Note:
If you need a peripheral -> CORDIC -> peripheral mode,
you may want to set Cordic into [Mode::ZeroOverhead] mode, and add extra arguments with Self::extra_config
sourcepub fn set_config(&mut self, config: Config)
pub fn set_config(&mut self, config: Config)
Set a new config for Cordic driver
sourcepub fn extra_config(
&mut self,
arg_cnt: AccessCount,
arg_width: Width,
res_width: Width,
)
pub fn extra_config( &mut self, arg_cnt: AccessCount, arg_width: Width, res_width: Width, )
Set extra config for data count and data width.
sourcepub fn reconfigure(&mut self)
pub fn reconfigure(&mut self)
Disable IRQ and DMA, clean RRDY, and set ARG2 to +1 (0x7FFFFFFF)
source§impl<'d, T: Instance> Cordic<'d, T>
impl<'d, T: Instance> Cordic<'d, T>
sourcepub fn blocking_calc_32bit(
&mut self,
arg: &[u32],
res: &mut [u32],
arg1_only: bool,
res1_only: bool,
) -> Result<usize, CordicError>
pub fn blocking_calc_32bit( &mut self, arg: &[u32], res: &mut [u32], arg1_only: bool, res1_only: bool, ) -> Result<usize, CordicError>
Run a blocking CORDIC calculation in q1.31 format
Notice:
If you set arg1_only
to true
, please be sure ARG2 value has been set to desired value before.
This function won’t set ARG2 to +1 before or after each round of calculation.
If you want to make sure ARG2 is set to +1, consider run .reconfigure().
sourcepub async fn async_calc_32bit(
&mut self,
write_dma: impl Peripheral<P = impl WriteDma<T>>,
read_dma: impl Peripheral<P = impl ReadDma<T>>,
arg: &[u32],
res: &mut [u32],
arg1_only: bool,
res1_only: bool,
) -> Result<usize, CordicError>
pub async fn async_calc_32bit( &mut self, write_dma: impl Peripheral<P = impl WriteDma<T>>, read_dma: impl Peripheral<P = impl ReadDma<T>>, arg: &[u32], res: &mut [u32], arg1_only: bool, res1_only: bool, ) -> Result<usize, CordicError>
Run a async CORDIC calculation in q.1.31 format
Notice:
If you set arg1_only
to true
, please be sure ARG2 value has been set to desired value before.
This function won’t set ARG2 to +1 before or after each round of calculation.
If you want to make sure ARG2 is set to +1, consider run .reconfigure().
source§impl<'d, T: Instance> Cordic<'d, T>
impl<'d, T: Instance> Cordic<'d, T>
sourcepub fn blocking_calc_16bit(
&mut self,
arg: &[u32],
res: &mut [u32],
) -> Result<usize, CordicError>
pub fn blocking_calc_16bit( &mut self, arg: &[u32], res: &mut [u32], ) -> Result<usize, CordicError>
Run a blocking CORDIC calculation in q1.15 format
Notice::
User will take respond to merge two u16 arguments into one u32 data, and/or split one u32 data into two u16 results.
sourcepub async fn async_calc_16bit(
&mut self,
write_dma: impl Peripheral<P = impl WriteDma<T>>,
read_dma: impl Peripheral<P = impl ReadDma<T>>,
arg: &[u32],
res: &mut [u32],
) -> Result<usize, CordicError>
pub async fn async_calc_16bit( &mut self, write_dma: impl Peripheral<P = impl WriteDma<T>>, read_dma: impl Peripheral<P = impl ReadDma<T>>, arg: &[u32], res: &mut [u32], ) -> Result<usize, CordicError>
Run a async CORDIC calculation in q1.15 format
Notice::
User will take respond to merge two u16 arguments into one u32 data, and/or split one u32 data into two u16 results.