Skip to main content

AdcPart

Struct AdcPart 

Source
pub struct AdcPart<'peripherals, ADC, D, const ROW: usize>
where ADC: Instance<Regs = Adc> + BasicInstance, D: RxDma<ADC>, <<ADC as BasicInstance>::Regs as BasicAdcRegs>::SampleTime: Clone,
{ pub adc: Adc<'peripherals, ADC>, pub dma: Peri<'peripherals, D>, pub row_adc: [AnyAdcChannel<'peripherals, ADC>; ROW], pub sample_time: <<ADC as BasicInstance>::Regs as BasicAdcRegs>::SampleTime, }
Expand description

ADC-related peripherals grouped to allow split borrows when constructing a [embassy_stm32::adc::ConfiguredSequence].

Fields§

§adc: Adc<'peripherals, ADC>

ADC peripheral used for sampling hall sensors.

§dma: Peri<'peripherals, D>

DMA channel used for non-blocking ADC sequence reads.

§row_adc: [AnyAdcChannel<'peripherals, ADC>; ROW]

ADC channels corresponding to each matrix row.

§sample_time: <<ADC as BasicInstance>::Regs as BasicAdcRegs>::SampleTime

ADC sample time applied to every channel in the sequence.

Implementations§

Source§

impl<'peripherals, ADC, D, const ROW: usize> AdcPart<'peripherals, ADC, D, ROW>
where ADC: Instance<Regs = Adc> + BasicInstance, D: RxDma<ADC>, <<ADC as BasicInstance>::Regs as BasicAdcRegs>::SampleTime: Clone,

Source

fn configured_sequence<'reader, IRQ2>( &'reader mut self, irq: IRQ2, ) -> ConfiguredSequence<'reader, Adc>
where IRQ2: Binding<D::Interrupt, InterruptHandler<D>> + 'reader + 'peripherals,

Create a [embassy_stm32::adc::ConfiguredSequence] over all row channels.

Programs the ADC sequence registers once; the returned reader can be triggered repeatedly without reprogramming, saving ~20 cycles per column per scan.

Source

pub const fn new( adc: Adc<'peripherals, ADC>, row_adc: [AnyAdcChannel<'peripherals, ADC>; ROW], dma: Peri<'peripherals, D>, sample_time: <<ADC as BasicInstance>::Regs as BasicAdcRegs>::SampleTime, ) -> Self

Create a new AdcPart from the given peripherals.

Auto Trait Implementations§

§

impl<'peripherals, ADC, D, const ROW: usize> Freeze for AdcPart<'peripherals, ADC, D, ROW>
where SampleTime: Sized, D: Freeze, ADC: Freeze,

§

impl<'peripherals, ADC, D, const ROW: usize> RefUnwindSafe for AdcPart<'peripherals, ADC, D, ROW>
where SampleTime: Sized, D: RefUnwindSafe, ADC: RefUnwindSafe,

§

impl<'peripherals, ADC, D, const ROW: usize> Send for AdcPart<'peripherals, ADC, D, ROW>
where SampleTime: Sized, D: Send, ADC: Send,

§

impl<'peripherals, ADC, D, const ROW: usize> Sync for AdcPart<'peripherals, ADC, D, ROW>
where SampleTime: Sized, D: Sync, ADC: Sync,

§

impl<'peripherals, ADC, D, const ROW: usize> Unpin for AdcPart<'peripherals, ADC, D, ROW>
where SampleTime: Sized, D: Unpin, ADC: Unpin,

§

impl<'peripherals, ADC, D, const ROW: usize> UnsafeUnpin for AdcPart<'peripherals, ADC, D, ROW>
where SampleTime: Sized, D: UnsafeUnpin, ADC: UnsafeUnpin,

§

impl<'peripherals, ADC, D, const ROW: usize> !UnwindSafe for AdcPart<'peripherals, ADC, D, ROW>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.