embassy-stm32

Crates

git

Versions

stm32u073kb

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>>, g7: Option<PinGroup<'d, T, G7>>, 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>>, g7: Option<PinGroup<'d, T, G7>>, 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.