pub struct FilterInjected<'a, 'd, 't, T, M, D>{ /* private fields */ }Expand description
Injected-conversion half of a filter.
Implementations§
Source§impl<'a, 'd, 't, T, M> FilterInjected<'a, 'd, 't, T, M, InjDma>
impl<'a, 'd, 't, T, M> FilterInjected<'a, 'd, 't, T, M, InjDma>
Sourcepub fn ring_buffered<'e, D: Dma<T, M>>(
&'e mut self,
dma: Peri<'e, D>,
irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'e,
dma_buf: &'e mut [u32],
) -> RingBufferedFilter<'e, T, M, InjDma>
pub fn ring_buffered<'e, D: Dma<T, M>>( &'e mut self, dma: Peri<'e, D>, irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'e, dma_buf: &'e mut [u32], ) -> RingBufferedFilter<'e, T, M, InjDma>
Attach a DMA ring buffer to this filter’s injected-conversion data register.
Source§impl<'a, 'd, 't, T, M, D> FilterInjected<'a, 'd, 't, T, M, D>
impl<'a, 'd, 't, T, M, D> FilterInjected<'a, 'd, 't, T, M, D>
Sourcepub fn assign_transceivers<const N: usize>(
&mut self,
transceivers: [&'t dyn TransceiverTrait<T, Enabled>; N],
)
pub fn assign_transceivers<const N: usize>( &mut self, transceivers: [&'t dyn TransceiverTrait<T, Enabled>; N], )
Reassigns the transceivers for injected conversions in-place.
The new transceiver must live at least as long as the previous one
('t), since this does not change the FilterInjected’s lifetime parameter.
Use Filter::replace_injected_transceivers if you need to assign a
transceiver with a shorter/different lifetime and get the old one back
for further mutation.
§Note
Unlike the regular channel select, the injected select (JCHGR) takes effect immediately and resets any injected scan in progress.
Sourcepub fn start_conversion(&mut self)
pub fn start_conversion(&mut self)
Start an injected conversion.
§Note
The request is ignored while an injected conversion is in progress
(JCIP). An injected conversion preempts a running regular conversion
(flagged via ResultRegular::pending).
Sourcepub async fn read(&mut self) -> Result<ResultInjected, Error>
pub async fn read(&mut self) -> Result<ResultInjected, Error>
Await the next injected conversion result.
Does not start a conversion: the conversion must already be running,
started by an external trigger, or started via
start_and_read. Resolves with the next
ResultInjected once a conversion completes.
§Note
Like FilterRegular::read, this hangs forever if the filter is
starved (no data produced, or no trigger); see that method for the
layered starvation detection.
Sourcepub async fn start_and_read(&mut self) -> Result<ResultInjected, Error>
pub async fn start_and_read(&mut self) -> Result<ResultInjected, Error>
Start an injected conversion and await its result.
Equivalent to start_conversion followed by
read: the read future waits for the conversion it just
launched.
Sourcepub fn try_get_result(&mut self) -> Result<ResultInjected, Error>
pub fn try_get_result(&mut self) -> Result<ResultInjected, Error>
Attempts to read the current injected conversion result.
Returns ResultInjected if JEOCF is set, Error::Overrun if an
overrun occurred, or Error::NotReady if no conversion result is
available.
The conversion result is sign-extended from 24 to 32 bits and is not scaled.
Reading the result clears the corresponding data register.
Sourcepub fn get_result_unchecked(&mut self) -> ResultInjected
pub fn get_result_unchecked(&mut self) -> ResultInjected
Reads and clears the current injected conversion result without checking
JEOCF.
The conversion result is sign-extended from 24 to 32 bits and is not scaled.
The returned data is only valid if JEOCF was set before reading.
§Note
This path does not check or clear the overrun flag; use
try_get_result to propagate overruns.
Sourcepub fn end_of_conversion(&self) -> bool
pub fn end_of_conversion(&self) -> bool
Returns whether an injected conversion result is available.
Sourcepub fn clear_overrun(&self)
pub fn clear_overrun(&self)
Clear the injected overrun flag.
Sourcepub fn conversion_in_progress(&self) -> bool
pub fn conversion_in_progress(&self) -> bool
Returns whether an injected conversion is currently in progress or pending.
Source§impl<'a, 'd, 't, T, M> FilterInjected<'a, 'd, 't, T, M, InjDma>
impl<'a, 'd, 't, T, M> FilterInjected<'a, 'd, 't, T, M, InjDma>
Sourcepub fn data_register(&mut self) -> *mut u32
pub fn data_register(&mut self) -> *mut u32
Pointer to JDATAR, for custom DMA setups instead of ring_buffered.
Reading clears the register, hence &mut self. Valid as long as the
underlying DfsdmCommon stays enabled; no Rust lifetime ties to it.