Embassy
embassy-stm32

Crates

git

Versions

stm32u535rb

Flavors

Struct embassy_stm32::tsc::Tsc

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

TSC driver

Implementations§

source§

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

source

pub fn new( 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>>, g8: Option<PinGroup<'d, T, G8>>, config: Config, ) -> Self

Create new TSC driver

source

pub fn start(&mut self)

Start charge transfer acquisition

source

pub fn start_it(&mut self)

Start charge transfer acquisition with interrupts enabled

source

pub fn stop(&mut self)

Stop charge transfer acquisition

source

pub fn stop_it(&mut self)

Stop charge transfer acquisition and clear interrupts

source

pub fn poll_for_acquisition(&mut self)

Wait for end of 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> Drop for Tsc<'d, T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

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

§

impl<'d, T> RefUnwindSafe for Tsc<'d, T>
where T: RefUnwindSafe,

§

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

§

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

§

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

§

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

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>,

§

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>,

§

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.