Tsc

Struct Tsc 

Source
pub struct Tsc<SPIN> { /* private fields */ }

Implementations§

Source§

impl<SPIN> Tsc<SPIN>

Source

pub fn tsc( tsc: TSC, sample_pin: SPIN, ahb: &mut AHB1, cfg: Option<Config>, ) -> Self
where SPIN: SamplePin<TSC>,

Source

pub fn start<PIN>(&self, _input: &mut PIN)
where PIN: ChannelPin<TSC>,

Starts a charge acquisition

Source

pub fn clear(&self, event: Event)

Clear interrupt & flags

Source

pub fn acquire<PIN>(&self, input: &mut PIN) -> Result<u16, Error>
where PIN: ChannelPin<TSC>,

Blocks waiting for a acquisition to complete or for a Max Count Error

Source

pub fn read<PIN>(&self, _input: &mut PIN) -> Result<u16, Error>
where PIN: ChannelPin<TSC>,

Reads the tsc group 2 count register

Source

pub fn read_unchecked(&self) -> u16

Reads the tsc group 2 count register WARNING, just returns the contents of the register! No validation of the correct pin

Source

pub fn in_progress(&mut self) -> bool

Is the tsc performing an aquisition

Source

pub fn listen(&mut self, event: Event)

Enables an interrupt event

Source

pub fn unlisten(&self, event: Event)

Disables an interrupt event

Source

pub fn free(self) -> (TSC, SPIN)

Releases the TSC peripheral and associated pins

Auto Trait Implementations§

§

impl<SPIN> Freeze for Tsc<SPIN>
where SPIN: Freeze,

§

impl<SPIN> RefUnwindSafe for Tsc<SPIN>
where SPIN: RefUnwindSafe,

§

impl<SPIN> Send for Tsc<SPIN>
where SPIN: Send,

§

impl<SPIN> !Sync for Tsc<SPIN>

§

impl<SPIN> Unpin for Tsc<SPIN>
where SPIN: Unpin,

§

impl<SPIN> UnwindSafe for Tsc<SPIN>
where SPIN: UnwindSafe,

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.