Struct lpc55_hal::drivers::touch::TouchSensor[][src]

pub struct TouchSensor<P1: PinId, P2: PinId, P3: PinId> { /* fields omitted */ }

Implementations

impl<P1, P2, P3> TouchSensor<P1, P2, P3> where
    P1: PinId,
    P2: PinId,
    P3: PinId
[src]

pub fn new(
    threshold: [u32; 3],
    confidence: u32,
    adc: Adc<Enabled>,
    adc_timer: Ctimer1<Enabled>,
    sample_timer: Ctimer2<Enabled>,
    _charge_pin: Pin<Pio1_16, Special<MATCH_OUTPUT3<Ctimer1<Enabled>>>>,
    buttons: ButtonPins<P1, P2, P3>
) -> Self
[src]

Threshold is the ADC sample limit where an is considered. Confidence is the number of times the threshold needs to be crossed

impl<P1, P2, P3> TouchSensor<P1, P2, P3> where
    P1: PinId,
    P2: PinId,
    P3: PinId
[src]

pub fn enabled(
    self,
    dma: &mut Dma<Enabled>,
    _token: ClocksSupportTouchToken
) -> Self
[src]

Starts DMA and internal timers to enable touch detection

impl<P1, P2, P3> TouchSensor<P1, P2, P3> where
    P1: PinId,
    P2: PinId,
    P3: PinId
[src]

pub fn count(&self, bufsel: u8) -> u32[src]

Count how many elements from a source are available Used for debugging

pub fn reset_results(&self, channel: TouchSensorChannel, offset: i32)[src]

Used after an edge is detected to prevent the same edge being detected twice

pub fn get_state(
    &self,
    channel: TouchSensorChannel,
    ctype: Compare
) -> TouchResult
[src]

Use threshold and confidence value to see if indicated state has occured in current buffer

pub fn has_edge(&self, channel: TouchSensorChannel, edge_type: Edge) -> bool[src]

Indicate if an edge has occured in current buffer. Does not reset.

Methods from Deref<Target = Adc<Enabled>>

pub fn arm_normal_channel(&mut self, channel_id: u8)[src]

pub fn arm_comparator_channel(&mut self, channel_id: u8)[src]

pub fn set_threshold(&mut self, low: u16, high: u16)[src]

pub fn cancel_compare(&mut self)[src]

pub fn read(
    &mut self,
    pin: &Pin<impl PinId, Analog<Input>>
) -> Result<u16, Underflow>
[src]

Trait Implementations

impl<P1, P2, P3> Deref for TouchSensor<P1, P2, P3> where
    P1: PinId,
    P2: PinId,
    P3: PinId
[src]

type Target = Adc<Enabled>

The resulting type after dereferencing.

impl<P1, P2, P3> DerefMut for TouchSensor<P1, P2, P3> where
    P1: PinId,
    P2: PinId,
    P3: PinId
[src]

Auto Trait Implementations

impl<P1, P2, P3> Send for TouchSensor<P1, P2, P3> where
    P1: Send,
    P2: Send,
    P3: Send

impl<P1, P2, P3> !Sync for TouchSensor<P1, P2, P3>

impl<P1, P2, P3> Unpin for TouchSensor<P1, P2, P3> where
    P1: Unpin,
    P2: Unpin,
    P3: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.