embassy-stm32

Crates

git

Versions

stm32f072rb

Flavors

embassy_stm32::tsc

Struct Tsc

source
pub struct Tsc<'d, T: Instance, K: PeriMode> { /* private fields */ }
Expand description

TSC driver

Implementations§

source§

impl<'d, T: Instance> Tsc<'d, T, Async>

source

pub fn new_async( peri: impl Peripheral<P = T> + 'd, g1: Option<PinGroup<'d, T, G1>>, g2: Option<PinGroup<'d, T, G2>>, g3: Option<PinGroup<'d, T, G3>>, g4: Option<PinGroup<'d, T, G4>>, g5: Option<PinGroup<'d, T, G5>>, g6: Option<PinGroup<'d, T, G6>>, config: Config, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self

Create a Tsc instance that can be awaited for completion

source

pub async fn pend_for_acquisition(&mut self)

Asyncronously wait for the end of an acquisition

source§

impl<'d, T: Instance> Tsc<'d, T, Blocking>

source

pub fn new_blocking( peri: impl Peripheral<P = T> + 'd, g1: Option<PinGroup<'d, T, G1>>, g2: Option<PinGroup<'d, T, G2>>, g3: Option<PinGroup<'d, T, G3>>, g4: Option<PinGroup<'d, T, G4>>, g5: Option<PinGroup<'d, T, G5>>, g6: Option<PinGroup<'d, T, G6>>, config: Config, ) -> Self

Create a Tsc instance that must be polled for completion

source

pub fn poll_for_acquisition(&mut self)

Wait for end of acquisition

source§

impl<'d, T: Instance, K: PeriMode> Tsc<'d, T, K>

source

pub fn start(&mut self)

Start charge transfer acquisition

source

pub fn stop(&mut self)

Stop charge transfer acquisition

source

pub fn get_state(&mut self) -> State

Get current state of acquisition

source

pub fn group_get_status(&mut self, index: Group) -> GroupStatus

Get the individual group status to check acquisition complete

source

pub fn group_get_value(&mut self, index: Group) -> u16

Get the count for the acquisiton, valid once group status is set

source

pub fn discharge_io(&mut self, status: bool)

Discharge the IOs for subsequent acquisition

Trait Implementations§

source§

impl<'d, T: Instance, K: PeriMode> Drop for Tsc<'d, T, K>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'d, T, K> Freeze for Tsc<'d, T, K>
where T: Freeze,

§

impl<'d, T, K> RefUnwindSafe for Tsc<'d, T, K>

§

impl<'d, T, K> Send for Tsc<'d, T, K>
where T: Send, K: Send,

§

impl<'d, T, K> Sync for Tsc<'d, T, K>
where T: Sync, K: Sync,

§

impl<'d, T, K> Unpin for Tsc<'d, T, K>
where T: Unpin, K: Unpin,

§

impl<'d, T, K> !UnwindSafe for Tsc<'d, T, K>

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.